// 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/apploadbalancer/v1/backend_group_service.proto

package apploadbalancer

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 (
	BackendGroupService_Get_FullMethodName            = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/Get"
	BackendGroupService_List_FullMethodName           = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/List"
	BackendGroupService_Create_FullMethodName         = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/Create"
	BackendGroupService_Update_FullMethodName         = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/Update"
	BackendGroupService_Delete_FullMethodName         = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/Delete"
	BackendGroupService_AddBackend_FullMethodName     = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/AddBackend"
	BackendGroupService_RemoveBackend_FullMethodName  = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/RemoveBackend"
	BackendGroupService_UpdateBackend_FullMethodName  = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/UpdateBackend"
	BackendGroupService_ListOperations_FullMethodName = "/yandex.cloud.apploadbalancer.v1.BackendGroupService/ListOperations"
)

// BackendGroupServiceClient is the client API for BackendGroupService 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 backend groups.
type BackendGroupServiceClient interface {
	// Returns the specified backend group.
	//
	// To get the list of all available backend groups, make a [List] request.
	Get(ctx context.Context, in *GetBackendGroupRequest, opts ...grpc.CallOption) (*BackendGroup, error)
	// Lists backend groups in the specified folder.
	List(ctx context.Context, in *ListBackendGroupsRequest, opts ...grpc.CallOption) (*ListBackendGroupsResponse, error)
	// Creates a backend group in the specified folder.
	Create(ctx context.Context, in *CreateBackendGroupRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates the specified backend group.
	Update(ctx context.Context, in *UpdateBackendGroupRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified backend group.
	Delete(ctx context.Context, in *DeleteBackendGroupRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Adds backends to the specified backend group.
	AddBackend(ctx context.Context, in *AddBackendRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Removes backends from the specified backend group.
	RemoveBackend(ctx context.Context, in *RemoveBackendRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates the specified backend.
	UpdateBackend(ctx context.Context, in *UpdateBackendRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Lists operations for the specified backend group.
	ListOperations(ctx context.Context, in *ListBackendGroupOperationsRequest, opts ...grpc.CallOption) (*ListBackendGroupOperationsResponse, error)
}

type backendGroupServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBackendGroupServiceClient(cc grpc.ClientConnInterface) BackendGroupServiceClient {
	return &backendGroupServiceClient{cc}
}

func (c *backendGroupServiceClient) Get(ctx context.Context, in *GetBackendGroupRequest, opts ...grpc.CallOption) (*BackendGroup, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(BackendGroup)
	err := c.cc.Invoke(ctx, BackendGroupService_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

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

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

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

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

func (c *backendGroupServiceClient) ListOperations(ctx context.Context, in *ListBackendGroupOperationsRequest, opts ...grpc.CallOption) (*ListBackendGroupOperationsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListBackendGroupOperationsResponse)
	err := c.cc.Invoke(ctx, BackendGroupService_ListOperations_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BackendGroupServiceServer is the server API for BackendGroupService service.
// All implementations should embed UnimplementedBackendGroupServiceServer
// for forward compatibility.
//
// A set of methods for managing backend groups.
type BackendGroupServiceServer interface {
	// Returns the specified backend group.
	//
	// To get the list of all available backend groups, make a [List] request.
	Get(context.Context, *GetBackendGroupRequest) (*BackendGroup, error)
	// Lists backend groups in the specified folder.
	List(context.Context, *ListBackendGroupsRequest) (*ListBackendGroupsResponse, error)
	// Creates a backend group in the specified folder.
	Create(context.Context, *CreateBackendGroupRequest) (*operation.Operation, error)
	// Updates the specified backend group.
	Update(context.Context, *UpdateBackendGroupRequest) (*operation.Operation, error)
	// Deletes the specified backend group.
	Delete(context.Context, *DeleteBackendGroupRequest) (*operation.Operation, error)
	// Adds backends to the specified backend group.
	AddBackend(context.Context, *AddBackendRequest) (*operation.Operation, error)
	// Removes backends from the specified backend group.
	RemoveBackend(context.Context, *RemoveBackendRequest) (*operation.Operation, error)
	// Updates the specified backend.
	UpdateBackend(context.Context, *UpdateBackendRequest) (*operation.Operation, error)
	// Lists operations for the specified backend group.
	ListOperations(context.Context, *ListBackendGroupOperationsRequest) (*ListBackendGroupOperationsResponse, error)
}

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

func (UnimplementedBackendGroupServiceServer) Get(context.Context, *GetBackendGroupRequest) (*BackendGroup, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedBackendGroupServiceServer) List(context.Context, *ListBackendGroupsRequest) (*ListBackendGroupsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedBackendGroupServiceServer) Create(context.Context, *CreateBackendGroupRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedBackendGroupServiceServer) Update(context.Context, *UpdateBackendGroupRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedBackendGroupServiceServer) Delete(context.Context, *DeleteBackendGroupRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedBackendGroupServiceServer) AddBackend(context.Context, *AddBackendRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddBackend not implemented")
}
func (UnimplementedBackendGroupServiceServer) RemoveBackend(context.Context, *RemoveBackendRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RemoveBackend not implemented")
}
func (UnimplementedBackendGroupServiceServer) UpdateBackend(context.Context, *UpdateBackendRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateBackend not implemented")
}
func (UnimplementedBackendGroupServiceServer) ListOperations(context.Context, *ListBackendGroupOperationsRequest) (*ListBackendGroupOperationsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented")
}
func (UnimplementedBackendGroupServiceServer) testEmbeddedByValue() {}

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

func RegisterBackendGroupServiceServer(s grpc.ServiceRegistrar, srv BackendGroupServiceServer) {
	// If the following call pancis, it indicates UnimplementedBackendGroupServiceServer 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(&BackendGroupService_ServiceDesc, srv)
}

func _BackendGroupService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetBackendGroupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BackendGroupServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BackendGroupService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BackendGroupServiceServer).Get(ctx, req.(*GetBackendGroupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

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

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

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

func _BackendGroupService_AddBackend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddBackendRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BackendGroupServiceServer).AddBackend(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BackendGroupService_AddBackend_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BackendGroupServiceServer).AddBackend(ctx, req.(*AddBackendRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BackendGroupService_RemoveBackend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RemoveBackendRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BackendGroupServiceServer).RemoveBackend(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BackendGroupService_RemoveBackend_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BackendGroupServiceServer).RemoveBackend(ctx, req.(*RemoveBackendRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BackendGroupService_UpdateBackend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateBackendRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BackendGroupServiceServer).UpdateBackend(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BackendGroupService_UpdateBackend_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BackendGroupServiceServer).UpdateBackend(ctx, req.(*UpdateBackendRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BackendGroupService_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListBackendGroupOperationsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BackendGroupServiceServer).ListOperations(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BackendGroupService_ListOperations_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BackendGroupServiceServer).ListOperations(ctx, req.(*ListBackendGroupOperationsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// BackendGroupService_ServiceDesc is the grpc.ServiceDesc for BackendGroupService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BackendGroupService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.apploadbalancer.v1.BackendGroupService",
	HandlerType: (*BackendGroupServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _BackendGroupService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _BackendGroupService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _BackendGroupService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _BackendGroupService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _BackendGroupService_Delete_Handler,
		},
		{
			MethodName: "AddBackend",
			Handler:    _BackendGroupService_AddBackend_Handler,
		},
		{
			MethodName: "RemoveBackend",
			Handler:    _BackendGroupService_RemoveBackend_Handler,
		},
		{
			MethodName: "UpdateBackend",
			Handler:    _BackendGroupService_UpdateBackend_Handler,
		},
		{
			MethodName: "ListOperations",
			Handler:    _BackendGroupService_ListOperations_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/apploadbalancer/v1/backend_group_service.proto",
}
