// 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/greenplum/v1/resource_groups_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 (
	ResourceGroupService_List_FullMethodName          = "/yandex.cloud.mdb.greenplum.v1.ResourceGroupService/List"
	ResourceGroupService_GetAtRevision_FullMethodName = "/yandex.cloud.mdb.greenplum.v1.ResourceGroupService/GetAtRevision"
	ResourceGroupService_Create_FullMethodName        = "/yandex.cloud.mdb.greenplum.v1.ResourceGroupService/Create"
	ResourceGroupService_Update_FullMethodName        = "/yandex.cloud.mdb.greenplum.v1.ResourceGroupService/Update"
	ResourceGroupService_Delete_FullMethodName        = "/yandex.cloud.mdb.greenplum.v1.ResourceGroupService/Delete"
)

// ResourceGroupServiceClient is the client API for ResourceGroupService 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 ResourceGroupServiceClient interface {
	// List all resource group
	List(ctx context.Context, in *ListResourceGroupsRequest, opts ...grpc.CallOption) (*ListResourceGroupsResponse, error)
	// Returns the specified resource group at revision.
	GetAtRevision(ctx context.Context, in *GetResourceGroupAtRevisionRequest, opts ...grpc.CallOption) (*ResourceGroup, error)
	// Creates resource group
	Create(ctx context.Context, in *CreateResourceGroupRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Update resource group
	Update(ctx context.Context, in *UpdateResourceGroupRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Delete resource group
	Delete(ctx context.Context, in *DeleteResourceGroupRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type resourceGroupServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewResourceGroupServiceClient(cc grpc.ClientConnInterface) ResourceGroupServiceClient {
	return &resourceGroupServiceClient{cc}
}

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

func (c *resourceGroupServiceClient) GetAtRevision(ctx context.Context, in *GetResourceGroupAtRevisionRequest, opts ...grpc.CallOption) (*ResourceGroup, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResourceGroup)
	err := c.cc.Invoke(ctx, ResourceGroupService_GetAtRevision_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

// ResourceGroupServiceServer is the server API for ResourceGroupService service.
// All implementations should embed UnimplementedResourceGroupServiceServer
// for forward compatibility.
type ResourceGroupServiceServer interface {
	// List all resource group
	List(context.Context, *ListResourceGroupsRequest) (*ListResourceGroupsResponse, error)
	// Returns the specified resource group at revision.
	GetAtRevision(context.Context, *GetResourceGroupAtRevisionRequest) (*ResourceGroup, error)
	// Creates resource group
	Create(context.Context, *CreateResourceGroupRequest) (*operation.Operation, error)
	// Update resource group
	Update(context.Context, *UpdateResourceGroupRequest) (*operation.Operation, error)
	// Delete resource group
	Delete(context.Context, *DeleteResourceGroupRequest) (*operation.Operation, error)
}

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

func (UnimplementedResourceGroupServiceServer) List(context.Context, *ListResourceGroupsRequest) (*ListResourceGroupsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedResourceGroupServiceServer) GetAtRevision(context.Context, *GetResourceGroupAtRevisionRequest) (*ResourceGroup, error) {
	return nil, status.Error(codes.Unimplemented, "method GetAtRevision not implemented")
}
func (UnimplementedResourceGroupServiceServer) Create(context.Context, *CreateResourceGroupRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedResourceGroupServiceServer) Update(context.Context, *UpdateResourceGroupRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedResourceGroupServiceServer) Delete(context.Context, *DeleteResourceGroupRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedResourceGroupServiceServer) testEmbeddedByValue() {}

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

func RegisterResourceGroupServiceServer(s grpc.ServiceRegistrar, srv ResourceGroupServiceServer) {
	// If the following call panics, it indicates UnimplementedResourceGroupServiceServer 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(&ResourceGroupService_ServiceDesc, srv)
}

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

func _ResourceGroupService_GetAtRevision_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetResourceGroupAtRevisionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ResourceGroupServiceServer).GetAtRevision(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ResourceGroupService_GetAtRevision_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ResourceGroupServiceServer).GetAtRevision(ctx, req.(*GetResourceGroupAtRevisionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

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

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

// ResourceGroupService_ServiceDesc is the grpc.ServiceDesc for ResourceGroupService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ResourceGroupService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.mdb.greenplum.v1.ResourceGroupService",
	HandlerType: (*ResourceGroupServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _ResourceGroupService_List_Handler,
		},
		{
			MethodName: "GetAtRevision",
			Handler:    _ResourceGroupService_GetAtRevision_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _ResourceGroupService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ResourceGroupService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _ResourceGroupService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/mdb/greenplum/v1/resource_groups_service.proto",
}
