// 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/postgresql/v1/backup_retention_policy_service.proto

package postgresql

import (
	context "context"
	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 (
	BackupRetentionPolicyService_List_FullMethodName   = "/yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService/List"
	BackupRetentionPolicyService_Create_FullMethodName = "/yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService/Create"
	BackupRetentionPolicyService_Delete_FullMethodName = "/yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService/Delete"
)

// BackupRetentionPolicyServiceClient is the client API for BackupRetentionPolicyService 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 PostgreSQL Cluster backup retention policies.
type BackupRetentionPolicyServiceClient interface {
	// List all retention policies.
	List(ctx context.Context, in *ListBackupRetentionPoliciesRequest, opts ...grpc.CallOption) (*ListBackupRetentionPoliciesResponse, error)
	// Add a new retention policy.
	Create(ctx context.Context, in *CreateBackupRetentionPolicyRequest, opts ...grpc.CallOption) (*CreateBackupRetentionPolicyResponse, error)
	// Delete retention policy.
	Delete(ctx context.Context, in *DeleteBackupRetentionPolicyRequest, opts ...grpc.CallOption) (*DeleteBackupRetentionPolicyResponse, error)
}

type backupRetentionPolicyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBackupRetentionPolicyServiceClient(cc grpc.ClientConnInterface) BackupRetentionPolicyServiceClient {
	return &backupRetentionPolicyServiceClient{cc}
}

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

func (c *backupRetentionPolicyServiceClient) Create(ctx context.Context, in *CreateBackupRetentionPolicyRequest, opts ...grpc.CallOption) (*CreateBackupRetentionPolicyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CreateBackupRetentionPolicyResponse)
	err := c.cc.Invoke(ctx, BackupRetentionPolicyService_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *backupRetentionPolicyServiceClient) Delete(ctx context.Context, in *DeleteBackupRetentionPolicyRequest, opts ...grpc.CallOption) (*DeleteBackupRetentionPolicyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DeleteBackupRetentionPolicyResponse)
	err := c.cc.Invoke(ctx, BackupRetentionPolicyService_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BackupRetentionPolicyServiceServer is the server API for BackupRetentionPolicyService service.
// All implementations should embed UnimplementedBackupRetentionPolicyServiceServer
// for forward compatibility.
//
// A set of methods for managing PostgreSQL Cluster backup retention policies.
type BackupRetentionPolicyServiceServer interface {
	// List all retention policies.
	List(context.Context, *ListBackupRetentionPoliciesRequest) (*ListBackupRetentionPoliciesResponse, error)
	// Add a new retention policy.
	Create(context.Context, *CreateBackupRetentionPolicyRequest) (*CreateBackupRetentionPolicyResponse, error)
	// Delete retention policy.
	Delete(context.Context, *DeleteBackupRetentionPolicyRequest) (*DeleteBackupRetentionPolicyResponse, error)
}

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

func (UnimplementedBackupRetentionPolicyServiceServer) List(context.Context, *ListBackupRetentionPoliciesRequest) (*ListBackupRetentionPoliciesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedBackupRetentionPolicyServiceServer) Create(context.Context, *CreateBackupRetentionPolicyRequest) (*CreateBackupRetentionPolicyResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedBackupRetentionPolicyServiceServer) Delete(context.Context, *DeleteBackupRetentionPolicyRequest) (*DeleteBackupRetentionPolicyResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedBackupRetentionPolicyServiceServer) testEmbeddedByValue() {}

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

func RegisterBackupRetentionPolicyServiceServer(s grpc.ServiceRegistrar, srv BackupRetentionPolicyServiceServer) {
	// If the following call panics, it indicates UnimplementedBackupRetentionPolicyServiceServer 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(&BackupRetentionPolicyService_ServiceDesc, srv)
}

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

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

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

// BackupRetentionPolicyService_ServiceDesc is the grpc.ServiceDesc for BackupRetentionPolicyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BackupRetentionPolicyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.postgresql.v1.BackupRetentionPolicyService",
	HandlerType: (*BackupRetentionPolicyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _BackupRetentionPolicyService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _BackupRetentionPolicyService_Create_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _BackupRetentionPolicyService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/postgresql/v1/backup_retention_policy_service.proto",
}
