diff --git a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md index f15d693f4..e18ba84e9 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md +++ b/sdk/keyvault/azure-security-keyvault-keys/CHANGELOG.md @@ -9,8 +9,8 @@ ### Breaking Changes - Removed `Azure::Security::KeyVault::Keys::JsonWebKey::to_json`. -- Replaced static functions from `KeyOperation` and `KeyCurveName` for static const members. -- Replaced the enum `JsonWebKeyType` for a class with static const members as ext enum. +- Replaced static functions from `KeyOperation` and `KeyCurveName` with static const members. +- Replaced the enum `JsonWebKeyType` for a class with static const members as an extensible enum called `KeyVaultKeyType`. - Renamed `MaxResults` to `MaxPageResults` for `GetSinglePageOptions`. ### Bug Fixes diff --git a/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client_options.hpp b/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client_options.hpp index 22e3544a3..5e7ee5866 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client_options.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client_options.hpp @@ -77,7 +77,5 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { : Azure::Core::_internal::ClientOptions(), Version(version) { } - - std::string GetVersionString() const { return Version.ToString(); } }; }}}} // namespace Azure::Security::KeyVault::Keys diff --git a/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_type.hpp b/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_type.hpp index 44b955622..3747175f1 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_type.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_type.hpp @@ -25,14 +25,14 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { public: /** - * @brief Construct a new JWT Type object + * @brief Construct a new JSON Web Token (JWT) type object. * - * @param jwt The JWT as string. + * @param jwt The JWT as a string. */ explicit KeyVaultKeyType(std::string jwt) : m_value(std::move(jwt)) {} /** - * @brief Construct a default JWT. + * @brief Construct a default KeyVaultKeyType with an empty string. * */ KeyVaultKeyType() = default; @@ -48,9 +48,9 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { } /** - * @brief Return the JWK as string. + * @brief Return the JSON Web Token (JWT) as a string. * - * @return The JWK represented as string. + * @return The JWT represented as string. */ std::string const& ToString() const { return m_value; } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp b/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp index 5b274d4b9..25ee50d34 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp +++ b/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp @@ -62,7 +62,7 @@ KeyClient::KeyClient( std::shared_ptr credential, KeyClientOptions options) { - auto apiVersion = options.GetVersionString(); + auto apiVersion = options.Version.ToString(); std::vector> perRetrypolicies; { diff --git a/sdk/keyvault/azure-security-keyvault-keys/test/ut/key_client_test.cpp b/sdk/keyvault/azure-security-keyvault-keys/test/ut/key_client_test.cpp index ec6f48a8c..20d6b6d24 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/test/ut/key_client_test.cpp +++ b/sdk/keyvault/azure-security-keyvault-keys/test/ut/key_client_test.cpp @@ -34,24 +34,24 @@ TEST(KeyClient, ServiceVersion) // 7.0 EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion::V7_0); KeyClient keyClient("vaultUrl", credential, options); - EXPECT_EQ(options.GetVersionString(), "7.0");); + EXPECT_EQ(options.Version.ToString(), "7.0");); } { // 7.1 EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion::V7_1); KeyClient keyClient("vaultUrl", credential, options); - EXPECT_EQ(options.GetVersionString(), "7.1");); + EXPECT_EQ(options.Version.ToString(), "7.1");); } { // 7.2 EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion::V7_2); KeyClient keyClient("vaultUrl", credential, options); - EXPECT_EQ(options.GetVersionString(), "7.2");); + EXPECT_EQ(options.Version.ToString(), "7.2");); } { // arbitrary version EXPECT_NO_THROW(auto options = KeyClientOptions(ServiceVersion("1.0")); KeyClient keyClient("vaultUrl", credential, options); - EXPECT_EQ(options.GetVersionString(), "1.0");); + EXPECT_EQ(options.Version.ToString(), "1.0");); } } diff --git a/sdk/keyvault/azure-security-keyvault-keys/test/ut/mocked_transport_adapter_test.hpp b/sdk/keyvault/azure-security-keyvault-keys/test/ut/mocked_transport_adapter_test.hpp index 5d619564d..aea271516 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/test/ut/mocked_transport_adapter_test.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/test/ut/mocked_transport_adapter_test.hpp @@ -61,7 +61,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam KeyClientOptions const& options = KeyClientOptions()) : KeyClient(vaultUrl, nullptr, options) { - auto apiVersion = options.GetVersionString(); + auto apiVersion = options.Version.ToString(); m_pipeline = std::make_unique( Azure::Core::Url(vaultUrl),