// 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/greenplum/v1/hba_rule_service.proto

package greenplum

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 (
	HBARuleService_List_FullMethodName           = "/yandex.cloud.mdb.greenplum.v1.HBARuleService/List"
	HBARuleService_ListAtRevision_FullMethodName = "/yandex.cloud.mdb.greenplum.v1.HBARuleService/ListAtRevision"
	HBARuleService_Create_FullMethodName         = "/yandex.cloud.mdb.greenplum.v1.HBARuleService/Create"
	HBARuleService_Update_FullMethodName         = "/yandex.cloud.mdb.greenplum.v1.HBARuleService/Update"
	HBARuleService_Delete_FullMethodName         = "/yandex.cloud.mdb.greenplum.v1.HBARuleService/Delete"
	HBARuleService_BatchUpdate_FullMethodName    = "/yandex.cloud.mdb.greenplum.v1.HBARuleService/BatchUpdate"
)

// HBARuleServiceClient is the client API for HBARuleService 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 Greenplum clusters.
type HBARuleServiceClient interface {
	// Retrieves a list of HBA rules for Greenplum clusters.
	List(ctx context.Context, in *ListHBARulesRequest, opts ...grpc.CallOption) (*ListHBARulesResponse, error)
	// Retrieves a list of HBA rules for Greenplum clusters for particular revision.
	ListAtRevision(ctx context.Context, in *ListHBARulesAtRevisionRequest, opts ...grpc.CallOption) (*ListHBARulesResponse, error)
	// Create single HBA rule for the specified Greenplum cluster to the end of HBA rules list.
	Create(ctx context.Context, in *CreateHBARuleRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Update specified HBA rule for the specified Greenplum cluster without changind it order.
	Update(ctx context.Context, in *UpdateHBARuleRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Delete specified HBA rule for the specified Greenplum cluster.
	Delete(ctx context.Context, in *DeleteHBARuleRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Modifies all HBA rules for the specified Greenplum cluster.
	BatchUpdate(ctx context.Context, in *BatchUpdateHBARulesRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type hBARuleServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewHBARuleServiceClient(cc grpc.ClientConnInterface) HBARuleServiceClient {
	return &hBARuleServiceClient{cc}
}

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

func (c *hBARuleServiceClient) ListAtRevision(ctx context.Context, in *ListHBARulesAtRevisionRequest, opts ...grpc.CallOption) (*ListHBARulesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListHBARulesResponse)
	err := c.cc.Invoke(ctx, HBARuleService_ListAtRevision_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

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

// HBARuleServiceServer is the server API for HBARuleService service.
// All implementations should embed UnimplementedHBARuleServiceServer
// for forward compatibility.
//
// A set of methods for managing Greenplum clusters.
type HBARuleServiceServer interface {
	// Retrieves a list of HBA rules for Greenplum clusters.
	List(context.Context, *ListHBARulesRequest) (*ListHBARulesResponse, error)
	// Retrieves a list of HBA rules for Greenplum clusters for particular revision.
	ListAtRevision(context.Context, *ListHBARulesAtRevisionRequest) (*ListHBARulesResponse, error)
	// Create single HBA rule for the specified Greenplum cluster to the end of HBA rules list.
	Create(context.Context, *CreateHBARuleRequest) (*operation.Operation, error)
	// Update specified HBA rule for the specified Greenplum cluster without changind it order.
	Update(context.Context, *UpdateHBARuleRequest) (*operation.Operation, error)
	// Delete specified HBA rule for the specified Greenplum cluster.
	Delete(context.Context, *DeleteHBARuleRequest) (*operation.Operation, error)
	// Modifies all HBA rules for the specified Greenplum cluster.
	BatchUpdate(context.Context, *BatchUpdateHBARulesRequest) (*operation.Operation, error)
}

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

func (UnimplementedHBARuleServiceServer) List(context.Context, *ListHBARulesRequest) (*ListHBARulesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedHBARuleServiceServer) ListAtRevision(context.Context, *ListHBARulesAtRevisionRequest) (*ListHBARulesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListAtRevision not implemented")
}
func (UnimplementedHBARuleServiceServer) Create(context.Context, *CreateHBARuleRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedHBARuleServiceServer) Update(context.Context, *UpdateHBARuleRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedHBARuleServiceServer) Delete(context.Context, *DeleteHBARuleRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedHBARuleServiceServer) BatchUpdate(context.Context, *BatchUpdateHBARulesRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method BatchUpdate not implemented")
}
func (UnimplementedHBARuleServiceServer) testEmbeddedByValue() {}

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

func RegisterHBARuleServiceServer(s grpc.ServiceRegistrar, srv HBARuleServiceServer) {
	// If the following call pancis, it indicates UnimplementedHBARuleServiceServer 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(&HBARuleService_ServiceDesc, srv)
}

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

func _HBARuleService_ListAtRevision_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListHBARulesAtRevisionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(HBARuleServiceServer).ListAtRevision(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: HBARuleService_ListAtRevision_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(HBARuleServiceServer).ListAtRevision(ctx, req.(*ListHBARulesAtRevisionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

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

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

func _HBARuleService_BatchUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BatchUpdateHBARulesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(HBARuleServiceServer).BatchUpdate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: HBARuleService_BatchUpdate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(HBARuleServiceServer).BatchUpdate(ctx, req.(*BatchUpdateHBARulesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// HBARuleService_ServiceDesc is the grpc.ServiceDesc for HBARuleService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var HBARuleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.greenplum.v1.HBARuleService",
	HandlerType: (*HBARuleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _HBARuleService_List_Handler,
		},
		{
			MethodName: "ListAtRevision",
			Handler:    _HBARuleService_ListAtRevision_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _HBARuleService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _HBARuleService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _HBARuleService_Delete_Handler,
		},
		{
			MethodName: "BatchUpdate",
			Handler:    _HBARuleService_BatchUpdate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/greenplum/v1/hba_rule_service.proto",
}
