// 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/mdb/clickhouse/v1/ml_model_service.proto

package clickhouse

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 (
	MlModelService_Get_FullMethodName    = "/yandex.cloud.mdb.clickhouse.v1.MlModelService/Get"
	MlModelService_List_FullMethodName   = "/yandex.cloud.mdb.clickhouse.v1.MlModelService/List"
	MlModelService_Create_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.MlModelService/Create"
	MlModelService_Update_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.MlModelService/Update"
	MlModelService_Delete_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.MlModelService/Delete"
)

// MlModelServiceClient is the client API for MlModelService 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 machine learning models.
type MlModelServiceClient interface {
	// Returns the specified machine learning model.
	//
	// To get the list of all available models, make a [List] request.
	Get(ctx context.Context, in *GetMlModelRequest, opts ...grpc.CallOption) (*MlModel, error)
	// Retrieves the list of machine learning models in the specified cluster.
	List(ctx context.Context, in *ListMlModelsRequest, opts ...grpc.CallOption) (*ListMlModelsResponse, error)
	// Creates a machine learning model in the specified cluster.
	Create(ctx context.Context, in *CreateMlModelRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates the specified machine learning model.
	Update(ctx context.Context, in *UpdateMlModelRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified machine learning model.
	Delete(ctx context.Context, in *DeleteMlModelRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type mlModelServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewMlModelServiceClient(cc grpc.ClientConnInterface) MlModelServiceClient {
	return &mlModelServiceClient{cc}
}

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

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

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

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

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

// MlModelServiceServer is the server API for MlModelService service.
// All implementations should embed UnimplementedMlModelServiceServer
// for forward compatibility.
//
// A set of methods for managing machine learning models.
type MlModelServiceServer interface {
	// Returns the specified machine learning model.
	//
	// To get the list of all available models, make a [List] request.
	Get(context.Context, *GetMlModelRequest) (*MlModel, error)
	// Retrieves the list of machine learning models in the specified cluster.
	List(context.Context, *ListMlModelsRequest) (*ListMlModelsResponse, error)
	// Creates a machine learning model in the specified cluster.
	Create(context.Context, *CreateMlModelRequest) (*operation.Operation, error)
	// Updates the specified machine learning model.
	Update(context.Context, *UpdateMlModelRequest) (*operation.Operation, error)
	// Deletes the specified machine learning model.
	Delete(context.Context, *DeleteMlModelRequest) (*operation.Operation, error)
}

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

func (UnimplementedMlModelServiceServer) Get(context.Context, *GetMlModelRequest) (*MlModel, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedMlModelServiceServer) List(context.Context, *ListMlModelsRequest) (*ListMlModelsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedMlModelServiceServer) Create(context.Context, *CreateMlModelRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedMlModelServiceServer) Update(context.Context, *UpdateMlModelRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedMlModelServiceServer) Delete(context.Context, *DeleteMlModelRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedMlModelServiceServer) testEmbeddedByValue() {}

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

func RegisterMlModelServiceServer(s grpc.ServiceRegistrar, srv MlModelServiceServer) {
	// If the following call panics, it indicates UnimplementedMlModelServiceServer 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(&MlModelService_ServiceDesc, srv)
}

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

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

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

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

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

// MlModelService_ServiceDesc is the grpc.ServiceDesc for MlModelService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MlModelService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.clickhouse.v1.MlModelService",
	HandlerType: (*MlModelServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _MlModelService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _MlModelService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _MlModelService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _MlModelService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _MlModelService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/clickhouse/v1/ml_model_service.proto",
}
