// 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/billing/v1/billing_account_service.proto

package billing

import (
	context "context"
	access "github.com/yandex-cloud/go-genproto/yandex/cloud/access"
	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 (
	BillingAccountService_Get_FullMethodName                        = "/yandex.cloud.billing.v1.BillingAccountService/Get"
	BillingAccountService_List_FullMethodName                       = "/yandex.cloud.billing.v1.BillingAccountService/List"
	BillingAccountService_ListBillableObjectBindings_FullMethodName = "/yandex.cloud.billing.v1.BillingAccountService/ListBillableObjectBindings"
	BillingAccountService_BindBillableObject_FullMethodName         = "/yandex.cloud.billing.v1.BillingAccountService/BindBillableObject"
	BillingAccountService_ListAccessBindings_FullMethodName         = "/yandex.cloud.billing.v1.BillingAccountService/ListAccessBindings"
	BillingAccountService_UpdateAccessBindings_FullMethodName       = "/yandex.cloud.billing.v1.BillingAccountService/UpdateAccessBindings"
)

// BillingAccountServiceClient is the client API for BillingAccountService 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 BillingAccount resources.
type BillingAccountServiceClient interface {
	// Returns the specified billing account.
	Get(ctx context.Context, in *GetBillingAccountRequest, opts ...grpc.CallOption) (*BillingAccount, error)
	// Retrieves the list of billing accounts available for current user.
	List(ctx context.Context, in *ListBillingAccountsRequest, opts ...grpc.CallOption) (*ListBillingAccountsResponse, error)
	// Retrieves the list of billable object bindings associated with the specified billing account.
	ListBillableObjectBindings(ctx context.Context, in *ListBillableObjectBindingsRequest, opts ...grpc.CallOption) (*ListBillableObjectBindingsResponse, error)
	// Binds billable object to the specified billing account.
	BindBillableObject(ctx context.Context, in *BindBillableObjectRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Lists access bindings for the specified billing account.
	ListAccessBindings(ctx context.Context, in *access.ListAccessBindingsRequest, opts ...grpc.CallOption) (*access.ListAccessBindingsResponse, error)
	// Updates access bindings for the specified billing account.
	UpdateAccessBindings(ctx context.Context, in *access.UpdateAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type billingAccountServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewBillingAccountServiceClient(cc grpc.ClientConnInterface) BillingAccountServiceClient {
	return &billingAccountServiceClient{cc}
}

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

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

func (c *billingAccountServiceClient) ListBillableObjectBindings(ctx context.Context, in *ListBillableObjectBindingsRequest, opts ...grpc.CallOption) (*ListBillableObjectBindingsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListBillableObjectBindingsResponse)
	err := c.cc.Invoke(ctx, BillingAccountService_ListBillableObjectBindings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *billingAccountServiceClient) ListAccessBindings(ctx context.Context, in *access.ListAccessBindingsRequest, opts ...grpc.CallOption) (*access.ListAccessBindingsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(access.ListAccessBindingsResponse)
	err := c.cc.Invoke(ctx, BillingAccountService_ListAccessBindings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *billingAccountServiceClient) UpdateAccessBindings(ctx context.Context, in *access.UpdateAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, BillingAccountService_UpdateAccessBindings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// BillingAccountServiceServer is the server API for BillingAccountService service.
// All implementations should embed UnimplementedBillingAccountServiceServer
// for forward compatibility.
//
// A set of methods for managing BillingAccount resources.
type BillingAccountServiceServer interface {
	// Returns the specified billing account.
	Get(context.Context, *GetBillingAccountRequest) (*BillingAccount, error)
	// Retrieves the list of billing accounts available for current user.
	List(context.Context, *ListBillingAccountsRequest) (*ListBillingAccountsResponse, error)
	// Retrieves the list of billable object bindings associated with the specified billing account.
	ListBillableObjectBindings(context.Context, *ListBillableObjectBindingsRequest) (*ListBillableObjectBindingsResponse, error)
	// Binds billable object to the specified billing account.
	BindBillableObject(context.Context, *BindBillableObjectRequest) (*operation.Operation, error)
	// Lists access bindings for the specified billing account.
	ListAccessBindings(context.Context, *access.ListAccessBindingsRequest) (*access.ListAccessBindingsResponse, error)
	// Updates access bindings for the specified billing account.
	UpdateAccessBindings(context.Context, *access.UpdateAccessBindingsRequest) (*operation.Operation, error)
}

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

func (UnimplementedBillingAccountServiceServer) Get(context.Context, *GetBillingAccountRequest) (*BillingAccount, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedBillingAccountServiceServer) List(context.Context, *ListBillingAccountsRequest) (*ListBillingAccountsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedBillingAccountServiceServer) ListBillableObjectBindings(context.Context, *ListBillableObjectBindingsRequest) (*ListBillableObjectBindingsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListBillableObjectBindings not implemented")
}
func (UnimplementedBillingAccountServiceServer) BindBillableObject(context.Context, *BindBillableObjectRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method BindBillableObject not implemented")
}
func (UnimplementedBillingAccountServiceServer) ListAccessBindings(context.Context, *access.ListAccessBindingsRequest) (*access.ListAccessBindingsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListAccessBindings not implemented")
}
func (UnimplementedBillingAccountServiceServer) UpdateAccessBindings(context.Context, *access.UpdateAccessBindingsRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateAccessBindings not implemented")
}
func (UnimplementedBillingAccountServiceServer) testEmbeddedByValue() {}

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

func RegisterBillingAccountServiceServer(s grpc.ServiceRegistrar, srv BillingAccountServiceServer) {
	// If the following call pancis, it indicates UnimplementedBillingAccountServiceServer 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(&BillingAccountService_ServiceDesc, srv)
}

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

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

func _BillingAccountService_ListBillableObjectBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListBillableObjectBindingsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BillingAccountServiceServer).ListBillableObjectBindings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BillingAccountService_ListBillableObjectBindings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BillingAccountServiceServer).ListBillableObjectBindings(ctx, req.(*ListBillableObjectBindingsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BillingAccountService_BindBillableObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BindBillableObjectRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BillingAccountServiceServer).BindBillableObject(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BillingAccountService_BindBillableObject_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BillingAccountServiceServer).BindBillableObject(ctx, req.(*BindBillableObjectRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BillingAccountService_ListAccessBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(access.ListAccessBindingsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BillingAccountServiceServer).ListAccessBindings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BillingAccountService_ListAccessBindings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BillingAccountServiceServer).ListAccessBindings(ctx, req.(*access.ListAccessBindingsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _BillingAccountService_UpdateAccessBindings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(access.UpdateAccessBindingsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BillingAccountServiceServer).UpdateAccessBindings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: BillingAccountService_UpdateAccessBindings_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BillingAccountServiceServer).UpdateAccessBindings(ctx, req.(*access.UpdateAccessBindingsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// BillingAccountService_ServiceDesc is the grpc.ServiceDesc for BillingAccountService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BillingAccountService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.billing.v1.BillingAccountService",
	HandlerType: (*BillingAccountServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _BillingAccountService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _BillingAccountService_List_Handler,
		},
		{
			MethodName: "ListBillableObjectBindings",
			Handler:    _BillingAccountService_ListBillableObjectBindings_Handler,
		},
		{
			MethodName: "BindBillableObject",
			Handler:    _BillingAccountService_BindBillableObject_Handler,
		},
		{
			MethodName: "ListAccessBindings",
			Handler:    _BillingAccountService_ListAccessBindings_Handler,
		},
		{
			MethodName: "UpdateAccessBindings",
			Handler:    _BillingAccountService_UpdateAccessBindings_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/billing/v1/billing_account_service.proto",
}
