// Code generated by sdkgen. DO NOT EDIT.

//nolint
package mongodb

import (
	"context"

	"google.golang.org/grpc"

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

//revive:disable

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

var _ mongodb.ClusterServiceClient = &ClusterServiceClient{}

// AddHosts implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) AddHosts(ctx context.Context, in *mongodb.AddClusterHostsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).AddHosts(ctx, in, opts...)
}

// AddShard implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) AddShard(ctx context.Context, in *mongodb.AddClusterShardRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).AddShard(ctx, in, opts...)
}

// Backup implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Backup(ctx context.Context, in *mongodb.BackupClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Backup(ctx, in, opts...)
}

// Create implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Create(ctx context.Context, in *mongodb.CreateClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Create(ctx, in, opts...)
}

// Delete implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Delete(ctx context.Context, in *mongodb.DeleteClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Delete(ctx, in, opts...)
}

// DeleteHosts implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) DeleteHosts(ctx context.Context, in *mongodb.DeleteClusterHostsRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).DeleteHosts(ctx, in, opts...)
}

// DeleteShard implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) DeleteShard(ctx context.Context, in *mongodb.DeleteClusterShardRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).DeleteShard(ctx, in, opts...)
}

// EnableSharding implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) EnableSharding(ctx context.Context, in *mongodb.EnableClusterShardingRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).EnableSharding(ctx, in, opts...)
}

// Get implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Get(ctx context.Context, in *mongodb.GetClusterRequest, opts ...grpc.CallOption) (*mongodb.Cluster, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Get(ctx, in, opts...)
}

// GetShard implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) GetShard(ctx context.Context, in *mongodb.GetClusterShardRequest, opts ...grpc.CallOption) (*mongodb.Shard, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).GetShard(ctx, in, opts...)
}

// List implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) List(ctx context.Context, in *mongodb.ListClustersRequest, opts ...grpc.CallOption) (*mongodb.ListClustersResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).List(ctx, in, opts...)
}

// ListBackups implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) ListBackups(ctx context.Context, in *mongodb.ListClusterBackupsRequest, opts ...grpc.CallOption) (*mongodb.ListClusterBackupsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).ListBackups(ctx, in, opts...)
}

// ListHosts implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) ListHosts(ctx context.Context, in *mongodb.ListClusterHostsRequest, opts ...grpc.CallOption) (*mongodb.ListClusterHostsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).ListHosts(ctx, in, opts...)
}

// ListLogs implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) ListLogs(ctx context.Context, in *mongodb.ListClusterLogsRequest, opts ...grpc.CallOption) (*mongodb.ListClusterLogsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).ListLogs(ctx, in, opts...)
}

// ListOperations implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) ListOperations(ctx context.Context, in *mongodb.ListClusterOperationsRequest, opts ...grpc.CallOption) (*mongodb.ListClusterOperationsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).ListOperations(ctx, in, opts...)
}

// ListShards implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) ListShards(ctx context.Context, in *mongodb.ListClusterShardsRequest, opts ...grpc.CallOption) (*mongodb.ListClusterShardsResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).ListShards(ctx, in, opts...)
}

// Move implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Move(ctx context.Context, in *mongodb.MoveClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Move(ctx, in, opts...)
}

// Restore implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Restore(ctx context.Context, in *mongodb.RestoreClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Restore(ctx, in, opts...)
}

// Start implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Start(ctx context.Context, in *mongodb.StartClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Start(ctx, in, opts...)
}

// Stop implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Stop(ctx context.Context, in *mongodb.StopClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Stop(ctx, in, opts...)
}

// Update implements mongodb.ClusterServiceClient
func (c *ClusterServiceClient) Update(ctx context.Context, in *mongodb.UpdateClusterRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return mongodb.NewClusterServiceClient(conn).Update(ctx, in, opts...)
}
