// Code generated by sdkgen. DO NOT EDIT.

//nolint
package containerregistry

import (
	"context"

	"google.golang.org/grpc"

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

//revive:disable

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

var _ containerregistry.RegistryServiceClient = &RegistryServiceClient{}

// Create implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) Create(ctx context.Context, in *containerregistry.CreateRegistryRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return containerregistry.NewRegistryServiceClient(conn).Create(ctx, in, opts...)
}

// Delete implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) Delete(ctx context.Context, in *containerregistry.DeleteRegistryRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return containerregistry.NewRegistryServiceClient(conn).Delete(ctx, in, opts...)
}

// Get implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) Get(ctx context.Context, in *containerregistry.GetRegistryRequest, opts ...grpc.CallOption) (*containerregistry.Registry, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return containerregistry.NewRegistryServiceClient(conn).Get(ctx, in, opts...)
}

// List implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) List(ctx context.Context, in *containerregistry.ListRegistriesRequest, opts ...grpc.CallOption) (*containerregistry.ListRegistriesResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return containerregistry.NewRegistryServiceClient(conn).List(ctx, in, opts...)
}

// ListAccessBindings implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) 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 containerregistry.NewRegistryServiceClient(conn).ListAccessBindings(ctx, in, opts...)
}

// SetAccessBindings implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) 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 containerregistry.NewRegistryServiceClient(conn).SetAccessBindings(ctx, in, opts...)
}

// Update implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) Update(ctx context.Context, in *containerregistry.UpdateRegistryRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return containerregistry.NewRegistryServiceClient(conn).Update(ctx, in, opts...)
}

// UpdateAccessBindings implements containerregistry.RegistryServiceClient
func (c *RegistryServiceClient) 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 containerregistry.NewRegistryServiceClient(conn).UpdateAccessBindings(ctx, in, opts...)
}
