Skip to content

Mark methods on CryptographyClient as const within KeyVault Keys #6370

Open
@ahsonkhan

Description

@ahsonkhan

Even though this SDK has shipped/GA'd, marking non-const methods as const is a non-breaking change so we can safely make this update and adhere to the C++ guidelines.

Azure::Response<DecryptResult> Decrypt(
DecryptParameters const& parameters,
Azure::Core::Context const& context = Azure::Core::Context());

Other KeyVault Keys clients like KeyClient are already correctly marking the methods as const, so we only need to update CryptographyClient.

Azure::Response<KeyVaultKey> CreateKey(
std::string const& name,
KeyVaultKeyType keyType,
CreateKeyOptions const& options = CreateKeyOptions(),
Azure::Core::Context const& context = Azure::Core::Context()) const;

SDK Clients are designed to be immutable as per the guidelines, so it should be safe to mark them as const so that a user referencing client instances as const& will be able to call any of the marked methods:

DO declare all client functions as const since service clients are intended to be immutable.

cc @LarryOsterman, @RickWinter

Similar to:
#6328
#6329
#6330

Codegen issue for context: https://github.com/Azure/autorest.cpp/issues/464

Metadata

Metadata

Assignees

Labels

Type

Projects

  • Status

    Untriaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions