// Code generated by sdkgen-v2. DO NOT EDIT.
package kmssdk

import (
	"context"

	kms "github.com/yandex-cloud/go-genproto/yandex/cloud/kms/v1"
	"github.com/yandex-cloud/go-sdk/v2/pkg/transport"
	"google.golang.org/grpc"
	"google.golang.org/protobuf/reflect/protoreflect"
)

// SymmetricCryptoClient provides methods for managing SymmetricCrypto resources of Yandex.Cloud KMS.
type SymmetricCryptoClient interface {
	SymmetricCryptoClientIterator
	Encrypt(context.Context, *kms.SymmetricEncryptRequest, ...grpc.CallOption) (*kms.SymmetricEncryptResponse, error)
	Decrypt(context.Context, *kms.SymmetricDecryptRequest, ...grpc.CallOption) (*kms.SymmetricDecryptResponse, error)
	ReEncrypt(context.Context, *kms.SymmetricReEncryptRequest, ...grpc.CallOption) (*kms.SymmetricReEncryptResponse, error)
	GenerateDataKey(context.Context, *kms.GenerateDataKeyRequest, ...grpc.CallOption) (*kms.GenerateDataKeyResponse, error)
}

var _ SymmetricCryptoClient = symmetricCryptoClient{}

type symmetricCryptoClient struct {
	connector transport.Connector
}

// NewSymmetricCryptoClient returns SymmetricCryptoClient implementation.
func NewSymmetricCryptoClient(connector transport.Connector) SymmetricCryptoClient {
	return symmetricCryptoClient{connector}
}

// Encrypt is an operation of Yandex.Cloud KMS SymmetricCrypto service.
func (c symmetricCryptoClient) Encrypt(ctx context.Context, in *kms.SymmetricEncryptRequest, opts ...grpc.CallOption) (*kms.SymmetricEncryptResponse, error) {
	connection, err := c.connector.GetConnection(ctx, SymmetricCryptoEncrypt, opts...)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(connection).Encrypt(ctx, in, opts...)
}

// Decrypt is an operation of Yandex.Cloud KMS SymmetricCrypto service.
func (c symmetricCryptoClient) Decrypt(ctx context.Context, in *kms.SymmetricDecryptRequest, opts ...grpc.CallOption) (*kms.SymmetricDecryptResponse, error) {
	connection, err := c.connector.GetConnection(ctx, SymmetricCryptoDecrypt, opts...)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(connection).Decrypt(ctx, in, opts...)
}

// ReEncrypt is an operation of Yandex.Cloud KMS SymmetricCrypto service.
func (c symmetricCryptoClient) ReEncrypt(ctx context.Context, in *kms.SymmetricReEncryptRequest, opts ...grpc.CallOption) (*kms.SymmetricReEncryptResponse, error) {
	connection, err := c.connector.GetConnection(ctx, SymmetricCryptoReEncrypt, opts...)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(connection).ReEncrypt(ctx, in, opts...)
}

// GenerateDataKey is an operation of Yandex.Cloud KMS SymmetricCrypto service.
func (c symmetricCryptoClient) GenerateDataKey(ctx context.Context, in *kms.GenerateDataKeyRequest, opts ...grpc.CallOption) (*kms.GenerateDataKeyResponse, error) {
	connection, err := c.connector.GetConnection(ctx, SymmetricCryptoGenerateDataKey, opts...)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(connection).GenerateDataKey(ctx, in, opts...)
}

var (
	SymmetricCryptoEncrypt         = protoreflect.FullName("yandex.cloud.kms.v1.SymmetricCryptoService.Encrypt")
	SymmetricCryptoDecrypt         = protoreflect.FullName("yandex.cloud.kms.v1.SymmetricCryptoService.Decrypt")
	SymmetricCryptoReEncrypt       = protoreflect.FullName("yandex.cloud.kms.v1.SymmetricCryptoService.ReEncrypt")
	SymmetricCryptoGenerateDataKey = protoreflect.FullName("yandex.cloud.kms.v1.SymmetricCryptoService.GenerateDataKey")
)
