// 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/marketplace/licensemanager/v1/lock_service.proto

package licensemanager

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 (
	LockService_Get_FullMethodName                      = "/yandex.cloud.marketplace.licensemanager.v1.LockService/Get"
	LockService_GetByInstanceAndResource_FullMethodName = "/yandex.cloud.marketplace.licensemanager.v1.LockService/GetByInstanceAndResource"
	LockService_List_FullMethodName                     = "/yandex.cloud.marketplace.licensemanager.v1.LockService/List"
	LockService_Create_FullMethodName                   = "/yandex.cloud.marketplace.licensemanager.v1.LockService/Create"
	LockService_Ensure_FullMethodName                   = "/yandex.cloud.marketplace.licensemanager.v1.LockService/Ensure"
	LockService_Delete_FullMethodName                   = "/yandex.cloud.marketplace.licensemanager.v1.LockService/Delete"
)

// LockServiceClient is the client API for LockService 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 subscription locks.
type LockServiceClient interface {
	// Returns the specified subscription lock.
	Get(ctx context.Context, in *GetLockRequest, opts ...grpc.CallOption) (*Lock, error)
	// Returns the subscription lock for specified subscription instance and resource.
	GetByInstanceAndResource(ctx context.Context, in *GetLockByInstanceAndResourceRequest, opts ...grpc.CallOption) (*Lock, error)
	// Returns subscriptions locks for specified resource and folder.
	List(ctx context.Context, in *ListLocksRequest, opts ...grpc.CallOption) (*ListLocksResponse, error)
	// Locks the specified subscription instance to the resource.
	Create(ctx context.Context, in *CreateLockRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Checks if the she specified subscription is already locked to the specified resource.
	// If it is not locked, locks the subscription to the resource.
	Ensure(ctx context.Context, in *EnsureLockRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Unlocks the specified subscription lock.
	Delete(ctx context.Context, in *DeleteLockRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type lockServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewLockServiceClient(cc grpc.ClientConnInterface) LockServiceClient {
	return &lockServiceClient{cc}
}

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

func (c *lockServiceClient) GetByInstanceAndResource(ctx context.Context, in *GetLockByInstanceAndResourceRequest, opts ...grpc.CallOption) (*Lock, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Lock)
	err := c.cc.Invoke(ctx, LockService_GetByInstanceAndResource_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

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

// LockServiceServer is the server API for LockService service.
// All implementations should embed UnimplementedLockServiceServer
// for forward compatibility.
//
// A set of methods for managing subscription locks.
type LockServiceServer interface {
	// Returns the specified subscription lock.
	Get(context.Context, *GetLockRequest) (*Lock, error)
	// Returns the subscription lock for specified subscription instance and resource.
	GetByInstanceAndResource(context.Context, *GetLockByInstanceAndResourceRequest) (*Lock, error)
	// Returns subscriptions locks for specified resource and folder.
	List(context.Context, *ListLocksRequest) (*ListLocksResponse, error)
	// Locks the specified subscription instance to the resource.
	Create(context.Context, *CreateLockRequest) (*operation.Operation, error)
	// Checks if the she specified subscription is already locked to the specified resource.
	// If it is not locked, locks the subscription to the resource.
	Ensure(context.Context, *EnsureLockRequest) (*operation.Operation, error)
	// Unlocks the specified subscription lock.
	Delete(context.Context, *DeleteLockRequest) (*operation.Operation, error)
}

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

func (UnimplementedLockServiceServer) Get(context.Context, *GetLockRequest) (*Lock, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedLockServiceServer) GetByInstanceAndResource(context.Context, *GetLockByInstanceAndResourceRequest) (*Lock, error) {
	return nil, status.Error(codes.Unimplemented, "method GetByInstanceAndResource not implemented")
}
func (UnimplementedLockServiceServer) List(context.Context, *ListLocksRequest) (*ListLocksResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedLockServiceServer) Create(context.Context, *CreateLockRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedLockServiceServer) Ensure(context.Context, *EnsureLockRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Ensure not implemented")
}
func (UnimplementedLockServiceServer) Delete(context.Context, *DeleteLockRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedLockServiceServer) testEmbeddedByValue() {}

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

func RegisterLockServiceServer(s grpc.ServiceRegistrar, srv LockServiceServer) {
	// If the following call panics, it indicates UnimplementedLockServiceServer 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(&LockService_ServiceDesc, srv)
}

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

func _LockService_GetByInstanceAndResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetLockByInstanceAndResourceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LockServiceServer).GetByInstanceAndResource(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LockService_GetByInstanceAndResource_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LockServiceServer).GetByInstanceAndResource(ctx, req.(*GetLockByInstanceAndResourceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

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

func _LockService_Ensure_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EnsureLockRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LockServiceServer).Ensure(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LockService_Ensure_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LockServiceServer).Ensure(ctx, req.(*EnsureLockRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

// LockService_ServiceDesc is the grpc.ServiceDesc for LockService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LockService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.marketplace.licensemanager.v1.LockService",
	HandlerType: (*LockServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _LockService_Get_Handler,
		},
		{
			MethodName: "GetByInstanceAndResource",
			Handler:    _LockService_GetByInstanceAndResource_Handler,
		},
		{
			MethodName: "List",
			Handler:    _LockService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _LockService_Create_Handler,
		},
		{
			MethodName: "Ensure",
			Handler:    _LockService_Ensure_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _LockService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/marketplace/licensemanager/v1/lock_service.proto",
}
