// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc             (unknown)
// source: global/nextgen/v1/tidb_group.proto

package nextgenv1

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	TiDBGroupService_CreateTiDBGroup_FullMethodName = "/global.nextgen.v1.TiDBGroupService/CreateTiDBGroup"
	TiDBGroupService_DeleteTiDBGroup_FullMethodName = "/global.nextgen.v1.TiDBGroupService/DeleteTiDBGroup"
)

// TiDBGroupServiceClient is the client API for TiDBGroupService 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 TiDBGroupServiceClient interface {
	CreateTiDBGroup(ctx context.Context, in *CreateTiDBGroupRequest, opts ...grpc.CallOption) (*TiDBGroup, error)
	DeleteTiDBGroup(ctx context.Context, in *DeleteTiDBGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type tiDBGroupServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewTiDBGroupServiceClient(cc grpc.ClientConnInterface) TiDBGroupServiceClient {
	return &tiDBGroupServiceClient{cc}
}

func (c *tiDBGroupServiceClient) CreateTiDBGroup(ctx context.Context, in *CreateTiDBGroupRequest, opts ...grpc.CallOption) (*TiDBGroup, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(TiDBGroup)
	err := c.cc.Invoke(ctx, TiDBGroupService_CreateTiDBGroup_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tiDBGroupServiceClient) DeleteTiDBGroup(ctx context.Context, in *DeleteTiDBGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, TiDBGroupService_DeleteTiDBGroup_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TiDBGroupServiceServer is the server API for TiDBGroupService service.
// All implementations should embed UnimplementedTiDBGroupServiceServer
// for forward compatibility
type TiDBGroupServiceServer interface {
	CreateTiDBGroup(context.Context, *CreateTiDBGroupRequest) (*TiDBGroup, error)
	DeleteTiDBGroup(context.Context, *DeleteTiDBGroupRequest) (*emptypb.Empty, error)
}

// UnimplementedTiDBGroupServiceServer should be embedded to have forward compatible implementations.
type UnimplementedTiDBGroupServiceServer struct {
}

func (UnimplementedTiDBGroupServiceServer) CreateTiDBGroup(context.Context, *CreateTiDBGroupRequest) (*TiDBGroup, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateTiDBGroup not implemented")
}
func (UnimplementedTiDBGroupServiceServer) DeleteTiDBGroup(context.Context, *DeleteTiDBGroupRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteTiDBGroup not implemented")
}

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

func RegisterTiDBGroupServiceServer(s grpc.ServiceRegistrar, srv TiDBGroupServiceServer) {
	s.RegisterService(&TiDBGroupService_ServiceDesc, srv)
}

func _TiDBGroupService_CreateTiDBGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateTiDBGroupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TiDBGroupServiceServer).CreateTiDBGroup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TiDBGroupService_CreateTiDBGroup_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TiDBGroupServiceServer).CreateTiDBGroup(ctx, req.(*CreateTiDBGroupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TiDBGroupService_DeleteTiDBGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteTiDBGroupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TiDBGroupServiceServer).DeleteTiDBGroup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TiDBGroupService_DeleteTiDBGroup_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TiDBGroupServiceServer).DeleteTiDBGroup(ctx, req.(*DeleteTiDBGroupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TiDBGroupService_ServiceDesc is the grpc.ServiceDesc for TiDBGroupService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TiDBGroupService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "global.nextgen.v1.TiDBGroupService",
	HandlerType: (*TiDBGroupServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateTiDBGroup",
			Handler:    _TiDBGroupService_CreateTiDBGroup_Handler,
		},
		{
			MethodName: "DeleteTiDBGroup",
			Handler:    _TiDBGroupService_DeleteTiDBGroup_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "global/nextgen/v1/tidb_group.proto",
}
