// 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/stacklandlicenseapi/v1/license_server_service.proto

package stacklandlicenseapi

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 (
	LicenseServerService_Register_FullMethodName  = "/yandex.cloud.marketplace.stacklandlicenseapi.v1.LicenseServerService/Register"
	LicenseServerService_SyncUsage_FullMethodName = "/yandex.cloud.marketplace.stacklandlicenseapi.v1.LicenseServerService/SyncUsage"
)

// LicenseServerServiceClient is the client API for LicenseServerService 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.
//
// Service for managing license servers
type LicenseServerServiceClient interface {
	// Register a new license server
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Synchronize: get license limits and submit usage data
	SyncUsage(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type licenseServerServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewLicenseServerServiceClient(cc grpc.ClientConnInterface) LicenseServerServiceClient {
	return &licenseServerServiceClient{cc}
}

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

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

// LicenseServerServiceServer is the server API for LicenseServerService service.
// All implementations should embed UnimplementedLicenseServerServiceServer
// for forward compatibility.
//
// Service for managing license servers
type LicenseServerServiceServer interface {
	// Register a new license server
	Register(context.Context, *RegisterRequest) (*operation.Operation, error)
	// Synchronize: get license limits and submit usage data
	SyncUsage(context.Context, *SyncRequest) (*operation.Operation, error)
}

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

func (UnimplementedLicenseServerServiceServer) Register(context.Context, *RegisterRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Register not implemented")
}
func (UnimplementedLicenseServerServiceServer) SyncUsage(context.Context, *SyncRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method SyncUsage not implemented")
}
func (UnimplementedLicenseServerServiceServer) testEmbeddedByValue() {}

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

func RegisterLicenseServerServiceServer(s grpc.ServiceRegistrar, srv LicenseServerServiceServer) {
	// If the following call panics, it indicates UnimplementedLicenseServerServiceServer 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(&LicenseServerService_ServiceDesc, srv)
}

func _LicenseServerService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RegisterRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LicenseServerServiceServer).Register(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LicenseServerService_Register_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LicenseServerServiceServer).Register(ctx, req.(*RegisterRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _LicenseServerService_SyncUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SyncRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LicenseServerServiceServer).SyncUsage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: LicenseServerService_SyncUsage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LicenseServerServiceServer).SyncUsage(ctx, req.(*SyncRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// LicenseServerService_ServiceDesc is the grpc.ServiceDesc for LicenseServerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LicenseServerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.marketplace.stacklandlicenseapi.v1.LicenseServerService",
	HandlerType: (*LicenseServerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _LicenseServerService_Register_Handler,
		},
		{
			MethodName: "SyncUsage",
			Handler:    _LicenseServerService_SyncUsage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/marketplace/stacklandlicenseapi/v1/license_server_service.proto",
}
