// 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/cloudregistry/v1/lifecycle_policy_service.proto

package cloudregistry

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"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	LifecyclePolicyService_Create_FullMethodName      = "/yandex.cloud.cloudregistry.v1.LifecyclePolicyService/Create"
	LifecyclePolicyService_Update_FullMethodName      = "/yandex.cloud.cloudregistry.v1.LifecyclePolicyService/Update"
	LifecyclePolicyService_Delete_FullMethodName      = "/yandex.cloud.cloudregistry.v1.LifecyclePolicyService/Delete"
	LifecyclePolicyService_Get_FullMethodName         = "/yandex.cloud.cloudregistry.v1.LifecyclePolicyService/Get"
	LifecyclePolicyService_List_FullMethodName        = "/yandex.cloud.cloudregistry.v1.LifecyclePolicyService/List"
	LifecyclePolicyService_ChangeState_FullMethodName = "/yandex.cloud.cloudregistry.v1.LifecyclePolicyService/ChangeState"
)

// LifecyclePolicyServiceClient is the client API for LifecyclePolicyService 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 LifecyclePolicy resources.
type LifecyclePolicyServiceClient interface {
	// Creates a lifecycle policy in the specified registry.
	Create(ctx context.Context, in *CreateLifecyclePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates the specified lifecycle policy.
	Update(ctx context.Context, in *UpdateLifecyclePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified lifecycle policy.
	Delete(ctx context.Context, in *DeleteLifecyclePolicyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Returns the specified lifecycle policy.
	Get(ctx context.Context, in *GetLifecyclePolicyRequest, opts ...grpc.CallOption) (*LifecyclePolicy, error)
	// Retrieves the list of lifecycle policies in the specified registry.
	List(ctx context.Context, in *ListLifecyclePolicyRequest, opts ...grpc.CallOption) (*ListLifecyclePolicyResponse, error)
	// Changes the state of the specified lifecycle policy.
	ChangeState(ctx context.Context, in *ChangeLifecyclePolicyStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type lifecyclePolicyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewLifecyclePolicyServiceClient(cc grpc.ClientConnInterface) LifecyclePolicyServiceClient {
	return &lifecyclePolicyServiceClient{cc}
}

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

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

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

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

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

func (c *lifecyclePolicyServiceClient) ChangeState(ctx context.Context, in *ChangeLifecyclePolicyStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, LifecyclePolicyService_ChangeState_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LifecyclePolicyServiceServer is the server API for LifecyclePolicyService service.
// All implementations should embed UnimplementedLifecyclePolicyServiceServer
// for forward compatibility.
//
// A set of methods for managing LifecyclePolicy resources.
type LifecyclePolicyServiceServer interface {
	// Creates a lifecycle policy in the specified registry.
	Create(context.Context, *CreateLifecyclePolicyRequest) (*operation.Operation, error)
	// Updates the specified lifecycle policy.
	Update(context.Context, *UpdateLifecyclePolicyRequest) (*operation.Operation, error)
	// Deletes the specified lifecycle policy.
	Delete(context.Context, *DeleteLifecyclePolicyRequest) (*operation.Operation, error)
	// Returns the specified lifecycle policy.
	Get(context.Context, *GetLifecyclePolicyRequest) (*LifecyclePolicy, error)
	// Retrieves the list of lifecycle policies in the specified registry.
	List(context.Context, *ListLifecyclePolicyRequest) (*ListLifecyclePolicyResponse, error)
	// Changes the state of the specified lifecycle policy.
	ChangeState(context.Context, *ChangeLifecyclePolicyStateRequest) (*emptypb.Empty, error)
}

// UnimplementedLifecyclePolicyServiceServer 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 UnimplementedLifecyclePolicyServiceServer struct{}

func (UnimplementedLifecyclePolicyServiceServer) Create(context.Context, *CreateLifecyclePolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedLifecyclePolicyServiceServer) Update(context.Context, *UpdateLifecyclePolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedLifecyclePolicyServiceServer) Delete(context.Context, *DeleteLifecyclePolicyRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedLifecyclePolicyServiceServer) Get(context.Context, *GetLifecyclePolicyRequest) (*LifecyclePolicy, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedLifecyclePolicyServiceServer) List(context.Context, *ListLifecyclePolicyRequest) (*ListLifecyclePolicyResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedLifecyclePolicyServiceServer) ChangeState(context.Context, *ChangeLifecyclePolicyStateRequest) (*emptypb.Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method ChangeState not implemented")
}
func (UnimplementedLifecyclePolicyServiceServer) testEmbeddedByValue() {}

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

func RegisterLifecyclePolicyServiceServer(s grpc.ServiceRegistrar, srv LifecyclePolicyServiceServer) {
	// If the following call panics, it indicates UnimplementedLifecyclePolicyServiceServer 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(&LifecyclePolicyService_ServiceDesc, srv)
}

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

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

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

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

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

func _LifecyclePolicyService_ChangeState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ChangeLifecyclePolicyStateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LifecyclePolicyServiceServer).ChangeState(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LifecyclePolicyService_ChangeState_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LifecyclePolicyServiceServer).ChangeState(ctx, req.(*ChangeLifecyclePolicyStateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// LifecyclePolicyService_ServiceDesc is the grpc.ServiceDesc for LifecyclePolicyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LifecyclePolicyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.cloudregistry.v1.LifecyclePolicyService",
	HandlerType: (*LifecyclePolicyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _LifecyclePolicyService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _LifecyclePolicyService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _LifecyclePolicyService_Delete_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _LifecyclePolicyService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _LifecyclePolicyService_List_Handler,
		},
		{
			MethodName: "ChangeState",
			Handler:    _LifecyclePolicyService_ChangeState_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/cloudregistry/v1/lifecycle_policy_service.proto",
}
