diff --git a/sdk/tables/azure-data-tables/inc/azure/data/tables/models.hpp b/sdk/tables/azure-data-tables/inc/azure/data/tables/models.hpp index 18219b428..afb4c3069 100644 --- a/sdk/tables/azure-data-tables/inc/azure/data/tables/models.hpp +++ b/sdk/tables/azure-data-tables/inc/azure/data/tables/models.hpp @@ -568,20 +568,6 @@ namespace Azure { namespace Data { namespace Tables { */ UpsertKind UpsertType = UpsertKind::Update; }; - /** - * @brief Add Entity options. - * - */ - struct AddEntityOptions : public UpsertEntityOptions - { - AddEntityOptions() = default; - /** - * @brief Create Entity options constructor. - * - * @param other Upsert Entity options. - */ - explicit AddEntityOptions(UpsertEntityOptions const& other) { (void)other; } - }; /** * @brief Add Entity result. @@ -595,25 +581,6 @@ namespace Azure { namespace Data { namespace Tables { std::string ETag; }; - /** - * @brief Update Entity options. - * - */ - struct UpdateEntityOptions final - { - /** - * @brief Update Entity options default constructor. - * - */ - UpdateEntityOptions() = default; - /** - * @brief Update Entity options constructor. - * - * @param other Update Entity options. - */ - UpdateEntityOptions(UpsertEntityOptions const& other) { (void)other; } - }; - /** * @brief Update Entity result. * @@ -626,25 +593,6 @@ namespace Azure { namespace Data { namespace Tables { std::string ETag; }; - /** - * @brief Merge Entity options. - * - */ - struct MergeEntityOptions final - { - /** - * @brief Merge Entity options default constructor. - * - */ - MergeEntityOptions() = default; - /** - * @brief Merge Entity options constructor. - * - * @param other Upsert Entity options. - */ - MergeEntityOptions(UpsertEntityOptions const& other) { (void)other; } - }; - /** * @brief Merge Entity result. * diff --git a/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp b/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp index 2f774cc57..1509ba7df 100644 --- a/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp +++ b/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp @@ -90,39 +90,33 @@ namespace Azure { namespace Data { namespace Tables { * @brief Add entity in a table. * * @param tableEntity The TableEntity to set. - * @param options Optional parameters to execute this function. * @param context for canceling long running operations. * @return Add entity result. */ Response AddEntity( Models::TableEntity const& tableEntity, - Models::AddEntityOptions const& options = {}, Core::Context const& context = {}); /** * @brief Update entity in a table. * * @param tableEntity The TableEntity to set. - * @param options Optional parameters to execute this function. * @param context for canceling long running operations. * @return Update entity result. */ Response UpdateEntity( Models::TableEntity const& tableEntity, - Models::UpdateEntityOptions const& options = {}, Core::Context const& context = {}); /** * @brief Merge entity in a table. * * @param tableEntity The TableEntity to merge. - * @param options Optional parameters to execute this function. * @param context for canceling long running operations. * @return Merge entity result. */ Response MergeEntity( Models::TableEntity const& tableEntity, - Models::MergeEntityOptions const& options = {}, Core::Context const& context = {}); /** diff --git a/sdk/tables/azure-data-tables/src/table_clients.cpp b/sdk/tables/azure-data-tables/src/table_clients.cpp index d65290081..a501945a3 100644 --- a/sdk/tables/azure-data-tables/src/table_clients.cpp +++ b/sdk/tables/azure-data-tables/src/table_clients.cpp @@ -421,10 +421,8 @@ Azure::Response TableServiceClient::DeleteTable( Azure::Response TableClient::AddEntity( Models::TableEntity const& tableEntity, - Models::AddEntityOptions const& options, Core::Context const& context) { - (void)options; auto url = m_url; url.AppendPath(m_tableName); @@ -453,10 +451,8 @@ Azure::Response TableClient::AddEntity( Azure::Response TableClient::UpdateEntity( Models::TableEntity const& tableEntity, - Models::UpdateEntityOptions const& options, Core::Context const& context) { - (void)options; auto url = m_url; url.AppendPath( m_tableName + PartitionKeyFragment @@ -498,10 +494,8 @@ Azure::Response TableClient::UpdateEntity( Azure::Response TableClient::MergeEntity( Models::TableEntity const& tableEntity, - Models::MergeEntityOptions const& options, Core::Context const& context) { - (void)options; auto url = m_url; url.AppendPath( m_tableName + PartitionKeyFragment @@ -578,18 +572,17 @@ Azure::Response TableClient::UpsertEntity( Models::UpsertEntityOptions const& options, Core::Context const& context) { - (void)options; try { switch (options.UpsertType) { case Models::UpsertKind::Merge: { - auto response = MergeEntity(tableEntity, Models::MergeEntityOptions(options), context); + auto response = MergeEntity(tableEntity, context); return Azure::Response( Models::UpsertEntityResult(response.Value), std::move(response.RawResponse)); } default: { - auto response = UpdateEntity(tableEntity, Models::UpdateEntityOptions(options), context); + auto response = UpdateEntity(tableEntity, context); return Azure::Response( Models::UpsertEntityResult(response.Value), std::move(response.RawResponse)); } @@ -597,7 +590,7 @@ Azure::Response TableClient::UpsertEntity( } catch (const Azure::Core::RequestFailedException&) { - auto response = AddEntity(tableEntity, Models::AddEntityOptions(options), context); + auto response = AddEntity(tableEntity, context); return Azure::Response( Models::UpsertEntityResult(response.Value), std::move(response.RawResponse)); } @@ -860,7 +853,7 @@ std::string TableClient::PrepDeleteEntity( + entity.GetRowKey().Value + ClosingFragment); returnValue += "DELETE " + url.GetAbsoluteUrl() + " HTTP/1.1\n"; returnValue += "Accept: application/json;odata=minimalmetadata\n"; - // returnValue += "Prefer: return-no-content\n"; + returnValue += "Prefer: return-no-content\n"; returnValue += "DataServiceVersion: 3.0;\n"; if (!entity.GetETag().Value.empty()) { diff --git a/sdk/tables/azure-data-tables/test/ut/table_client_test.cpp b/sdk/tables/azure-data-tables/test/ut/table_client_test.cpp index c906959e9..1afbbf316 100644 --- a/sdk/tables/azure-data-tables/test/ut/table_client_test.cpp +++ b/sdk/tables/azure-data-tables/test/ut/table_client_test.cpp @@ -348,7 +348,7 @@ namespace Azure { namespace Data { namespace Test { options.UpsertType = Azure::Data::Tables::Models::UpsertKind::Update; entity.Properties["Product"] = TableEntityProperty("Tables2"); - auto updateResponse = m_tableClient->MergeEntity(entity, options); + auto updateResponse = m_tableClient->MergeEntity(entity); EXPECT_EQ( updateResponse.RawResponse->GetStatusCode(), Azure::Core::Http::HttpStatusCode::NoContent); @@ -358,7 +358,7 @@ namespace Azure { namespace Data { namespace Test { options2.UpsertType = Azure::Data::Tables::Models::UpsertKind::Merge; entity.Properties["Product3"] = TableEntityProperty("Tables3"); entity.SetETag(updateResponse.Value.ETag); - auto updateResponse2 = m_tableClient->MergeEntity(entity, options2); + auto updateResponse2 = m_tableClient->MergeEntity(entity); EXPECT_EQ( updateResponse2.RawResponse->GetStatusCode(), Azure::Core::Http::HttpStatusCode::NoContent);