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

package tidb_mgmt_servicev1

import (
	context "context"
	v1 "github.com/tidbcloud/tidb-management-service/api/spec/global/nextgen/v1"
	v11 "github.com/tidbcloud/tidb-management-service/api/spec/global/serverless/v1"
	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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	BackupService_OverrideFlexibleBackupRetention_FullMethodName = "/tidb_mgmt_service.v1.BackupService/OverrideFlexibleBackupRetention"
)

// BackupServiceClient is the client API for BackupService 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.
//
// All APIs here are for global control plane internal use only.
type BackupServiceClient interface {
	OverrideFlexibleBackupRetention(ctx context.Context, in *v1.OverrideFlexibleBackupRetentionRequest, opts ...grpc.CallOption) (*v1.BackupSetting, error)
}

type backupServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBackupServiceClient(cc grpc.ClientConnInterface) BackupServiceClient {
	return &backupServiceClient{cc}
}

func (c *backupServiceClient) OverrideFlexibleBackupRetention(ctx context.Context, in *v1.OverrideFlexibleBackupRetentionRequest, opts ...grpc.CallOption) (*v1.BackupSetting, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(v1.BackupSetting)
	err := c.cc.Invoke(ctx, BackupService_OverrideFlexibleBackupRetention_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BackupServiceServer is the server API for BackupService service.
// All implementations should embed UnimplementedBackupServiceServer
// for forward compatibility
//
// All APIs here are for global control plane internal use only.
type BackupServiceServer interface {
	OverrideFlexibleBackupRetention(context.Context, *v1.OverrideFlexibleBackupRetentionRequest) (*v1.BackupSetting, error)
}

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

func (UnimplementedBackupServiceServer) OverrideFlexibleBackupRetention(context.Context, *v1.OverrideFlexibleBackupRetentionRequest) (*v1.BackupSetting, error) {
	return nil, status.Errorf(codes.Unimplemented, "method OverrideFlexibleBackupRetention not implemented")
}

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

func RegisterBackupServiceServer(s grpc.ServiceRegistrar, srv BackupServiceServer) {
	s.RegisterService(&BackupService_ServiceDesc, srv)
}

func _BackupService_OverrideFlexibleBackupRetention_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v1.OverrideFlexibleBackupRetentionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BackupServiceServer).OverrideFlexibleBackupRetention(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BackupService_OverrideFlexibleBackupRetention_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BackupServiceServer).OverrideFlexibleBackupRetention(ctx, req.(*v1.OverrideFlexibleBackupRetentionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// BackupService_ServiceDesc is the grpc.ServiceDesc for BackupService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BackupService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tidb_mgmt_service.v1.BackupService",
	HandlerType: (*BackupServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OverrideFlexibleBackupRetention",
			Handler:    _BackupService_OverrideFlexibleBackupRetention_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tidb_mgmt_service/v1/backup.proto",
}

const (
	ServerlessPGBackupProxyService_CreatePGBackup_FullMethodName       = "/tidb_mgmt_service.v1.ServerlessPGBackupProxyService/CreatePGBackup"
	ServerlessPGBackupProxyService_ListPGBackups_FullMethodName        = "/tidb_mgmt_service.v1.ServerlessPGBackupProxyService/ListPGBackups"
	ServerlessPGBackupProxyService_GetPGBackup_FullMethodName          = "/tidb_mgmt_service.v1.ServerlessPGBackupProxyService/GetPGBackup"
	ServerlessPGBackupProxyService_GetPGBackupPolicy_FullMethodName    = "/tidb_mgmt_service.v1.ServerlessPGBackupProxyService/GetPGBackupPolicy"
	ServerlessPGBackupProxyService_UpdatePGBackupPolicy_FullMethodName = "/tidb_mgmt_service.v1.ServerlessPGBackupProxyService/UpdatePGBackupPolicy"
)

// ServerlessPGBackupProxyServiceClient is the client API for ServerlessPGBackupProxyService 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.
//
// ServerlessPGBackupProxyService proxies PostgreSQL backup APIs from
// serverless-service to serverless-global-service through tidb-mgmt-service.
type ServerlessPGBackupProxyServiceClient interface {
	CreatePGBackup(ctx context.Context, in *v11.CreatePGBackupRequest, opts ...grpc.CallOption) (*v11.CreatePGBackupResponse, error)
	ListPGBackups(ctx context.Context, in *v11.ListPGBackupsRequest, opts ...grpc.CallOption) (*v11.ListPGBackupsResponse, error)
	GetPGBackup(ctx context.Context, in *v11.GetPGBackupRequest, opts ...grpc.CallOption) (*v11.GetPGBackupResponse, error)
	GetPGBackupPolicy(ctx context.Context, in *v11.GetPGBackupPolicyRequest, opts ...grpc.CallOption) (*v11.GetPGBackupPolicyResponse, error)
	UpdatePGBackupPolicy(ctx context.Context, in *v11.UpdatePGBackupPolicyRequest, opts ...grpc.CallOption) (*v11.UpdatePGBackupPolicyResponse, error)
}

type serverlessPGBackupProxyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewServerlessPGBackupProxyServiceClient(cc grpc.ClientConnInterface) ServerlessPGBackupProxyServiceClient {
	return &serverlessPGBackupProxyServiceClient{cc}
}

func (c *serverlessPGBackupProxyServiceClient) CreatePGBackup(ctx context.Context, in *v11.CreatePGBackupRequest, opts ...grpc.CallOption) (*v11.CreatePGBackupResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(v11.CreatePGBackupResponse)
	err := c.cc.Invoke(ctx, ServerlessPGBackupProxyService_CreatePGBackup_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverlessPGBackupProxyServiceClient) ListPGBackups(ctx context.Context, in *v11.ListPGBackupsRequest, opts ...grpc.CallOption) (*v11.ListPGBackupsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(v11.ListPGBackupsResponse)
	err := c.cc.Invoke(ctx, ServerlessPGBackupProxyService_ListPGBackups_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverlessPGBackupProxyServiceClient) GetPGBackup(ctx context.Context, in *v11.GetPGBackupRequest, opts ...grpc.CallOption) (*v11.GetPGBackupResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(v11.GetPGBackupResponse)
	err := c.cc.Invoke(ctx, ServerlessPGBackupProxyService_GetPGBackup_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverlessPGBackupProxyServiceClient) GetPGBackupPolicy(ctx context.Context, in *v11.GetPGBackupPolicyRequest, opts ...grpc.CallOption) (*v11.GetPGBackupPolicyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(v11.GetPGBackupPolicyResponse)
	err := c.cc.Invoke(ctx, ServerlessPGBackupProxyService_GetPGBackupPolicy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serverlessPGBackupProxyServiceClient) UpdatePGBackupPolicy(ctx context.Context, in *v11.UpdatePGBackupPolicyRequest, opts ...grpc.CallOption) (*v11.UpdatePGBackupPolicyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(v11.UpdatePGBackupPolicyResponse)
	err := c.cc.Invoke(ctx, ServerlessPGBackupProxyService_UpdatePGBackupPolicy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ServerlessPGBackupProxyServiceServer is the server API for ServerlessPGBackupProxyService service.
// All implementations should embed UnimplementedServerlessPGBackupProxyServiceServer
// for forward compatibility
//
// ServerlessPGBackupProxyService proxies PostgreSQL backup APIs from
// serverless-service to serverless-global-service through tidb-mgmt-service.
type ServerlessPGBackupProxyServiceServer interface {
	CreatePGBackup(context.Context, *v11.CreatePGBackupRequest) (*v11.CreatePGBackupResponse, error)
	ListPGBackups(context.Context, *v11.ListPGBackupsRequest) (*v11.ListPGBackupsResponse, error)
	GetPGBackup(context.Context, *v11.GetPGBackupRequest) (*v11.GetPGBackupResponse, error)
	GetPGBackupPolicy(context.Context, *v11.GetPGBackupPolicyRequest) (*v11.GetPGBackupPolicyResponse, error)
	UpdatePGBackupPolicy(context.Context, *v11.UpdatePGBackupPolicyRequest) (*v11.UpdatePGBackupPolicyResponse, error)
}

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

func (UnimplementedServerlessPGBackupProxyServiceServer) CreatePGBackup(context.Context, *v11.CreatePGBackupRequest) (*v11.CreatePGBackupResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreatePGBackup not implemented")
}
func (UnimplementedServerlessPGBackupProxyServiceServer) ListPGBackups(context.Context, *v11.ListPGBackupsRequest) (*v11.ListPGBackupsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListPGBackups not implemented")
}
func (UnimplementedServerlessPGBackupProxyServiceServer) GetPGBackup(context.Context, *v11.GetPGBackupRequest) (*v11.GetPGBackupResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPGBackup not implemented")
}
func (UnimplementedServerlessPGBackupProxyServiceServer) GetPGBackupPolicy(context.Context, *v11.GetPGBackupPolicyRequest) (*v11.GetPGBackupPolicyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPGBackupPolicy not implemented")
}
func (UnimplementedServerlessPGBackupProxyServiceServer) UpdatePGBackupPolicy(context.Context, *v11.UpdatePGBackupPolicyRequest) (*v11.UpdatePGBackupPolicyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdatePGBackupPolicy not implemented")
}

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

func RegisterServerlessPGBackupProxyServiceServer(s grpc.ServiceRegistrar, srv ServerlessPGBackupProxyServiceServer) {
	s.RegisterService(&ServerlessPGBackupProxyService_ServiceDesc, srv)
}

func _ServerlessPGBackupProxyService_CreatePGBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v11.CreatePGBackupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerlessPGBackupProxyServiceServer).CreatePGBackup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerlessPGBackupProxyService_CreatePGBackup_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerlessPGBackupProxyServiceServer).CreatePGBackup(ctx, req.(*v11.CreatePGBackupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerlessPGBackupProxyService_ListPGBackups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v11.ListPGBackupsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerlessPGBackupProxyServiceServer).ListPGBackups(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerlessPGBackupProxyService_ListPGBackups_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerlessPGBackupProxyServiceServer).ListPGBackups(ctx, req.(*v11.ListPGBackupsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerlessPGBackupProxyService_GetPGBackup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v11.GetPGBackupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerlessPGBackupProxyServiceServer).GetPGBackup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerlessPGBackupProxyService_GetPGBackup_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerlessPGBackupProxyServiceServer).GetPGBackup(ctx, req.(*v11.GetPGBackupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerlessPGBackupProxyService_GetPGBackupPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v11.GetPGBackupPolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerlessPGBackupProxyServiceServer).GetPGBackupPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerlessPGBackupProxyService_GetPGBackupPolicy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerlessPGBackupProxyServiceServer).GetPGBackupPolicy(ctx, req.(*v11.GetPGBackupPolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ServerlessPGBackupProxyService_UpdatePGBackupPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(v11.UpdatePGBackupPolicyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServerlessPGBackupProxyServiceServer).UpdatePGBackupPolicy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ServerlessPGBackupProxyService_UpdatePGBackupPolicy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServerlessPGBackupProxyServiceServer).UpdatePGBackupPolicy(ctx, req.(*v11.UpdatePGBackupPolicyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ServerlessPGBackupProxyService_ServiceDesc is the grpc.ServiceDesc for ServerlessPGBackupProxyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServerlessPGBackupProxyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tidb_mgmt_service.v1.ServerlessPGBackupProxyService",
	HandlerType: (*ServerlessPGBackupProxyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreatePGBackup",
			Handler:    _ServerlessPGBackupProxyService_CreatePGBackup_Handler,
		},
		{
			MethodName: "ListPGBackups",
			Handler:    _ServerlessPGBackupProxyService_ListPGBackups_Handler,
		},
		{
			MethodName: "GetPGBackup",
			Handler:    _ServerlessPGBackupProxyService_GetPGBackup_Handler,
		},
		{
			MethodName: "GetPGBackupPolicy",
			Handler:    _ServerlessPGBackupProxyService_GetPGBackupPolicy_Handler,
		},
		{
			MethodName: "UpdatePGBackupPolicy",
			Handler:    _ServerlessPGBackupProxyService_UpdatePGBackupPolicy_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tidb_mgmt_service/v1/backup.proto",
}
