diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index da392cb8e..ed5555ce4 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -6,6 +6,8 @@ ### Breaking Changes +- Removed ServiceVersion type and changed the ApiVersion field within `TableClientOptions` to be std::string. + ### Bugs Fixed - Use the package version for telemetry, rather than api version. diff --git a/sdk/tables/azure-data-tables/inc/azure/data/tables/tables_clients.hpp b/sdk/tables/azure-data-tables/inc/azure/data/tables/tables_clients.hpp index 94752a787..5b81973ec 100644 --- a/sdk/tables/azure-data-tables/inc/azure/data/tables/tables_clients.hpp +++ b/sdk/tables/azure-data-tables/inc/azure/data/tables/tables_clients.hpp @@ -38,10 +38,6 @@ namespace Azure { namespace Data { namespace Test { namespace Azure { namespace Data { namespace Tables { namespace _detail { - /** - * The version used for the operations to Tables services. - */ - constexpr static const char* ApiVersion = "2019-02-02"; /** * The package name of the SDK. */ @@ -74,48 +70,6 @@ namespace Azure { namespace Data { namespace Tables { constexpr static const char* ODataError = "odata.error"; } // namespace _detail - /** - * @brief API version for Tables service. - */ - class ServiceVersion final { - public: - /** - * @brief Construct a new Service Version object - * - * @param version The string version for Tables Service. - */ - explicit ServiceVersion(std::string version) : m_version{std::move(version)} {} - - /** - * @brief Enable comparing between two versions. - * - * @param other Another service version to be compared. - */ - bool operator==(const ServiceVersion& other) const { return m_version == other.m_version; } - - /** - * @brief Enable comparing between two versions. - * - * @param other Another service version to be compared. - */ - bool operator!=(const ServiceVersion& other) const { return !(*this == other); } - - /** - * @brief Returns string representation. - * - */ - std::string const& ToString() const { return m_version; } - - /** - * @brief API version 2019-12-12. - * - */ - AZ_DATA_TABLES_DLLEXPORT const static ServiceVersion V2019_02_02; - - private: - std::string m_version; - }; - /** * @brief Audiences available for Blobs * @@ -145,7 +99,7 @@ namespace Azure { namespace Data { namespace Tables { /** * API version used by this client. */ - ServiceVersion ApiVersion{_detail::ApiVersion}; + std::string ApiVersion{"2019-02-02"}; /** * Enables tenant discovery through the authorization challenge when the client is configured to diff --git a/sdk/tables/azure-data-tables/src/tables_clients.cpp b/sdk/tables/azure-data-tables/src/tables_clients.cpp index 5722108d0..1dc347e3f 100644 --- a/sdk/tables/azure-data-tables/src/tables_clients.cpp +++ b/sdk/tables/azure-data-tables/src/tables_clients.cpp @@ -25,8 +25,7 @@ TableServiceClient::TableServiceClient(const TableClientOptions& options) std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(newOptions.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(newOptions.ApiVersion)); m_pipeline = std::make_shared( newOptions, _detail::TablesServicePackageName, @@ -43,8 +42,7 @@ TableServiceClient::TableServiceClient( std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(options.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(options.ApiVersion)); m_pipeline = std::make_shared( options, _detail::TablesServicePackageName, @@ -66,8 +64,7 @@ TableServiceClient::TableServiceClient( std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(options.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(options.ApiVersion)); perRetryPolicies.emplace_back(std::make_unique()); { @@ -79,8 +76,7 @@ TableServiceClient::TableServiceClient( perRetryPolicies.emplace_back(std::make_unique( credential, tokenContext, newOptions.EnableTenantDiscovery)); } - perOperationPolicies.emplace_back( - std::make_unique(newOptions.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(newOptions.ApiVersion)); m_pipeline = std::make_shared( newOptions, _detail::TablesServicePackageName, @@ -99,8 +95,7 @@ TableServiceClient::TableServiceClient( std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(options.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(options.ApiVersion)); m_pipeline = std::make_shared( options, _detail::TablesServicePackageName, @@ -115,8 +110,7 @@ TableServiceClient::TableServiceClient( std::vector> perRetryPolicies2; std::vector> perOperationPolicies2; perRetryPolicies2.emplace_back(std::make_unique()); - perOperationPolicies2.emplace_back( - std::make_unique(newOptions.ApiVersion.ToString())); + perOperationPolicies2.emplace_back(std::make_unique(newOptions.ApiVersion)); m_pipeline = std::make_shared( newOptions, _detail::TablesServicePackageName, @@ -332,8 +326,7 @@ TableClient::TableClient( std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(options.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(options.ApiVersion)); m_pipeline = std::make_shared( options, _detail::TablesServicePackageName, @@ -355,8 +348,7 @@ TableClient::TableClient( std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(options.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(options.ApiVersion)); perRetryPolicies.emplace_back(std::make_unique()); { @@ -368,8 +360,7 @@ TableClient::TableClient( perRetryPolicies.emplace_back(std::make_unique( credential, tokenContext, newOptions.EnableTenantDiscovery)); } - perOperationPolicies.emplace_back( - std::make_unique(newOptions.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(newOptions.ApiVersion)); m_pipeline = std::make_shared( newOptions, _detail::TablesServicePackageName, @@ -389,8 +380,7 @@ TableClient::TableClient( std::vector> perRetryPolicies; std::vector> perOperationPolicies; perRetryPolicies.emplace_back(std::make_unique()); - perOperationPolicies.emplace_back( - std::make_unique(options.ApiVersion.ToString())); + perOperationPolicies.emplace_back(std::make_unique(options.ApiVersion)); m_pipeline = std::make_shared( options, _detail::TablesServicePackageName, @@ -405,8 +395,7 @@ TableClient::TableClient( std::vector> perRetryPolicies2; std::vector> perOperationPolicies2; perRetryPolicies2.emplace_back(std::make_unique()); - perOperationPolicies2.emplace_back( - std::make_unique(newOptions.ApiVersion.ToString())); + perOperationPolicies2.emplace_back(std::make_unique(newOptions.ApiVersion)); m_pipeline = std::make_shared( newOptions, _detail::TablesServicePackageName,