diff --git a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md index 097cbbb55..17516601a 100644 --- a/sdk/storage/azure-storage-files-datalake/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-datalake/CHANGELOG.md @@ -15,6 +15,7 @@ - `ExpiryTime` is renamed to `ExpiresOn`. - `LastAccessTime` is renamed to `LastAccessedOn`. - Move version strings into `Details` namespace. +- Renamed all functions and structures that could retrieve partial query results from the server to have `SinglePage` suffix instead of `Segment` suffix. - `ReadFileResult` now have `ContentRange` as string. - `ReadFileOptions` now have `Azure::Core::Http::Range Range` instead of `Content-Length` and `Offset`. 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 550a8d273..b391a0984 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 @@ -67,7 +67,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * @brief Optional parameters for ServiceClient::ListFilesSystems */ - struct ListFileSystemsSegmentOptions + struct ListFileSystemsSinglePageOptions { /** * @brief Context for cancelling long running operations. @@ -94,7 +94,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * return. If omitted or greater than 5,000, the response will * include up to 5,000 items. */ - Azure::Core::Nullable MaxResults; + Azure::Core::Nullable PageSizeHint; }; /** @@ -199,7 +199,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * return. If omitted or greater than 5,000, the response will * include up to 5,000 items. */ - Azure::Core::Nullable MaxResults; + Azure::Core::Nullable PageSizeHint; /** * @brief Filters results to paths within the specified directory. An error occurs 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 3cd55f36f..359528e65 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 @@ -17,7 +17,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam using GetUserDelegationKeyResult = Blobs::Models::GetUserDelegationKeyResult; using UserDelegationKey = Blobs::Models::UserDelegationKey; - using ListFileSystemsSegmentResult = ServiceListFileSystemsResult; + using ListFileSystemsSinglePageResult = ServiceListFileSystemsResult; // FileSystemClient models: diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp index dfdaca9a8..621fecff7 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp @@ -89,12 +89,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * @brief List the file systems from the service. * @param options Optional parameters to list the file systems. - * @return Azure::Core::Response containing the listed + * @return Azure::Core::Response containing the listed * result of file systems and continuation token for unfinished list result. * @remark This request is sent to blob endpoint. */ - Azure::Core::Response ListFileSystemsSegement( - const ListFileSystemsSegmentOptions& options = ListFileSystemsSegmentOptions()) const; + Azure::Core::Response ListFileSystemsSinglePage( + const ListFileSystemsSinglePageOptions& options = ListFileSystemsSinglePageOptions()) const; /** * @brief Retrieves a key that can be used to delegate Active Directory authorization to 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 3bf658e2a..174879cbb 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 @@ -35,7 +35,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { constexpr static const char* QueryForceFlag = "forceflag"; constexpr static const char* QueryPath = "directory"; constexpr static const char* QueryPrefix = "prefix"; - constexpr static const char* QueryMaxResults = "maxresults"; + constexpr static const char* QueryPageSizeHint = "maxresults"; constexpr static const char* QueryUpn = "upn"; constexpr static const char* QueryPosition = "position"; constexpr static const char* QueryRetainUncommittedData = "retainuncommitteddata"; @@ -720,7 +720,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (listFileSystemsOptions.MaxResults.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::QueryMaxResults, + Details::QueryPageSizeHint, Storage::Details::UrlEncodeQueryParameter( std::to_string(listFileSystemsOptions.MaxResults.GetValue()))); } @@ -1041,7 +1041,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (listPathsOptions.MaxResults.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::QueryMaxResults, + Details::QueryPageSizeHint, Storage::Details::UrlEncodeQueryParameter( std::to_string(listPathsOptions.MaxResults.GetValue()))); } 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 1688cd3a6..ced1649e3 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,7 +91,7 @@ void DataLakeGettingStarted() std::vector fileSystems; do { - auto response = serviceClient.ListFileSystemsSegement(); + auto response = serviceClient.ListFileSystemsSinglePage(); if (response->ContinuationToken.HasValue()) { continuation = response->ContinuationToken.GetValue(); 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 9dcdcb878..f88a4806f 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 @@ -251,7 +251,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { protocolLayerOptions.Resource = Models::FileSystemResourceType::Filesystem; protocolLayerOptions.Upn = options.UserPrincipalName; protocolLayerOptions.ContinuationToken = options.ContinuationToken; - protocolLayerOptions.MaxResults = options.MaxResults; + protocolLayerOptions.MaxResults = options.PageSizeHint; protocolLayerOptions.Directory = options.Directory; protocolLayerOptions.RecursiveRequired = recursive; return Details::DataLakeRestClient::FileSystem::ListPaths( 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 08097cf6f..ee2c9f0ee 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 @@ -172,20 +172,20 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { builder, m_blobServiceClient.GetBlobContainerClient(fileSystemName), m_pipeline); } - Azure::Core::Response - DataLakeServiceClient::ListFileSystemsSegement(const ListFileSystemsSegmentOptions& options) const + Azure::Core::Response + DataLakeServiceClient::ListFileSystemsSinglePage(const ListFileSystemsSinglePageOptions& options) const { Blobs::ListBlobContainersSinglePageOptions blobOptions; blobOptions.Context = options.Context; blobOptions.Prefix = options.Prefix; blobOptions.ContinuationToken = options.ContinuationToken; - blobOptions.PageSizeHint = options.MaxResults; + blobOptions.PageSizeHint = options.PageSizeHint; auto result = m_blobServiceClient.ListBlobContainersSinglePage(blobOptions); - auto response = Models::ListFileSystemsSegmentResult(); + auto response = Models::ListFileSystemsSinglePageResult(); response.ContinuationToken = result->ContinuationToken.empty() ? response.ContinuationToken : result->ContinuationToken; response.Filesystems = FileSystemsFromContainerItems(result->Items); - return Azure::Core::Response( + 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 f052f793d..d9412c81f 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 @@ -246,7 +246,7 @@ namespace Azure { namespace Storage { namespace Test { { // List max result Files::DataLake::ListPathsOptions options; - options.MaxResults = 2; + options.PageSizeHint = 2; auto response = m_fileSystemClient->ListPaths(true, options); EXPECT_LE(2U, response->Paths.size()); } 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 a91f5d8f6..05e8c8820 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 @@ -57,14 +57,14 @@ namespace Azure { namespace Storage { namespace Test { { std::vector result; std::string continuation; - Files::DataLake::ListFileSystemsSegmentOptions options; + Files::DataLake::ListFileSystemsSinglePageOptions options; if (!prefix.empty()) { options.Prefix = prefix; } do { - auto response = m_dataLakeServiceClient->ListFileSystemsSegement(options); + auto response = m_dataLakeServiceClient->ListFileSystemsSinglePage(options); result.insert(result.end(), response->Filesystems.begin(), response->Filesystems.end()); if (response->ContinuationToken.HasValue()) { @@ -130,9 +130,9 @@ namespace Azure { namespace Storage { namespace Test { } { // List max result - Files::DataLake::ListFileSystemsSegmentOptions options; - options.MaxResults = 2; - auto response = m_dataLakeServiceClient->ListFileSystemsSegement(options); + Files::DataLake::ListFileSystemsSinglePageOptions options; + options.PageSizeHint = 2; + auto response = m_dataLakeServiceClient->ListFileSystemsSinglePage(options); EXPECT_LE(2U, response->Filesystems.size()); } } @@ -157,7 +157,7 @@ namespace Azure { namespace Storage { namespace Test { .GetUri(); auto datalakeServiceClient = Azure::Storage::Files::DataLake::DataLakeServiceClient(datalakeServiceUri + sasToken); - EXPECT_NO_THROW(datalakeServiceClient.ListFileSystemsSegement()); + EXPECT_NO_THROW(datalakeServiceClient.ListFileSystemsSinglePage()); } }}} // namespace Azure::Storage::Test diff --git a/sdk/storage/azure-storage-files-shares/CHANGELOG.md b/sdk/storage/azure-storage-files-shares/CHANGELOG.md index 6d65d6c38..c80542723 100644 --- a/sdk/storage/azure-storage-files-shares/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-shares/CHANGELOG.md @@ -16,6 +16,7 @@ - `FileShareHttpHeaders` is renamed to `ShareFileHttpHeaders`, and member `std::string ContentMd5` is changed to `Storage::ContentHash ContentHash`. - All date time related strings are now changed to `Azure::Core::DateTime` type. - Move version strings into `Details` namespace. +- Renamed all functions and structures that could retrieve partial query results from the server to have `SinglePage` suffix instead of `Segment` suffix. - Removed `FileRange` and `ClearRange`, they are now represented with `Azure::Core::Http::Range`. - Removed `Offset` and `Length` pair in options. They are now represented with `Azure::Core::Http::Range`. 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 7dc3c928d..abdf6ceae 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 @@ -30,7 +30,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { constexpr static const char* QueryCopyId = "copyid"; constexpr static const char* QueryListSharesInclude = "include"; constexpr static const char* QueryContinuationToken = "marker"; - constexpr static const char* QueryMaxResults = "maxresults"; + constexpr static const char* QueryPageSizeHint = "maxresults"; constexpr static const char* QueryPrefix = "prefix"; constexpr static const char* QueryPrevShareSnapshot = "prevsharesnapshot"; constexpr static const char* QueryShareSnapshot = "sharesnapshot"; @@ -212,7 +212,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { }; // Abstract for entries that can be listed from Directory. - struct FilesAndDirectoriesListSegment + struct FilesAndDirectoriesListSinglePage { std::vector DirectoryItems; std::vector FileItems; @@ -260,7 +260,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { }; // An enumeration of directories and files. - struct ListFilesAndDirectoriesSegmentResponse + struct ListFilesAndDirectoriesSinglePageResponse { std::string ServiceEndpoint; std::string ShareName; @@ -268,8 +268,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string DirectoryPath; std::string Prefix; std::string PreviousContinuationToken; - int32_t MaxResults = int32_t(); - Models::FilesAndDirectoriesListSegment Segment; + int32_t PageSizeHint = int32_t(); + Models::FilesAndDirectoriesListSinglePage SinglePage; std::string ContinuationToken; }; @@ -314,7 +314,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ServiceEndpoint; std::string Prefix; std::string PreviousContinuationToken; - int32_t MaxResults = int32_t(); + int32_t PageSizeHint = int32_t(); std::vector ShareItems; std::string ContinuationToken; }; @@ -458,12 +458,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Core::Nullable Protocol; }; - struct ServiceListSharesSegmentResult + struct ServiceListSharesSinglePageResult { std::string ServiceEndpoint; std::string Prefix; std::string PreviousContinuationToken; - int32_t MaxResults = int32_t(); + int32_t PageSizeHint = int32_t(); std::vector ShareItems; std::string ContinuationToken; }; @@ -640,7 +640,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { bool IsServerEncrypted = bool(); }; - struct DirectoryListFilesAndDirectoriesSegmentResult + struct DirectoryListFilesAndDirectoriesSinglePageResult { std::string ServiceEndpoint; std::string ShareName; @@ -648,8 +648,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string DirectoryPath; std::string Prefix; std::string PreviousContinuationToken; - int32_t MaxResults = int32_t(); - Models::FilesAndDirectoriesListSegment Segment; + int32_t PageSizeHint = int32_t(); + Models::FilesAndDirectoriesListSinglePage SinglePage; std::string ContinuationToken; ShareFileHttpHeaders HttpHeaders; }; @@ -1307,7 +1307,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return GetPropertiesParseResult(context, pipeline.Send(context, request)); } - struct ListSharesSegmentOptions + struct ListSharesSinglePageOptions { Azure::Core::Nullable Prefix; Azure::Core::Nullable ContinuationToken; @@ -1317,51 +1317,53 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = Details::DefaultServiceApiVersion; }; - static Azure::Core::Response ListSharesSegment( + static Azure::Core::Response + ListSharesSinglePage( const Azure::Core::Http::Url& url, Azure::Core::Http::HttpPipeline& pipeline, Azure::Core::Context context, - const ListSharesSegmentOptions& listSharesSegmentOptions) + const ListSharesSinglePageOptions& listSharesSinglePageOptions) { Azure::Core::Http::Request request(Azure::Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter(Details::QueryComp, "list"); - if (listSharesSegmentOptions.Prefix.HasValue()) + if (listSharesSinglePageOptions.Prefix.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryPrefix, Storage::Details::UrlEncodeQueryParameter( - listSharesSegmentOptions.Prefix.GetValue())); + listSharesSinglePageOptions.Prefix.GetValue())); } - if (listSharesSegmentOptions.ContinuationToken.HasValue()) + if (listSharesSinglePageOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - listSharesSegmentOptions.ContinuationToken.GetValue())); + listSharesSinglePageOptions.ContinuationToken.GetValue())); } - if (listSharesSegmentOptions.MaxResults.HasValue()) + if (listSharesSinglePageOptions.MaxResults.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::QueryMaxResults, + Details::QueryPageSizeHint, Storage::Details::UrlEncodeQueryParameter( - std::to_string(listSharesSegmentOptions.MaxResults.GetValue()))); + std::to_string(listSharesSinglePageOptions.MaxResults.GetValue()))); } - if (listSharesSegmentOptions.ListSharesInclude.HasValue()) + if (listSharesSinglePageOptions.ListSharesInclude.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryListSharesInclude, Storage::Details::UrlEncodeQueryParameter(Models::ListSharesIncludeTypeToString( - listSharesSegmentOptions.ListSharesInclude.GetValue()))); + listSharesSinglePageOptions.ListSharesInclude.GetValue()))); } - if (listSharesSegmentOptions.Timeout.HasValue()) + if (listSharesSinglePageOptions.Timeout.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryTimeout, Storage::Details::UrlEncodeQueryParameter( - std::to_string(listSharesSegmentOptions.Timeout.GetValue()))); + std::to_string(listSharesSinglePageOptions.Timeout.GetValue()))); } - request.AddHeader(Details::HeaderVersion, listSharesSegmentOptions.ApiVersionParameter); - return ListSharesSegmentParseResult(context, pipeline.Send(context, request)); + request.AddHeader( + Details::HeaderVersion, listSharesSinglePageOptions.ApiVersionParameter); + return ListSharesSinglePageParseResult(context, pipeline.Send(context, request)); } private: @@ -2056,8 +2058,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static Azure::Core::Response - ListSharesSegmentParseResult( + static Azure::Core::Response + ListSharesSinglePageParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -2068,11 +2070,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const auto& bodyBuffer = response.GetBody(); auto reader = Storage::Details::XmlReader( reinterpret_cast(bodyBuffer.data()), bodyBuffer.size()); - Models::ServiceListSharesSegmentResult result = bodyBuffer.empty() - ? Models::ServiceListSharesSegmentResult() - : ServiceListSharesSegmentResultFromListSharesResponse( + Models::ServiceListSharesSinglePageResult result = bodyBuffer.empty() + ? Models::ServiceListSharesSinglePageResult() + : ServiceListSharesSinglePageResultFromListSharesResponse( ListSharesResponseFromXml(reader)); - return Azure::Core::Response( + return Azure::Core::Response( std::move(result), std::move(responsePtr)); } else @@ -2614,7 +2616,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { path.size() == 2 && path[0] == XmlTagName::EnumerationResults && path[1] == XmlTagName::MaxResults) { - result.MaxResults = std::stoi(node.Value); + result.PageSizeHint = std::stoi(node.Value); } else if ( path.size() == 2 && path[0] == XmlTagName::EnumerationResults @@ -2641,14 +2643,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static Models::ServiceListSharesSegmentResult - ServiceListSharesSegmentResultFromListSharesResponse(Models::ListSharesResponse object) + static Models::ServiceListSharesSinglePageResult + ServiceListSharesSinglePageResultFromListSharesResponse(Models::ListSharesResponse object) { - Models::ServiceListSharesSegmentResult result; + Models::ServiceListSharesSinglePageResult result; result.ServiceEndpoint = std::move(object.ServiceEndpoint); result.Prefix = std::move(object.Prefix); result.PreviousContinuationToken = std::move(object.PreviousContinuationToken); - result.MaxResults = object.MaxResults; + result.PageSizeHint = object.PageSizeHint; result.ShareItems = std::move(object.ShareItems); result.ContinuationToken = std::move(object.ContinuationToken); @@ -4357,7 +4359,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return SetMetadataParseResult(context, pipeline.Send(context, request)); } - struct ListFilesAndDirectoriesSegmentOptions + struct ListFilesAndDirectoriesSinglePageOptions { Azure::Core::Nullable Prefix; Azure::Core::Nullable ShareSnapshot; @@ -4367,54 +4369,55 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = Details::DefaultServiceApiVersion; }; - static Azure::Core::Response - ListFilesAndDirectoriesSegment( + static Azure::Core::Response + ListFilesAndDirectoriesSinglePage( const Azure::Core::Http::Url& url, Azure::Core::Http::HttpPipeline& pipeline, Azure::Core::Context context, - const ListFilesAndDirectoriesSegmentOptions& listFilesAndDirectoriesSegmentOptions) + const ListFilesAndDirectoriesSinglePageOptions& + listFilesAndDirectoriesSinglePageOptions) { Azure::Core::Http::Request request(Azure::Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter(Details::QueryRestype, "directory"); request.GetUrl().AppendQueryParameter(Details::QueryComp, "list"); - if (listFilesAndDirectoriesSegmentOptions.Prefix.HasValue()) + if (listFilesAndDirectoriesSinglePageOptions.Prefix.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryPrefix, Storage::Details::UrlEncodeQueryParameter( - listFilesAndDirectoriesSegmentOptions.Prefix.GetValue())); + listFilesAndDirectoriesSinglePageOptions.Prefix.GetValue())); } - if (listFilesAndDirectoriesSegmentOptions.ShareSnapshot.HasValue()) + if (listFilesAndDirectoriesSinglePageOptions.ShareSnapshot.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryShareSnapshot, Storage::Details::UrlEncodeQueryParameter( - listFilesAndDirectoriesSegmentOptions.ShareSnapshot.GetValue())); + listFilesAndDirectoriesSinglePageOptions.ShareSnapshot.GetValue())); } - if (listFilesAndDirectoriesSegmentOptions.ContinuationToken.HasValue()) + if (listFilesAndDirectoriesSinglePageOptions.ContinuationToken.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryContinuationToken, Storage::Details::UrlEncodeQueryParameter( - listFilesAndDirectoriesSegmentOptions.ContinuationToken.GetValue())); + listFilesAndDirectoriesSinglePageOptions.ContinuationToken.GetValue())); } - if (listFilesAndDirectoriesSegmentOptions.MaxResults.HasValue()) + if (listFilesAndDirectoriesSinglePageOptions.MaxResults.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::QueryMaxResults, - Storage::Details::UrlEncodeQueryParameter( - std::to_string(listFilesAndDirectoriesSegmentOptions.MaxResults.GetValue()))); + Details::QueryPageSizeHint, + Storage::Details::UrlEncodeQueryParameter(std::to_string( + listFilesAndDirectoriesSinglePageOptions.MaxResults.GetValue()))); } - if (listFilesAndDirectoriesSegmentOptions.Timeout.HasValue()) + if (listFilesAndDirectoriesSinglePageOptions.Timeout.HasValue()) { request.GetUrl().AppendQueryParameter( Details::QueryTimeout, Storage::Details::UrlEncodeQueryParameter( - std::to_string(listFilesAndDirectoriesSegmentOptions.Timeout.GetValue()))); + std::to_string(listFilesAndDirectoriesSinglePageOptions.Timeout.GetValue()))); } request.AddHeader( - Details::HeaderVersion, listFilesAndDirectoriesSegmentOptions.ApiVersionParameter); - return ListFilesAndDirectoriesSegmentParseResult( + Details::HeaderVersion, listFilesAndDirectoriesSinglePageOptions.ApiVersionParameter); + return ListFilesAndDirectoriesSinglePageParseResult( context, pipeline.Send(context, request)); } @@ -4446,7 +4449,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (listHandlesOptions.MaxResults.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::QueryMaxResults, + Details::QueryPageSizeHint, Storage::Details::UrlEncodeQueryParameter( std::to_string(listHandlesOptions.MaxResults.GetValue()))); } @@ -4689,8 +4692,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Core::Response - ListFilesAndDirectoriesSegmentParseResult( + static Azure::Core::Response + ListFilesAndDirectoriesSinglePageParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -4701,12 +4704,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const auto& bodyBuffer = response.GetBody(); auto reader = Storage::Details::XmlReader( reinterpret_cast(bodyBuffer.data()), bodyBuffer.size()); - Models::DirectoryListFilesAndDirectoriesSegmentResult result = bodyBuffer.empty() - ? Models::DirectoryListFilesAndDirectoriesSegmentResult() - : DirectoryListFilesAndDirectoriesSegmentResultFromListFilesAndDirectoriesSegmentResponse( - ListFilesAndDirectoriesSegmentResponseFromXml(reader)); + Models::DirectoryListFilesAndDirectoriesSinglePageResult result = bodyBuffer.empty() + ? Models::DirectoryListFilesAndDirectoriesSinglePageResult() + : DirectoryListFilesAndDirectoriesSinglePageResultFromListFilesAndDirectoriesSinglePageResponse( + ListFilesAndDirectoriesSinglePageResponseFromXml(reader)); result.HttpHeaders.ContentType = response.GetHeaders().at(Details::HeaderContentType); - return Azure::Core::Response( + return Azure::Core::Response( std::move(result), std::move(responsePtr)); } else @@ -4880,10 +4883,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static Models::FilesAndDirectoriesListSegment FilesAndDirectoriesListSegmentFromXml( + static Models::FilesAndDirectoriesListSinglePage FilesAndDirectoriesListSinglePageFromXml( Storage::Details::XmlReader& reader) { - auto result = Models::FilesAndDirectoriesListSegment(); + auto result = Models::FilesAndDirectoriesListSinglePage(); enum class XmlTagName { Directory, @@ -4943,10 +4946,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static Models::ListFilesAndDirectoriesSegmentResponse - ListFilesAndDirectoriesSegmentResponseFromXml(Storage::Details::XmlReader& reader) + static Models::ListFilesAndDirectoriesSinglePageResponse + ListFilesAndDirectoriesSinglePageResponseFromXml(Storage::Details::XmlReader& reader) { - auto result = Models::ListFilesAndDirectoriesSegmentResponse(); + auto result = Models::ListFilesAndDirectoriesSinglePageResponse(); enum class XmlTagName { Entries, @@ -5012,7 +5015,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (path.size() == 2 && path[0] == XmlTagName::EnumerationResults && path[1] == XmlTagName::Entries) { - result.Segment = FilesAndDirectoriesListSegmentFromXml(reader); + result.SinglePage = FilesAndDirectoriesListSinglePageFromXml(reader); path.pop_back(); } } @@ -5027,7 +5030,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { path.size() == 2 && path[0] == XmlTagName::EnumerationResults && path[1] == XmlTagName::MaxResults) { - result.MaxResults = std::stoi(node.Value); + result.PageSizeHint = std::stoi(node.Value); } else if ( path.size() == 2 && path[0] == XmlTagName::EnumerationResults @@ -5072,19 +5075,19 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static Models::DirectoryListFilesAndDirectoriesSegmentResult - DirectoryListFilesAndDirectoriesSegmentResultFromListFilesAndDirectoriesSegmentResponse( - Models::ListFilesAndDirectoriesSegmentResponse object) + static Models::DirectoryListFilesAndDirectoriesSinglePageResult + DirectoryListFilesAndDirectoriesSinglePageResultFromListFilesAndDirectoriesSinglePageResponse( + Models::ListFilesAndDirectoriesSinglePageResponse object) { - Models::DirectoryListFilesAndDirectoriesSegmentResult result; + Models::DirectoryListFilesAndDirectoriesSinglePageResult result; result.ServiceEndpoint = std::move(object.ServiceEndpoint); result.ShareName = std::move(object.ShareName); result.ShareSnapshot = std::move(object.ShareSnapshot); result.DirectoryPath = std::move(object.DirectoryPath); result.Prefix = std::move(object.Prefix); result.PreviousContinuationToken = std::move(object.PreviousContinuationToken); - result.MaxResults = object.MaxResults; - result.Segment = std::move(object.Segment); + result.PageSizeHint = object.PageSizeHint; + result.SinglePage = std::move(object.SinglePage); result.ContinuationToken = std::move(object.ContinuationToken); return result; @@ -6170,7 +6173,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (listHandlesOptions.MaxResults.HasValue()) { request.GetUrl().AppendQueryParameter( - Details::QueryMaxResults, + Details::QueryPageSizeHint, Storage::Details::UrlEncodeQueryParameter( std::to_string(listHandlesOptions.MaxResults.GetValue()))); } diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp index 94a471878..8cdc3d2ab 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp @@ -208,13 +208,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief List files and directories under the directory. * @param options Optional parameters to list the files and directories under this directory. - * @return Azure::Core::Response containing the + * @return Azure::Core::Response containing the * information of the operation, directory, share and the listed result. */ - Azure::Core::Response - ListFilesAndDirectoriesSegment( - const ListFilesAndDirectoriesSegmentOptions& options - = ListFilesAndDirectoriesSegmentOptions()) const; + Azure::Core::Response + ListFilesAndDirectoriesSinglePage( + const ListFilesAndDirectoriesSinglePageOptions& options + = ListFilesAndDirectoriesSinglePageOptions()) const; private: Azure::Core::Http::Url m_shareUri; diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp index 08f173fb7..fa1c5f3bd 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_directory_client.hpp @@ -145,23 +145,23 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief List files and directories under the directory. * @param options Optional parameters to list the files and directories under this directory. - * @return Azure::Core::Response containing the + * @return Azure::Core::Response containing the * information of the operation, directory, share and the listed result. */ - Azure::Core::Response - ListFilesAndDirectoriesSegment( - const ListFilesAndDirectoriesSegmentOptions& options - = ListFilesAndDirectoriesSegmentOptions()) const; + Azure::Core::Response + ListFilesAndDirectoriesSinglePage( + const ListFilesAndDirectoriesSinglePageOptions& options + = ListFilesAndDirectoriesSinglePageOptions()) const; /** * @brief List open handles on the directory. * @param options Optional parameters to list this directory's open handles. - * @return Azure::Core::Response containing the + * @return Azure::Core::Response containing the * information of the operation and the open handles of this directory */ - Azure::Core::Response ListHandlesSegment( - const ListDirectoryHandlesSegmentOptions& options - = ListDirectoryHandlesSegmentOptions()) const; + Azure::Core::Response ListHandlesSinglePage( + const ListDirectoryHandlesSinglePageOptions& options + = ListDirectoryHandlesSinglePageOptions()) const; /** * @brief Closes a handle opened on a directory at the service. diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp index 4b35b526d..a3a76eac6 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp @@ -259,11 +259,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief List open handles on the file. * @param options Optional parameters to list this file's open handles. - * @return Azure::Core::Response containing the + * @return Azure::Core::Response containing the * information of the operation and the open handles of this file */ - Azure::Core::Response ListHandlesSegment( - const ListFileHandlesSegmentOptions& options = ListFileHandlesSegmentOptions()) const; + Azure::Core::Response ListHandlesSinglePage( + const ListFileHandlesSinglePageOptions& options = ListFileHandlesSinglePageOptions()) const; /** * @brief Closes a handle opened on a file at the service. 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 3df73f1df..8bea77089 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 @@ -45,7 +45,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Core::Http::TransportPolicyOptions TransportPolicyOptions; }; - struct ListSharesSegmentOptions + struct ListSharesSinglePageOptions { /** * @brief Context for cancelling long running operations. @@ -68,10 +68,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief Specifies the maximum number of entries to return. If the request does not specify - * maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 + * PageSizeHint, or specifies a value greater than 5,000, the server will return up to 5,000 * items. */ - Azure::Core::Nullable MaxResults; + Azure::Core::Nullable PageSizeHint; /** * @brief Include this parameter to specify one or more datasets to include in the response. @@ -331,7 +331,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Core::Context Context; }; - struct ListFilesAndDirectoriesSegmentOptions + struct ListFilesAndDirectoriesSinglePageOptions { /** * @brief Context for cancelling long running operations. @@ -354,13 +354,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief Specifies the maximum number of entries to return. If the request does not specify - * maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 + * PageSizeHint, or specifies a value greater than 5,000, the server will return up to 5,000 * items. */ - Azure::Core::Nullable MaxResults; + Azure::Core::Nullable PageSizeHint; }; - struct ListDirectoryHandlesSegmentOptions + struct ListDirectoryHandlesSinglePageOptions { /** * @brief Context for cancelling long running operations. @@ -377,10 +377,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief Specifies the maximum number of entries to return. If the request does not specify - * maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 + * PageSizeHint, or specifies a value greater than 5,000, the server will return up to 5,000 * items. */ - Azure::Core::Nullable MaxResults; + Azure::Core::Nullable PageSizeHint; /** * @brief Specifies operation should apply to the directory specified in the URI, its files, its @@ -688,7 +688,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { LeaseAccessConditions AccessConditions; }; - struct ListFileHandlesSegmentOptions + struct ListFileHandlesSinglePageOptions { /** * @brief Context for cancelling long running operations. @@ -705,10 +705,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief Specifies the maximum number of entries to return. If the request does not specify - * maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 + * PageSizeHint, or specifies a value greater than 5,000, the server will return up to 5,000 * items. */ - Azure::Core::Nullable MaxResults; + Azure::Core::Nullable PageSizeHint; }; struct ForceCloseFileHandleOptions 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 7e3695586..60d70913c 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 @@ -11,7 +11,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { names // ServiceClient models: - using ListSharesSegmentResult = ServiceListSharesSegmentResult; + using ListSharesSinglePageResult = ServiceListSharesSinglePageResult; using SetServicePropertiesResult = ServiceSetPropertiesResult; using GetServicePropertiesResult = StorageServiceProperties; @@ -45,7 +45,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { names { }; - struct ListFilesAndDirectoriesSegmentResult + struct ListFilesAndDirectoriesSinglePageResult { std::string ServiceEndpoint; std::string ShareName; @@ -53,13 +53,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { names std::string DirectoryPath; std::string Prefix; std::string PreviousContinuationToken; - int32_t MaxResults = int32_t(); + int32_t PageSizeHint = int32_t(); std::string ContinuationToken; std::vector DirectoryItems; std::vector FileItems; }; - struct ListDirectoryHandlesSegmentResult + struct ListDirectoryHandlesSinglePageResult { std::vector Handles; std::string ContinuationToken; @@ -104,7 +104,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { names using ClearFileRangeResult = FileUploadRangeResult; using UploadFileRangeFromUrlResult = FileUploadRangeFromUrlResult; using GetFileRangeListResult = FileGetRangeListResult; - using ListFileHandlesSegmentResult = ListDirectoryHandlesSegmentResult; + using ListFileHandlesSinglePageResult = ListDirectoryHandlesSinglePageResult; using ForceCloseAllFileHandlesResult = FileForceCloseHandlesResult; using AcquireFileLeaseResult = FileAcquireLeaseResult; using ReleaseFileLeaseResult = FileReleaseLeaseResult; diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp index 78e7a422a..944ed87c3 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp @@ -69,12 +69,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief List the shares from the service. * @param options Optional parameters to list the shares. - * @return Azure::Core::Response The results containing the + * @return Azure::Core::Response The results containing the * shares returned and information used for future list operation on valid result not yet * returned. */ - Azure::Core::Response ListSharesSegment( - const ListSharesSegmentOptions& options = ListSharesSegmentOptions()) const; + Azure::Core::Response ListSharesSinglePage( + const ListSharesSinglePageOptions& options = ListSharesSinglePageOptions()) const; /** * @brief Set the service's properties. 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 ef927761b..66561d675 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_client.cpp @@ -228,30 +228,30 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_shareUri, *m_pipeline, options.Context, protocolLayerOptions); } - Azure::Core::Response - ShareClient::ListFilesAndDirectoriesSegment( - const ListFilesAndDirectoriesSegmentOptions& options) const + Azure::Core::Response + ShareClient::ListFilesAndDirectoriesSinglePage( + const ListFilesAndDirectoriesSinglePageOptions& options) const { auto protocolLayerOptions - = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSegmentOptions(); + = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePageOptions(); protocolLayerOptions.Prefix = options.Prefix; protocolLayerOptions.ContinuationToken = options.ContinuationToken; - protocolLayerOptions.MaxResults = options.MaxResults; - auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSegment( + protocolLayerOptions.MaxResults = options.PageSizeHint; + auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePage( m_shareUri, *m_pipeline, options.Context, protocolLayerOptions); - Models::ListFilesAndDirectoriesSegmentResult ret; + Models::ListFilesAndDirectoriesSinglePageResult ret; ret.ServiceEndpoint = std::move(result->ServiceEndpoint); ret.ShareName = std::move(result->ShareName); ret.ShareSnapshot = std::move(result->ShareSnapshot); ret.DirectoryPath = std::move(result->DirectoryPath); ret.Prefix = std::move(result->Prefix); ret.PreviousContinuationToken = std::move(result->PreviousContinuationToken); - ret.MaxResults = result->MaxResults; + ret.PageSizeHint = result->PageSizeHint; ret.ContinuationToken = std::move(result->ContinuationToken); - ret.DirectoryItems = std::move(result->Segment.DirectoryItems); - ret.FileItems = std::move(result->Segment.FileItems); + ret.DirectoryItems = std::move(result->SinglePage.DirectoryItems); + ret.FileItems = std::move(result->SinglePage.FileItems); - return Azure::Core::Response( + return Azure::Core::Response( std::move(ret), result.ExtractRawResponse()); } 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 17f56ecd3..bdd2c8fe7 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 @@ -238,47 +238,47 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions); } - Azure::Core::Response - ShareDirectoryClient::ListFilesAndDirectoriesSegment( - const ListFilesAndDirectoriesSegmentOptions& options) const + Azure::Core::Response + ShareDirectoryClient::ListFilesAndDirectoriesSinglePage( + const ListFilesAndDirectoriesSinglePageOptions& options) const { auto protocolLayerOptions - = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSegmentOptions(); + = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePageOptions(); protocolLayerOptions.Prefix = options.Prefix; protocolLayerOptions.ContinuationToken = options.ContinuationToken; - protocolLayerOptions.MaxResults = options.MaxResults; - auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSegment( + protocolLayerOptions.MaxResults = options.PageSizeHint; + auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePage( m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions); - Models::ListFilesAndDirectoriesSegmentResult ret; + Models::ListFilesAndDirectoriesSinglePageResult ret; ret.ServiceEndpoint = std::move(result->ServiceEndpoint); ret.ShareName = std::move(result->ShareName); ret.ShareSnapshot = std::move(result->ShareSnapshot); ret.DirectoryPath = std::move(result->DirectoryPath); ret.Prefix = std::move(result->Prefix); ret.PreviousContinuationToken = std::move(result->PreviousContinuationToken); - ret.MaxResults = result->MaxResults; + ret.PageSizeHint = result->PageSizeHint; ret.ContinuationToken = std::move(result->ContinuationToken); - ret.DirectoryItems = std::move(result->Segment.DirectoryItems); - ret.FileItems = std::move(result->Segment.FileItems); + ret.DirectoryItems = std::move(result->SinglePage.DirectoryItems); + ret.FileItems = std::move(result->SinglePage.FileItems); - return Azure::Core::Response( + return Azure::Core::Response( std::move(ret), result.ExtractRawResponse()); } - Azure::Core::Response - ShareDirectoryClient::ListHandlesSegment(const ListDirectoryHandlesSegmentOptions& options) const + Azure::Core::Response + ShareDirectoryClient::ListHandlesSinglePage(const ListDirectoryHandlesSinglePageOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::Directory::ListHandlesOptions(); protocolLayerOptions.ContinuationToken = options.ContinuationToken; - protocolLayerOptions.MaxResults = options.MaxResults; + protocolLayerOptions.MaxResults = options.PageSizeHint; protocolLayerOptions.Recursive = options.Recursive; auto result = Details::ShareRestClient::Directory::ListHandles( m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions); - Models::ListDirectoryHandlesSegmentResult ret; + Models::ListDirectoryHandlesSinglePageResult ret; ret.ContinuationToken = std::move(result->ContinuationToken); ret.Handles = std::move(result->HandleList); - return Azure::Core::Response( + return Azure::Core::Response( std::move(ret), result.ExtractRawResponse()); } 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 9754ce995..5fa4081bb 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 @@ -487,19 +487,19 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions); } - Azure::Core::Response ShareFileClient::ListHandlesSegment( - const ListFileHandlesSegmentOptions& options) const + Azure::Core::Response ShareFileClient::ListHandlesSinglePage( + const ListFileHandlesSinglePageOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::File::ListHandlesOptions(); protocolLayerOptions.ContinuationToken = options.ContinuationToken; - protocolLayerOptions.MaxResults = options.MaxResults; + protocolLayerOptions.MaxResults = options.PageSizeHint; auto result = Details::ShareRestClient::File::ListHandles( m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions); - Models::ListFileHandlesSegmentResult ret; + Models::ListFileHandlesSinglePageResult ret; ret.ContinuationToken = std::move(result->ContinuationToken); ret.Handles = std::move(result->HandleList); - return Azure::Core::Response( + return Azure::Core::Response( std::move(ret), result.ExtractRawResponse()); } 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 8cabd8e98..49fa3bc01 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 @@ -92,15 +92,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return ShareClient(builder, m_pipeline); } - Azure::Core::Response ShareServiceClient::ListSharesSegment( - const ListSharesSegmentOptions& options) const + Azure::Core::Response ShareServiceClient::ListSharesSinglePage( + const ListSharesSinglePageOptions& options) const { - auto protocolLayerOptions = Details::ShareRestClient::Service::ListSharesSegmentOptions(); + auto protocolLayerOptions = Details::ShareRestClient::Service::ListSharesSinglePageOptions(); protocolLayerOptions.ListSharesInclude = options.ListSharesInclude; protocolLayerOptions.ContinuationToken = options.ContinuationToken; - protocolLayerOptions.MaxResults = options.MaxResults; + protocolLayerOptions.MaxResults = options.PageSizeHint; protocolLayerOptions.Prefix = options.Prefix; - return Details::ShareRestClient::Service::ListSharesSegment( + return Details::ShareRestClient::Service::ListSharesSinglePage( m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions); } 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 faf18c1a3..c00ab84b7 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 @@ -51,7 +51,7 @@ namespace Azure { namespace Storage { namespace Test { std::vector directoryResult; std::vector fileResult; std::string continuation; - Files::Shares::ListFilesAndDirectoriesSegmentOptions options; + Files::Shares::ListFilesAndDirectoriesSinglePageOptions options; if (!prefix.empty()) { options.Prefix = prefix; @@ -59,7 +59,7 @@ namespace Azure { namespace Storage { namespace Test { auto directoryClient = m_shareClient->GetShareDirectoryClient(directoryPath); do { - auto response = directoryClient.ListFilesAndDirectoriesSegment(options); + auto response = directoryClient.ListFilesAndDirectoriesSinglePage(options); directoryResult.insert( directoryResult.end(), response->DirectoryItems.begin(), response->DirectoryItems.end()); fileResult.insert(fileResult.end(), response->FileItems.begin(), response->FileItems.end()); @@ -239,7 +239,7 @@ namespace Azure { namespace Storage { namespace Test { } } - TEST_F(FileShareDirectoryClientTest, ListFilesAndDirectoriesSegmentTest) + TEST_F(FileShareDirectoryClientTest, ListFilesAndDirectoriesSinglePageTest) { // Setup auto directoryNameA = LowercaseRandomString(); @@ -345,17 +345,17 @@ namespace Azure { namespace Storage { namespace Test { } { // List max result - Files::Shares::ListFilesAndDirectoriesSegmentOptions options; - options.MaxResults = 2; + Files::Shares::ListFilesAndDirectoriesSinglePageOptions options; + options.PageSizeHint = 2; auto directoryNameAClient = m_shareClient->GetShareDirectoryClient(directoryNameA); - auto response = directoryNameAClient.ListFilesAndDirectoriesSegment(options); + auto response = directoryNameAClient.ListFilesAndDirectoriesSinglePage(options); EXPECT_LE(2U, response->DirectoryItems.size() + response->FileItems.size()); } } TEST_F(FileShareDirectoryClientTest, HandlesFunctionalityWorks) { - auto result = m_fileShareDirectoryClient->ListHandlesSegment(); + auto result = m_fileShareDirectoryClient->ListHandlesSinglePage(); EXPECT_TRUE(result->Handles.empty()); EXPECT_TRUE(result->ContinuationToken.empty()); EXPECT_NO_THROW(m_fileShareDirectoryClient->ForceCloseAllHandles()); 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 4fd4bc986..0bd00020e 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 { TEST_F(FileShareFileClientTest, HandlesFunctionalityWorks) { - auto result = m_fileClient->ListHandlesSegment(); + auto result = m_fileClient->ListHandlesSinglePage(); EXPECT_TRUE(result->Handles.empty()); EXPECT_TRUE(result->ContinuationToken.empty()); EXPECT_NO_THROW(m_fileClient->ForceCloseAllHandles()); diff --git a/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp index d37f9debf..6691dc594 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp @@ -70,7 +70,7 @@ namespace Azure { namespace Storage { namespace Test { auto verifyFileList = [&](const std::string& sas) { auto shareClient = Files::Shares::ShareClient(shareUri + sas); - EXPECT_NO_THROW(shareClient.ListFilesAndDirectoriesSegment()); + EXPECT_NO_THROW(shareClient.ListFilesAndDirectoriesSinglePage()); }; for (auto permissions : 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 945c82b79..004871ffd 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 @@ -68,14 +68,14 @@ namespace Azure { namespace Storage { namespace Test { { std::vector result; std::string continuation; - Files::Shares::ListSharesSegmentOptions options; + Files::Shares::ListSharesSinglePageOptions options; if (!prefix.empty()) { options.Prefix = prefix; } do { - auto response = m_fileShareServiceClient->ListSharesSegment(options); + auto response = m_fileShareServiceClient->ListSharesSinglePage(options); result.insert(result.end(), response->ShareItems.begin(), response->ShareItems.end()); continuation = response->ContinuationToken; options.ContinuationToken = continuation; @@ -130,9 +130,9 @@ namespace Azure { namespace Storage { namespace Test { } { // List max result - Files::Shares::ListSharesSegmentOptions options; - options.MaxResults = 2; - auto response = m_fileShareServiceClient->ListSharesSegment(options); + Files::Shares::ListSharesSinglePageOptions options; + options.PageSizeHint = 2; + auto response = m_fileShareServiceClient->ListSharesSinglePage(options); EXPECT_LE(2U, response->ShareItems.size()); } }