From a7672f67f6fbc7db1a81666e0cf2370625572b2e Mon Sep 17 00:00:00 2001 From: Kan Tang Date: Wed, 14 Oct 2020 00:18:38 -0700 Subject: [PATCH] Renamed all continuation related object to ContinuationToken. (#779) * Renamed all continuation related object to ContinuationToken. * Refined changelog. --- .../azure-storage-files-datalake/CHANGELOG.md | 3 +- .../files/datalake/datalake_options.hpp | 12 +- .../files/datalake/datalake_responses.hpp | 2 +- .../protocol/datalake_rest_client.hpp | 138 ++++++------ .../sample/datalake_getting_started.cpp | 4 +- .../src/datalake_directory_client.cpp | 8 +- .../src/datalake_file_system_client.cpp | 2 +- .../src/datalake_path_client.cpp | 2 +- .../src/datalake_service_client.cpp | 6 +- .../test/datalake_file_system_client_test.cpp | 6 +- .../test/datalake_service_client_test.cpp | 6 +- .../azure-storage-files-shares/CHANGELOG.md | 7 +- .../shares/protocol/share_rest_client.hpp | 205 +++++++++--------- .../storage/files/shares/share_options.hpp | 12 +- .../storage/files/shares/share_responses.hpp | 6 +- .../src/share_client.cpp | 6 +- .../src/share_directory_client.cpp | 12 +- .../src/share_file_client.cpp | 6 +- .../src/share_service_client.cpp | 2 +- .../test/share_directory_client_test.cpp | 6 +- .../test/share_file_client_test.cpp | 2 +- .../test/share_service_client_test.cpp | 4 +- 22 files changed, 235 insertions(+), 222 deletions(-) diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index f971ea3c0..e22102557 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -6,16 +6,15 @@ * Service version is now 2020-02-10. * Added support for SAS generation in DataLake service. -* CreateFromConnectionString now accepts unencoded file, path and directory name. * Added support for `FileClient::ScheduleDeletion`. * Added support for `DirectoryClient::SetAccessControlRecursive`. -* `ETag` and `LastModified` is now `std::string` instead of `Azure::Core::Nullable` in `CreateDirectoryResult`, `CreateFileResult` and `CreatePathResult`. * `PathAppendDataResult` now returns `ContentMD5`, `ContentCrc64` and `IsServerEncrypted`. ### Breaking Changes * `CreateFromConnectionString` now accepts unencoded file, path and directory name. * `ETag` and `LastModified` is now `std::string` instead of `Azure::Core::Nullable` in `CreateDirectoryResult`, `CreateFileResult` and `CreatePathResult`. +* `Continuation` is renamed to `ContinuationToken` in options and returned result objects. ## 1.0.0-beta.2 (2020-09-09) diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp index a11530acf..306274b05 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp @@ -114,7 +114,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * in the response, it must be specified in a subsequent invocation * of the list operation to continue listing the filesystems. */ - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; /** * @brief An optional value that specifies the maximum number of items to @@ -219,7 +219,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * in the response, it must be specified in a subsequent invocation * of the list operation to continue listing the paths. */ - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; /** * @brief An optional value that specifies the maximum number of items to @@ -452,7 +452,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * the response, it must be specified in a subsequent invocation of the delete operation * to continue deleting the directory. */ - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; /** * @brief Required and valid only when the resource is a directory. If "true", all paths beneath @@ -611,7 +611,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * is returned in the response, it must be specified in a subsequent invocation of the * rename operation to continue renaming the directory. */ - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; /** * @brief This parameter determines the behavior of the rename operation. The value must be @@ -654,7 +654,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * the response, it must be specified in a subsequent invocation of the delete operation * to continue deleting the directory. */ - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; /** * @brief Specify the access condition for the path. @@ -680,7 +680,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * invocation of the setAccessControlRecursive operation to continue the * setAccessControlRecursive operation on the directory. */ - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; /** * @brief It specifies the maximum number of files or directories on which the acl change will diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp index 9ad9dde24..55390b627 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_responses.hpp @@ -176,7 +176,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct RenameDirectoryResult { - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; }; using SetDirectoryAccessControlRecursiveResult = PathSetAccessControlRecursiveResult; diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp index bd9f4bbc4..74a305cdf 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp @@ -30,7 +30,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { constexpr static const char* c_QueryTimeout = "timeout"; constexpr static const char* c_QueryRecursiveOptional = "recursive"; constexpr static const char* c_QueryRecursiveRequired = "recursive"; - constexpr static const char* c_QueryContinuation = "continuation"; + constexpr static const char* c_QueryContinuationToken = "continuation"; constexpr static const char* c_QueryPathSetAccessControlRecursiveMode = "mode"; constexpr static const char* c_QueryForceFlag = "forceflag"; constexpr static const char* c_QueryDirectory = "directory"; @@ -669,7 +669,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct ServiceListFileSystemsResult { - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; std::vector Filesystems; static ServiceListFileSystemsResult ServiceListFileSystemsResultFromFileSystemList( @@ -709,7 +709,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct FileSystemListPathsResult { - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; std::vector Paths; static FileSystemListPathsResult FileSystemListPathsResultFromPathList(PathList object) @@ -725,7 +725,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { Azure::Core::Nullable ETag; Azure::Core::Nullable LastModified; - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; Azure::Core::Nullable ContentLength; }; @@ -739,7 +739,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Azure::Core::Nullable ContentRange; Azure::Core::Nullable ContentMd5; Azure::Core::Nullable Properties; - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; int32_t DirectoriesSuccessful = int32_t(); int32_t FilesSuccessful = int32_t(); int32_t FailureCount = int32_t(); @@ -806,7 +806,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct PathDeleteResult { - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; }; struct PathSetAccessControlResult @@ -817,7 +817,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct PathSetAccessControlRecursiveResult { - Azure::Core::Nullable Continuation; + Azure::Core::Nullable ContinuationToken; int32_t DirectoriesSuccessful = int32_t(); int32_t FilesSuccessful = int32_t(); int32_t FailureCount = int32_t(); @@ -866,12 +866,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Azure::Core::Nullable Prefix; // Filters results to filesystems within the specified prefix. Azure::Core::Nullable - Continuation; // Optional. When deleting a directory, the number of paths that are - // deleted with each invocation is limited. If the number of paths to be - // deleted exceeds this limit, a continuation token is returned in this - // response header. When a continuation token is returned in the - // response, it must be specified in a subsequent invocation of the delete - // operation to continue deleting the directory. + ContinuationToken; // Optional. The number of paths processed with each invocation is + // limited. If the number of paths to be processed exceeds this + // limit, a continuation token is returned in the response header + // x-ms-continuation. When a continuation token is returned in the + // response, it must be percent-encoded and specified in a subsequent + // invocation of setAcessControlRecursive operation. Azure::Core::Nullable MaxResults; // An optional value that specifies the maximum number of items to return. // If omitted or greater than 5,000, the response will include up to 5,000 @@ -903,12 +903,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Details::c_QueryPrefix, Storage::Details::UrlEncodeQueryParameter(listFileSystemsOptions.Prefix.GetValue())); } - if (listFileSystemsOptions.Continuation.HasValue()) + if (listFileSystemsOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryContinuation, + Details::c_QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - listFileSystemsOptions.Continuation.GetValue())); + listFileSystemsOptions.ContinuationToken.GetValue())); } if (listFileSystemsOptions.MaxResults.HasValue()) { @@ -951,7 +951,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(Details::c_HeaderXMsContinuation) != response.GetHeaders().end()) { - result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderXMsContinuation); } return Azure::Core::Response( std::move(result), std::move(responsePtr)); @@ -1209,12 +1209,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { = Details::c_DefaultServiceApiVersion; // Specifies the version of the operation to use // for this request. Azure::Core::Nullable - Continuation; // Optional. When deleting a directory, the number of paths that are - // deleted with each invocation is limited. If the number of paths to be - // deleted exceeds this limit, a continuation token is returned in this - // response header. When a continuation token is returned in the - // response, it must be specified in a subsequent invocation of the delete - // operation to continue deleting the directory. + ContinuationToken; // Optional. The number of paths processed with each invocation is + // limited. If the number of paths to be processed exceeds this + // limit, a continuation token is returned in the response header + // x-ms-continuation. When a continuation token is returned in the + // response, it must be percent-encoded and specified in a subsequent + // invocation of setAcessControlRecursive operation. Azure::Core::Nullable Directory; // Optional. Filters results to paths within the specified directory. An // error occurs if the directory does not exist. @@ -1257,11 +1257,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { } request.AddHeader( Details::c_HeaderApiVersionParameter, listPathsOptions.ApiVersionParameter); - if (listPathsOptions.Continuation.HasValue()) + if (listPathsOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryContinuation, - Storage::Details::UrlEncodeQueryParameter(listPathsOptions.Continuation.GetValue())); + Details::c_QueryContinuationToken, + Storage::Details::UrlEncodeQueryParameter( + listPathsOptions.ContinuationToken.GetValue())); } if (listPathsOptions.Directory.HasValue()) { @@ -1392,7 +1393,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(Details::c_HeaderXMsContinuation) != response.GetHeaders().end()) { - result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderXMsContinuation); } return Azure::Core::Response( std::move(result), std::move(responsePtr)); @@ -1424,12 +1425,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Resource; // Required only for Create File and Create Directory. The value must be // "file" or "directory". Azure::Core::Nullable - Continuation; // Optional. When deleting a directory, the number of paths that are - // deleted with each invocation is limited. If the number of paths to be - // deleted exceeds this limit, a continuation token is returned in this - // response header. When a continuation token is returned in the - // response, it must be specified in a subsequent invocation of the delete - // operation to continue deleting the directory. + ContinuationToken; // Optional. The number of paths processed with each invocation is + // limited. If the number of paths to be processed exceeds this + // limit, a continuation token is returned in the response header + // x-ms-continuation. When a continuation token is returned in the + // response, it must be percent-encoded and specified in a subsequent + // invocation of setAcessControlRecursive operation. Azure::Core::Nullable Mode; // Optional. Valid only when namespace is enabled. This parameter determines the // behavior of the rename operation. The value must be "legacy" or "posix", and @@ -1537,11 +1538,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Storage::Details::UrlEncodeQueryParameter( PathResourceTypeToString(createOptions.Resource.GetValue()))); } - if (createOptions.Continuation.HasValue()) + if (createOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryContinuation, - Storage::Details::UrlEncodeQueryParameter(createOptions.Continuation.GetValue())); + Details::c_QueryContinuationToken, + Storage::Details::UrlEncodeQueryParameter( + createOptions.ContinuationToken.GetValue())); } if (createOptions.Mode.HasValue()) { @@ -1669,12 +1671,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { // be applied. If omitted or greater than 2,000, the request will process up // to 2,000 items Azure::Core::Nullable - Continuation; // Optional. The number of paths processed with each invocation is - // limited. If the number of paths to be processed exceeds this limit, a - // continuation token is returned in the response header - // x-ms-continuation. When a continuation token is returned in the - // response, it must be percent-encoded and specified in a subsequent - // invocation of setAcessControlRecursive operation. + ContinuationToken; // Optional. The number of paths processed with each invocation is + // limited. If the number of paths to be processed exceeds this + // limit, a continuation token is returned in the response header + // x-ms-continuation. When a continuation token is returned in the + // response, it must be percent-encoded and specified in a subsequent + // invocation of setAcessControlRecursive operation. PathSetAccessControlRecursiveMode Mode; // Mode "set" sets POSIX access control rights on files and directories, "modify" // modifies one or more POSIX access control rights that pre-exist on files and @@ -1810,11 +1812,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Storage::Details::UrlEncodeQueryParameter( std::to_string(updateOptions.MaxRecords.GetValue()))); } - if (updateOptions.Continuation.HasValue()) + if (updateOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryContinuation, - Storage::Details::UrlEncodeQueryParameter(updateOptions.Continuation.GetValue())); + Details::c_QueryContinuationToken, + Storage::Details::UrlEncodeQueryParameter( + updateOptions.ContinuationToken.GetValue())); } request.GetUrl().AppendQueryParameter( Details::c_QueryPathSetAccessControlRecursiveMode, @@ -2263,12 +2266,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { // for this request. Azure::Core::Nullable RecursiveOptional; // Required Azure::Core::Nullable - Continuation; // Optional. When deleting a directory, the number of paths that are - // deleted with each invocation is limited. If the number of paths to be - // deleted exceeds this limit, a continuation token is returned in this - // response header. When a continuation token is returned in the - // response, it must be specified in a subsequent invocation of the delete - // operation to continue deleting the directory. + ContinuationToken; // Optional. The number of paths processed with each invocation is + // limited. If the number of paths to be processed exceeds this + // limit, a continuation token is returned in the response header + // x-ms-continuation. When a continuation token is returned in the + // response, it must be percent-encoded and specified in a subsequent + // invocation of setAcessControlRecursive operation. Azure::Core::Nullable LeaseIdOptional; // If specified, the operation only succeeds if the resource's lease is // active and matches this ID. @@ -2311,11 +2314,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Storage::Details::UrlEncodeQueryParameter( (deleteOptions.RecursiveOptional.GetValue() ? "true" : "false"))); } - if (deleteOptions.Continuation.HasValue()) + if (deleteOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryContinuation, - Storage::Details::UrlEncodeQueryParameter(deleteOptions.Continuation.GetValue())); + Details::c_QueryContinuationToken, + Storage::Details::UrlEncodeQueryParameter( + deleteOptions.ContinuationToken.GetValue())); } if (deleteOptions.LeaseIdOptional.HasValue()) { @@ -2459,12 +2463,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { // href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting // Timeouts for Blob Service Operations. Azure::Core::Nullable - Continuation; // Optional. When deleting a directory, the number of paths that are - // deleted with each invocation is limited. If the number of paths to be - // deleted exceeds this limit, a continuation token is returned in this - // response header. When a continuation token is returned in the - // response, it must be specified in a subsequent invocation of the delete - // operation to continue deleting the directory. + ContinuationToken; // Optional. The number of paths processed with each invocation is + // limited. If the number of paths to be processed exceeds this + // limit, a continuation token is returned in the response header + // x-ms-continuation. When a continuation token is returned in the + // response, it must be percent-encoded and specified in a subsequent + // invocation of setAcessControlRecursive operation. PathSetAccessControlRecursiveMode Mode; // Mode "set" sets POSIX access control rights on files and directories, "modify" // modifies one or more POSIX access control rights that pre-exist on files and @@ -2510,12 +2514,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Storage::Details::UrlEncodeQueryParameter( std::to_string(setAccessControlRecursiveOptions.Timeout.GetValue()))); } - if (setAccessControlRecursiveOptions.Continuation.HasValue()) + if (setAccessControlRecursiveOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryContinuation, + Details::c_QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - setAccessControlRecursiveOptions.Continuation.GetValue())); + setAccessControlRecursiveOptions.ContinuationToken.GetValue())); } request.GetUrl().AppendQueryParameter( Details::c_QueryPathSetAccessControlRecursiveMode, @@ -2899,7 +2903,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(Details::c_HeaderXMsContinuation) != response.GetHeaders().end()) { - result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderXMsContinuation); } if (response.GetHeaders().find(Details::c_HeaderContentLength) != response.GetHeaders().end()) @@ -2989,7 +2993,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(Details::c_HeaderXMsContinuation) != response.GetHeaders().end()) { - result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderXMsContinuation); } return Azure::Core::Response(std::move(result), std::move(responsePtr)); } @@ -3323,7 +3327,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(Details::c_HeaderXMsContinuation) != response.GetHeaders().end()) { - result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderXMsContinuation); } return Azure::Core::Response(std::move(result), std::move(responsePtr)); } @@ -3374,7 +3378,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetHeaders().find(Details::c_HeaderXMsContinuation) != response.GetHeaders().end()) { - result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderXMsContinuation); } return Azure::Core::Response( std::move(result), std::move(responsePtr)); diff --git a/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp b/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp index cb3fc7ff4..d6847e428 100644 --- a/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp +++ b/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp @@ -91,9 +91,9 @@ void DataLakeGettingStarted() do { auto response = serviceClient.ListFileSystemsSegement(); - if (response->Continuation.HasValue()) + if (response->ContinuationToken.HasValue()) { - continuation = response->Continuation.GetValue(); + continuation = response->ContinuationToken.GetValue(); } fileSystems.insert( fileSystems.end(), response->Filesystems.begin(), response->Filesystems.end()); diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp index a975adbb0..2296af1c7 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp @@ -164,7 +164,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { destinationDfsUri.SetPath(destinationFileSystem.GetValue() + '/' + destinationPath); DataLakeRestClient::Path::CreateOptions protocolLayerOptions; - protocolLayerOptions.Continuation = options.Continuation; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.Mode = options.Mode; protocolLayerOptions.SourceLeaseId = options.SourceAccessConditions.LeaseId; protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId; @@ -181,7 +181,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { destinationDfsUri, *m_pipeline, options.Context, protocolLayerOptions); // At this point, there is not more exception thrown, meaning the rename is successful. auto ret = RenameDirectoryResult(); - ret.Continuation = std::move(result->Continuation); + ret.ContinuationToken = std::move(result->ContinuationToken); return Azure::Core::Response( std::move(ret), result.ExtractRawResponse()); } @@ -191,7 +191,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { const DeleteDirectoryOptions& options) const { DataLakeRestClient::Path::DeleteOptions protocolLayerOptions; - protocolLayerOptions.Continuation = options.Continuation; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId; protocolLayerOptions.IfMatch = options.AccessConditions.IfMatch; protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch; @@ -210,7 +210,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { DataLakeRestClient::Path::SetAccessControlRecursiveOptions protocolLayerOptions; protocolLayerOptions.Mode = mode; - protocolLayerOptions.Continuation = options.Continuation; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxRecords = options.MaxRecords; protocolLayerOptions.ForceFlag = options.ForceFlag; protocolLayerOptions.Acl = Acl::SerializeAcls(acls); diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp index d25d7b186..d5e2caa4d 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp @@ -250,7 +250,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { DataLakeRestClient::FileSystem::ListPathsOptions protocolLayerOptions; protocolLayerOptions.Upn = options.UserPrincipalName; - protocolLayerOptions.Continuation = options.Continuation; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxResults = options.MaxResults; protocolLayerOptions.Directory = options.Directory; protocolLayerOptions.RecursiveRequired = recursive; diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp index e4a942052..e4d3fd5aa 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp @@ -267,7 +267,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Azure::Core::Response PathClient::Delete(const DeletePathOptions& options) const { DataLakeRestClient::Path::DeleteOptions protocolLayerOptions; - protocolLayerOptions.Continuation = options.Continuation; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId; protocolLayerOptions.IfMatch = options.AccessConditions.IfMatch; protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch; diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp index 0d71ddbbc..5d14308ad 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp @@ -175,12 +175,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Blobs::ListContainersSegmentOptions blobOptions; blobOptions.Context = options.Context; blobOptions.Prefix = options.Prefix; - blobOptions.ContinuationToken = options.Continuation; + blobOptions.ContinuationToken = options.ContinuationToken; blobOptions.MaxResults = options.MaxResults; auto result = m_blobServiceClient.ListBlobContainersSegment(blobOptions); auto response = ListFileSystemsSegmentResult(); - response.Continuation - = result->ContinuationToken.empty() ? response.Continuation : result->ContinuationToken; + response.ContinuationToken + = result->ContinuationToken.empty() ? response.ContinuationToken : result->ContinuationToken; response.Filesystems = FileSystemsFromContainerItems(result->Items); return Azure::Core::Response( std::move(response), result.ExtractRawResponse()); diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp index 1c058daca..7b1e55c7b 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_file_system_client_test.cpp @@ -63,10 +63,10 @@ namespace Azure { namespace Storage { namespace Test { { auto response = m_fileSystemClient->ListPaths(recursive, options); result.insert(result.end(), response->Paths.begin(), response->Paths.end()); - if (response->Continuation.HasValue()) + if (response->ContinuationToken.HasValue()) { - continuation = response->Continuation.GetValue(); - options.Continuation = continuation; + continuation = response->ContinuationToken.GetValue(); + options.ContinuationToken = continuation; } else { diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp index 401b2306f..76a0c61d7 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp @@ -65,10 +65,10 @@ namespace Azure { namespace Storage { namespace Test { { auto response = m_dataLakeServiceClient->ListFileSystemsSegement(options); result.insert(result.end(), response->Filesystems.begin(), response->Filesystems.end()); - if (response->Continuation.HasValue()) + if (response->ContinuationToken.HasValue()) { - continuation = response->Continuation.GetValue(); - options.Continuation = continuation; + continuation = response->ContinuationToken.GetValue(); + options.ContinuationToken = continuation; } } while (!continuation.empty()); return result; diff --git a/sdk/storage/azure-storage-files-shares/CHANGELOG.md b/sdk/storage/azure-storage-files-shares/CHANGELOG.md index 5c48540ab..b6909cd30 100644 --- a/sdk/storage/azure-storage-files-shares/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-shares/CHANGELOG.md @@ -5,10 +5,6 @@ ### New Features * Service version is now 2020-02-10. -* CreateFromConnectionString now accepts unencoded file and directory name. -* Added support for getting range list with previous snapshot. `GetFileRangeListResult` now returns `std::vector Ranges` and `std::vector ClearRanges` instead of `std::vector RangeList`. -* Added support for SMB Multi-Channel setting for `ServiceClient::GetProperties` and `ServiceClient::SetProperties`. This is only available for Storage account with Premium File access. - - Standard account user has to remove the returned SMB Multi-Channel setting before set, otherwise service would return failure. * Added support for leasing a share: - ShareClient::AcquireLease - ShareClient::ReleaseLease @@ -22,6 +18,9 @@ * Added support for getting range list with previous snapshot. `GetFileRangeListResult` now returns `std::vector Ranges` and `std::vector ClearRanges` instead of `std::vector RangeList`. * Added support for SMB Multi-Channel setting for `ServiceClient::GetProperties` and `ServiceClient::SetProperties`. This is only available for Storage account with Premium File access. - Standard account user has to remove the returned SMB Multi-Channel setting before set, otherwise service would return failure. +* `Marker` is renamed to `ContinuationToken` in options. +* `NextMarker` is renamed to `ContinuationToken` in returned result objects. +* `Marker` is renamed to `PreviousContinuationToken` in returned result objects. ## 1.0.0-beta.2 (2020-09-09) diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp index 65903c1b6..a3d0c5765 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp @@ -28,7 +28,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { constexpr static const char* c_DefaultServiceApiVersion = "2020-02-10"; constexpr static const char* c_QueryCopyId = "copyid"; constexpr static const char* c_QueryListSharesInclude = "include"; - constexpr static const char* c_QueryMarker = "marker"; + constexpr static const char* c_QueryContinuationToken = "marker"; constexpr static const char* c_QueryMaxResults = "maxresults"; constexpr static const char* c_QueryPrefix = "prefix"; constexpr static const char* c_QueryPrevShareSnapshot = "prevsharesnapshot"; @@ -99,11 +99,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { constexpr static const char* c_HeaderFileParentId = "x-ms-file-parent-id"; constexpr static const char* c_HeaderIsServerEncrypted = "x-ms-server-encrypted"; constexpr static const char* c_HeaderContentType = "content-type"; - constexpr static const char* c_HeaderMarker = "x-ms-marker"; + constexpr static const char* c_HeaderContinuationToken = "x-ms-marker"; constexpr static const char* c_HeaderNumberOfHandlesClosed = "x-ms-number-of-handles-closed"; constexpr static const char* c_HeaderNumberOfHandlesFailedToClose = "x-ms-number-of-handles-failed"; - constexpr static const char* c_HeaderFileContentLength = "x-ms-content-length"; + constexpr static const char* c_HeaderXMsContentLength = "x-ms-content-length"; constexpr static const char* c_HeaderContentRange = "content-range"; constexpr static const char* c_HeaderTransactionalContentMd5 = "content-md5"; constexpr static const char* c_HeaderContentEncoding = "content-encoding"; @@ -117,6 +117,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { constexpr static const char* c_HeaderCopyProgress = "x-ms-copy-progress"; constexpr static const char* c_HeaderCopyStatus = "x-ms-copy-status"; constexpr static const char* c_HeaderFileType = "x-ms-type"; + constexpr static const char* c_HeaderXMsRange = "x-ms-range"; constexpr static const char* c_HeaderFileRangeWrite = "x-ms-write"; constexpr static const char* c_HeaderFileRangeWriteTypeDefault = "update"; constexpr static const char* c_HeaderXMsContentCrc64 = "x-ms-content-crc64"; @@ -494,17 +495,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ShareSnapshot; std::string DirectoryPath; std::string Prefix; - std::string Marker; + std::string PreviousContinuationToken; int32_t MaxResults = int32_t(); FilesAndDirectoriesListSegment Segment; - std::string NextMarker; + std::string ContinuationToken; }; // An enumeration of handles. struct ListHandlesResponse { std::vector HandleList; - std::string NextMarker; + std::string ContinuationToken; }; // Properties of a share. @@ -542,10 +543,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::string ServiceEndpoint; std::string Prefix; - std::string Marker; + std::string PreviousContinuationToken; int32_t MaxResults = int32_t(); std::vector ShareItems; - std::string NextMarker; + std::string ContinuationToken; }; // The retention policy. @@ -798,10 +799,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::string ServiceEndpoint; std::string Prefix; - std::string Marker; + std::string PreviousContinuationToken; int32_t MaxResults = int32_t(); std::vector ShareItems; - std::string NextMarker; + std::string ContinuationToken; }; struct ShareCreateResult @@ -983,23 +984,23 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ShareSnapshot; std::string DirectoryPath; std::string Prefix; - std::string Marker; + std::string PreviousContinuationToken; int32_t MaxResults = int32_t(); FilesAndDirectoriesListSegment Segment; - std::string NextMarker; + std::string ContinuationToken; FileShareHttpHeaders HttpHeaders; }; struct DirectoryListHandlesResult { std::vector HandleList; - std::string NextMarker; + std::string ContinuationToken; FileShareHttpHeaders HttpHeaders; }; struct DirectoryForceCloseHandlesResult { - Azure::Core::Nullable marker; + Azure::Core::Nullable ContinuationToken; int32_t numberOfHandlesClosed = int32_t(); int32_t numberOfHandlesFailedToClose = int32_t(); }; @@ -1166,13 +1167,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct FileListHandlesResult { std::vector HandleList; - std::string NextMarker; + std::string ContinuationToken; FileShareHttpHeaders HttpHeaders; }; struct FileForceCloseHandlesResult { - Azure::Core::Nullable marker; + Azure::Core::Nullable ContinuationToken; int32_t numberOfHandlesClosed = int32_t(); int32_t numberOfHandlesFailedToClose = int32_t(); }; @@ -1260,11 +1261,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Core::Nullable Prefix; // Filters the results to return only entries // whose name begins with the specified prefix. Azure::Core::Nullable - Marker; // A string value that identifies the portion of the list to be returned with - // the next list operation. The operation returns a marker value within the - // response body if the list returned was not complete. The marker value may - // then be used in a subsequent call to request the next set of list items. The - // marker value is opaque to the client. + ContinuationToken; // A string value that identifies the portion of the list to be + // returned with the next list operation. The operation returns a + // marker value within the response body if the list returned was not + // complete. The marker value may then be used in a subsequent call + // to request the next set of list items. The marker value is opaque + // to the client. Azure::Core::Nullable MaxResults; // Specifies the maximum number of entries to return. If the request does // not specify maxresults, or specifies a value greater than 5,000, the @@ -1296,12 +1298,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::UrlEncodeQueryParameter( listSharesSegmentOptions.Prefix.GetValue())); } - if (listSharesSegmentOptions.Marker.HasValue()) + if (listSharesSegmentOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryMarker, + Details::c_QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - listSharesSegmentOptions.Marker.GetValue())); + listSharesSegmentOptions.ContinuationToken.GetValue())); } if (listSharesSegmentOptions.MaxResults.HasValue()) { @@ -2513,9 +2515,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { else if (node.Type == XmlNodeType::Text) { if (path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults - && path[1] == XmlTagName::c_Marker) + && path[1] == XmlTagName::c_NextMarker) { - result.Marker = node.Value; + result.ContinuationToken = node.Value; } else if ( path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults @@ -2523,18 +2525,18 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { result.MaxResults = std::stoi(node.Value); } - else if ( - path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults - && path[1] == XmlTagName::c_NextMarker) - { - result.NextMarker = node.Value; - } else if ( path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults && path[1] == XmlTagName::c_Prefix) { result.Prefix = node.Value; } + else if ( + path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults + && path[1] == XmlTagName::c_Marker) + { + result.PreviousContinuationToken = node.Value; + } } else if (node.Type == XmlNodeType::Attribute) { @@ -2554,10 +2556,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { ServiceListSharesSegmentResult result; result.ServiceEndpoint = std::move(object.ServiceEndpoint); result.Prefix = std::move(object.Prefix); - result.Marker = std::move(object.Marker); + result.PreviousContinuationToken = std::move(object.PreviousContinuationToken); result.MaxResults = object.MaxResults; result.ShareItems = std::move(object.ShareItems); - result.NextMarker = std::move(object.NextMarker); + result.ContinuationToken = std::move(object.ContinuationToken); return result; } @@ -4484,11 +4486,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { ShareSnapshot; // The snapshot parameter is an opaque DateTime value that, when present, // specifies the share snapshot to query. Azure::Core::Nullable - Marker; // A string value that identifies the portion of the list to be returned with - // the next list operation. The operation returns a marker value within the - // response body if the list returned was not complete. The marker value may - // then be used in a subsequent call to request the next set of list items. The - // marker value is opaque to the client. + ContinuationToken; // A string value that identifies the portion of the list to be + // returned with the next list operation. The operation returns a + // marker value within the response body if the list returned was not + // complete. The marker value may then be used in a subsequent call + // to request the next set of list items. The marker value is opaque + // to the client. Azure::Core::Nullable MaxResults; // Specifies the maximum number of entries to return. If the request does // not specify maxresults, or specifies a value greater than 5,000, the @@ -4526,12 +4529,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::UrlEncodeQueryParameter( listFilesAndDirectoriesSegmentOptions.ShareSnapshot.GetValue())); } - if (listFilesAndDirectoriesSegmentOptions.Marker.HasValue()) + if (listFilesAndDirectoriesSegmentOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryMarker, + Details::c_QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - listFilesAndDirectoriesSegmentOptions.Marker.GetValue())); + listFilesAndDirectoriesSegmentOptions.ContinuationToken.GetValue())); } if (listFilesAndDirectoriesSegmentOptions.MaxResults.HasValue()) { @@ -4555,11 +4558,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct ListHandlesOptions { Azure::Core::Nullable - Marker; // A string value that identifies the portion of the list to be returned with - // the next list operation. The operation returns a marker value within the - // response body if the list returned was not complete. The marker value may - // then be used in a subsequent call to request the next set of list items. The - // marker value is opaque to the client. + ContinuationToken; // A string value that identifies the portion of the list to be + // returned with the next list operation. The operation returns a + // marker value within the response body if the list returned was not + // complete. The marker value may then be used in a subsequent call + // to request the next set of list items. The marker value is opaque + // to the client. Azure::Core::Nullable MaxResults; // Specifies the maximum number of entries to return. If the request does // not specify maxresults, or specifies a value greater than 5,000, the @@ -4587,11 +4591,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { Azure::Core::Http::Request request(Azure::Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter(Details::c_QueryComp, "listhandles"); - if (listHandlesOptions.Marker.HasValue()) + if (listHandlesOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryMarker, - Storage::Details::UrlEncodeQueryParameter(listHandlesOptions.Marker.GetValue())); + Details::c_QueryContinuationToken, + Storage::Details::UrlEncodeQueryParameter( + listHandlesOptions.ContinuationToken.GetValue())); } if (listHandlesOptions.MaxResults.HasValue()) { @@ -4631,11 +4636,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { // href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting // Timeouts for File Service Operations. Azure::Core::Nullable - Marker; // A string value that identifies the portion of the list to be returned with - // the next list operation. The operation returns a marker value within the - // response body if the list returned was not complete. The marker value may - // then be used in a subsequent call to request the next set of list items. The - // marker value is opaque to the client. + ContinuationToken; // A string value that identifies the portion of the list to be + // returned with the next list operation. The operation returns a + // marker value within the response body if the list returned was not + // complete. The marker value may then be used in a subsequent call + // to request the next set of list items. The marker value is opaque + // to the client. Azure::Core::Nullable ShareSnapshot; // The snapshot parameter is an opaque DateTime value that, when present, // specifies the share snapshot to query. @@ -4665,12 +4671,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::UrlEncodeQueryParameter( std::to_string(forceCloseHandlesOptions.Timeout.GetValue()))); } - if (forceCloseHandlesOptions.Marker.HasValue()) + if (forceCloseHandlesOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryMarker, + Details::c_QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - forceCloseHandlesOptions.Marker.GetValue())); + forceCloseHandlesOptions.ContinuationToken.GetValue())); } if (forceCloseHandlesOptions.ShareSnapshot.HasValue()) { @@ -5159,9 +5165,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { else if (node.Type == XmlNodeType::Text) { if (path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults - && path[1] == XmlTagName::c_Marker) + && path[1] == XmlTagName::c_NextMarker) { - result.Marker = node.Value; + result.ContinuationToken = node.Value; } else if ( path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults @@ -5169,18 +5175,18 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { result.MaxResults = std::stoi(node.Value); } - else if ( - path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults - && path[1] == XmlTagName::c_NextMarker) - { - result.NextMarker = node.Value; - } else if ( path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults && path[1] == XmlTagName::c_Prefix) { result.Prefix = node.Value; } + else if ( + path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults + && path[1] == XmlTagName::c_Marker) + { + result.PreviousContinuationToken = node.Value; + } } else if (node.Type == XmlNodeType::Attribute) { @@ -5222,10 +5228,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.ShareSnapshot = std::move(object.ShareSnapshot); result.DirectoryPath = std::move(object.DirectoryPath); result.Prefix = std::move(object.Prefix); - result.Marker = std::move(object.Marker); + result.PreviousContinuationToken = std::move(object.PreviousContinuationToken); result.MaxResults = object.MaxResults; result.Segment = std::move(object.Segment); - result.NextMarker = std::move(object.NextMarker); + result.ContinuationToken = std::move(object.ContinuationToken); return result; } @@ -5435,7 +5441,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults && path[1] == XmlTagName::c_NextMarker) { - result.NextMarker = node.Value; + result.ContinuationToken = node.Value; } } } @@ -5447,7 +5453,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { DirectoryListHandlesResult result; result.HandleList = std::move(object.HandleList); - result.NextMarker = std::move(object.NextMarker); + result.ContinuationToken = std::move(object.ContinuationToken); return result; } @@ -5460,9 +5466,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { // Success. DirectoryForceCloseHandlesResult result; - if (response.GetHeaders().find(Details::c_HeaderMarker) != response.GetHeaders().end()) + if (response.GetHeaders().find(Details::c_HeaderContinuationToken) + != response.GetHeaders().end()) { - result.marker = response.GetHeaders().at(Details::c_HeaderMarker); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderContinuationToken); } result.numberOfHandlesClosed = std::stoi(response.GetHeaders().at(Details::c_HeaderNumberOfHandlesClosed)); @@ -5545,7 +5552,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } request.AddHeader(Details::c_HeaderVersion, createOptions.ApiVersionParameter); request.AddHeader( - Details::c_HeaderFileContentLength, std::to_string(createOptions.XMsContentLength)); + Details::c_HeaderXMsContentLength, std::to_string(createOptions.XMsContentLength)); request.AddHeader(Details::c_HeaderFileTypeConstant, "file"); if (createOptions.FileContentType.HasValue()) { @@ -5814,7 +5821,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (setHttpHeadersOptions.XMsContentLength.HasValue()) { request.AddHeader( - Details::c_HeaderFileContentLength, + Details::c_HeaderXMsContentLength, std::to_string(setHttpHeadersOptions.XMsContentLength.GetValue())); } if (setHttpHeadersOptions.FileContentType.HasValue()) @@ -6187,7 +6194,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::UrlEncodeQueryParameter( std::to_string(uploadRangeOptions.Timeout.GetValue()))); } - request.AddHeader(Details::c_HeaderRange, uploadRangeOptions.XMsRange); + request.AddHeader(Details::c_HeaderXMsRange, uploadRangeOptions.XMsRange); request.AddHeader( Details::c_HeaderFileRangeWrite, FileRangeWriteTypeToString(uploadRangeOptions.XMsWrite)); @@ -6358,7 +6365,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.AddHeader(Details::c_HeaderVersion, getRangeListOptions.ApiVersionParameter); if (getRangeListOptions.XMsRange.HasValue()) { - request.AddHeader(Details::c_HeaderRange, getRangeListOptions.XMsRange.GetValue()); + request.AddHeader(Details::c_HeaderXMsRange, getRangeListOptions.XMsRange.GetValue()); } if (getRangeListOptions.LeaseIdOptional.HasValue()) { @@ -6562,11 +6569,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct ListHandlesOptions { Azure::Core::Nullable - Marker; // A string value that identifies the portion of the list to be returned with - // the next list operation. The operation returns a marker value within the - // response body if the list returned was not complete. The marker value may - // then be used in a subsequent call to request the next set of list items. The - // marker value is opaque to the client. + ContinuationToken; // A string value that identifies the portion of the list to be + // returned with the next list operation. The operation returns a + // marker value within the response body if the list returned was not + // complete. The marker value may then be used in a subsequent call + // to request the next set of list items. The marker value is opaque + // to the client. Azure::Core::Nullable MaxResults; // Specifies the maximum number of entries to return. If the request does // not specify maxresults, or specifies a value greater than 5,000, the @@ -6591,11 +6599,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { Azure::Core::Http::Request request(Azure::Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter(Details::c_QueryComp, "listhandles"); - if (listHandlesOptions.Marker.HasValue()) + if (listHandlesOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryMarker, - Storage::Details::UrlEncodeQueryParameter(listHandlesOptions.Marker.GetValue())); + Details::c_QueryContinuationToken, + Storage::Details::UrlEncodeQueryParameter( + listHandlesOptions.ContinuationToken.GetValue())); } if (listHandlesOptions.MaxResults.HasValue()) { @@ -6629,11 +6638,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { // href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting // Timeouts for File Service Operations. Azure::Core::Nullable - Marker; // A string value that identifies the portion of the list to be returned with - // the next list operation. The operation returns a marker value within the - // response body if the list returned was not complete. The marker value may - // then be used in a subsequent call to request the next set of list items. The - // marker value is opaque to the client. + ContinuationToken; // A string value that identifies the portion of the list to be + // returned with the next list operation. The operation returns a + // marker value within the response body if the list returned was not + // complete. The marker value may then be used in a subsequent call + // to request the next set of list items. The marker value is opaque + // to the client. Azure::Core::Nullable ShareSnapshot; // The snapshot parameter is an opaque DateTime value that, when present, // specifies the share snapshot to query. @@ -6660,12 +6670,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Storage::Details::UrlEncodeQueryParameter( std::to_string(forceCloseHandlesOptions.Timeout.GetValue()))); } - if (forceCloseHandlesOptions.Marker.HasValue()) + if (forceCloseHandlesOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::c_QueryMarker, + Details::c_QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - forceCloseHandlesOptions.Marker.GetValue())); + forceCloseHandlesOptions.ContinuationToken.GetValue())); } if (forceCloseHandlesOptions.ShareSnapshot.HasValue()) { @@ -7335,7 +7345,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified); result.ETag = response.GetHeaders().at(Details::c_HeaderETag); result.FileContentLength - = std::stoll(response.GetHeaders().at(Details::c_HeaderFileContentLength)); + = std::stoll(response.GetHeaders().at(Details::c_HeaderXMsContentLength)); return Azure::Core::Response( std::move(result), std::move(responsePtr)); } @@ -7800,7 +7810,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (path.size() == 2 && path[0] == XmlTagName::c_EnumerationResults && path[1] == XmlTagName::c_NextMarker) { - result.NextMarker = node.Value; + result.ContinuationToken = node.Value; } } } @@ -7812,7 +7822,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { FileListHandlesResult result; result.HandleList = std::move(object.HandleList); - result.NextMarker = std::move(object.NextMarker); + result.ContinuationToken = std::move(object.ContinuationToken); return result; } @@ -7825,9 +7835,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { // Success. FileForceCloseHandlesResult result; - if (response.GetHeaders().find(Details::c_HeaderMarker) != response.GetHeaders().end()) + if (response.GetHeaders().find(Details::c_HeaderContinuationToken) + != response.GetHeaders().end()) { - result.marker = response.GetHeaders().at(Details::c_HeaderMarker); + result.ContinuationToken = response.GetHeaders().at(Details::c_HeaderContinuationToken); } result.numberOfHandlesClosed = std::stoi(response.GetHeaders().at(Details::c_HeaderNumberOfHandlesClosed)); diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp index 1b3fb7548..40decfbc7 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp @@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * returned was not complete. The marker value may then be used in a subsequent call to request * the next set of list items. The marker value is opaque to the client. */ - Azure::Core::Nullable Marker; + Azure::Core::Nullable ContinuationToken; /** * @brief Specifies the maximum number of entries to return. If the request does not specify @@ -377,7 +377,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * returned was not complete. The marker value may then be used in a subsequent call to request * the next set of list items. The marker value is opaque to the client. */ - Azure::Core::Nullable Marker; + Azure::Core::Nullable ContinuationToken; /** * @brief Specifies the maximum number of entries to return. If the request does not specify @@ -400,7 +400,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * returned was not complete. The marker value may then be used in a subsequent call to request * the next set of list items. The marker value is opaque to the client. */ - Azure::Core::Nullable Marker; + Azure::Core::Nullable ContinuationToken; /** * @brief Specifies the maximum number of entries to return. If the request does not specify @@ -437,7 +437,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * close was not complete. The marker value may then be used in a subsequent call to * close the next handle. The marker value is opaque to the client. */ - Azure::Core::Nullable Marker; + Azure::Core::Nullable ContinuationToken; /** * @brief Specifies operation should apply to the directory specified in the URI, its files, its @@ -750,7 +750,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * returned was not complete. The marker value may then be used in a subsequent call to request * the next set of list items. The marker value is opaque to the client. */ - Azure::Core::Nullable Marker; + Azure::Core::Nullable ContinuationToken; /** * @brief Specifies the maximum number of entries to return. If the request does not specify @@ -781,7 +781,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * close was not complete. The marker value may then be used in a subsequent call to * close the next handle. The marker value is opaque to the client. */ - Azure::Core::Nullable Marker; + Azure::Core::Nullable ContinuationToken; }; /** diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp index afad42dd4..913d4ea81 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp @@ -52,9 +52,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ShareSnapshot; std::string DirectoryPath; std::string Prefix; - std::string Marker; + std::string PreviousContinuationToken; int32_t MaxResults = int32_t(); - std::string NextMarker; + std::string ContinuationToken; std::vector DirectoryItems; std::vector FileItems; }; @@ -62,7 +62,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct ListDirectoryHandlesSegmentResult { std::vector HandleList; - std::string NextMarker; + std::string ContinuationToken; }; struct FileShareSmbProperties diff --git a/sdk/storage/azure-storage-files-shares/src/share_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_client.cpp index ecca5737c..7915cc939 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_client.cpp @@ -253,7 +253,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto protocolLayerOptions = ShareRestClient::Directory::ListFilesAndDirectoriesSegmentOptions(); protocolLayerOptions.Prefix = options.Prefix; - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxResults = options.MaxResults; auto result = ShareRestClient::Directory::ListFilesAndDirectoriesSegment( m_shareUri, *m_pipeline, options.Context, protocolLayerOptions); @@ -263,9 +263,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { ret.ShareSnapshot = std::move(result->ShareSnapshot); ret.DirectoryPath = std::move(result->DirectoryPath); ret.Prefix = std::move(result->Prefix); - ret.Marker = std::move(result->Marker); + ret.PreviousContinuationToken = std::move(result->PreviousContinuationToken); ret.MaxResults = result->MaxResults; - ret.NextMarker = std::move(result->NextMarker); + ret.ContinuationToken = std::move(result->ContinuationToken); ret.DirectoryItems = std::move(result->Segment.DirectoryItems); ret.FileItems = std::move(result->Segment.FileItems); diff --git a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp index 007e81aac..c93bc1e1f 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_directory_client.cpp @@ -257,7 +257,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto protocolLayerOptions = ShareRestClient::Directory::ListFilesAndDirectoriesSegmentOptions(); protocolLayerOptions.Prefix = options.Prefix; - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxResults = options.MaxResults; auto result = ShareRestClient::Directory::ListFilesAndDirectoriesSegment( m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions); @@ -267,9 +267,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { ret.ShareSnapshot = std::move(result->ShareSnapshot); ret.DirectoryPath = std::move(result->DirectoryPath); ret.Prefix = std::move(result->Prefix); - ret.Marker = std::move(result->Marker); + ret.PreviousContinuationToken = std::move(result->PreviousContinuationToken); ret.MaxResults = result->MaxResults; - ret.NextMarker = std::move(result->NextMarker); + ret.ContinuationToken = std::move(result->ContinuationToken); ret.DirectoryItems = std::move(result->Segment.DirectoryItems); ret.FileItems = std::move(result->Segment.FileItems); @@ -281,13 +281,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const ListDirectoryHandlesSegmentOptions& options) const { auto protocolLayerOptions = ShareRestClient::Directory::ListHandlesOptions(); - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxResults = options.MaxResults; protocolLayerOptions.Recursive = options.Recursive; auto result = ShareRestClient::Directory::ListHandles( m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions); ListDirectoryHandlesSegmentResult ret; - ret.NextMarker = std::move(result->NextMarker); + ret.ContinuationToken = std::move(result->ContinuationToken); ret.HandleList = std::move(result->HandleList); return Azure::Core::Response( @@ -311,7 +311,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto protocolLayerOptions = ShareRestClient::Directory::ForceCloseHandlesOptions(); protocolLayerOptions.HandleId = c_FileAllHandles; - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.Recursive = options.Recursive; return ShareRestClient::Directory::ForceCloseHandles( m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions); diff --git a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp index b2e2981d0..48a305b90 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp @@ -485,12 +485,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const ListFileHandlesSegmentOptions& options) const { auto protocolLayerOptions = ShareRestClient::File::ListHandlesOptions(); - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxResults = options.MaxResults; auto result = ShareRestClient::File::ListHandles( m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions); ListFileHandlesSegmentResult ret; - ret.NextMarker = std::move(result->NextMarker); + ret.ContinuationToken = std::move(result->ContinuationToken); ret.HandleList = std::move(result->HandleList); return Azure::Core::Response( @@ -514,7 +514,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto protocolLayerOptions = ShareRestClient::File::ForceCloseHandlesOptions(); protocolLayerOptions.HandleId = c_FileAllHandles; - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; return ShareRestClient::File::ForceCloseHandles( m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions); } diff --git a/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp index cf88cdf23..6e4c6f1b4 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp @@ -120,7 +120,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto protocolLayerOptions = ShareRestClient::Service::ListSharesSegmentOptions(); protocolLayerOptions.ListSharesInclude = options.ListSharesInclude; - protocolLayerOptions.Marker = options.Marker; + protocolLayerOptions.ContinuationToken = options.ContinuationToken; protocolLayerOptions.MaxResults = options.MaxResults; protocolLayerOptions.Prefix = options.Prefix; return ShareRestClient::Service::ListSharesSegment( diff --git a/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp index 926bae4da..64386ac32 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_directory_client_test.cpp @@ -60,8 +60,8 @@ namespace Azure { namespace Storage { namespace Test { directoryResult.insert( directoryResult.end(), response->DirectoryItems.begin(), response->DirectoryItems.end()); fileResult.insert(fileResult.end(), response->FileItems.begin(), response->FileItems.end()); - continuation = response->NextMarker; - options.Marker = continuation; + continuation = response->ContinuationToken; + options.ContinuationToken = continuation; } while (!continuation.empty()); return std:: make_pair, std::vector>( @@ -349,7 +349,7 @@ namespace Azure { namespace Storage { namespace Test { { auto result = m_fileShareDirectoryClient->ListHandlesSegment(); EXPECT_TRUE(result->HandleList.empty()); - EXPECT_TRUE(result->NextMarker.empty()); + EXPECT_TRUE(result->ContinuationToken.empty()); EXPECT_NO_THROW(m_fileShareDirectoryClient->ForceCloseAllHandles()); } }}} // namespace Azure::Storage::Test diff --git a/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp index d94636449..d93fa48e6 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_file_client_test.cpp @@ -210,7 +210,7 @@ namespace Azure { namespace Storage { namespace Test { { auto result = m_fileClient->ListHandlesSegment(); EXPECT_TRUE(result->HandleList.empty()); - EXPECT_TRUE(result->NextMarker.empty()); + EXPECT_TRUE(result->ContinuationToken.empty()); EXPECT_NO_THROW(m_fileClient->ForceCloseAllHandles()); } diff --git a/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp index 44a1e5797..aea681f25 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp @@ -67,8 +67,8 @@ namespace Azure { namespace Storage { namespace Test { { auto response = m_fileShareServiceClient->ListSharesSegment(options); result.insert(result.end(), response->ShareItems.begin(), response->ShareItems.end()); - continuation = response->NextMarker; - options.Marker = continuation; + continuation = response->ContinuationToken; + options.ContinuationToken = continuation; } while (!continuation.empty()); return result; }