Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark methods on CryptographyClient as const within KeyVault Keys #6370

Open
ahsonkhan opened this issue Jan 24, 2025 · 0 comments
Open

Mark methods on CryptographyClient as const within KeyVault Keys #6370

ahsonkhan opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels

Comments

@ahsonkhan
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants