// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v3.21.12
// source: yandex/cloud/backup/v1/policy_service.proto

package backup

import (
	context "context"
	operation "github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	PolicyService_List_FullMethodName             = "/yandex.cloud.backup.v1.PolicyService/List"
	PolicyService_Create_FullMethodName           = "/yandex.cloud.backup.v1.PolicyService/Create"
	PolicyService_Get_FullMethodName              = "/yandex.cloud.backup.v1.PolicyService/Get"
	PolicyService_Update_FullMethodName           = "/yandex.cloud.backup.v1.PolicyService/Update"
	PolicyService_Delete_FullMethodName           = "/yandex.cloud.backup.v1.PolicyService/Delete"
	PolicyService_Apply_FullMethodName            = "/yandex.cloud.backup.v1.PolicyService/Apply"
	PolicyService_ListApplications_FullMethodName = "/yandex.cloud.backup.v1.PolicyService/ListApplications"
	PolicyService_Execute_FullMethodName          = "/yandex.cloud.backup.v1.PolicyService/Execute"
	PolicyService_Revoke_FullMethodName           = "/yandex.cloud.backup.v1.PolicyService/Revoke"
)

// PolicyServiceClient is the client API for PolicyService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// A set of methods for managing [policies](/docs/backup/concepts/policy).
type PolicyServiceClient interface {
	// List [policies](/docs/backup/concepts/policy) of specified folder.
	List(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error)
	// Create a new policy.
	//
	// For detailed information, please see [Creating a backup policy](/docs/backup/operations/policy-vm/create).
	Create(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Get specific policy.
	Get(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*Policy, error)
	// Update specific policy.
	Update(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Delete specific policy.
	Delete(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Apply policy to [Compute Cloud instance](/docs/backup/concepts/vm-connection#os).
	Apply(ctx context.Context, in *ApplyPolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// List applied policies using filters.
	ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error)
	// Run policy on specific Compute Cloud instance. That will create backup
	// according selected policy. In order to perform this action, policy should be
	// applied to the Compute Cloud instance.
	Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Revoke policy from Compute Cloud instance.
	Revoke(ctx context.Context, in *RevokeRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type policyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPolicyServiceClient(cc grpc.ClientConnInterface) PolicyServiceClient {
	return &policyServiceClient{cc}
}

func (c *policyServiceClient) List(ctx context.Context, in *ListPoliciesRequest, opts ...grpc.CallOption) (*ListPoliciesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListPoliciesResponse)
	err := c.cc.Invoke(ctx, PolicyService_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Create(ctx context.Context, in *CreatePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, PolicyService_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Get(ctx context.Context, in *GetPolicyRequest, opts ...grpc.CallOption) (*Policy, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Policy)
	err := c.cc.Invoke(ctx, PolicyService_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Update(ctx context.Context, in *UpdatePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, PolicyService_Update_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Delete(ctx context.Context, in *DeletePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, PolicyService_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Apply(ctx context.Context, in *ApplyPolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, PolicyService_Apply_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) ListApplications(ctx context.Context, in *ListApplicationsRequest, opts ...grpc.CallOption) (*ListApplicationsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListApplicationsResponse)
	err := c.cc.Invoke(ctx, PolicyService_ListApplications_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, PolicyService_Execute_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *policyServiceClient) Revoke(ctx context.Context, in *RevokeRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, PolicyService_Revoke_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PolicyServiceServer is the server API for PolicyService service.
// All implementations should embed UnimplementedPolicyServiceServer
// for forward compatibility.
//
// A set of methods for managing [policies](/docs/backup/concepts/policy).
type PolicyServiceServer interface {
	// List [policies](/docs/backup/concepts/policy) of specified folder.
	List(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error)
	// Create a new policy.
	//
	// For detailed information, please see [Creating a backup policy](/docs/backup/operations/policy-vm/create).
	Create(context.Context, *CreatePolicyRequest) (*operation.Operation, error)
	// Get specific policy.
	Get(context.Context, *GetPolicyRequest) (*Policy, error)
	// Update specific policy.
	Update(context.Context, *UpdatePolicyRequest) (*operation.Operation, error)
	// Delete specific policy.
	Delete(context.Context, *DeletePolicyRequest) (*operation.Operation, error)
	// Apply policy to [Compute Cloud instance](/docs/backup/concepts/vm-connection#os).
	Apply(context.Context, *ApplyPolicyRequest) (*operation.Operation, error)
	// List applied policies using filters.
	ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error)
	// Run policy on specific Compute Cloud instance. That will create backup
	// according selected policy. In order to perform this action, policy should be
	// applied to the Compute Cloud instance.
	Execute(context.Context, *ExecuteRequest) (*operation.Operation, error)
	// Revoke policy from Compute Cloud instance.
	Revoke(context.Context, *RevokeRequest) (*operation.Operation, error)
}

// UnimplementedPolicyServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedPolicyServiceServer struct{}

func (UnimplementedPolicyServiceServer) List(context.Context, *ListPoliciesRequest) (*ListPoliciesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedPolicyServiceServer) Create(context.Context, *CreatePolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedPolicyServiceServer) Get(context.Context, *GetPolicyRequest) (*Policy, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedPolicyServiceServer) Update(context.Context, *UpdatePolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedPolicyServiceServer) Delete(context.Context, *DeletePolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedPolicyServiceServer) Apply(context.Context, *ApplyPolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Apply not implemented")
}
func (UnimplementedPolicyServiceServer) ListApplications(context.Context, *ListApplicationsRequest) (*ListApplicationsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListApplications not implemented")
}
func (UnimplementedPolicyServiceServer) Execute(context.Context, *ExecuteRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Execute not implemented")
}
func (UnimplementedPolicyServiceServer) Revoke(context.Context, *RevokeRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Revoke not implemented")
}
func (UnimplementedPolicyServiceServer) testEmbeddedByValue() {}

// UnsafePolicyServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PolicyServiceServer will
// result in compilation errors.
type UnsafePolicyServiceServer interface {
	mustEmbedUnimplementedPolicyServiceServer()
}

func RegisterPolicyServiceServer(s grpc.ServiceRegistrar, srv PolicyServiceServer) {
	// If the following call panics, it indicates UnimplementedPolicyServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&PolicyService_ServiceDesc, srv)
}

func _PolicyService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListPoliciesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).List(ctx, req.(*ListPoliciesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreatePolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Create(ctx, req.(*CreatePolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetPolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Get(ctx, req.(*GetPolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdatePolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Update_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Update(ctx, req.(*UpdatePolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeletePolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Delete(ctx, req.(*DeletePolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Apply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ApplyPolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Apply(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Apply_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Apply(ctx, req.(*ApplyPolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_ListApplications_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListApplicationsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).ListApplications(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_ListApplications_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).ListApplications(ctx, req.(*ListApplicationsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ExecuteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Execute(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Execute_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Execute(ctx, req.(*ExecuteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PolicyService_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RevokeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PolicyServiceServer).Revoke(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PolicyService_Revoke_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PolicyServiceServer).Revoke(ctx, req.(*RevokeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// PolicyService_ServiceDesc is the grpc.ServiceDesc for PolicyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PolicyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.backup.v1.PolicyService",
	HandlerType: (*PolicyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _PolicyService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _PolicyService_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _PolicyService_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _PolicyService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _PolicyService_Delete_Handler,
		},
		{
			MethodName: "Apply",
			Handler:    _PolicyService_Apply_Handler,
		},
		{
			MethodName: "ListApplications",
			Handler:    _PolicyService_ListApplications_Handler,
		},
		{
			MethodName: "Execute",
			Handler:    _PolicyService_Execute_Handler,
		},
		{
			MethodName: "Revoke",
			Handler:    _PolicyService_Revoke_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/backup/v1/policy_service.proto",
}
