From 941b67178e3c2b52705e1c84015ed21835dd5140 Mon Sep 17 00:00:00 2001 From: Kan Tang Date: Fri, 7 May 2021 15:47:35 +0800 Subject: [PATCH] File/datalake service doxygen comments and detail struct name refine. (#2207) # Pull Request Checklist Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly: See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests). - [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html) - [x] Doxygen docs - [x] Unit tests - [x] No unwanted commits/changes - [x] Descriptive title/description - [] PR is single purpose - [x] Related issue listed - [x] Comments in source - [x] No typos - [x] Update changelog - [x] Not work-in-progress - [x] External references or docs updated - [x] Self review of PR done - [x] Any breaking changes? --- .../files/datalake/datalake_responses.hpp | 421 ++- .../protocol/datalake_rest_client.hpp | 354 ++- .../src/datalake_directory_client.cpp | 2 +- .../src/datalake_file_system_client.cpp | 2 +- .../src/datalake_rest_client.cpp | 2 +- .../azure-storage-files-shares/CHANGELOG.md | 1 + .../shares/protocol/share_rest_client.hpp | 2255 +++++++++++++---- .../storage/files/shares/share_responses.hpp | 206 +- .../src/share_file_client.cpp | 6 +- .../src/share_rest_client.cpp | 6 +- 10 files changed, 2613 insertions(+), 642 deletions(-) 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 5cb710bb0..9b9382220 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 @@ -23,64 +23,172 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { using UserDelegationKey = Blobs::Models::UserDelegationKey; + /** + * @brief The detailed information of a file system. + */ struct FileSystemItemDetails { + /** + * An HTTP entity tag associated with the file system. + */ Azure::ETag ETag; + + /** + * The data and time the file system was last modified. + */ Azure::DateTime LastModified; + + /** + * The Metadata of the file system. + */ Storage::Metadata Metadata; + + /** + * The public access type of the file system. + */ PublicAccessType AccessType = PublicAccessType::None; + + /** + * A boolean that indicates if the file system has immutability policy. + */ bool HasImmutabilityPolicy = false; + + /** + * A boolean that indicates if the file system has legal hold. + */ bool HasLegalHold = false; + + /** + * The duration of the lease on the file system if it has one. + */ Azure::Nullable LeaseDuration; + + /** + * The lease state of the file system. + */ Models::LeaseState LeaseState = Models::LeaseState::Available; + + /** + * The lease status of the file system. + */ Models::LeaseStatus LeaseStatus = Models::LeaseStatus::Unlocked; }; // struct FileSystemItemDetails + /** + * @brief The file system item returned when listing the file systems. + */ struct FileSystemItem { + /** + * The name of the file system. + */ std::string Name; + + /** + * The detailed information of the file system. + */ FileSystemItemDetails Details; }; // struct BlobContainerItem // FileSystemClient models: + /** + * @brief The access policy of a file system. + */ struct FileSystemAccessPolicy { + /** + * The public access type of the file system. + */ PublicAccessType AccessType = PublicAccessType::None; + + /** + * The signed identifiers of the file system. + */ std::vector SignedIdentifiers; }; // struct DataLakeFileSystemAccessPolciy using SetFileSystemAccessPolicyResult = Blobs::Models::SetBlobContainerAccessPolicyResult; + /** + * @brief The properties of a file system. + */ struct FileSystemProperties { + /** + * An HTTP entity tag associated with the file system. + */ Azure::ETag ETag; + + /** + * The data and time the file system was last modified. + */ DateTime LastModified; + + /** + * The Metadata of the file system. + */ Storage::Metadata Metadata; }; + /** + * @brief The information returned when creating the file system. + */ struct CreateFileSystemResult { + /** + * If the object is created. + */ bool Created = true; + + /** + * An HTTP entity tag associated with the file system. + */ Azure::ETag ETag; + + /** + * The data and time the file system was last modified. + */ DateTime LastModified; }; + /** + * @brief The information returned when deleting the file system. + */ struct DeleteFileSystemResult { + /** + * If the object is deleted. + */ bool Deleted = true; }; + /** + * @brief The information returned when setting the filesystem's metadata + */ struct SetFileSystemMetadataResult { + /** + * An HTTP entity tag associated with the file system. + */ Azure::ETag ETag; + + /** + * The data and time the file system was last modified. + */ DateTime LastModified; }; // PathClient models: + /** + * @brief The information returned when deleting the path. + */ struct DeletePathResult { + /** + * If the object is deleted. + */ bool Deleted = true; }; @@ -92,11 +200,29 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { using RehydratePriority = Blobs::Models::RehydratePriority; using ArchiveStatus = Blobs::Models::ArchiveStatus; + /** + * @brief An access control object. + */ struct Acl { + /** + * The scope of the ACL. + */ std::string Scope; + + /** + * The type of the ACL. + */ std::string Type; + + /** + * The id of the ACL. + */ std::string Id; + + /** + * The permissions of the ACL. + */ std::string Permissions; /** @@ -128,118 +254,405 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { static std::string SerializeAcls(const std::vector& aclsArray); }; + /** + * @brief The properties of the path. + */ struct PathProperties { + /** + * An HTTP entity tag associated with the path. + */ Azure::ETag ETag; + + /** + * The data and time the path was last modified. + */ DateTime LastModified; + + /** + * The date and time at which the path was created. + */ DateTime CreatedOn; + + /** + * The size of the file. + */ int64_t FileSize = 0; + + /** + * The metadata of the path. + */ Storage::Metadata Metadata; + + /** + * The duration of the lease on the path. + */ Azure::Nullable LeaseDuration; + + /** + * The state of the lease on the path. + */ Azure::Nullable LeaseState; + + /** + * The status of the lease on the path. + */ Azure::Nullable LeaseStatus; + + /** + * The common http headers of the path. + */ PathHttpHeaders HttpHeaders; + + /** + * A boolean indicates if the server is encrypted. + */ Azure::Nullable IsServerEncrypted; + + /** + * The encryption key's SHA256. + */ Azure::Nullable> EncryptionKeySha256; + + /** + * The copy ID of the path, if the path is created from a copy operation. + */ Azure::Nullable CopyId; + + /** + * The copy source of the path, if the path is created from a copy operation. + */ Azure::Nullable CopySource; + + /** + * The copy status of the path, if the path is created from a copy operation. + */ Azure::Nullable CopyStatus; + + /** + * The copy progress of the path, if the path is created from a copy operation. + */ Azure::Nullable CopyProgress; + + /** + * The copy completion time of the path, if the path is created from a copy operation. + */ Azure::Nullable CopyCompletedOn; + + /** + * The expiry time of the path. + */ Azure::Nullable ExpiresOn; + + /** + * The time this path is last accessed on. + */ Azure::Nullable LastAccessedOn; + + /** + * A boolean indicates if the path is a directory. + */ bool IsDirectory = false; + + /** + * The archive status of the path. + */ Azure::Nullable ArchiveStatus; + + /** + * The rehydrate priority of the path. + */ Azure::Nullable RehydratePriority; + + /** + * The copy status's description of the path, if the path is created from a copy operation. + */ Azure::Nullable CopyStatusDescription; + + /** + * A boolean indicates if the path has been incremental copied. + */ Azure::Nullable IsIncrementalCopy; + + /** + * The incremental copy destination snapshot of the path. + */ Azure::Nullable IncrementalCopyDestinationSnapshot; + + /** + * The version ID of the path. + */ Azure::Nullable VersionId; + + /** + * A boolean indicates if the path is in its current version. + */ Azure::Nullable IsCurrentVersion; }; + /** + * @brief The access control list of a path. + */ struct PathAccessControlList { + /** + * The owner of the path. + */ std::string Owner; + + /** + * The group of the path. + */ std::string Group; + + /** + * The permission of the path. + */ std::string Permissions; + + /** + * The acls of the path. + */ std::vector Acls; }; + /** + * @brief The information returned when setting the path's Http headers. + */ struct SetPathHttpHeadersResult { + /** + * An HTTP entity tag associated with the path. + */ Azure::ETag ETag; + + /** + * The data and time the path was last modified. + */ DateTime LastModified; }; + /** + * @brief The information returned when setting the path's metadata. + */ struct SetPathMetadataResult { + /** + * An HTTP entity tag associated with the path. + */ Azure::ETag ETag; + + /** + * The data and time the path was last modified. + */ DateTime LastModified; }; + /** + * @brief The information returned when creating a path. + */ struct CreatePathResult { + /** + * A boolean indicates if the path is created. + */ bool Created = true; + + /** + * An HTTP entity tag associated with the path. + */ Azure::ETag ETag; + + /** + * The data and time the path was last modified. + */ DateTime LastModified; + + /** + * The size of the file. + */ Azure::Nullable FileSize; }; - using SetPathAccessControlListResult = _detail::PathSetAccessControlResult; - using SetPathPermissionsResult = _detail::PathSetAccessControlResult; + using SetPathPermissionsResult = SetPathAccessControlListResult; // FileClient models: using UploadFileFromResult = Blobs::Models::UploadBlockBlobResult; - using AppendFileResult = _detail::PathAppendDataResult; - using FlushFileResult = _detail::PathFlushDataResult; using ScheduleFileDeletionResult = Blobs::Models::SetBlobExpiryResult; using CopyStatus = Blobs::Models::CopyStatus; + /** + * @brief The detailed information returned when downloading a file. + */ struct DownloadFileDetails { + /** + * An HTTP entity tag associated with the file. + */ Azure::ETag ETag; + + /** + * The data and time the file was last modified. + */ DateTime LastModified; + + /** + * The lease duration of the file. + */ Azure::Nullable LeaseDuration; + + /** + * The lease state of the file. + */ Models::LeaseState LeaseState; + + /** + * The lease status of the file. + */ Models::LeaseStatus LeaseStatus; + + /** + * The common Http headers of the file. + */ PathHttpHeaders HttpHeaders; + + /** + * The metadata of the file. + */ Storage::Metadata Metadata; + + /** + * The time this file is created on. + */ DateTime CreatedOn; + + /** + * The time this file expires on. + */ Azure::Nullable ExpiresOn; + + /** + * The time this file is last accessed on. + */ Azure::Nullable LastAccessedOn; + + /** + * The copy ID of the file, if the file is created from a copy operation. + */ Azure::Nullable CopyId; + + /** + * The copy source of the file, if the file is created from a copy operation. + */ Azure::Nullable CopySource; + + /** + * The copy status of the file, if the file is created from a copy operation. + */ Azure::Nullable CopyStatus; + + /** + * The copy status's description of the file, if the file is created from a copy operation. + */ Azure::Nullable CopyStatusDescription; + + /** + * The copy progress of the file, if the file is created from a copy operation. + */ Azure::Nullable CopyProgress; + + /** + * The copy completed time of the file, if the file is created from a copy operation. + */ Azure::Nullable CopyCompletedOn; + + /** + * The version ID of the file. + */ Azure::Nullable VersionId; + + /** + * If the file is in its current version. + */ Azure::Nullable IsCurrentVersion; + + /** + * A boolean indicates if the service is encrypted. + */ bool IsServerEncrypted = false; + + /** + * The encryption key's SHA256. + */ Azure::Nullable> EncryptionKeySha256; + + /** + * The encryption scope. + */ Azure::Nullable EncryptionScope; }; + /** + * @brief The content and information returned when downloading a file. + */ struct DownloadFileResult { + /** + * The body of the downloaded result. + */ std::unique_ptr Body; + + /** + * The size of the file. + */ int64_t FileSize = int64_t(); + + /** + * The range of the downloaded content. + */ Azure::Core::Http::HttpRange ContentRange; + + /** + * The transactional hash of the downloaded content. + */ Azure::Nullable TransactionalContentHash; + + /** + * The detailed information of the downloaded file. + */ DownloadFileDetails Details; }; + /** + * @brief The information returned when deleting a file. + */ struct DeleteFileResult { + /** + * A boolean indicates if the file is deleted. + */ bool Deleted = true; }; + /** + * @brief The information returned when downloading a file to a specific destination. + */ struct DownloadFileToResult { + /** + * The size of the file. + */ int64_t FileSize = int64_t(); + + /** + * The range of the downloaded content. + */ Azure::Core::Http::HttpRange ContentRange; + + /** + * The detailed information of the downloaded file. + */ DownloadFileDetails Details; }; 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 3baeb8f13..3495fb125 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 @@ -28,35 +28,112 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace Models { + + /** + * @brief The common HTTP headers. + */ struct PathHttpHeaders { + + /** + * The cache control of the content. + */ std::string CacheControl; + + /** + * The disposition of the content. + */ std::string ContentDisposition; + + /** + * The encoding of the content. + */ std::string ContentEncoding; + + /** + * The language of the content. + */ std::string ContentLanguage; + + /** + * The type of the content. + */ std::string ContentType; + + /** + * The hash of the content. + */ Storage::ContentHash ContentHash; }; + /** + * @brief The failed entries when setting the Acl. + */ struct AclFailedEntry { + /** + * The name of the failed entry. + */ std::string Name; + + /** + * The type of the failure. + */ std::string Type; + + /** + * The error message of the failure. + */ std::string ErrorMessage; }; struct PathItem { + /** + * The name of the path item. + */ std::string Name; + + /** + * A boolean that indicates if the path is a directory. + */ bool IsDirectory = bool(); + + /** + * The data and time the file or directory was last modified. Write operations on the file or + * directory update the last modified time. + */ DateTime LastModified; + + /** + * An HTTP entity tag associated with the file or directory. + */ std::string ETag; + + /** + * The size of the file. + */ int64_t FileSize = int64_t(); + + /** + * The owner of the file. + */ std::string Owner; + + /** + * The group of the file. + */ std::string Group; + + /** + * The permission of the file. + */ std::string Permissions; }; + /** + * @brief The public access type of a file system. + */ class PublicAccessType { public: PublicAccessType() = default; @@ -73,7 +150,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string m_value; }; // extensible enum PublicAccessType - // Required only for Create File and Create Directory. The value must be "file" or "directory". + /** + * @brief Required only for Create File and Create Directory. The value must be "file" or + * "directory". + */ class PathResourceType { public: PathResourceType() = default; @@ -89,7 +169,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string m_value; }; // extensible enum PathResourceType - // When a resource is leased, specifies whether the lease is of infinite or fixed duration. + /** + * @brief When a resource is leased, specifies whether the lease is of infinite or fixed + * duration. + */ class LeaseDuration { public: LeaseDuration() = default; @@ -105,7 +188,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string m_value; }; // extensible enum LeaseDuration - // Lease state of the resource. + /** + * @brief Lease state of the resource. + */ class LeaseState { public: LeaseState() = default; @@ -124,7 +209,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string m_value; }; // extensible enum LeaseState - // The lease status of the resource. + /** + * @brief The lease status of the resource. + */ class LeaseStatus { public: LeaseStatus() = default; @@ -140,6 +227,65 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string m_value; }; // extensible enum LeaseStatus + /** + * @brief The serialized return result for operation: SetPathAccessControlList + */ + struct SetPathAccessControlListResult + { + + /** + * An HTTP entity tag associated with the file or directory. + */ + Azure::ETag ETag; + + /** + * The data and time the file or directory was last modified. Write operations on the file or + * directory update the last modified time. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: FlushFile + */ + struct FlushFileResult + { + + /** + * An HTTP entity tag associated with the file or directory. + */ + Azure::ETag ETag; + + /** + * The data and time the file or directory was last modified. Write operations on the file or + * directory update the last modified time. + */ + DateTime LastModified; + + /** + * The size of the resource in bytes. + */ + int64_t ContentLength = int64_t(); + }; + + /** + * @brief The serialized return result for operation: AppendFile + */ + struct AppendFileResult + { + + /** + * If the blob has an MD5 hash and this operation is to read the full blob, this response + * header is returned so that the client can check for message content integrity. + */ + Azure::Nullable TransactionalContentHash; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + }; + } // namespace Models namespace _detail { using namespace Models; @@ -206,28 +352,29 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { constexpr static const char* HeaderLeaseStatus = "x-ms-lease-status"; constexpr static const char* HeaderRequestIsServerEncrypted = "x-ms-request-server-encrypted"; - // The value must be "filesystem" for all filesystem operations. - class FileSystemResourceType { + /** + * @brief The value must be "filesystem" for all filesystem operations. + */ + class FileSystemResource { public: - FileSystemResourceType() = default; - explicit FileSystemResourceType(std::string value) : m_value(std::move(value)) {} - bool operator==(const FileSystemResourceType& other) const - { - return m_value == other.m_value; - } - bool operator!=(const FileSystemResourceType& other) const { return !(*this == other); } + FileSystemResource() = default; + explicit FileSystemResource(std::string value) : m_value(std::move(value)) {} + bool operator==(const FileSystemResource& other) const { return m_value == other.m_value; } + bool operator!=(const FileSystemResource& other) const { return !(*this == other); } const std::string& ToString() const { return m_value; } - AZ_STORAGE_FILES_DATALAKE_DLLEXPORT const static FileSystemResourceType Filesystem; + AZ_STORAGE_FILES_DATALAKE_DLLEXPORT const static FileSystemResource Filesystem; private: std::string m_value; - }; // extensible enum FileSystemResourceType + }; // extensible enum FileSystemResource - // 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 directories, "remove" - // removes one or more POSIX access control rights that were present earlier on files and - // directories + /** + * @brief 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 directories, + * "remove" removes one or more POSIX access control rights that were present earlier on files + * and directories + */ class PathSetAccessControlRecursiveMode { public: PathSetAccessControlRecursiveMode() = default; @@ -253,19 +400,27 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct SetAccessControlRecursiveResponse { int32_t NumberOfSuccessfulDirectories = int32_t(); + int32_t NumberOfSuccessfulFiles = int32_t(); + int32_t NumberOfFailures = int32_t(); + std::vector FailedEntries; }; + /** + * @brief The items returned when listing paths. + */ struct PathList { std::vector Items; }; - // Optional. Valid only when namespace is enabled. This parameter determines the behavior of the - // rename operation. The value must be "legacy" or "posix", and the default value will be - // "posix". + /** + * @brief Optional. Valid only when namespace is enabled. This parameter determines the behavior + * of the rename operation. The value must be "legacy" or "posix", and the default value will be + * "posix". + */ class PathRenameMode { public: PathRenameMode() = default; @@ -281,10 +436,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string m_value; }; // extensible enum PathRenameMode - // Optional. If the value is "getStatus" only the system defined properties for the path are - // returned. If the value is "getAccessControl" the access control list is returned in the - // response headers (Hierarchical Namespace must be enabled for the account), otherwise the - // properties are returned. + /** + * @brief Optional. If the value is "getStatus" only the system defined properties for the path + * are returned. If the value is "getAccessControl" the access control list is returned in the + * response headers (Hierarchical Namespace must be enabled for the account), otherwise the + * properties are returned. + */ class PathGetPropertiesAction { public: PathGetPropertiesAction() = default; @@ -306,42 +463,125 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { struct FileSystemListPathsResult { std::vector Items; + + /** + * If the number of paths to be listed exceeds the maxResults 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 list operation to continue listing + * the paths. + */ Azure::Nullable ContinuationToken; }; struct PathCreateResult { + + /** + * An HTTP entity tag associated with the file or directory. + */ Azure::ETag ETag; + + /** + * The data and time the file or directory was last modified. Write operations on the file or + * directory update the last modified time. + */ Azure::Nullable LastModified; + + /** + * The size of the resource in bytes. + */ Azure::Nullable ContentLength; }; struct PathGetPropertiesResult { + + /** + * Indicates that the service supports requests for partial file content. + */ Azure::Nullable AcceptRanges; + + /** + * The Http Headers of the object. + */ PathHttpHeaders HttpHeaders; + + /** + * An HTTP entity tag associated with the file or directory. + */ Azure::ETag ETag; + + /** + * The data and time the file or directory was last modified. Write operations on the file or + * directory update the last modified time. + */ DateTime LastModified; + + /** + * The type of the resource. The value may be "file" or "directory". If not set, the value + * is "file". + */ Azure::Nullable ResourceType; + + /** + * The user-defined properties associated with the file or directory, in the format of a + * comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a + * base64 encoded string. Note that the string may only contain ASCII characters in the + * ISO-8859-1 character set. + */ Azure::Nullable Properties; + + /** + * The owner of the file or directory. Included in the response if Hierarchical Namespace is + * enabled for the account. + */ Azure::Nullable Owner; + + /** + * The owning group of the file or directory. Included in the response if Hierarchical + * Namespace is enabled for the account. + */ Azure::Nullable Group; + + /** + * The POSIX access permissions for the file owner, the file owning group, and others. + * Included in the response if Hierarchical Namespace is enabled for the account. + */ Azure::Nullable Permissions; + + /** + * The POSIX access control list for the file or directory. Included in the response only if + * the action is "getAccessControl" and Hierarchical Namespace is enabled for the account. + */ Azure::Nullable Acl; + + /** + * When a resource is leased, specifies whether the lease is of infinite or fixed duration. + */ Azure::Nullable LeaseDuration; + + /** + * Lease state of the resource. + */ Azure::Nullable LeaseState; + + /** + * The lease status of the resource. + */ Azure::Nullable LeaseStatus; }; struct PathDeleteResult { - Azure::Nullable ContinuationToken; - }; - struct PathSetAccessControlResult - { - Azure::ETag ETag; - DateTime LastModified; + /** + * 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. + */ + Azure::Nullable ContinuationToken; }; struct PathSetAccessControlRecursiveResult @@ -350,29 +590,25 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { int32_t NumberOfSuccessfulFiles = int32_t(); int32_t NumberOfFailures = int32_t(); std::vector FailedEntries; + + /** + * When performing setAccessControlRecursive on a directory, the number of paths that are + * processed with each invocation is limited. If the number of paths to be processed 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 + * setAccessControlRecursive operation to continue the setAccessControlRecursive operation on + * the directory. + */ Azure::Nullable ContinuationToken; }; - struct PathFlushDataResult - { - Azure::ETag ETag; - DateTime LastModified; - int64_t ContentLength = int64_t(); - }; - - struct PathAppendDataResult - { - Azure::Nullable TransactionalContentHash; - bool IsServerEncrypted = bool(); - }; - class DataLakeRestClient { public: class FileSystem { public: struct ListPathsOptions { - FileSystemResourceType Resource; + FileSystemResource Resource; Azure::Nullable Timeout; std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; Azure::Nullable ContinuationToken; @@ -811,7 +1047,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response SetAccessControl( + static Azure::Response SetAccessControl( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -955,7 +1191,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response FlushData( + static Azure::Response FlushData( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -1065,7 +1301,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response AppendData( + static Azure::Response AppendData( const Azure::Core::Url& url, Azure::Core::IO::BodyStream& bodyStream, Azure::Core::Http::_internal::HttpPipeline& pipeline, @@ -1280,7 +1516,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { } } - static Azure::Response SetAccessControlParseResult( + static Azure::Response SetAccessControlParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -1288,7 +1524,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Set directory access control response. - PathSetAccessControlResult result; + Models::SetPathAccessControlListResult result; if (response.GetHeaders().find(_detail::HeaderETag) != response.GetHeaders().end()) { result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); @@ -1300,7 +1536,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); } - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -1375,7 +1611,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { return result; } - static Azure::Response FlushDataParseResult( + static Azure::Response FlushDataParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -1383,7 +1619,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // The data was flushed (written) to the file successfully. - PathFlushDataResult result; + Models::FlushFileResult result; if (response.GetHeaders().find(_detail::HeaderETag) != response.GetHeaders().end()) { result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); @@ -1401,7 +1637,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { result.ContentLength = std::stoll(response.GetHeaders().at(_detail::HeaderContentLength)); } - return Azure::Response(std::move(result), std::move(responsePtr)); + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { @@ -1410,7 +1647,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { } } - static Azure::Response AppendDataParseResult( + static Azure::Response AppendDataParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -1418,7 +1655,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted) { // Append data to file control response. - PathAppendDataResult result; + Models::AppendFileResult result; if (response.GetHeaders().find(_detail::HeaderContentHashMd5) != response.GetHeaders().end()) { @@ -1434,7 +1671,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { } result.IsServerEncrypted = response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true"; - return Azure::Response(std::move(result), std::move(responsePtr)); + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { 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 1ffc50356..b50120188 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 @@ -203,7 +203,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { const Azure::Core::Context& context) const { _detail::DataLakeRestClient::FileSystem::ListPathsOptions protocolLayerOptions; - protocolLayerOptions.Resource = _detail::FileSystemResourceType::Filesystem; + protocolLayerOptions.Resource = _detail::FileSystemResource::Filesystem; protocolLayerOptions.Upn = options.UserPrincipalName; protocolLayerOptions.MaxResults = options.PageSizeHint; 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 b41bdaa0e..b489f0062 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 @@ -269,7 +269,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { const Azure::Core::Context& context) const { _detail::DataLakeRestClient::FileSystem::ListPathsOptions protocolLayerOptions; - protocolLayerOptions.Resource = _detail::FileSystemResourceType::Filesystem; + protocolLayerOptions.Resource = _detail::FileSystemResource::Filesystem; protocolLayerOptions.Upn = options.UserPrincipalName; protocolLayerOptions.MaxResults = options.PageSizeHint; protocolLayerOptions.RecursiveRequired = recursive; diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_rest_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_rest_client.cpp index ac001e79b..0aed2520b 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_rest_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_rest_client.cpp @@ -33,7 +33,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { const PathGetPropertiesAction PathGetPropertiesAction::GetAccessControl("getAccessControl"); const PathGetPropertiesAction PathGetPropertiesAction::GetStatus("getStatus"); - const FileSystemResourceType FileSystemResourceType::Filesystem("filesystem"); + const FileSystemResource FileSystemResource::Filesystem("filesystem"); const PathSetAccessControlRecursiveMode PathSetAccessControlRecursiveMode::Set("set"); const PathSetAccessControlRecursiveMode PathSetAccessControlRecursiveMode::Modify("modify"); diff --git a/sdk/storage/azure-storage-files-shares/CHANGELOG.md b/sdk/storage/azure-storage-files-shares/CHANGELOG.md index af6f256d4..838dfcdd8 100644 --- a/sdk/storage/azure-storage-files-shares/CHANGELOG.md +++ b/sdk/storage/azure-storage-files-shares/CHANGELOG.md @@ -10,6 +10,7 @@ - Renamed `HasMorePages()` in paged response to `HasPage()`. - `ShareLeaseClient::Change()` updates internal lease id. +- `ShareItem::ShareMetadata` was renamed to `ShareItem::Metadata`. ## 12.0.0-beta.10 (2021-04-16) 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 bef13ae22..05a60ab0c 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,56 +30,90 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models { + + /** + * @brief The common HTTP headers. + */ struct FileHttpHeaders { + + /** + * The cache control of the content. + */ std::string CacheControl; + + /** + * The disposition of the content. + */ std::string ContentDisposition; + + /** + * The encoding of the content. + */ std::string ContentEncoding; + + /** + * The language of the content. + */ std::string ContentLanguage; + + /** + * The type of the content. + */ std::string ContentType; + + /** + * The hash of the content. + */ Storage::ContentHash ContentHash; }; + /** + * @brief The SMB related properties of the file. + */ struct FileSmbProperties { /** - * @brief Permission key of the directory or file. + * Permission key of the directory or file. */ Azure::Nullable PermissionKey; /** - * @brief If specified, the provided file attributes shall be set. Default value: + * If specified, the provided file attributes shall be set. Default value: * FileAttribute::Archive for file and FileAttribute::Directory for directory. * FileAttribute::None can also be specified as default. */ FileAttributes Attributes; /** - * @brief Creation time for the file/directory. + * Creation time for the file/directory. */ Azure::Nullable CreatedOn; /** - * @brief Last write time for the file/directory. + * Last write time for the file/directory. */ Azure::Nullable LastWrittenOn; /** - * @brief Changed time for the file/directory. + * Changed time for the file/directory. */ Azure::Nullable ChangedOn; /** - * @brief The fileId of the file. + * The fileId of the file. */ std::string FileId; /** - * @brief The parentId of the file + * The parentId of the file */ std::string ParentFileId; }; - // Specifies the access tier of the share. + + /** + * @brief Specifies the access tier of the share. + */ class AccessTier { public: AccessTier() = default; @@ -97,9 +131,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum AccessTier - // Specifies the option to copy file security descriptor from source file or to set it using the - // value which is defined by the header value of x-ms-file-permission or - // x-ms-file-permission-key. + /** + * @brief Specifies the option to copy file security descriptor from source file or to set it + * using the value which is defined by the header value of x-ms-file-permission or + * x-ms-file-permission-key. + */ class PermissionCopyMode { public: PermissionCopyMode() = default; @@ -115,7 +151,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum PermissionCopyMode - // Specifies the option include to delete the base share and all of its snapshots. + /** + * @brief Specifies the option include to delete the base share and all of its snapshots. + */ class DeleteSnapshotsOption { public: DeleteSnapshotsOption() = default; @@ -130,74 +168,158 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum DeleteSnapshotsOption - // An Access policy. + /** + * @brief An Access policy. + */ struct AccessPolicy { - DateTime StartsOn; // The date-time the policy is active. - DateTime ExpiresOn; // The date-time the policy expires. - std::string Permission; // The permissions for the ACL policy. + /** + * The date-time the policy is active. + */ + DateTime StartsOn; + + /** + * The date-time the policy expires. + */ + DateTime ExpiresOn; + + /** + * The permissions for the ACL policy. + */ + std::string Permission; }; - // CORS is an HTTP feature that enables a web application running under one domain to access - // resources in another domain. Web browsers implement a security restriction known as - // same-origin policy that prevents a web page from calling APIs in a different domain; CORS - // provides a secure way to allow one domain (the origin domain) to call APIs in another domain. + /** + * @brief CORS is an HTTP feature that enables a web application running under one domain to + * access resources in another domain. Web browsers implement a security restriction known as + * same-origin policy that prevents a web page from calling APIs in a different domain; CORS + * provides a secure way to allow one domain (the origin domain) to call APIs in another domain. + */ struct CorsRule { - std::string AllowedOrigins; // The origin domains that are permitted to make a request against - // the storage service via CORS. The origin domain is the domain - // from which the request originates. Note that the origin must be - // an exact case-sensitive match with the origin that the user age - // sends to the service. You can also use the wildcard character - // '*' to allow all origin domains to make requests via CORS. - std::string AllowedMethods; // The methods (HTTP request verbs) that the origin domain may use - // for a CORS request. (comma separated) - std::string AllowedHeaders; // The request headers that the origin domain may specify on the - // CORS request. - std::string ExposedHeaders; // The response headers that may be sent in the response to the - // CORS request and exposed by the browser to the request issuer. - int32_t MaxAgeInSeconds = int32_t(); // The maximum amount time that a browser should cache - // the preflight OPTIONS request. + /** + * The origin domains that are permitted to make a request against the storage service via + * CORS. The origin domain is the domain from which the request originates. Note that the + * origin must be an exact case-sensitive match with the origin that the user age sends to the + * service. You can also use the wildcard character '*' to allow all origin domains to make + * requests via CORS. + */ + std::string AllowedOrigins; + + /** + * The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma + * separated) + */ + std::string AllowedMethods; + + /** + * The request headers that the origin domain may specify on the CORS request. + */ + std::string AllowedHeaders; + + /** + * The response headers that may be sent in the response to the CORS request and exposed by + * the browser to the request issuer. + */ + std::string ExposedHeaders; + + /** + * The maximum amount time that a browser should cache the preflight OPTIONS request. + */ + int32_t MaxAgeInSeconds = int32_t(); }; - // A listed directory item. + /** + * @brief A listed directory item. + */ struct DirectoryItem { + /** + * The name of the directory. + */ std::string Name; }; - // File properties. + /** + * @brief The detailed information of the file. + */ struct FileItemDetails { - int64_t ContentLength - = int64_t(); // Content length of the file. This value may not be up-to-date since an SMB - // client may have modified the file locally. The value of Content-Length may - // not reflect that fact until the handle is closed or the op-lock is broken. - // To retrieve current property values, call Get File Properties. + /** + * Content length of the file. This value may not be up-to-date since an SMB client may have + * modified the file locally. The value of Content-Length may not reflect that fact until the + * handle is closed or the op-lock is broken. To retrieve current property values, call Get + * File Properties. + */ + int64_t ContentLength = int64_t(); }; - // A listed file item. + /** + * @brief A listed file item. + */ struct FileItem { + /** + * The name of the file. + */ std::string Name; + + /** + * The detailed information of the file. + */ FileItemDetails Details; }; - // A listed Azure Storage handle item. + /** + * @brief A listed Azure Storage handle item. + */ struct HandleItem { - std::string HandleId; // XSMB service handle ID - std::string Path; // File or directory name including full path starting from share root - std::string FileId; // FileId uniquely identifies the file or directory. - std::string ParentId; // ParentId uniquely identifies the parent directory of the object. - std::string SessionId; // SMB session ID in context of which the file handle was opened - std::string ClientIp; // Client IP that opened the handle - DateTime OpenedOn; // Time when the session that previously opened the handle has last been - // reconnected. (UTC) - DateTime LastReconnectedOn; // Time handle was last connected to (UTC) + /** + * XSMB service handle ID + */ + std::string HandleId; + + /** + * File or directory name including full path starting from share root + */ + std::string Path; + + /** + * FileId uniquely identifies the file or directory. + */ + std::string FileId; + + /** + * ParentId uniquely identifies the parent directory of the object. + */ + std::string ParentId; + + /** + * SMB session ID in context of which the file handle was opened + */ + std::string SessionId; + + /** + * Client IP that opened the handle + */ + std::string ClientIp; + + /** + * Time when the session that previously opened the handle has last been reconnected. (UTC) + */ + DateTime OpenedOn; + + /** + * Time handle was last connected to (UTC) + */ + DateTime LastReconnectedOn; }; - // When a file or share is leased, specifies whether the lease is of infinite or fixed duration. + /** + * @brief When a file or share is leased, specifies whether the lease is of infinite or fixed + * duration. + */ class LeaseDuration { public: LeaseDuration() = default; @@ -213,7 +335,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum LeaseDuration - // Lease state of the file or share. + /** + * @brief Lease state of the file or share. + */ class LeaseState { public: LeaseState() = default; @@ -232,7 +356,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum LeaseState - // The current lease status of the file or share. + /** + * @brief The current lease status of the file or share. + */ class LeaseStatus { public: LeaseStatus() = default; @@ -248,96 +374,249 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum LeaseStatus - // Properties of a share. + /** + * @brief Details of the share properties. + */ struct ShareItemDetails { + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties or metadata updates the last modified time. Operations on files do + * not affect the last modified time of the share. + */ DateTime LastModified; + + /** + * The ETag contains a value which represents the version of the share, in quotes. + */ Azure::ETag Etag; + + /** + * The quota of the share in GB + */ int64_t Quota = int64_t(); + + /** + * Returns the current share provisioned ipos. + */ Azure::Nullable ProvisionedIops; + + /** + * Returns the current share provisioned ingress in megabytes per second. + */ Azure::Nullable ProvisionedIngressMBps; + + /** + * Returns the current share provisioned egress in megabytes per second. + */ Azure::Nullable ProvisionedEgressMBps; + + /** + * Returns the current share next allowed quota downgrade time. + */ Azure::Nullable NextAllowedQuotaDowngradeTime; + + /** + * The time on which the share was deleted. + */ Azure::Nullable DeletedOn; + + /** + * The remaining retention days of the share. + */ int32_t RemainingRetentionDays = int32_t(); - Azure::Nullable AccessTier; // The access tier of the share. + + /** + * The access tier of the share. + */ + Azure::Nullable AccessTier; + + /** + * Returns the last modified time (in UTC) of the access tier of the share. + */ Azure::Nullable AccessTierChangedOn; + + /** + * Returns the transition state betweeen access tiers, when present. + */ Azure::Nullable AccessTierTransitionState; + + /** + * The current lease status of the file or share. + */ Models::LeaseStatus LeaseStatus; + + /** + * Lease state of the file or share. + */ Models::LeaseState LeaseState; + + /** + * When a file or share is leased, specifies whether the lease is of infinite or fixed + * duration. + */ Models::LeaseDuration LeaseDuration; }; - // A listed Azure Storage share item. + /** + * @brief A listed Azure Storage share item. + */ struct ShareItem { + /** + * The name of the share. + */ std::string Name; + + /** + * The snapshot of the share. + */ std::string Snapshot; + + /** + * If the share is deleted. + */ bool Deleted = bool(); + + /** + * The version string. + */ std::string Version; + + /** + * Details of the share properties. + */ ShareItemDetails Details; - Storage::Metadata ShareMetadata; + + /** + * The metadata of the share. + */ + Storage::Metadata Metadata; }; - // The retention policy. + /** + * @brief The retention policy. + */ struct RetentionPolicy { - bool Enabled - = bool(); // Indicates whether a retention policy is enabled for the File service. If - // false, metrics data is retained, and the user is responsible for deleting it. - Azure::Nullable - Days; // Indicates the number of days that metrics data should be retained. All data older - // than this value will be deleted. Metrics data is deleted on a best-effort basis - // after the retention period expires. + /** + * Indicates whether a retention policy is enabled for the File service. If false, metrics + * data is retained, and the user is responsible for deleting it. + */ + bool Enabled = bool(); + + /** + * Indicates the number of days that metrics data should be retained. All data older than this + * value will be deleted. Metrics data is deleted on a best-effort basis after the retention + * period expires. + */ + Azure::Nullable Days; }; - // Storage Analytics metrics for file service. + /** + * @brief Storage Analytics metrics for file service. + */ struct Metrics { - std::string Version; // The version of Storage Analytics to configure. - bool Enabled = bool(); // Indicates whether metrics are enabled for the File service. - Azure::Nullable IncludeApis; // Indicates whether metrics should generate summary - // statistics for called API operations. + /** + * The version of Storage Analytics to configure. + */ + std::string Version; + + /** + * Indicates whether metrics are enabled for the File service. + */ + bool Enabled = bool(); + + /** + * Indicates whether metrics should generate summary statistics for called API operations. + */ + Azure::Nullable IncludeApis; + + /** + * The retention policy. + */ Models::RetentionPolicy RetentionPolicy; }; - // Settings for SMB multichannel + /** + * @brief Settings for SMB multichannel + */ struct SmbMultichannel { - bool Enabled = bool(); // If SMB multichannel is enabled. + /** + * If SMB multichannel is enabled. + */ + bool Enabled = bool(); }; - // Settings for SMB protocol. + /** + * @brief Settings for SMB protocol. + */ struct SmbSettings { - SmbMultichannel Multichannel; // Settings for SMB Multichannel. + /** + * Settings for SMB Multichannel. + */ + SmbMultichannel Multichannel; }; - // Protocol settings + /** + * @brief Protocol settings + */ struct ProtocolSettings { - SmbSettings Settings; // Settings for SMB protocol. + /** + * Settings for SMB protocol. + */ + SmbSettings Settings; }; - // Signed identifier. + /** + * @brief Signed identifier. + */ struct SignedIdentifier { - std::string Id; // A unique id. - AccessPolicy Policy; // The access policy. + /** + * A unique id. + */ + std::string Id; + + /** + * The access policy. + */ + AccessPolicy Policy; }; - // Storage service properties. + /** + * @brief Storage service properties. + */ struct ShareServiceProperties { - Metrics HourMetrics; // A summary of request statistics grouped by API in hourly aggregates - // for files. - Metrics MinuteMetrics; // A summary of request statistics grouped by API in minute aggregates - // for files. - std::vector Cors; // The set of CORS rules. - Azure::Nullable Protocol; // Protocol settings + /** + * A summary of request statistics grouped by API in hourly aggregates for files. + */ + Metrics HourMetrics; + + /** + * A summary of request statistics grouped by API in minute aggregates for files. + */ + Metrics MinuteMetrics; + + /** + * The set of CORS rules. + */ + std::vector Cors; + + /** + * Protocol settings + */ + Azure::Nullable Protocol; }; - // State of the copy operation identified by 'x-ms-copy-id'. + /** + * @brief State of the copy operation identified by 'x-ms-copy-id'. + */ class CopyStatus { public: CopyStatus() = default; @@ -355,6 +634,797 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum CopyStatus + /** + * @brief The serialized return result for operation: SetServiceProperties + */ + struct SetServicePropertiesResult + { + }; + + /** + * @brief The serialized return result for operation: CreateShare + */ + struct CreateShareResult + { + + /** + * The ETag contains a value which represents the version of the share, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties or metadata updates the last modified time. Operations on files do + * not affect the last modified time of the share. + */ + DateTime LastModified; + + /** + * If the object is created. + */ + bool Created = true; + }; + + /** + * @brief The serialized return result for operation: GetShareProperties + */ + struct ShareProperties + { + + /** + * The metadata of the object. + */ + Storage::Metadata Metadata; + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + + /** + * Returns the current share quota in GB. + */ + int64_t Quota = int64_t(); + + /** + * Returns the current share provisioned ipos. + */ + Azure::Nullable ProvisionedIops; + + /** + * Returns the current share provisioned ingress in megabytes per second. + */ + Azure::Nullable ProvisionedIngressMBps; + + /** + * Returns the current share provisioned egress in megabytes per second. + */ + Azure::Nullable ProvisionedEgressMBps; + + /** + * Returns the current share next allowed quota downgrade time. + */ + Azure::Nullable NextAllowedQuotaDowngradeTime; + + /** + * When a file or share is leased, specifies whether the lease is of infinite or fixed + * duration. + */ + Azure::Nullable LeaseDuration; + + /** + * Lease state of the file or share. + */ + Azure::Nullable LeaseState; + + /** + * The current lease status of the file or share. + */ + Azure::Nullable LeaseStatus; + + /** + * Returns the access tier set on the share. + */ + Azure::Nullable AccessTier; + + /** + * Returns the last modified time (in UTC) of the access tier of the share. + */ + Azure::Nullable AccessTierChangedOn; + + /** + * Returns the transition state betweeen access tiers, when present. + */ + Azure::Nullable AccessTierTransitionState; + }; + + /** + * @brief The serialized return result for operation: DeleteShare + */ + struct DeleteShareResult + { + + /** + * If the object is deleted. + */ + bool Deleted = true; + }; + + /** + * @brief The serialized return result for operation: AcquireLease + */ + struct AcquireLeaseResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + + /** + * Uniquely identifies a share's lease + */ + std::string LeaseId; + }; + + /** + * @brief The serialized return result for operation: ReleaseLease + */ + struct ReleaseLeaseResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: ChangeLease + */ + struct ChangeLeaseResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + + /** + * Uniquely identifies a share's lease + */ + std::string LeaseId; + }; + + /** + * @brief The serialized return result for operation: RenewLease + */ + struct RenewLeaseResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + + /** + * Uniquely identifies a share's lease + */ + std::string LeaseId; + }; + + /** + * @brief The serialized return result for operation: BreakLease + */ + struct BreakLeaseResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: CreateShareSnapshot + */ + struct CreateShareSnapshotResult + { + + /** + * This header is a DateTime value that uniquely identifies the share snapshot. The value of + * this header may be used in subsequent requests to access the share snapshot. This value is + * opaque. + */ + std::string Snapshot; + + /** + * The ETag contains a value which represents the version of the share snapshot, in quotes. A + * share snapshot cannot be modified, so the ETag of a given share snapshot never changes. + * However, if new metadata was supplied with the Snapshot Share request then the ETag of the + * share snapshot differs from that of the base share. If no metadata was specified with the + * request, the ETag of the share snapshot is identical to that of the base share at the time + * the share snapshot was taken. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. A share snapshot cannot be modified, + * so the last modified time of a given share snapshot never changes. However, if new metadata + * was supplied with the Snapshot Share request then the last modified time of the share + * snapshot differs from that of the base share. If no metadata was specified with the + * request, the last modified time of the share snapshot is identical to that of the base + * share at the time the share snapshot was taken. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: CreateSharePermission + */ + struct CreateSharePermissionResult + { + + /** + * Key of the permission set for the directory/file. + */ + std::string FilePermissionKey; + }; + + /** + * @brief The serialized return result for operation: SetShareProperties + */ + struct SetSharePropertiesResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: SetShareMetadata + */ + struct SetShareMetadataResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: GetShareAccessPolicy + */ + struct ShareAccessPolicy + { + std::vector SignedIdentifiers; + }; + + /** + * @brief The serialized return result for operation: SetShareAccessPolicy + */ + struct SetShareAccessPolicyResult + { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: GetShareStatistics + */ + struct ShareStatistics + { + /** + * The approximate size of the data stored in bytes. Note that this value may not include all + * recently created or recently resized files. + */ + int64_t ShareUsageInBytes = int64_t(); + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ + DateTime LastModified; + }; + + /** + * @brief The serialized return result for operation: CreateDirectory + */ + struct CreateDirectoryResult + { + + /** + * The ETag contains a value which represents the version of the directory, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * directory or its properties updates the last modified time. Operations on files do not + * affect the last modified time of the directory. + */ + DateTime LastModified; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ + FileSmbProperties SmbProperties; + + /** + * If the object is created. + */ + bool Created = true; + }; + + /** + * @brief The serialized return result for operation: GetDirectoryProperties + */ + struct DirectoryProperties + { + + /** + * The metadata of the object. + */ + Storage::Metadata Metadata; + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the Directory was last modified. Operations on files within the + * directory do not affect the last modified time of the directory. + */ + DateTime LastModified; + + /** + * The value of this header is set to true if the directory metadata is completely encrypted + * using the specified algorithm. Otherwise, the value is set to false. + */ + bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ + FileSmbProperties SmbProperties; + }; + + /** + * @brief The serialized return result for operation: DeleteDirectory + */ + struct DeleteDirectoryResult + { + + /** + * If the object is deleted. + */ + bool Deleted = true; + }; + + /** + * @brief The serialized return result for operation: SetDirectoryProperties + */ + struct SetDirectoryPropertiesResult + { + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the directory was last modified. Any operation that modifies the + * directory or its properties updates the last modified time. Operations on files do not + * affect the last modified time of the directory. + */ + DateTime LastModified; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ + FileSmbProperties SmbProperties; + }; + + /** + * @brief The serialized return result for operation: SetDirectoryMetadata + */ + struct SetDirectoryMetadataResult + { + + /** + * The ETag contains a value which represents the version of the directory, in quotes. + */ + Azure::ETag ETag; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + }; + + /** + * @brief The serialized return result for operation: CreateFile + */ + struct CreateFileResult + { + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * directory or its properties updates the last modified time. Operations on files do not + * affect the last modified time of the directory. + */ + DateTime LastModified; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ + FileSmbProperties SmbProperties; + + /** + * If the object is created. + */ + bool Created = true; + }; + + /** + * @brief The serialized return result for operation: GetFileProperties + */ + struct FileProperties + { + + /** + * Returns the date and time the file was last modified. The date format follows RFC 1123. Any + * operation that modifies the file or its properties updates the last modified time. + */ + DateTime LastModified; + + /** + * The metadata of the object. + */ + Storage::Metadata Metadata; + + /** + * The size of the file in bytes. This header returns the value of the 'x-ms-content-length' + * header that is stored with the file. + */ + int64_t FileSize = int64_t(); + + /** + * The Http Headers of the object. + */ + FileHttpHeaders HttpHeaders; + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ + Azure::ETag ETag; + + /** + * Conclusion time of the last attempted Copy File operation where this file was the + * destination file. This value can specify the time of a completed, aborted, or failed copy + * attempt. + */ + Azure::Nullable CopyCompletedOn; + + /** + * Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + */ + Azure::Nullable CopyStatusDescription; + + /** + * String identifier for the last attempted Copy File operation where this file was the + * destination file. + */ + Azure::Nullable CopyId; + + /** + * Contains the number of bytes copied and the total bytes in the source in the last attempted + * Copy File operation where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. + */ + Azure::Nullable CopyProgress; + + /** + * URL up to 2KB in length that specifies the source file used in the last attempted Copy File + * operation where this file was the destination file. + */ + Azure::Nullable CopySource; + + /** + * State of the copy operation identified by 'x-ms-copy-id'. + */ + Azure::Nullable CopyStatus; + + /** + * The value of this header is set to true if the file data and application metadata are + * completely encrypted using the specified algorithm. Otherwise, the value is set to false + * (when the file is unencrypted, or if only parts of the file/application metadata are + * encrypted). + */ + bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ + FileSmbProperties SmbProperties; + + /** + * When a file or share is leased, specifies whether the lease is of infinite or fixed + * duration. + */ + Azure::Nullable LeaseDuration; + + /** + * Lease state of the file or share. + */ + Azure::Nullable LeaseState; + + /** + * The current lease status of the file or share. + */ + Azure::Nullable LeaseStatus; + }; + + /** + * @brief The serialized return result for operation: DeleteFile + */ + struct DeleteFileResult + { + + /** + * If the object is deleted. + */ + bool Deleted = true; + }; + + /** + * @brief The serialized return result for operation: SetFileProperties + */ + struct SetFilePropertiesResult + { + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the directory was last modified. Any operation that modifies the + * directory or its properties updates the last modified time. Operations on files do not + * affect the last modified time of the directory. + */ + DateTime LastModified; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ + FileSmbProperties SmbProperties; + }; + + /** + * @brief The serialized return result for operation: SetFileMetadata + */ + struct SetFileMetadataResult + { + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + }; + + /** + * @brief The serialized return result for operation: UploadFileRange + */ + struct UploadFileRangeResult + { + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the directory was last modified. Any operation that modifies the + * share or its properties or metadata updates the last modified time. Operations on files do + * not affect the last modified time of the share. + */ + DateTime LastModified; + + /** + * This header is returned so that the client can check for message content integrity. The + * value of this header is computed by the File service; it is not necessarily the same value + * as may have been specified in the request headers. + */ + Storage::ContentHash TransactionalContentHash; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + }; + + /** + * @brief The serialized return result for operation: UploadFileRangeFromUri + */ + struct UploadFileRangeFromUriResult + { + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * Returns the date and time the directory was last modified. Any operation that modifies the + * share or its properties or metadata updates the last modified time. Operations on files do + * not affect the last modified time of the share. + */ + DateTime LastModified; + + /** + * This header is returned so that the client can check for message content integrity. The + * value of this header is computed by the File service; it is not necessarily the same value + * as may have been specified in the request headers. + */ + Storage::ContentHash TransactionalContentHash; + + /** + * A boolean that indicates if the server is encrypted. + */ + bool IsServerEncrypted = bool(); + }; + + /** + * @brief The serialized return result for operation: GetFileRangeList + */ + struct GetFileRangeListResult + { + /** + * Ranges of the file. + */ + std::vector Ranges; + + /** + * Cleared ranges of the file + */ + std::vector ClearRanges; + + /** + * The date/time that the file was last modified. Any operation that modifies the file, + * including an update of the file's metadata or properties, changes the file's last modified + * time. + */ + DateTime LastModified; + + /** + * The ETag contains a value which represents the version of the file, in quotes. + */ + Azure::ETag ETag; + + /** + * The size of the file in bytes. + */ + int64_t FileSize = int64_t(); + }; + + /** + * @brief The serialized return result for operation: AbortFileCopy + */ + struct AbortFileCopyResult + { + }; + + /** + * @brief Include this parameter to specify one or more datasets to include in the response. + */ enum class ListSharesIncludeFlags { None = 0, @@ -454,7 +1524,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { constexpr static const char* HeaderFilePermission = "x-ms-file-permission"; constexpr static const char* HeaderFilePermissionKey = "x-ms-file-permission-key"; constexpr static const char* HeaderFileRangeWriteFromUrl = "x-ms-write"; - constexpr static const char* HeaderFileRangeWriteFromUrlTypeDefault = "update"; + constexpr static const char* HeaderFileRangeWriteFromUrlDefault = "update"; constexpr static const char* HeaderFileTypeConstant = "x-ms-type"; constexpr static const char* HeaderRangeGetContentMd5 = "x-ms-range-get-content-md5"; constexpr static const char* HeaderHandleId = "x-ms-handle-id"; @@ -518,103 +1588,211 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { constexpr static const char* HeaderCopyProgress = "x-ms-copy-progress"; constexpr static const char* HeaderCopyStatus = "x-ms-copy-status"; constexpr static const char* HeaderXMsRange = "x-ms-range"; - constexpr static const char* HeaderFileRangeWriteType = "x-ms-write"; - constexpr static const char* HeaderFileRangeWriteTypeDefault = "update"; + constexpr static const char* HeaderFileRangeWrite = "x-ms-write"; + constexpr static const char* HeaderFileRangeWriteDefault = "update"; constexpr static const char* HeaderTransactionalContentHashCrc64 = "x-ms-content-crc64"; - // Only update is supported: - Update: Writes the bytes downloaded from the source url into the - // specified range. - class FileRangeWriteFromUrlType { + /** + * @brief Only update is supported: - Update: Writes the bytes downloaded from the source url + * into the specified range. + */ + class FileRangeWriteFromUrl { public: - FileRangeWriteFromUrlType() = default; - explicit FileRangeWriteFromUrlType(std::string value) : m_value(std::move(value)) {} - bool operator==(const FileRangeWriteFromUrlType& other) const - { - return m_value == other.m_value; - } - bool operator!=(const FileRangeWriteFromUrlType& other) const { return !(*this == other); } + FileRangeWriteFromUrl() = default; + explicit FileRangeWriteFromUrl(std::string value) : m_value(std::move(value)) {} + bool operator==(const FileRangeWriteFromUrl& other) const { return m_value == other.m_value; } + bool operator!=(const FileRangeWriteFromUrl& other) const { return !(*this == other); } const std::string& ToString() const { return m_value; } - AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileRangeWriteFromUrlType Update; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileRangeWriteFromUrl Update; private: std::string m_value; - }; // extensible enum FileRangeWriteFromUrlType + }; // extensible enum FileRangeWriteFromUrl - // Abstract for entries that can be listed from Directory. + /** + * @brief Abstract for entries that can be listed from Directory. + */ struct FilesAndDirectoriesListSinglePage { + /** + * An array of the directory items returned. + */ std::vector DirectoryItems; + + /** + * An array of the directory items returned. + */ std::vector FileItems; }; - // An enumeration of directories and files. + /** + * @brief An enumeration of directories and files. + */ struct ListFilesAndDirectoriesSinglePageResponse { + /** + * The service's endpoint. + */ std::string ServiceEndpoint; + + /** + * The name of the share. + */ std::string ShareName; + + /** + * The snapshot of the share. + */ std::string ShareSnapshot; + + /** + * The path of the directory. + */ std::string DirectoryPath; + + /** + * The prefix of the directories and files. + */ std::string Prefix; + + /** + * The maximum number of items to be returned in a single page. + */ int32_t PageSizeHint = int32_t(); + + /** + * A returned page. + */ FilesAndDirectoriesListSinglePage SinglePage; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; }; - // An enumeration of handles. + /** + * @brief An enumeration of handles. + */ struct ListHandlesResponse { + /** + * An array contains all the handles returned. + */ std::vector HandleList; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; }; - // An enumeration of shares. + /** + * @brief An enumeration of shares. + */ struct ListSharesResponse { + /** + * The service's endpoint. + */ std::string ServiceEndpoint; + + /** + * The prefix of the share listed. + */ std::string Prefix; + + /** + * The maximum number of entries returned in a single page. + */ int32_t PageSizeHint = int32_t(); + + /** + * An array of the share items returned in a single page. + */ std::vector Items; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; }; - // An Azure Storage file range. + /** + * @brief An Azure Storage file range. + */ struct FileRange { - int64_t Start = int64_t(); // Start of the range. - int64_t End = int64_t(); // End of the range. + /** + * Start of the range. + */ + int64_t Start = int64_t(); + + /** + * End of the range. + */ + int64_t End = int64_t(); }; - // An Azure Storage file clear range. + /** + * @brief An Azure Storage file clear range. + */ struct ClearRange { - int64_t Start = int64_t(); // Start of the range. - int64_t End = int64_t(); // End of the range. + /** + * Start of the range. + */ + int64_t Start = int64_t(); + + /** + * End of the range. + */ + int64_t End = int64_t(); }; - // The list of file ranges + /** + * @brief The list of file ranges + */ struct RangeList { + /** + * Ranges of the file. + */ std::vector Ranges; + + /** + * Cleared ranges of the file + */ std::vector ClearRanges; }; - // Stats for the share. + /** + * @brief Stats for the share. + */ struct ShareStats { - int64_t ShareUsageInBytes - = int64_t(); // The approximate size of the data stored in bytes. Note that this value may - // not include all recently created or recently resized files. + /** + * The approximate size of the data stored in bytes. Note that this value may not include all + * recently created or recently resized files. + */ + int64_t ShareUsageInBytes = int64_t(); }; - // A permission (a security descriptor) at the share level. + /** + * @brief A permission (a security descriptor) at the share level. + */ struct SharePermission { - std::string - FilePermission; // The permission in the Security Descriptor Definition Language (SDDL). + /** + * The permission in the Security Descriptor Definition Language (SDDL). + */ + std::string FilePermission; }; - // Describes what lease action to take. + /** + * @brief Describes what lease action to take. + */ class LeaseAction { public: LeaseAction() = default; @@ -633,368 +1811,451 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string m_value; }; // extensible enum LeaseAction - // Specify one of the following options: - Update: Writes the bytes specified by the request - // body into the specified range. The Range and Content-Length headers must match to perform the - // update. - Clear: Clears the specified range and releases the space used in storage for that - // range. To clear a range, set the Content-Length header to zero, and set the Range header to a - // value that indicates the range to clear, up to maximum file size. - class FileRangeWriteType { + /** + * @brief Specify one of the following options: - Update: Writes the bytes specified by the + * request body into the specified range. The Range and Content-Length headers must match to + * perform the update. - Clear: Clears the specified range and releases the space used in + * storage for that range. To clear a range, set the Content-Length header to zero, and set the + * Range header to a value that indicates the range to clear, up to maximum file size. + */ + class FileRangeWrite { public: - FileRangeWriteType() = default; - explicit FileRangeWriteType(std::string value) : m_value(std::move(value)) {} - bool operator==(const FileRangeWriteType& other) const { return m_value == other.m_value; } - bool operator!=(const FileRangeWriteType& other) const { return !(*this == other); } + FileRangeWrite() = default; + explicit FileRangeWrite(std::string value) : m_value(std::move(value)) {} + bool operator==(const FileRangeWrite& other) const { return m_value == other.m_value; } + bool operator!=(const FileRangeWrite& other) const { return !(*this == other); } const std::string& ToString() const { return m_value; } - AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileRangeWriteType Update; - AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileRangeWriteType Clear; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileRangeWrite Update; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileRangeWrite Clear; private: std::string m_value; - }; // extensible enum FileRangeWriteType - - struct ServiceSetPropertiesResult - { - }; + }; // extensible enum FileRangeWrite struct ServiceGetPropertiesResult { + /** + * A summary of request statistics grouped by API in hourly aggregates for files. + */ Metrics HourMetrics; + + /** + * A summary of request statistics grouped by API in minute aggregates for files. + */ Metrics MinuteMetrics; + + /** + * The set of CORS rules. + */ std::vector Cors; + + /** + * Protocol settings + */ Azure::Nullable Protocol; }; struct ServiceListSharesSinglePageResult { + /** + * The service's endpoint. + */ std::string ServiceEndpoint; + + /** + * The prefix of the share listed. + */ std::string Prefix; + + /** + * The maximum number of entries returned in a single page. + */ int32_t PageSizeHint = int32_t(); + + /** + * An array of the share items returned in a single page. + */ std::vector Items; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; }; - struct ShareCreateResult - { - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareGetPropertiesResult - { - Storage::Metadata Metadata; - Azure::ETag ETag; - DateTime LastModified; - int64_t Quota = int64_t(); - Azure::Nullable ProvisionedIops; - Azure::Nullable ProvisionedIngressMBps; - Azure::Nullable ProvisionedEgressMBps; - Azure::Nullable NextAllowedQuotaDowngradeTime; - Azure::Nullable LeaseDuration; - Azure::Nullable LeaseState; - Azure::Nullable LeaseStatus; - Azure::Nullable AccessTier; - Azure::Nullable AccessTierChangedOn; - Azure::Nullable AccessTierTransitionState; - }; - - struct ShareDeleteResult - { - }; - - struct ShareAcquireLeaseResult - { - Azure::ETag ETag; - DateTime LastModified; - std::string LeaseId; - }; - - struct ShareReleaseLeaseResult - { - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareChangeLeaseResult - { - Azure::ETag ETag; - DateTime LastModified; - std::string LeaseId; - }; - - struct ShareRenewLeaseResult - { - Azure::ETag ETag; - DateTime LastModified; - std::string LeaseId; - }; - - struct ShareBreakLeaseResult - { - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareCreateSnapshotResult - { - std::string Snapshot; - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareCreatePermissionResult - { - std::string FilePermissionKey; - }; - struct ShareGetPermissionResult { + /** + * The permission in the Security Descriptor Definition Language (SDDL). + */ std::string FilePermission; }; - struct ShareSetPropertiesResult - { - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareSetMetadataResult - { - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareGetAccessPolicyResult - { - std::vector SignedIdentifiers; - }; - - struct ShareSetAccessPolicyResult - { - Azure::ETag ETag; - DateTime LastModified; - }; - - struct ShareGetStatisticsResult - { - int64_t ShareUsageInBytes = int64_t(); - Azure::ETag ETag; - DateTime LastModified; - }; - struct ShareRestoreResult { + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ Azure::ETag ETag; + + /** + * Returns the date and time the share was last modified. Any operation that modifies the + * share or its properties updates the last modified time. Operations on files do not affect + * the last modified time of the share. + */ DateTime LastModified; }; - struct DirectoryCreateResult - { - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - }; - - struct DirectoryGetPropertiesResult - { - Storage::Metadata Metadata; - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - }; - - struct DirectoryDeleteResult - { - }; - - struct DirectorySetPropertiesResult - { - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - }; - - struct DirectorySetMetadataResult - { - Azure::ETag ETag; - bool IsServerEncrypted = bool(); - }; - struct DirectoryListFilesAndDirectoriesSinglePageResult { + /** + * The service's endpoint. + */ std::string ServiceEndpoint; + + /** + * The name of the share. + */ std::string ShareName; + + /** + * The snapshot of the share. + */ std::string ShareSnapshot; + + /** + * The path of the directory. + */ std::string DirectoryPath; + + /** + * The prefix of the directories and files. + */ std::string Prefix; + + /** + * The maximum number of items to be returned in a single page. + */ int32_t PageSizeHint = int32_t(); + + /** + * A returned page. + */ FilesAndDirectoriesListSinglePage SinglePage; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; + + /** + * The Http Headers of the object. + */ FileHttpHeaders HttpHeaders; }; struct DirectoryListHandlesResult { + /** + * An array contains all the handles returned. + */ std::vector HandleList; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; + + /** + * The Http Headers of the object. + */ FileHttpHeaders HttpHeaders; }; struct DirectoryForceCloseHandlesResult { - Azure::Nullable ContinuationToken; - int32_t NumberOfHandlesClosed = int32_t(); - int32_t NumberOfHandlesFailedToClose = int32_t(); - }; - struct FileCreateResult - { - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; + /** + * A string describing next handle to be closed. It is returned when more handles need to be + * closed to complete the request. + */ + Azure::Nullable ContinuationToken; + + /** + * Contains count of number of handles closed. + */ + int32_t NumberOfHandlesClosed = int32_t(); + + /** + * Contains count of number of handles that failed to close. + */ + int32_t NumberOfHandlesFailedToClose = int32_t(); }; struct FileDownloadResult { std::unique_ptr BodyStream; + + /** + * Returns the date and time the file was last modified. Any operation that modifies the file + * or its properties updates the last modified time. + */ DateTime LastModified; + + /** + * The metadata of the object. + */ Storage::Metadata Metadata; + + /** + * The Http Headers of the object. + */ FileHttpHeaders HttpHeaders; + + /** + * A HttpRange type indicates the range of the content. + */ Azure::Core::Http::HttpRange ContentRange; + + /** + * The size of the file. + */ int64_t FileSize = int64_t(); + + /** + * The ETag contains a value that you can use to perform operations conditionally, in quotes. + */ Azure::ETag ETag; + + /** + * If the file has an MD5 hash and the request is to read the full file, this response header + * is returned so that the client can check for message content integrity. If the request is + * to read a specified range and the 'x-ms-range-get-content-md5' is set to true, then the + * request returns an MD5 hash for the range, as long as the range size is less than or equal + * to 4 MB. If neither of these sets of conditions is true, then no value is returned for the + * 'Content-MD5' header. + */ Azure::Nullable TransactionalContentHash; + + /** + * Indicates that the service supports requests for partial file content. + */ std::string AcceptRanges; + + /** + * Conclusion time of the last attempted Copy File operation where this file was the + * destination file. This value can specify the time of a completed, aborted, or failed copy + * attempt. + */ Azure::Nullable CopyCompletedOn; + + /** + * Only appears when x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + */ Azure::Nullable CopyStatusDescription; + + /** + * String identifier for the last attempted Copy File operation where this file was the + * destination file. + */ Azure::Nullable CopyId; + + /** + * Contains the number of bytes copied and the total bytes in the source in the last attempted + * Copy File operation where this file was the destination file. Can show between 0 and + * Content-Length bytes copied. + */ Azure::Nullable CopyProgress; + + /** + * URL up to 2KB in length that specifies the source file used in the last attempted Copy File + * operation where this file was the destination file. + */ Azure::Nullable CopySource; + + /** + * State of the copy operation identified by 'x-ms-copy-id'. + */ Azure::Nullable CopyStatus; + + /** + * The value of this header is set to true if the file data and application metadata are + * completely encrypted using the specified algorithm. Otherwise, the value is set to false + * (when the file is unencrypted, or if only parts of the file/application metadata are + * encrypted). + */ bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ FileSmbProperties SmbProperties; + + /** + * When a file or share is leased, specifies whether the lease is of infinite or fixed + * duration. + */ Azure::Nullable LeaseDuration; + + /** + * Lease state of the file or share. + */ Azure::Nullable LeaseState; + + /** + * The current lease status of the file or share. + */ Azure::Nullable LeaseStatus; }; - struct FileGetPropertiesResult - { - DateTime LastModified; - Storage::Metadata Metadata; - int64_t FileSize = int64_t(); - FileHttpHeaders HttpHeaders; - Azure::ETag ETag; - Azure::Nullable CopyCompletedOn; - Azure::Nullable CopyStatusDescription; - Azure::Nullable CopyId; - Azure::Nullable CopyProgress; - Azure::Nullable CopySource; - Azure::Nullable CopyStatus; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - Azure::Nullable LeaseDuration; - Azure::Nullable LeaseState; - Azure::Nullable LeaseStatus; - }; - - struct FileDeleteResult - { - }; - - struct FileSetHttpHeadersResult - { - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - }; - - struct FileSetMetadataResult - { - Azure::ETag ETag; - bool IsServerEncrypted = bool(); - }; - struct FileAcquireLeaseResult { + + /** + * The ETag contains a value that you can use to perform operations conditionally. If the + * request version is 2011-08-18 or newer, the ETag value will be in quotes. + */ Azure::ETag ETag; + + /** + * Returns the date and time the file was last modified. Any operation that modifies the file, + * including an update of the file's metadata or properties, changes the last-modified time of + * the file. + */ DateTime LastModified; + + /** + * Uniquely identifies a file's lease + */ std::string LeaseId; }; struct FileReleaseLeaseResult { + + /** + * The ETag contains a value that you can use to perform operations conditionally. If the + * request version is 2011-08-18 or newer, the ETag value will be in quotes. + */ Azure::ETag ETag; + + /** + * Returns the date and time the file was last modified. Any operation that modifies the file, + * including an update of the file's metadata or properties, changes the last-modified time of + * the file. + */ DateTime LastModified; }; struct FileChangeLeaseResult { + + /** + * The ETag contains a value that you can use to perform operations conditionally. If the + * request version is 2011-08-18 or newer, the ETag value will be in quotes. + */ Azure::ETag ETag; + + /** + * Returns the date and time the file was last modified. Any operation that modifies the file, + * including an update of the file's metadata or properties, changes the last-modified time of + * the file. + */ DateTime LastModified; + + /** + * Uniquely identifies a file's lease + */ std::string LeaseId; }; struct FileBreakLeaseResult { + + /** + * The ETag contains a value that you can use to perform operations conditionally. If the + * request version is 2011-08-18 or newer, the ETag value will be in quotes. + */ Azure::ETag ETag; + + /** + * Returns the date and time the file was last modified. Any operation that modifies the file, + * including an update of the file's metadata or properties, changes the last-modified time of + * the file. + */ DateTime LastModified; + + /** + * Uniquely identifies a file's lease + */ Azure::Nullable LeaseId; }; - struct FileUploadRangeResult - { - Azure::ETag ETag; - DateTime LastModified; - Storage::ContentHash TransactionalContentHash; - bool IsServerEncrypted = bool(); - }; - - struct FileUploadRangeFromUrlResult - { - Azure::ETag ETag; - DateTime LastModified; - Storage::ContentHash TransactionalContentHash; - bool IsServerEncrypted = bool(); - }; - - struct FileGetRangeListResult - { - std::vector Ranges; - std::vector ClearRanges; - DateTime LastModified; - Azure::ETag ETag; - int64_t FileSize = int64_t(); - }; - struct FileStartCopyResult { - Azure::ETag ETag; - DateTime LastModified; - std::string CopyId; - Models::CopyStatus CopyStatus; - }; - struct FileAbortCopyResult - { + /** + * If the copy is completed, contains the ETag of the destination file. If the copy is not + * complete, contains the ETag of the empty file created at the start of the copy. + */ + Azure::ETag ETag; + + /** + * Returns the date/time that the copy operation to the destination file completed. + */ + DateTime LastModified; + + /** + * String identifier for this copy operation. Use with Get File or Get File Properties to + * check the status of this copy operation, or pass to Abort Copy File to abort a pending + * copy. + */ + std::string CopyId; + + /** + * State of the copy operation identified by x-ms-copy-id. + */ + Models::CopyStatus CopyStatus; }; struct FileListHandlesResult { + /** + * An array contains all the handles returned. + */ std::vector HandleList; + + /** + * A continuation token used for further enumerations. + */ Azure::Nullable ContinuationToken; + + /** + * The Http Headers of the object. + */ FileHttpHeaders HttpHeaders; }; struct FileForceCloseHandlesResult { + + /** + * A string describing next handle to be closed. It is returned when more handles need to be + * closed to complete the request. + */ Azure::Nullable ContinuationToken; + + /** + * Contains count of number of handles closed. + */ int32_t NumberOfHandlesClosed = int32_t(); + + /** + * Contains count of number of handles that failed to close. + */ int32_t NumberOfHandlesFailedToClose = int32_t(); }; @@ -1061,7 +2322,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response SetProperties( + static Azure::Response SetProperties( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -1176,7 +2437,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } private: - static Azure::Response SetPropertiesParseResult( + static Azure::Response SetPropertiesParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -1184,8 +2445,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted) { // Success (Accepted) - ServiceSetPropertiesResult result; - return Azure::Response( + Models::SetServicePropertiesResult result; + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -2306,7 +3567,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } else if (path.size() == 1 && path[0] == XmlTagName::Metadata) { - result.ShareMetadata = MetadataFromXml(reader); + result.Metadata = MetadataFromXml(reader); path.pop_back(); } } @@ -2461,7 +3722,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response Create( + static Azure::Response Create( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2502,7 +3763,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response GetProperties( + static Azure::Response GetProperties( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2540,7 +3801,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response Delete( + static Azure::Response Delete( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2583,7 +3844,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable ShareSnapshot; }; - static Azure::Response AcquireLease( + static Azure::Response AcquireLease( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2627,7 +3888,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable ShareSnapshot; }; - static Azure::Response ReleaseLease( + static Azure::Response ReleaseLease( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2665,7 +3926,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable ShareSnapshot; }; - static Azure::Response ChangeLease( + static Azure::Response ChangeLease( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2707,7 +3968,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable ShareSnapshot; }; - static Azure::Response RenewLease( + static Azure::Response RenewLease( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2745,7 +4006,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable ShareSnapshot; }; - static Azure::Response BreakLease( + static Azure::Response BreakLease( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2790,7 +4051,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response CreateSnapshot( + static Azure::Response CreateSnapshot( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2822,7 +4083,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { SharePermission Permission; }; - static Azure::Response CreatePermission( + static Azure::Response CreatePermission( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2890,7 +4151,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response SetProperties( + static Azure::Response SetProperties( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2933,7 +4194,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response SetMetadata( + static Azure::Response SetMetadata( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -2969,7 +4230,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response GetAccessPolicy( + static Azure::Response GetAccessPolicy( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -3002,7 +4263,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response SetAccessPolicy( + static Azure::Response SetAccessPolicy( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -3045,7 +4306,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response GetStatistics( + static Azure::Response GetStatistics( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -3108,7 +4369,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } private: - static Azure::Response CreateParseResult( + static Azure::Response CreateParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3116,12 +4377,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success, Share created. - ShareCreateResult result; + Models::CreateShareResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response(std::move(result), std::move(responsePtr)); + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { @@ -3130,7 +4392,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response GetPropertiesParseResult( + static Azure::Response GetPropertiesParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3138,7 +4400,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success - ShareGetPropertiesResult result; + Models::ShareProperties result; for (auto i = response.GetHeaders().lower_bound(_detail::HeaderMetadata); i != response.GetHeaders().end() @@ -3211,7 +4473,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.AccessTierTransitionState = response.GetHeaders().at(_detail::HeaderAccessTierTransitionState); } - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3221,7 +4483,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response DeleteParseResult( + static Azure::Response DeleteParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3229,8 +4491,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted) { // Accepted - ShareDeleteResult result; - return Azure::Response(std::move(result), std::move(responsePtr)); + Models::DeleteShareResult result; + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { @@ -3239,7 +4502,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response AcquireLeaseParseResult( + static Azure::Response AcquireLeaseParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3247,13 +4510,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // The Acquire operation completed successfully. - ShareAcquireLeaseResult result; + Models::AcquireLeaseResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3263,7 +4526,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response ReleaseLeaseParseResult( + static Azure::Response ReleaseLeaseParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3271,12 +4534,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // The Release operation completed successfully. - ShareReleaseLeaseResult result; + Models::ReleaseLeaseResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3286,7 +4549,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response ChangeLeaseParseResult( + static Azure::Response ChangeLeaseParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3294,13 +4557,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // The Change operation completed successfully. - ShareChangeLeaseResult result; + Models::ChangeLeaseResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3310,7 +4573,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response RenewLeaseParseResult( + static Azure::Response RenewLeaseParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3318,13 +4581,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // The Renew operation completed successfully. - ShareRenewLeaseResult result; + Models::RenewLeaseResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); result.LeaseId = response.GetHeaders().at(_detail::HeaderLeaseId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3334,7 +4597,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response BreakLeaseParseResult( + static Azure::Response BreakLeaseParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3342,12 +4605,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted) { // The Break operation completed successfully. - ShareBreakLeaseResult result; + Models::BreakLeaseResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3357,7 +4620,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response CreateSnapshotParseResult( + static Azure::Response CreateSnapshotParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3365,13 +4628,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success, Share snapshot created. - ShareCreateSnapshotResult result; + Models::CreateShareSnapshotResult result; result.Snapshot = response.GetHeaders().at(_detail::HeaderSnapshot); result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3381,7 +4644,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response CreatePermissionParseResult( + static Azure::Response CreatePermissionParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3389,9 +4652,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success, Share level permission created. - ShareCreatePermissionResult result; + Models::CreateSharePermissionResult result; result.FilePermissionKey = response.GetHeaders().at(_detail::HeaderFilePermissionKey); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3447,7 +4710,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static Azure::Response SetPropertiesParseResult( + static Azure::Response SetPropertiesParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3455,12 +4718,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success - ShareSetPropertiesResult result; + Models::SetSharePropertiesResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3470,7 +4733,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response SetMetadataParseResult( + static Azure::Response SetMetadataParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3478,12 +4741,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success - ShareSetMetadataResult result; + Models::SetShareMetadataResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3493,7 +4756,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response GetAccessPolicyParseResult( + static Azure::Response GetAccessPolicyParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3504,10 +4767,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const auto& bodyBuffer = response.GetBody(); auto reader = _internal::XmlReader( reinterpret_cast(bodyBuffer.data()), bodyBuffer.size()); - ShareGetAccessPolicyResult result = bodyBuffer.empty() - ? ShareGetAccessPolicyResult() - : ShareGetAccessPolicyResultFromSignedIdentifiers(SignedIdentifiersFromXml(reader)); - return Azure::Response( + Models::ShareAccessPolicy result = bodyBuffer.empty() + ? Models::ShareAccessPolicy() + : ShareAccessPolicyFromSignedIdentifiers(SignedIdentifiersFromXml(reader)); + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3707,15 +4970,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static ShareGetAccessPolicyResult ShareGetAccessPolicyResultFromSignedIdentifiers( + static Models::ShareAccessPolicy ShareAccessPolicyFromSignedIdentifiers( std::vector object) { - ShareGetAccessPolicyResult result; + Models::ShareAccessPolicy result; result.SignedIdentifiers = std::move(object); return result; } - static Azure::Response SetAccessPolicyParseResult( + static Azure::Response SetAccessPolicyParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3723,12 +4986,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success. - ShareSetAccessPolicyResult result; + Models::SetShareAccessPolicyResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3789,7 +5052,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } writer.Write(_internal::XmlNode{_internal::XmlNodeType::EndTag}); } - static Azure::Response GetStatisticsParseResult( + static Azure::Response GetStatisticsParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -3800,14 +5063,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const auto& bodyBuffer = response.GetBody(); auto reader = _internal::XmlReader( reinterpret_cast(bodyBuffer.data()), bodyBuffer.size()); - ShareGetStatisticsResult result = bodyBuffer.empty() - ? ShareGetStatisticsResult() - : ShareGetStatisticsResultFromShareStats(ShareStatsFromXml(reader)); + Models::ShareStatistics result = bodyBuffer.empty() + ? Models::ShareStatistics() + : ShareStatisticsFromShareStats(ShareStatsFromXml(reader)); result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -3874,9 +5137,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static ShareGetStatisticsResult ShareGetStatisticsResultFromShareStats(ShareStats object) + static Models::ShareStatistics ShareStatisticsFromShareStats(ShareStats object) { - ShareGetStatisticsResult result; + Models::ShareStatistics result; result.ShareUsageInBytes = object.ShareUsageInBytes; return result; @@ -3918,7 +5181,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string FileLastWriteTime; }; - static Azure::Response Create( + static Azure::Response Create( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -3960,7 +5223,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response GetProperties( + static Azure::Response GetProperties( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -3991,7 +5254,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response Delete( + static Azure::Response Delete( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -4020,7 +5283,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string FileLastWriteTime; }; - static Azure::Response SetProperties( + static Azure::Response SetProperties( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -4062,7 +5325,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; }; - static Azure::Response SetMetadata( + static Azure::Response SetMetadata( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -4254,7 +5517,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } private: - static Azure::Response CreateParseResult( + static Azure::Response CreateParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -4262,7 +5525,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success, Directory created. - DirectoryCreateResult result; + Models::CreateDirectoryResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), @@ -4283,7 +5546,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId); result.SmbProperties.ParentFileId = response.GetHeaders().at(_detail::HeaderParentFileId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -4293,7 +5556,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response GetPropertiesParseResult( + static Azure::Response GetPropertiesParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -4301,7 +5564,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success. - DirectoryGetPropertiesResult result; + Models::DirectoryProperties result; for (auto i = response.GetHeaders().lower_bound(_detail::HeaderMetadata); i != response.GetHeaders().end() @@ -4330,7 +5593,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId); result.SmbProperties.ParentFileId = response.GetHeaders().at(_detail::HeaderParentFileId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -4340,7 +5603,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response DeleteParseResult( + static Azure::Response DeleteParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -4348,8 +5611,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted) { // Success (Accepted). - DirectoryDeleteResult result; - return Azure::Response( + Models::DeleteDirectoryResult result; + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -4359,7 +5622,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response SetPropertiesParseResult( + static Azure::Response SetPropertiesParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -4367,7 +5630,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success - DirectorySetPropertiesResult result; + Models::SetDirectoryPropertiesResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), @@ -4388,7 +5651,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId); result.SmbProperties.ParentFileId = response.GetHeaders().at(_detail::HeaderParentFileId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -4398,7 +5661,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response SetMetadataParseResult( + static Azure::Response SetMetadataParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -4406,11 +5669,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success (OK). - DirectorySetMetadataResult result; + Models::SetDirectoryMetadataResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.IsServerEncrypted = response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true"; - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -5082,7 +6345,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response Create( + static Azure::Response Create( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5204,7 +6467,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response GetProperties( + static Azure::Response GetProperties( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5239,7 +6502,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response Delete( + static Azure::Response Delete( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5279,7 +6542,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response SetHttpHeaders( + static Azure::Response SetHttpHeaders( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5366,7 +6629,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response SetMetadata( + static Azure::Response SetMetadata( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5531,14 +6794,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { Azure::Nullable Timeout; std::string XMsRange; - FileRangeWriteType XMsWrite; + FileRangeWrite XMsWrite; int64_t ContentLength = int64_t(); Azure::Nullable ContentMd5; std::string ApiVersionParameter = _detail::DefaultServiceApiVersion; Azure::Nullable LeaseIdOptional; }; - static Azure::Response UploadRange( + static Azure::Response UploadRange( const Azure::Core::Url& url, Azure::Core::IO::BodyStream& bodyStream, Azure::Core::Http::_internal::HttpPipeline& pipeline, @@ -5555,8 +6818,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::to_string(uploadRangeOptions.Timeout.Value()))); } request.SetHeader(_detail::HeaderXMsRange, uploadRangeOptions.XMsRange); - request.SetHeader( - _detail::HeaderFileRangeWriteType, uploadRangeOptions.XMsWrite.ToString()); + request.SetHeader(_detail::HeaderFileRangeWrite, uploadRangeOptions.XMsWrite.ToString()); request.SetHeader( _detail::HeaderContentLength, std::to_string(uploadRangeOptions.ContentLength)); if (uploadRangeOptions.ContentMd5.HasValue()) @@ -5579,7 +6841,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string TargetRange; std::string CopySource; Azure::Nullable SourceRange; - FileRangeWriteFromUrlType XMsWrite; + FileRangeWriteFromUrl XMsWrite; int64_t ContentLength = int64_t(); Azure::Nullable SourceContentCrc64; Azure::Nullable SourceIfMatchCrc64; @@ -5588,7 +6850,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response UploadRangeFromUrl( + static Azure::Response UploadRangeFromUrl( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5654,7 +6916,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response GetRangeList( + static Azure::Response GetRangeList( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5790,7 +7052,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Azure::Nullable LeaseIdOptional; }; - static Azure::Response AbortCopy( + static Azure::Response AbortCopy( const Azure::Core::Url& url, Azure::Core::Http::_internal::HttpPipeline& pipeline, Azure::Core::Context context, @@ -5908,7 +7170,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } private: - static Azure::Response CreateParseResult( + static Azure::Response CreateParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -5916,7 +7178,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success, File created. - FileCreateResult result; + Models::CreateFileResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), @@ -5937,7 +7199,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId); result.SmbProperties.ParentFileId = response.GetHeaders().at(_detail::HeaderParentFileId); - return Azure::Response(std::move(result), std::move(responsePtr)); + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { @@ -6272,7 +7535,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response GetPropertiesParseResult( + static Azure::Response GetPropertiesParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6280,7 +7543,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success. - FileGetPropertiesResult result; + Models::FileProperties result; result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); @@ -6399,7 +7662,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.LeaseStatus = LeaseStatus(response.GetHeaders().at(_detail::HeaderLeaseStatus)); } - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -6409,7 +7672,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response DeleteParseResult( + static Azure::Response DeleteParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6417,8 +7680,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted) { // Success (Accepted). - FileDeleteResult result; - return Azure::Response(std::move(result), std::move(responsePtr)); + Models::DeleteFileResult result; + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { @@ -6427,7 +7691,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response SetHttpHeadersParseResult( + static Azure::Response SetHttpHeadersParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6435,7 +7699,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success - FileSetHttpHeadersResult result; + Models::SetFilePropertiesResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), @@ -6456,7 +7720,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.SmbProperties.FileId = response.GetHeaders().at(_detail::HeaderFileId); result.SmbProperties.ParentFileId = response.GetHeaders().at(_detail::HeaderParentFileId); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -6466,7 +7730,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response SetMetadataParseResult( + static Azure::Response SetMetadataParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6474,11 +7738,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok) { // Success (OK). - FileSetMetadataResult result; + Models::SetFileMetadataResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.IsServerEncrypted = response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true"; - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -6585,7 +7849,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response UploadRangeParseResult( + static Azure::Response UploadRangeParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6593,7 +7857,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success (Created). - FileUploadRangeResult result; + Models::UploadFileRangeResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), @@ -6611,7 +7875,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { result.IsServerEncrypted = response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true"; } - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -6621,7 +7885,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response UploadRangeFromUrlParseResult( + static Azure::Response UploadRangeFromUrlParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6629,7 +7893,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created) { // Success (Created). - FileUploadRangeFromUrlResult result; + Models::UploadFileRangeFromUriResult result; result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), @@ -6639,7 +7903,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { HashAlgorithm::Crc64); result.IsServerEncrypted = response.GetHeaders().at(_detail::HeaderRequestIsServerEncrypted) == "true"; - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -6649,7 +7913,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response GetRangeListParseResult( + static Azure::Response GetRangeListParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6660,15 +7924,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const auto& bodyBuffer = response.GetBody(); auto reader = _internal::XmlReader( reinterpret_cast(bodyBuffer.data()), bodyBuffer.size()); - FileGetRangeListResult result = bodyBuffer.empty() - ? FileGetRangeListResult() - : FileGetRangeListResultFromRangeList(RangeListFromXml(reader)); + Models::GetFileRangeListResult result = bodyBuffer.empty() + ? Models::GetFileRangeListResult() + : GetFileRangeListResultFromRangeList(RangeListFromXml(reader)); result.LastModified = DateTime::Parse( response.GetHeaders().at(_detail::HeaderLastModified), DateTime::DateFormat::Rfc1123); result.ETag = Azure::ETag(response.GetHeaders().at(_detail::HeaderETag)); result.FileSize = std::stoll(response.GetHeaders().at(_detail::HeaderXMsContentLength)); - return Azure::Response( + return Azure::Response( std::move(result), std::move(responsePtr)); } else @@ -6747,9 +8011,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { return result; } - static FileGetRangeListResult FileGetRangeListResultFromRangeList(RangeList object) + static Models::GetFileRangeListResult GetFileRangeListResultFromRangeList(RangeList object) { - FileGetRangeListResult result; + Models::GetFileRangeListResult result; result.Ranges = std::move(object.Ranges); result.ClearRanges = std::move(object.ClearRanges); @@ -6786,7 +8050,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } } - static Azure::Response AbortCopyParseResult( + static Azure::Response AbortCopyParseResult( Azure::Core::Context context, std::unique_ptr responsePtr) { @@ -6794,8 +8058,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::NoContent) { // The delete request was accepted and the file will be deleted. - FileAbortCopyResult result; - return Azure::Response(std::move(result), std::move(responsePtr)); + Models::AbortFileCopyResult result; + return Azure::Response( + std::move(result), std::move(responsePtr)); } else { 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 671aab7c4..0f695e6f8 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 @@ -18,133 +18,187 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models { - // ServiceClient models: - - using SetServicePropertiesResult = _detail::ServiceSetPropertiesResult; - - // ShareClient models: - struct CreateShareResult - { - bool Created = true; - Azure::ETag ETag; - DateTime LastModified; - }; - - struct DeleteShareResult - { - bool Deleted = true; - }; - using CreateShareSnapshotResult = _detail::ShareCreateSnapshotResult; - using ShareProperties = _detail::ShareGetPropertiesResult; - using SetSharePropertiesResult = _detail::ShareSetPropertiesResult; - using SetShareMetadataResult = _detail::ShareSetMetadataResult; - using ShareAccessPolicy = _detail::ShareGetAccessPolicyResult; - using SetShareAccessPolicyResult = _detail::ShareSetAccessPolicyResult; - using ShareStatistics = _detail::ShareGetStatisticsResult; - using CreateSharePermissionResult = _detail::ShareCreatePermissionResult; - using AcquireLeaseResult = _detail::ShareAcquireLeaseResult; - using RenewLeaseResult = _detail::ShareRenewLeaseResult; - using ReleaseLeaseResult = _detail::ShareReleaseLeaseResult; - using BreakLeaseResult = _detail::ShareBreakLeaseResult; - using ChangeLeaseResult = _detail::ShareChangeLeaseResult; - - // DirectoryClient models: - - struct CreateDirectoryResult - { - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - std::string ParentFileId; - bool Created = false; - }; - - struct DeleteDirectoryResult - { - bool Deleted = true; - }; - - using DirectoryProperties = _detail::DirectoryGetPropertiesResult; - using SetDirectoryPropertiesResult = _detail::DirectorySetPropertiesResult; - using SetDirectoryMetadataResult = _detail::DirectorySetMetadataResult; - + /** + * @brief The information returned when forcing the directory handles to close. + */ struct ForceCloseDirectoryHandleResult { }; - // FileClient models: - struct CreateFileResult - { - bool Created = true; - Azure::ETag ETag; - DateTime LastModified; - bool IsServerEncrypted = bool(); - FileSmbProperties SmbProperties; - }; - - struct DeleteFileResult - { - bool Deleted = true; - }; - + /** + * @brief The detailed information returned when downloading a file. + */ struct DownloadFileDetails { - DateTime LastModified; - Storage::Metadata Metadata; + /** + * An HTTP entity tag associated with the file. + */ Azure::ETag ETag; + + /** + * The data and time the file was last modified. + */ + DateTime LastModified; + + /** + * The metadata of the file. + */ + Storage::Metadata Metadata; + + /** + * The copy completed time of the file, if the file is created from a copy operation. + */ Nullable CopyCompletedOn; + + /** + * The copy status's description of the file, if the file is created from a copy operation. + */ Nullable CopyStatusDescription; + + /** + * The copy ID of the file, if the file is created from a copy operation. + */ Nullable CopyId; + + /** + * The copy progress of the file, if the file is created from a copy operation. + */ Nullable CopyProgress; + + /** + * The copy source of the file, if the file is created from a copy operation. + */ Nullable CopySource; + + /** + * The copy status of the file, if the file is created from a copy operation. + */ Nullable CopyStatus; + + /** + * A boolean indicates if the service is encrypted. + */ bool IsServerEncrypted = bool(); + + /** + * The SMB related properties of the file or directory. + */ FileSmbProperties SmbProperties; + + /** + * When a file is leased, specifies whether the lease is of infinite or fixed duration. + */ Nullable LeaseDuration; + + /** + * Lease state of the file. + */ Nullable LeaseState; + + /** + * The current lease status of the file. + */ Nullable LeaseStatus; }; + /** + * @brief The content and information returned when downloading a file. + */ struct DownloadFileResult { + /** + * The body of the downloaded result. + */ std::unique_ptr BodyStream; + + /** + * The range of the downloaded content. + */ Azure::Core::Http::HttpRange ContentRange; + + /** + * The size of the file. + */ int64_t FileSize = 0; + + /** + * The transactional hash of the downloaded content. + */ Nullable TransactionalContentHash; + + /** + * The common Http headers of the file. + */ FileHttpHeaders HttpHeaders; + + /** + * The detailed information of the downloaded file. + */ DownloadFileDetails Details; }; - using AbortFileCopyResult = _detail::FileAbortCopyResult; - using FileProperties = _detail::FileGetPropertiesResult; - using SetFilePropertiesResult = _detail::FileSetHttpHeadersResult; - using ResizeFileResult = _detail::FileSetHttpHeadersResult; - using SetFileMetadataResult = _detail::FileSetMetadataResult; - using UploadFileRangeResult = _detail::FileUploadRangeResult; + /** + * @brief The information returned when clearing a range in the file. + */ struct ClearFileRangeResult { + /** + * An HTTP entity tag associated with the file. + */ Azure::ETag ETag; + + /** + * The data and time the file was last modified. + */ DateTime LastModified; + + /** + * A boolean indicates if the service is encrypted. + */ bool IsServerEncrypted = bool(); }; - using UploadFileRangeFromUriResult = _detail::FileUploadRangeFromUrlResult; - using GetFileRangeListResult = _detail::FileGetRangeListResult; + /** + * @brief The information returned when downloading a file to a destination. + */ struct DownloadFileToResult { + /** + * The size of the file. + */ int64_t FileSize = 0; + + /** + * The range of the downloaded content. + */ Azure::Core::Http::HttpRange ContentRange; + + /** + * The common Http headers of the file. + */ FileHttpHeaders HttpHeaders; + + /** + * The detailed information of the downloaded file. + */ DownloadFileDetails Details; }; + /** + * @brief The information returned when forcing a file handle to close. + */ struct ForceCloseFileHandleResult { }; + /** + * @brief The information returned when uploading a file from a source. + */ struct UploadFileFromResult { + /** + * A boolean indicates if the service is encrypted. + */ bool IsServerEncrypted = false; }; 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 07f6996a9..7d995e4de 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 @@ -486,7 +486,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Azure::Core::Context& context) const { auto protocolLayerOptions = _detail::ShareRestClient::File::UploadRangeOptions(); - protocolLayerOptions.XMsWrite = _detail::FileRangeWriteType::Update; + protocolLayerOptions.XMsWrite = _detail::FileRangeWrite::Update; protocolLayerOptions.ContentLength = content.Length(); protocolLayerOptions.XMsRange = std::string("bytes=") + std::to_string(offset) + std::string("-") + std::to_string(offset + content.Length() - 1); @@ -508,7 +508,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Azure::Core::Context& context) const { auto protocolLayerOptions = _detail::ShareRestClient::File::UploadRangeOptions(); - protocolLayerOptions.XMsWrite = _detail::FileRangeWriteType::Clear; + protocolLayerOptions.XMsWrite = _detail::FileRangeWrite::Clear; protocolLayerOptions.ContentLength = 0; protocolLayerOptions.XMsRange = std::string("bytes=") + std::to_string(offset) + std::string("-") + std::to_string(offset + length - 1); @@ -1116,7 +1116,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { = options.SourceAccessCondition.IfNoneMatchContentHash; protocolLayerOptions.SourceRange = std::string("bytes=") + std::to_string(sourceRange.Offset) + std::string("-") + std::to_string(sourceRange.Offset + sourceRange.Length.Value() - 1); - protocolLayerOptions.XMsWrite = _detail::FileRangeWriteFromUrlType::Update; + protocolLayerOptions.XMsWrite = _detail::FileRangeWriteFromUrl::Update; return _detail::ShareRestClient::File::UploadRangeFromUrl( m_shareFileUrl, *m_pipeline, context, protocolLayerOptions); diff --git a/sdk/storage/azure-storage-files-shares/src/share_rest_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_rest_client.cpp index 7b2448988..17688df29 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_rest_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_rest_client.cpp @@ -35,10 +35,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } // namespace Models namespace _detail { - const FileRangeWriteType FileRangeWriteType::Update("update"); - const FileRangeWriteType FileRangeWriteType::Clear("clear"); + const FileRangeWrite FileRangeWrite::Update("update"); + const FileRangeWrite FileRangeWrite::Clear("clear"); - const FileRangeWriteFromUrlType FileRangeWriteFromUrlType::Update("update"); + const FileRangeWriteFromUrl FileRangeWriteFromUrl::Update("update"); const LeaseAction LeaseAction::Acquire("acquire"); const LeaseAction LeaseAction::Release("release");