// 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/format_schema_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 (
	FormatSchemaService_Get_FullMethodName    = "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Get"
	FormatSchemaService_List_FullMethodName   = "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/List"
	FormatSchemaService_Create_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Create"
	FormatSchemaService_Update_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Update"
	FormatSchemaService_Delete_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.FormatSchemaService/Delete"
)

// FormatSchemaServiceClient is the client API for FormatSchemaService 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 [format schemas](https://clickhouse.com/docs/en/interfaces/formats) for input and output data.
type FormatSchemaServiceClient interface {
	// Returns detailed information about a given format schema.
	Get(ctx context.Context, in *GetFormatSchemaRequest, opts ...grpc.CallOption) (*FormatSchema, error)
	// Returns a list of format schemas in a cluster.
	List(ctx context.Context, in *ListFormatSchemasRequest, opts ...grpc.CallOption) (*ListFormatSchemasResponse, error)
	// Adds a format schema to a cluster.
	Create(ctx context.Context, in *CreateFormatSchemaRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Changes a format schema.
	Update(ctx context.Context, in *UpdateFormatSchemaRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes a format schema from a cluster.
	Delete(ctx context.Context, in *DeleteFormatSchemaRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type formatSchemaServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFormatSchemaServiceClient(cc grpc.ClientConnInterface) FormatSchemaServiceClient {
	return &formatSchemaServiceClient{cc}
}

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

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

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

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

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

// FormatSchemaServiceServer is the server API for FormatSchemaService service.
// All implementations should embed UnimplementedFormatSchemaServiceServer
// for forward compatibility.
//
// A set of methods for managing [format schemas](https://clickhouse.com/docs/en/interfaces/formats) for input and output data.
type FormatSchemaServiceServer interface {
	// Returns detailed information about a given format schema.
	Get(context.Context, *GetFormatSchemaRequest) (*FormatSchema, error)
	// Returns a list of format schemas in a cluster.
	List(context.Context, *ListFormatSchemasRequest) (*ListFormatSchemasResponse, error)
	// Adds a format schema to a cluster.
	Create(context.Context, *CreateFormatSchemaRequest) (*operation.Operation, error)
	// Changes a format schema.
	Update(context.Context, *UpdateFormatSchemaRequest) (*operation.Operation, error)
	// Deletes a format schema from a cluster.
	Delete(context.Context, *DeleteFormatSchemaRequest) (*operation.Operation, error)
}

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

func (UnimplementedFormatSchemaServiceServer) Get(context.Context, *GetFormatSchemaRequest) (*FormatSchema, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedFormatSchemaServiceServer) List(context.Context, *ListFormatSchemasRequest) (*ListFormatSchemasResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedFormatSchemaServiceServer) Create(context.Context, *CreateFormatSchemaRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedFormatSchemaServiceServer) Update(context.Context, *UpdateFormatSchemaRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedFormatSchemaServiceServer) Delete(context.Context, *DeleteFormatSchemaRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedFormatSchemaServiceServer) testEmbeddedByValue() {}

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

func RegisterFormatSchemaServiceServer(s grpc.ServiceRegistrar, srv FormatSchemaServiceServer) {
	// If the following call panics, it indicates UnimplementedFormatSchemaServiceServer 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(&FormatSchemaService_ServiceDesc, srv)
}

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

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

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

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

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

// FormatSchemaService_ServiceDesc is the grpc.ServiceDesc for FormatSchemaService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FormatSchemaService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.clickhouse.v1.FormatSchemaService",
	HandlerType: (*FormatSchemaServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _FormatSchemaService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _FormatSchemaService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _FormatSchemaService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _FormatSchemaService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _FormatSchemaService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/clickhouse/v1/format_schema_service.proto",
}
