// Code generated by sdkgen. DO NOT EDIT.

//nolint
package compute

import (
	"context"

	"google.golang.org/grpc"

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

//revive:disable

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

var _ compute.SnapshotServiceClient = &SnapshotServiceClient{}

// Create implements compute.SnapshotServiceClient
func (c *SnapshotServiceClient) Create(ctx context.Context, in *compute.CreateSnapshotRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return compute.NewSnapshotServiceClient(conn).Create(ctx, in, opts...)
}

// Delete implements compute.SnapshotServiceClient
func (c *SnapshotServiceClient) Delete(ctx context.Context, in *compute.DeleteSnapshotRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return compute.NewSnapshotServiceClient(conn).Delete(ctx, in, opts...)
}

// Get implements compute.SnapshotServiceClient
func (c *SnapshotServiceClient) Get(ctx context.Context, in *compute.GetSnapshotRequest, opts ...grpc.CallOption) (*compute.Snapshot, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return compute.NewSnapshotServiceClient(conn).Get(ctx, in, opts...)
}

// List implements compute.SnapshotServiceClient
func (c *SnapshotServiceClient) List(ctx context.Context, in *compute.ListSnapshotsRequest, opts ...grpc.CallOption) (*compute.ListSnapshotsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return compute.NewSnapshotServiceClient(conn).List(ctx, in, opts...)
}

// ListOperations implements compute.SnapshotServiceClient
func (c *SnapshotServiceClient) ListOperations(ctx context.Context, in *compute.ListSnapshotOperationsRequest, opts ...grpc.CallOption) (*compute.ListSnapshotOperationsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return compute.NewSnapshotServiceClient(conn).ListOperations(ctx, in, opts...)
}

// Update implements compute.SnapshotServiceClient
func (c *SnapshotServiceClient) Update(ctx context.Context, in *compute.UpdateSnapshotRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return compute.NewSnapshotServiceClient(conn).Update(ctx, in, opts...)
}
