// 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/datasphere/v1/folder_budget_service.proto

package datasphere

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	FolderBudgetService_Get_FullMethodName = "/yandex.cloud.datasphere.v1.FolderBudgetService/Get"
	FolderBudgetService_Set_FullMethodName = "/yandex.cloud.datasphere.v1.FolderBudgetService/Set"
)

// FolderBudgetServiceClient is the client API for FolderBudgetService 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 Datasphere folder budgets.
type FolderBudgetServiceClient interface {
	// Returns the specified folder budget.
	Get(ctx context.Context, in *GetFolderBudgetRequest, opts ...grpc.CallOption) (*GetFolderBudgetResponse, error)
	// Sets the unit balance and the limits of the specified folder budget.
	Set(ctx context.Context, in *SetFolderBudgetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type folderBudgetServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFolderBudgetServiceClient(cc grpc.ClientConnInterface) FolderBudgetServiceClient {
	return &folderBudgetServiceClient{cc}
}

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

func (c *folderBudgetServiceClient) Set(ctx context.Context, in *SetFolderBudgetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, FolderBudgetService_Set_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// FolderBudgetServiceServer is the server API for FolderBudgetService service.
// All implementations should embed UnimplementedFolderBudgetServiceServer
// for forward compatibility.
//
// A set of methods for managing Datasphere folder budgets.
type FolderBudgetServiceServer interface {
	// Returns the specified folder budget.
	Get(context.Context, *GetFolderBudgetRequest) (*GetFolderBudgetResponse, error)
	// Sets the unit balance and the limits of the specified folder budget.
	Set(context.Context, *SetFolderBudgetRequest) (*emptypb.Empty, error)
}

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

func (UnimplementedFolderBudgetServiceServer) Get(context.Context, *GetFolderBudgetRequest) (*GetFolderBudgetResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedFolderBudgetServiceServer) Set(context.Context, *SetFolderBudgetRequest) (*emptypb.Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method Set not implemented")
}
func (UnimplementedFolderBudgetServiceServer) testEmbeddedByValue() {}

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

func RegisterFolderBudgetServiceServer(s grpc.ServiceRegistrar, srv FolderBudgetServiceServer) {
	// If the following call panics, it indicates UnimplementedFolderBudgetServiceServer 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(&FolderBudgetService_ServiceDesc, srv)
}

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

func _FolderBudgetService_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetFolderBudgetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FolderBudgetServiceServer).Set(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FolderBudgetService_Set_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FolderBudgetServiceServer).Set(ctx, req.(*SetFolderBudgetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// FolderBudgetService_ServiceDesc is the grpc.ServiceDesc for FolderBudgetService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FolderBudgetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.datasphere.v1.FolderBudgetService",
	HandlerType: (*FolderBudgetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _FolderBudgetService_Get_Handler,
		},
		{
			MethodName: "Set",
			Handler:    _FolderBudgetService_Set_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/datasphere/v1/folder_budget_service.proto",
}
