// Code generated by sdkgen. DO NOT EDIT.

// nolint
package kms

import (
	"context"

	"google.golang.org/grpc"

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

//revive:disable

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

// Decrypt implements kms.SymmetricCryptoServiceClient
func (c *SymmetricCryptoServiceClient) Decrypt(ctx context.Context, in *kms.SymmetricDecryptRequest, opts ...grpc.CallOption) (*kms.SymmetricDecryptResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(conn).Decrypt(ctx, in, opts...)
}

// Encrypt implements kms.SymmetricCryptoServiceClient
func (c *SymmetricCryptoServiceClient) Encrypt(ctx context.Context, in *kms.SymmetricEncryptRequest, opts ...grpc.CallOption) (*kms.SymmetricEncryptResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(conn).Encrypt(ctx, in, opts...)
}

// GenerateDataKey implements kms.SymmetricCryptoServiceClient
func (c *SymmetricCryptoServiceClient) GenerateDataKey(ctx context.Context, in *kms.GenerateDataKeyRequest, opts ...grpc.CallOption) (*kms.GenerateDataKeyResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(conn).GenerateDataKey(ctx, in, opts...)
}

// ReEncrypt implements kms.SymmetricCryptoServiceClient
func (c *SymmetricCryptoServiceClient) ReEncrypt(ctx context.Context, in *kms.SymmetricReEncryptRequest, opts ...grpc.CallOption) (*kms.SymmetricReEncryptResponse, error) {
	conn, err := c.getConn(ctx)
	if err != nil {
		return nil, err
	}
	return kms.NewSymmetricCryptoServiceClient(conn).ReEncrypt(ctx, in, opts...)
}
