6#include "azure/data/tables/credentials/azure_sas_credential.hpp"
7#include "azure/data/tables/credentials/named_key_credential.hpp"
8#include "azure/data/tables/models.hpp"
10#include <azure/core/credentials/credentials.hpp>
11#include <azure/core/http/http.hpp>
12#include <azure/core/http/policies/policy.hpp>
13#include <azure/core/internal/http/pipeline.hpp>
14#include <azure/core/internal/json/json.hpp>
15#include <azure/core/response.hpp>
23#ifdef _azure_TABLES_TESTING_BUILD
24namespace Azure {
namespace Data {
namespace Tables {
namespace StressTest {
25 class TransactionStressTest;
27namespace Azure {
namespace Data {
namespace Test {
28 class TransactionsBodyTest_TransactionCreate_Test;
29 class TransactionsBodyTest_TransactionBodyInsertMergeOp_Test;
30 class TransactionsBodyTest_TransactionBodyInsertReplaceOp_Test;
31 class TransactionsBodyTest_TransactionBodyDeleteOp_Test;
32 class TransactionsBodyTest_TransactionBodyUpdateMergeOp_Test;
33 class TransactionsBodyTest_TransactionBodyUpdateReplaceOp_Test;
34 class TransactionsBodyTest_TransactionBodyAddOp_Test;
38namespace Azure {
namespace Data {
namespace Tables {
44 constexpr static const char* ApiVersion =
"2019-02-02";
48 constexpr static const char* TablesServicePackageName =
"data-tables";
50 constexpr static const char* OriginHeader =
"Origin";
51 constexpr static const char* AccessControlRequestMethodHeader =
"Access-Control-Request-Method";
52 constexpr static const char* ResrouceTypeService =
"service";
53 constexpr static const char* ComponentProperties =
"properties";
54 constexpr static const char* ContentTypeXml =
"application/xml";
55 constexpr static const char* ContentTypeJson =
"application/json";
56 constexpr static const char* ResourceTypeHeader =
"restype";
57 constexpr static const char* CompHeader =
"comp";
58 constexpr static const char* ContentTypeHeader =
"Content-Type";
59 constexpr static const char* ContentLengthHeader =
"Content-Length";
60 constexpr static const char* AcceptHeader =
"Accept";
61 constexpr static const char* PreferHeader =
"Prefer";
62 constexpr static const char* PreferNoContent =
"return-no-content";
63 constexpr static const char* AcceptFullMeta =
"application/json;odata=fullmetadata";
64 constexpr static const char* IfMatch =
"If-Match";
65 constexpr static const char* PartitionKeyFragment =
"(PartitionKey='";
66 constexpr static const char* RowKeyFragment =
"',RowKey='";
67 constexpr static const char* ClosingFragment =
"')";
68 constexpr static const char* Value =
"value";
69 constexpr static const char* TableName =
"TableName";
70 constexpr static const char* ODataEditLink =
"odata.editLink";
71 constexpr static const char* ODataId =
"odata.id";
72 constexpr static const char* ODataType =
"odata.type";
73 constexpr static const char* ODataMeta =
"odata.metadata";
74 constexpr static const char* ODataError =
"odata.error";
87 explicit ServiceVersion(std::string version) : m_version{std::move(version)} {}
107 std::string
const&
ToString()
const {
return m_version; }
116 std::string m_version;
124 :
public Azure::Core::_internal::ExtendableEnumeration<TablesAudience> {
135 : ExtendableEnumeration(std::move(tablesAudience))
179 std::string
const& serviceUrl,
180 std::string
const& tableName,
193 const std::string& serviceUrl,
194 const std::string& tableName,
195 std::shared_ptr<Core::Credentials::TokenCredential> credential,
208 const std::string& tableName,
209 std::shared_ptr<Azure::Data::Tables::Credentials::NamedKeyCredential> credential,
223 const std::string& serviceUrl,
224 std::shared_ptr<Azure::Data::Tables::Credentials::AzureSasCredential> credential,
225 const std::string& tableName,
238 const std::string& connectionString,
239 const std::string& tableName,
249 Response<Models::TableAccessPolicy>
GetAccessPolicy(Core::Context
const& context = {});
261 Core::Context
const& context = {});
271 Response<Models::AddEntityResult>
AddEntity(
274 Core::Context
const& context = {});
287 Core::Context
const& context = {});
300 Core::Context
const& context = {});
311 Core::Context
const& context = {});
324 Core::Context
const& context = {});
335 Core::Context
const& context = {});
346 const std::string& partitionKey,
347 const std::string& rowKey,
348 Core::Context
const& context = {});
358 std::vector<Models::TransactionStep>
const& steps,
359 Core::Context
const& context = {});
362#ifdef _azure_TABLES_TESTING_BUILD
363 friend class Azure::Data::Tables::StressTest::TransactionStressTest;
364 friend class Azure::Data::Test::TransactionsBodyTest_TransactionCreate_Test;
365 friend class Azure::Data::Test::TransactionsBodyTest_TransactionBodyInsertMergeOp_Test;
366 friend class Azure::Data::Test::TransactionsBodyTest_TransactionBodyInsertReplaceOp_Test;
367 friend class Azure::Data::Test::TransactionsBodyTest_TransactionBodyDeleteOp_Test;
368 friend class Azure::Data::Test::TransactionsBodyTest_TransactionBodyUpdateMergeOp_Test;
369 friend class Azure::Data::Test::TransactionsBodyTest_TransactionBodyUpdateReplaceOp_Test;
370 friend class Azure::Data::Test::TransactionsBodyTest_TransactionBodyAddOp_Test;
373 std::string PreparePayload(
374 std::string
const& batchId,
375 std::string
const& changesetId,
376 std::vector<Models::TransactionStep>
const& steps);
382 std::shared_ptr<Core::Http::_internal::HttpPipeline> m_pipeline;
384 std::string m_tableName;
409 const std::string& serviceUrl,
422 const std::string& serviceUrl,
423 std::shared_ptr<Core::Credentials::TokenCredential> credential,
436 const std::string& serviceUrl,
437 std::shared_ptr<Azure::Data::Tables::Credentials::NamedKeyCredential> credential,
450 const std::string& serviceUrl,
451 std::shared_ptr<Azure::Data::Tables::Credentials::AzureSasCredential> credential,
463 const std::string& connectionString,
474 std::string
const& tableName,
475 Core::Context
const& context = {});
485 std::string
const& tableName,
486 Core::Context
const& context = {});
497 const Azure::Core::Context& context = {})
const;
507 Core::Context
const& context = {});
516 Core::Context
const& context = {});
524 Response<Models::ServiceStatistics>
GetStatistics(Core::Context
const& context = {});
535 Core::Context
const& context = {});
550 std::shared_ptr<Core::Http::_internal::HttpPipeline> m_pipeline;
551 std::shared_ptr<Core::Credentials::TokenCredential> m_tokenCredential;
552 std::shared_ptr<Azure::Data::Tables::Credentials::NamedKeyCredential> m_namedKeyCredential;
Query Entities result.
Definition models.hpp:771
Query tables paged response.
Definition models.hpp:99
Table Entity.
Definition models.hpp:480
API version for Tables service.
Definition tables_clients.hpp:80
bool operator!=(const ServiceVersion &other) const
Enable comparing between two versions.
Definition tables_clients.hpp:101
ServiceVersion(std::string version)
Construct a new Service Version object.
Definition tables_clients.hpp:87
std::string const & ToString() const
Returns string representation.
Definition tables_clients.hpp:107
bool operator==(const ServiceVersion &other) const
Enable comparing between two versions.
Definition tables_clients.hpp:94
AZ_DATA_TABLES_DLLEXPORT static const ServiceVersion V2019_02_02
API version 2019-12-12.
Definition tables_clients.hpp:113
Table Client.
Definition tables_clients.hpp:167
Response< Models::UpsertEntityResult > UpsertEntity(Models::TableEntity const &tableEntity, Models::UpsertEntityOptions const &options={}, Core::Context const &context={})
Upsert specified entity in a table.
Definition tables_clients.cpp:791
Models::QueryEntitiesPagedResponse QueryEntities(Models::QueryEntitiesOptions const &options={}, Core::Context const &context={})
Queries entities in a table.
Definition tables_clients.cpp:861
Response< Models::SetTableAccessPolicyResult > SetAccessPolicy(Models::TableAccessPolicy const &tableAccessPolicy, Core::Context const &context={})
Sets stored access policies for the table that may be used with Shared Access Signatures.
Definition tables_clients.cpp:564
Response< Models::AddEntityResult > AddEntity(Models::TableEntity const &tableEntity, Models::AddEntityOptions const &options={}, Core::Context const &context={})
Add entity in a table.
Definition tables_clients.cpp:637
static TableClient CreateFromConnectionString(const std::string &connectionString, const std::string &tableName, const TableClientOptions &options={})
Initializes a new instance of tableClient.
Definition tables_clients.cpp:430
Response< Models::DeleteEntityResult > DeleteEntity(Models::TableEntity const &tableEntity, Core::Context const &context={})
Deletes the specified entity in a table.
Definition tables_clients.cpp:759
Response< Models::TableEntity > GetEntity(const std::string &partitionKey, const std::string &rowKey, Core::Context const &context={})
Queries a single entity in a table.
Definition tables_clients.cpp:828
Response< Models::TableAccessPolicy > GetAccessPolicy(Core::Context const &context={})
Retrieves details about any stored access policies specified on the table that may be used with Share...
Definition tables_clients.cpp:591
Response< Models::MergeEntityResult > MergeEntity(Models::TableEntity const &tableEntity, Models::MergeEntityOptions const &options={}, Core::Context const &context={})
Merge entity in a table.
Definition tables_clients.cpp:714
Response< Models::UpdateEntityResult > UpdateEntity(Models::TableEntity const &tableEntity, Models::UpdateEntityOptions const &options={}, Core::Context const &context={})
Update entity in a table.
Definition tables_clients.cpp:669
Response< Models::SubmitTransactionResult > SubmitTransaction(std::vector< Models::TransactionStep > const &steps, Core::Context const &context={})
Submits a transaction.
Definition tables_clients.cpp:947
Table Service Client.
Definition tables_clients.hpp:390
Response< Models::SetServicePropertiesResult > SetServiceProperties(Models::SetServicePropertiesOptions const &options={}, Core::Context const &context={})
Set service properties.
Definition tables_clients.cpp:194
Response< Models::PreflightCheckResult > PreflightCheck(Models::PreflightCheckOptions const &options, Core::Context const &context={})
Pre flight check.
Definition tables_clients.cpp:172
TableClient GetTableClient(const std::string &tableName, TableClientOptions const &options={}) const
Get table client.
Definition tables_clients.cpp:135
Response< Models::Table > CreateTable(std::string const &tableName, Core::Context const &context={})
Creates a new table under the given account.
Definition tables_clients.cpp:452
Response< Models::ServiceStatistics > GetStatistics(Core::Context const &context={})
Get service statistics.
Definition tables_clients.cpp:247
Response< Models::DeleteTableResult > DeleteTable(std::string const &tableName, Core::Context const &context={})
Operation permanently deletes the specified table.
Definition tables_clients.cpp:613
Models::QueryTablesPagedResponse QueryTables(const Models::QueryTablesOptions &options={}, const Azure::Core::Context &context={}) const
Queries tables under the given account.
Definition tables_clients.cpp:503
static TableServiceClient CreateFromConnectionString(const std::string &connectionString, const TableClientOptions &options={})
Initializes a new instance of tableClient.
Definition tables_clients.cpp:154
Response< Models::TableServiceProperties > GetServiceProperties(Core::Context const &context={})
Get service properties.
Definition tables_clients.cpp:224
Audiences available for Blobs.
Definition tables_clients.hpp:124
TablesAudience(std::string tablesAudience)
Construct a new TablesAudience object.
Definition tables_clients.hpp:134
Add Entity options.
Definition models.hpp:592
Merge Entity options.
Definition models.hpp:650
Preflight check options.
Definition models.hpp:287
Query Entities options.
Definition models.hpp:733
Query Tables options.
Definition models.hpp:68
Set Service Properties options.
Definition models.hpp:261
Table Access Policy.
Definition models.hpp:427
Update Entity options.
Definition models.hpp:619
Upsert Entity options.
Definition models.hpp:580
Optional parameters for constructing a new TableClient.
Definition tables_clients.hpp:144
bool EnableTenantDiscovery
Definition tables_clients.hpp:155
ServiceVersion ApiVersion
Definition tables_clients.hpp:148
Azure::Nullable< TablesAudience > Audience
Definition tables_clients.hpp:161