// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.21.12
// source: yandex/cloud/mdb/clickhouse/v1/cluster_extension_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 (
	ClusterExtensionService_Get_FullMethodName           = "/yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService/Get"
	ClusterExtensionService_List_FullMethodName          = "/yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService/List"
	ClusterExtensionService_Create_FullMethodName        = "/yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService/Create"
	ClusterExtensionService_Delete_FullMethodName        = "/yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService/Delete"
	ClusterExtensionService_Update_FullMethodName        = "/yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService/Update"
	ClusterExtensionService_SetExtensions_FullMethodName = "/yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService/SetExtensions"
)

// ClusterExtensionServiceClient is the client API for ClusterExtensionService 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.
type ClusterExtensionServiceClient interface {
	Get(ctx context.Context, in *GetClusterExtensionRequest, opts ...grpc.CallOption) (*ClusterExtension, error)
	List(ctx context.Context, in *ListClusterExtensionsRequest, opts ...grpc.CallOption) (*ListClusterExtensionsResponse, error)
	Create(ctx context.Context, in *CreateClusterExtensionRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	Delete(ctx context.Context, in *DeleteClusterExtensionRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	Update(ctx context.Context, in *UpdateClusterExtensionRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Set the list of cluster extensions. Not specified extensions will be deleted.
	SetExtensions(ctx context.Context, in *SetClusterExtensionsRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type clusterExtensionServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewClusterExtensionServiceClient(cc grpc.ClientConnInterface) ClusterExtensionServiceClient {
	return &clusterExtensionServiceClient{cc}
}

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

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

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

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

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

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

// ClusterExtensionServiceServer is the server API for ClusterExtensionService service.
// All implementations should embed UnimplementedClusterExtensionServiceServer
// for forward compatibility.
type ClusterExtensionServiceServer interface {
	Get(context.Context, *GetClusterExtensionRequest) (*ClusterExtension, error)
	List(context.Context, *ListClusterExtensionsRequest) (*ListClusterExtensionsResponse, error)
	Create(context.Context, *CreateClusterExtensionRequest) (*operation.Operation, error)
	Delete(context.Context, *DeleteClusterExtensionRequest) (*operation.Operation, error)
	Update(context.Context, *UpdateClusterExtensionRequest) (*operation.Operation, error)
	// Set the list of cluster extensions. Not specified extensions will be deleted.
	SetExtensions(context.Context, *SetClusterExtensionsRequest) (*operation.Operation, error)
}

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

func (UnimplementedClusterExtensionServiceServer) Get(context.Context, *GetClusterExtensionRequest) (*ClusterExtension, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedClusterExtensionServiceServer) List(context.Context, *ListClusterExtensionsRequest) (*ListClusterExtensionsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedClusterExtensionServiceServer) Create(context.Context, *CreateClusterExtensionRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedClusterExtensionServiceServer) Delete(context.Context, *DeleteClusterExtensionRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedClusterExtensionServiceServer) Update(context.Context, *UpdateClusterExtensionRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedClusterExtensionServiceServer) SetExtensions(context.Context, *SetClusterExtensionsRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SetExtensions not implemented")
}
func (UnimplementedClusterExtensionServiceServer) testEmbeddedByValue() {}

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

func RegisterClusterExtensionServiceServer(s grpc.ServiceRegistrar, srv ClusterExtensionServiceServer) {
	// If the following call pancis, it indicates UnimplementedClusterExtensionServiceServer 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(&ClusterExtensionService_ServiceDesc, srv)
}

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

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

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

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

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

func _ClusterExtensionService_SetExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetClusterExtensionsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ClusterExtensionServiceServer).SetExtensions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ClusterExtensionService_SetExtensions_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ClusterExtensionServiceServer).SetExtensions(ctx, req.(*SetClusterExtensionsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ClusterExtensionService_ServiceDesc is the grpc.ServiceDesc for ClusterExtensionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ClusterExtensionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.clickhouse.v1.ClusterExtensionService",
	HandlerType: (*ClusterExtensionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _ClusterExtensionService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _ClusterExtensionService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _ClusterExtensionService_Create_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _ClusterExtensionService_Delete_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ClusterExtensionService_Update_Handler,
		},
		{
			MethodName: "SetExtensions",
			Handler:    _ClusterExtensionService_SetExtensions_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/clickhouse/v1/cluster_extension_service.proto",
}
