// Code generated by sdkgen. DO NOT EDIT.

//nolint
package resourcemanager

import (
	"context"

	"google.golang.org/grpc"

	"github.com/yandex-cloud/go-genproto/yandex/cloud/access"
	"github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
	"github.com/yandex-cloud/go-genproto/yandex/cloud/resourcemanager/v1"
)

//revive:disable

// CloudServiceClient is a resourcemanager.CloudServiceClient with
// lazy GRPC connection initialization.
type CloudServiceClient struct {
	getConn func(ctx context.Context) (*grpc.ClientConn, error)
}

var _ resourcemanager.CloudServiceClient = &CloudServiceClient{}

// Get implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) Get(ctx context.Context, in *resourcemanager.GetCloudRequest, opts ...grpc.CallOption) (*resourcemanager.Cloud, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).Get(ctx, in, opts...)
}

// List implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) List(ctx context.Context, in *resourcemanager.ListCloudsRequest, opts ...grpc.CallOption) (*resourcemanager.ListCloudsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).List(ctx, in, opts...)
}

// ListAccessBindings implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) ListAccessBindings(ctx context.Context, in *access.ListAccessBindingsRequest, opts ...grpc.CallOption) (*access.ListAccessBindingsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).ListAccessBindings(ctx, in, opts...)
}

// ListOperations implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) ListOperations(ctx context.Context, in *resourcemanager.ListCloudOperationsRequest, opts ...grpc.CallOption) (*resourcemanager.ListCloudOperationsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).ListOperations(ctx, in, opts...)
}

// SetAccessBindings implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) SetAccessBindings(ctx context.Context, in *access.SetAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).SetAccessBindings(ctx, in, opts...)
}

// Update implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) Update(ctx context.Context, in *resourcemanager.UpdateCloudRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).Update(ctx, in, opts...)
}

// UpdateAccessBindings implements resourcemanager.CloudServiceClient
func (c *CloudServiceClient) UpdateAccessBindings(ctx context.Context, in *access.UpdateAccessBindingsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return resourcemanager.NewCloudServiceClient(conn).UpdateAccessBindings(ctx, in, opts...)
}
