New protocol layer for File Share service (#3371)

This commit is contained in:
JinmingHu 2022-02-28 14:12:12 +08:00 committed by GitHub
parent b26df4804d
commit f628269290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 7295 additions and 9287 deletions

View File

@ -10,6 +10,8 @@
### Other Changes
- Deprecated enum `LeaseDuration`, use `LeaseDurationType` instead.
## 12.2.0 (2021-09-08)
### Breaking Changes

View File

@ -40,12 +40,11 @@ endif()
set(
AZURE_STORAGE_FILES_SHARES_HEADER
inc/azure/storage/files/shares/protocol/share_rest_client.hpp
inc/azure/storage/files/shares/dll_import_export.hpp
inc/azure/storage/files/shares/rest_client.hpp
inc/azure/storage/files/shares/share_client.hpp
inc/azure/storage/files/shares/share_constants.hpp
inc/azure/storage/files/shares/share_directory_client.hpp
inc/azure/storage/files/shares/share_file_attributes.hpp
inc/azure/storage/files/shares/share_file_client.hpp
inc/azure/storage/files/shares/share_lease_client.hpp
inc/azure/storage/files/shares/share_options.hpp
@ -58,13 +57,12 @@ set(
set(
AZURE_STORAGE_FILES_SHARES_SOURCE
src/private/package_version.hpp
src/rest_client.cpp
src/share_client.cpp
src/share_directory_client.cpp
src/share_file_attributes.cpp
src/share_file_client.cpp
src/share_lease_client.cpp
src/share_responses.cpp
src/share_rest_client.cpp
src/share_sas_builder.cpp
src/share_service_client.cpp
)

View File

@ -8,6 +8,7 @@
#pragma once
#include "azure/storage/common/storage_exception.hpp"
#include "azure/storage/files/shares/dll_import_export.hpp"
#include "azure/storage/files/shares/share_client.hpp"
#include "azure/storage/files/shares/share_directory_client.hpp"

View File

@ -9,7 +9,6 @@
#include <azure/core/response.hpp>
#include <azure/storage/common/storage_credential.hpp>
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
#include "azure/storage/files/shares/share_options.hpp"
#include "azure/storage/files/shares/share_responses.hpp"
#include "azure/storage/files/shares/share_service_client.hpp"

View File

@ -10,7 +10,6 @@
#include <azure/core/response.hpp>
#include <azure/storage/common/storage_credential.hpp>
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
#include "azure/storage/files/shares/share_client.hpp"
#include "azure/storage/files/shares/share_options.hpp"
#include "azure/storage/files/shares/share_responses.hpp"

View File

@ -1,110 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#pragma once
#include <string>
#include <vector>
#include "azure/storage/files/shares/dll_import_export.hpp"
namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models {
class FileAttributes final {
public:
FileAttributes() = default;
explicit FileAttributes(const std::string& value);
std::string ToString() const;
const std::vector<std::string> GetValues() const { return m_value; }
bool operator==(const FileAttributes& other) const { return m_value == other.m_value; }
bool operator!=(const FileAttributes& other) const { return !(*this == other); }
FileAttributes operator|(const FileAttributes& other) const;
FileAttributes operator&(const FileAttributes& other) const;
FileAttributes operator^(const FileAttributes& other) const;
FileAttributes& operator|=(const FileAttributes& other)
{
*this = *this | other;
return *this;
}
FileAttributes& operator&=(const FileAttributes& other)
{
*this = *this & other;
return *this;
}
FileAttributes& operator^=(const FileAttributes& other)
{
*this = *this ^ other;
return *this;
}
/**
* @brief The File or Directory is read-only.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes ReadOnly;
/**
* @brief The File or Directory is hidden, and thus is not included in an ordinary directory
* listing.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes Hidden;
/**
* @brief The File or Directory is a systemfile. That is, the file is part of the operating
* system or is used exclusively by the operating system.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes System;
/**
* @brief The file or directory is a standard file that has no special attributes. This
* attribute is valid only if it is used alone.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes None;
/**
* @brief The file is a directory.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes Directory;
/**
* @brief The file is a candidate for backup or removal.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes Archive;
/**
* @brief The file or directory is temporary. A temporary file contains data that is needed
* while an application is executing but is not needed after the application is finished. File
* systems try to keep all the data in memory for quicker access rather than flushing the data
* back to mass storage. A temporary file should be deleted by the application as soon as it
* is no longer needed.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes Temporary;
/**
* @brief The file or directory is offline. The data of the file is not immediately available.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes Offline;
/**
* @brief The file or directory will not be indexed by the operating system's content indexing
* service.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes NotContentIndexed;
/**
* @brief The file or directory is excluded from the data integrity scan. When this value is
* applied to a directory, by default, all new files and subdirectories within that directory
* are excluded from data integrity.
*/
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static FileAttributes NoScrubData;
private:
std::vector<std::string> m_value;
};
}}}}} // namespace Azure::Storage::Files::Shares::Models

View File

@ -10,7 +10,6 @@
#include <azure/core/response.hpp>
#include <azure/storage/common/storage_credential.hpp>
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
#include "azure/storage/files/shares/share_client.hpp"
#include "azure/storage/files/shares/share_directory_client.hpp"
#include "azure/storage/files/shares/share_options.hpp"

View File

@ -11,7 +11,7 @@
#include <azure/core/nullable.hpp>
#include <azure/storage/common/access_conditions.hpp>
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
#include "azure/storage/files/shares/rest_client.hpp"
/* cSpell:ignore dacl */

View File

@ -6,7 +6,6 @@
#include <azure/core/operation.hpp>
#include <azure/core/paged_response.hpp>
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
#include "azure/storage/files/shares/share_constants.hpp"
#include "azure/storage/files/shares/share_options.hpp"
@ -18,6 +17,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
namespace Models {
using LeaseDuration [[deprecated]] = LeaseDurationType;
/**
* @brief The information returned when forcing the directory handles to close.
*/
@ -25,118 +26,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
};
/**
* @brief The detailed information returned when downloading a file.
*/
struct DownloadFileDetails final
{
/**
* 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<DateTime> CopyCompletedOn;
/**
* The copy status's description of the file, if the file is created from a copy operation.
*/
Nullable<std::string> CopyStatusDescription;
/**
* The copy ID of the file, if the file is created from a copy operation.
*/
Nullable<std::string> CopyId;
/**
* The copy progress of the file, if the file is created from a copy operation.
*/
Nullable<std::string> CopyProgress;
/**
* The copy source of the file, if the file is created from a copy operation.
*/
Nullable<std::string> CopySource;
/**
* The copy status of the file, if the file is created from a copy operation.
*/
Nullable<Models::CopyStatus> 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<Models::LeaseDuration> LeaseDuration;
/**
* Lease state of the file.
*/
Nullable<Models::LeaseState> LeaseState;
/**
* The current lease status of the file.
*/
Nullable<Models::LeaseStatus> LeaseStatus;
};
/**
* @brief The content and information returned when downloading a file.
*/
struct DownloadFileResult final
{
/**
* The body of the downloaded result.
*/
std::unique_ptr<Azure::Core::IO::BodyStream> 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<Storage::ContentHash> TransactionalContentHash;
/**
* The common HTTP headers of the file.
*/
FileHttpHeaders HttpHeaders;
/**
* The detailed information of the downloaded file.
*/
DownloadFileDetails Details;
};
/**
* @brief The information returned when clearing a range in the file.
*/
@ -202,6 +91,103 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
bool IsServerEncrypted = false;
};
/**
* @brief Response type for #Azure::Storage::Files::Shares::ShareLeaseClient::AcquireLease.
*/
struct AcquireLeaseResult final
{
/**
* 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 or file's lease.
*/
std::string LeaseId;
};
/**
* @brief Response type for #Azure::Storage::Files::Shares::ShareLeaseClient::ReleaseLease.
*/
struct ReleaseLeaseResult final
{
/**
* 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 Response type for #Azure::Storage::Files::Shares::ShareLeaseClient::ChangeLease.
*/
struct ChangeLeaseResult final
{
/**
* 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 or file's lease.
*/
std::string LeaseId;
};
/**
* @brief Response type for #Azure::Storage::Files::Shares::ShareLeaseClient::RenewLease.
*/
struct RenewLeaseResult final
{
/**
* 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 or file's lease.
*/
std::string LeaseId;
};
/**
* @brief Response type for #Azure::Storage::Files::Shares::ShareLeaseClient::BreakLease.
*/
struct BreakLeaseResult final
{
/**
* 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;
};
} // namespace Models
/**

View File

@ -10,7 +10,6 @@
#include <azure/core/response.hpp>
#include <azure/storage/common/storage_credential.hpp>
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
#include "azure/storage/files/shares/share_options.hpp"
#include "azure/storage/files/shares/share_responses.hpp"

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@
#include <azure/storage/common/internal/storage_per_retry_policy.hpp>
#include <azure/storage/common/internal/storage_service_version_policy.hpp>
#include <azure/storage/common/storage_common.hpp>
#include <azure/storage/common/storage_exception.hpp>
#include "azure/storage/files/shares/share_directory_client.hpp"
#include "azure/storage/files/shares/share_file_client.hpp"
@ -101,12 +102,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const CreateShareOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Share::CreateOptions();
protocolLayerOptions.Metadata = options.Metadata;
protocolLayerOptions.ShareQuota = options.ShareQuotaInGiB;
protocolLayerOptions.XMsAccessTier = options.AccessTier;
auto result = _detail::ShareRestClient::Share::Create(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::CreateShareOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
protocolLayerOptions.Quota = options.ShareQuotaInGiB;
protocolLayerOptions.AccessTier = options.AccessTier;
auto result
= _detail::ShareClient::Create(*m_pipeline, m_shareUrl, protocolLayerOptions, context);
Models::CreateShareResult ret;
ret.Created = true;
ret.ETag = std::move(result.Value.ETag);
@ -139,13 +141,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const DeleteShareOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Share::DeleteOptions();
auto protocolLayerOptions = _detail::ShareClient::DeleteShareOptions();
if (options.DeleteSnapshots.HasValue() && options.DeleteSnapshots.Value())
{
protocolLayerOptions.XMsDeleteSnapshots = Models::DeleteSnapshotsOption::Include;
protocolLayerOptions.DeleteSnapshots = Models::DeleteSnapshotsOption::Include;
}
auto result = _detail::ShareRestClient::Share::Delete(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto result
= _detail::ShareClient::Delete(*m_pipeline, m_shareUrl, protocolLayerOptions, context);
Models::DeleteShareResult ret;
ret.Deleted = true;
return Azure::Response<Models::DeleteShareResult>(
@ -176,10 +178,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const CreateShareSnapshotOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Share::CreateSnapshotOptions();
protocolLayerOptions.Metadata = options.Metadata;
return _detail::ShareRestClient::Share::CreateSnapshot(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::CreateShareSnapshotOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
return _detail::ShareClient::CreateSnapshot(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ShareProperties> ShareClient::GetProperties(
@ -187,20 +190,20 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::GetPropertiesOptions();
return _detail::ShareRestClient::Share::GetProperties(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::GetSharePropertiesOptions();
return _detail::ShareClient::GetProperties(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetSharePropertiesResult> ShareClient::SetProperties(
const SetSharePropertiesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Share::SetPropertiesOptions();
protocolLayerOptions.ShareQuota = options.ShareQuotaInGiB;
protocolLayerOptions.XMsAccessTier = options.AccessTier;
return _detail::ShareRestClient::Share::SetProperties(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::SetSharePropertiesOptions();
protocolLayerOptions.Quota = options.ShareQuotaInGiB;
protocolLayerOptions.AccessTier = options.AccessTier;
return _detail::ShareClient::SetProperties(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetShareMetadataResult> ShareClient::SetMetadata(
@ -209,10 +212,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::SetMetadataOptions();
protocolLayerOptions.Metadata = metadata;
return _detail::ShareRestClient::Share::SetMetadata(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::SetShareMetadataOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(metadata.begin(), metadata.end());
return _detail::ShareClient::SetMetadata(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ShareAccessPolicy> ShareClient::GetAccessPolicy(
@ -220,9 +224,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::GetAccessPolicyOptions();
return _detail::ShareRestClient::Share::GetAccessPolicy(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::GetShareAccessPolicyOptions();
return _detail::ShareClient::GetAccessPolicy(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetShareAccessPolicyResult> ShareClient::SetAccessPolicy(
@ -231,10 +235,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::SetAccessPolicyOptions();
auto protocolLayerOptions = _detail::ShareClient::SetShareAccessPolicyOptions();
protocolLayerOptions.ShareAcl = accessPolicy;
return _detail::ShareRestClient::Share::SetAccessPolicy(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
return _detail::ShareClient::SetAccessPolicy(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ShareStatistics> ShareClient::GetStatistics(
@ -242,9 +246,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::GetStatisticsOptions();
return _detail::ShareRestClient::Share::GetStatistics(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::GetShareStatisticsOptions();
return _detail::ShareClient::GetStatistics(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<Models::CreateSharePermissionResult> ShareClient::CreatePermission(
@ -253,10 +257,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::CreatePermissionOptions();
protocolLayerOptions.Permission.FilePermission = permission;
return _detail::ShareRestClient::Share::CreatePermission(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::CreateSharePermissionOptions();
protocolLayerOptions.SharePermission.Permission = permission;
return _detail::ShareClient::CreatePermission(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
}
Azure::Response<std::string> ShareClient::GetPermission(
@ -265,12 +269,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Share::GetPermissionOptions();
protocolLayerOptions.FilePermissionKeyRequired = permissionKey;
auto result = _detail::ShareRestClient::Share::GetPermission(
m_shareUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ShareClient::GetSharePermissionOptions();
protocolLayerOptions.FilePermissionKey = permissionKey;
auto result = _detail::ShareClient::GetPermission(
*m_pipeline, m_shareUrl, protocolLayerOptions, context);
return Azure::Response<std::string>(result.Value.FilePermission, std::move(result.RawResponse));
return Azure::Response<std::string>(result.Value.Permission, std::move(result.RawResponse));
}
}}}} // namespace Azure::Storage::Files::Shares

View File

@ -11,6 +11,7 @@
#include <azure/storage/common/internal/storage_per_retry_policy.hpp>
#include <azure/storage/common/internal/storage_service_version_policy.hpp>
#include <azure/storage/common/storage_common.hpp>
#include <azure/storage/common/storage_exception.hpp>
#include "azure/storage/files/shares/share_file_client.hpp"
@ -116,13 +117,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const CreateDirectoryOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Directory::CreateOptions();
protocolLayerOptions.Metadata = options.Metadata;
protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString();
if (protocolLayerOptions.FileAttributes.empty())
auto protocolLayerOptions = _detail::DirectoryClient::CreateDirectoryOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
if (options.SmbProperties.Attributes.GetValues().empty())
{
protocolLayerOptions.FileAttributes = Models::FileAttributes::Directory.ToString();
}
else
{
protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString();
}
if (options.SmbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.Value().ToString(
@ -153,8 +158,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FilePermission = std::string(FileInheritPermission);
}
auto result = _detail::ShareRestClient::Directory::Create(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto result = _detail::DirectoryClient::Create(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
Models::CreateDirectoryResult ret;
ret.Created = true;
ret.ETag = std::move(result.Value.ETag);
@ -193,9 +198,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Directory::DeleteOptions();
auto result = _detail::ShareRestClient::Directory::Delete(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::DirectoryClient::DeleteDirectoryOptions();
auto result = _detail::DirectoryClient::Delete(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
Models::DeleteDirectoryResult ret;
ret.Deleted = true;
return Azure::Response<Models::DeleteDirectoryResult>(
@ -229,9 +234,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Directory::GetPropertiesOptions();
return _detail::ShareRestClient::Directory::GetProperties(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::DirectoryClient::GetDirectoryPropertiesOptions();
return _detail::DirectoryClient::GetProperties(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetDirectoryPropertiesResult> ShareDirectoryClient::SetProperties(
@ -239,7 +244,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const SetDirectoryPropertiesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Directory::SetPropertiesOptions();
auto protocolLayerOptions = _detail::DirectoryClient::SetDirectoryPropertiesOptions();
protocolLayerOptions.FileAttributes = smbProperties.Attributes.ToString();
if (protocolLayerOptions.FileAttributes.empty())
{
@ -275,8 +280,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FilePermission = FilePreserveSmbProperties;
}
return _detail::ShareRestClient::Directory::SetProperties(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
return _detail::DirectoryClient::SetProperties(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetDirectoryMetadataResult> ShareDirectoryClient::SetMetadata(
@ -285,10 +290,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Directory::SetMetadataOptions();
protocolLayerOptions.Metadata = std::move(metadata);
return _detail::ShareRestClient::Directory::SetMetadata(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::DirectoryClient::SetDirectoryMetadataOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(metadata.begin(), metadata.end());
return _detail::DirectoryClient::SetMetadata(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
}
ListFilesAndDirectoriesPagedResponse ShareDirectoryClient::ListFilesAndDirectories(
@ -296,29 +302,26 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
auto protocolLayerOptions
= _detail::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePageOptions();
= _detail::DirectoryClient::ListDirectoryFilesAndDirectoriesSegmentOptions();
protocolLayerOptions.Prefix = options.Prefix;
if (options.ContinuationToken.HasValue() && !options.ContinuationToken.Value().empty())
{
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
}
protocolLayerOptions.Marker = options.ContinuationToken;
protocolLayerOptions.MaxResults = options.PageSizeHint;
auto response = _detail::ShareRestClient::Directory::ListFilesAndDirectoriesSinglePage(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto response = _detail::DirectoryClient::ListFilesAndDirectoriesSegment(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
ListFilesAndDirectoriesPagedResponse pagedResponse;
pagedResponse.ServiceEndpoint = std::move(response.Value.ServiceEndpoint);
pagedResponse.ShareName = std::move(response.Value.ShareName);
pagedResponse.ShareSnapshot = std::move(response.Value.ShareSnapshot);
pagedResponse.ShareSnapshot = response.Value.ShareSnapshot.ValueOr(std::string());
pagedResponse.DirectoryPath = std::move(response.Value.DirectoryPath);
pagedResponse.Prefix = std::move(response.Value.Prefix);
pagedResponse.Directories = std::move(response.Value.SinglePage.DirectoryItems);
pagedResponse.Files = std::move(response.Value.SinglePage.FileItems);
pagedResponse.Directories = std::move(response.Value.Segment.DirectoryItems);
pagedResponse.Files = std::move(response.Value.Segment.FileItems);
pagedResponse.m_shareDirectoryClient = std::make_shared<ShareDirectoryClient>(*this);
pagedResponse.m_operationOptions = options;
pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string());
pagedResponse.NextPageToken = response.Value.ContinuationToken;
pagedResponse.NextPageToken = response.Value.Marker;
pagedResponse.RawResponse = std::move(response.RawResponse);
return pagedResponse;
@ -328,15 +331,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const ListDirectoryHandlesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Directory::ListHandlesOptions();
if (options.ContinuationToken.HasValue() && !options.ContinuationToken.Value().empty())
{
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
}
auto protocolLayerOptions = _detail::DirectoryClient::ListDirectoryHandlesOptions();
protocolLayerOptions.Marker = options.ContinuationToken;
protocolLayerOptions.MaxResults = options.PageSizeHint;
protocolLayerOptions.Recursive = options.Recursive;
auto response = _detail::ShareRestClient::Directory::ListHandles(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto response = _detail::DirectoryClient::ListHandles(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
ListDirectoryHandlesPagedResponse pagedResponse;
@ -344,7 +344,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
pagedResponse.m_shareDirectoryClient = std::make_shared<ShareDirectoryClient>(*this);
pagedResponse.m_operationOptions = options;
pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string());
pagedResponse.NextPageToken = response.Value.ContinuationToken;
if (!response.Value.NextMarker.empty())
{
pagedResponse.NextPageToken = response.Value.NextMarker;
}
pagedResponse.RawResponse = std::move(response.RawResponse);
return pagedResponse;
@ -356,10 +359,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::File::ForceCloseHandlesOptions();
auto protocolLayerOptions = _detail::DirectoryClient::ForceDirectoryCloseHandlesOptions();
protocolLayerOptions.HandleId = handleId;
auto result = _detail::ShareRestClient::File::ForceCloseHandles(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto result = _detail::DirectoryClient::ForceCloseHandles(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
Models::ForceCloseDirectoryHandleResult ret;
return Azure::Response<Models::ForceCloseDirectoryHandleResult>(
std::move(ret), std::move(result.RawResponse));
@ -369,15 +372,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const ForceCloseAllDirectoryHandlesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Directory::ForceCloseHandlesOptions();
auto protocolLayerOptions = _detail::DirectoryClient::ForceDirectoryCloseHandlesOptions();
protocolLayerOptions.HandleId = FileAllHandles;
if (options.ContinuationToken.HasValue() && !options.ContinuationToken.Value().empty())
{
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
}
protocolLayerOptions.Marker = options.ContinuationToken;
protocolLayerOptions.Recursive = options.Recursive;
auto response = _detail::ShareRestClient::Directory::ForceCloseHandles(
m_shareDirectoryUrl, *m_pipeline, context, protocolLayerOptions);
auto response = _detail::DirectoryClient::ForceCloseHandles(
*m_pipeline, m_shareDirectoryUrl, protocolLayerOptions, context);
ForceCloseAllDirectoryHandlesPagedResponse pagedResponse;

View File

@ -1,89 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "azure/storage/files/shares/share_file_attributes.hpp"
#include <algorithm>
#include <iterator>
namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models {
FileAttributes::FileAttributes(const std::string& value)
{
std::string::const_iterator cur = value.begin();
while (cur != value.end())
{
auto delimiter_pos
= std::find_if(cur, value.end(), [](char c) { return c == ' ' || c == '|'; });
m_value.emplace_back(std::string(cur, delimiter_pos));
while (delimiter_pos != value.end() && (*delimiter_pos == ' ' || *delimiter_pos == '|'))
{
++delimiter_pos;
}
cur = delimiter_pos;
}
std::sort(m_value.begin(), m_value.end());
}
FileAttributes FileAttributes::operator|(const FileAttributes& other) const
{
FileAttributes ret;
std::set_union(
m_value.begin(),
m_value.end(),
other.m_value.begin(),
other.m_value.end(),
std::back_inserter(ret.m_value));
return ret;
}
FileAttributes FileAttributes::operator&(const FileAttributes& other) const
{
FileAttributes ret;
std::set_intersection(
m_value.begin(),
m_value.end(),
other.m_value.begin(),
other.m_value.end(),
std::back_inserter(ret.m_value));
return ret;
}
FileAttributes FileAttributes::operator^(const FileAttributes& other) const
{
FileAttributes ret;
std::set_symmetric_difference(
m_value.begin(),
m_value.end(),
other.m_value.begin(),
other.m_value.end(),
std::back_inserter(ret.m_value));
return ret;
}
std::string FileAttributes::ToString() const
{
std::string ret;
for (const auto& v : m_value)
{
if (!ret.empty())
{
ret += " | ";
}
ret += v;
}
return ret;
}
const FileAttributes FileAttributes::ReadOnly("ReadOnly");
const FileAttributes FileAttributes::Hidden("Hidden");
const FileAttributes FileAttributes::System("System");
const FileAttributes FileAttributes::None("None");
const FileAttributes FileAttributes::Directory("Directory");
const FileAttributes FileAttributes::Archive("Archive");
const FileAttributes FileAttributes::Temporary("Temporary");
const FileAttributes FileAttributes::Offline("Offline");
const FileAttributes FileAttributes::NotContentIndexed("NotContentIndexed");
const FileAttributes FileAttributes::NoScrubData("NoScrubData");
}}}}} // namespace Azure::Storage::Files::Shares::Models

View File

@ -16,6 +16,7 @@
#include <azure/storage/common/internal/storage_per_retry_policy.hpp>
#include <azure/storage/common/internal/storage_service_version_policy.hpp>
#include <azure/storage/common/storage_common.hpp>
#include <azure/storage/common/storage_exception.hpp>
#include "azure/storage/files/shares/share_constants.hpp"
@ -106,8 +107,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const CreateFileOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::CreateOptions();
protocolLayerOptions.Metadata = options.Metadata;
auto protocolLayerOptions = _detail::FileClient::CreateFileOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString();
if (protocolLayerOptions.FileAttributes.empty())
{
@ -143,7 +145,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FilePermission = std::string(FileInheritPermission);
}
protocolLayerOptions.XMsContentLength = fileSize;
protocolLayerOptions.FileContentLength = fileSize;
if (!options.HttpHeaders.ContentType.empty())
{
protocolLayerOptions.FileContentType = options.HttpHeaders.ContentType;
@ -169,11 +171,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
AZURE_ASSERT_MSG(
options.HttpHeaders.ContentHash.Algorithm == HashAlgorithm::Md5,
"This operation only supports MD5 content hash.");
protocolLayerOptions.ContentMd5 = options.HttpHeaders.ContentHash;
protocolLayerOptions.FileContentMD5 = options.HttpHeaders.ContentHash.Value;
}
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
auto result = _detail::ShareRestClient::File::Create(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
auto result
= _detail::FileClient::Create(*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
Models::CreateFileResult ret;
ret.Created = true;
ret.ETag = std::move(result.Value.ETag);
@ -188,10 +190,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const DeleteFileOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::DeleteOptions();
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
auto result = _detail::ShareRestClient::File::Delete(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::FileClient::DeleteFileOptions();
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
auto result
= _detail::FileClient::Delete(*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
Models::DeleteFileResult ret;
ret.Deleted = true;
return Azure::Response<Models::DeleteFileResult>(std::move(ret), std::move(result.RawResponse));
@ -222,7 +224,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const DownloadFileOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::DownloadOptions();
auto protocolLayerOptions = _detail::FileClient::DownloadFileOptions();
if (options.Range.HasValue())
{
if (options.Range.Value().Length.HasValue())
@ -245,17 +247,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
"This operation only supports MD5 content hash.");
if (options.RangeHashAlgorithm.Value() == HashAlgorithm::Md5)
{
protocolLayerOptions.GetRangeContentMd5 = true;
protocolLayerOptions.RangeGetContentMD5 = true;
}
}
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
auto downloadResponse = _detail::ShareRestClient::File::Download(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
auto downloadResponse
= _detail::FileClient::Download(*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
{
// In case network failure during reading the body
auto eTag = downloadResponse.Value.ETag;
auto eTag = downloadResponse.Value.Details.ETag;
auto retryFunction
= [this, options, eTag](int64_t retryOffset, const Azure::Core::Context& context)
@ -282,28 +284,31 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
downloadResponse.Value.BodyStream = std::make_unique<_internal::ReliableStream>(
std::move(downloadResponse.Value.BodyStream), reliableStreamOptions, retryFunction);
}
Models::DownloadFileResult ret;
ret.BodyStream = std::move(downloadResponse.Value.BodyStream);
ret.ContentRange = std::move(downloadResponse.Value.ContentRange);
ret.FileSize = downloadResponse.Value.FileSize;
ret.TransactionalContentHash = std::move(downloadResponse.Value.TransactionalContentHash);
ret.HttpHeaders = std::move(downloadResponse.Value.HttpHeaders);
ret.Details.LastModified = std::move(downloadResponse.Value.LastModified);
ret.Details.Metadata = std::move(downloadResponse.Value.Metadata);
ret.Details.ETag = std::move(downloadResponse.Value.ETag);
ret.Details.CopyCompletedOn = std::move(downloadResponse.Value.CopyCompletedOn);
ret.Details.CopyStatusDescription = std::move(downloadResponse.Value.CopyStatusDescription);
ret.Details.CopyId = std::move(downloadResponse.Value.CopyId);
ret.Details.CopyProgress = std::move(downloadResponse.Value.CopyProgress);
ret.Details.CopySource = std::move(downloadResponse.Value.CopySource);
ret.Details.CopyStatus = std::move(downloadResponse.Value.CopyStatus);
ret.Details.IsServerEncrypted = downloadResponse.Value.IsServerEncrypted;
ret.Details.SmbProperties = std::move(downloadResponse.Value.SmbProperties);
ret.Details.LeaseDuration = std::move(downloadResponse.Value.LeaseDuration);
ret.Details.LeaseState = std::move(downloadResponse.Value.LeaseState);
ret.Details.LeaseStatus = std::move(downloadResponse.Value.LeaseStatus);
return Azure::Response<Models::DownloadFileResult>(
std::move(ret), std::move(downloadResponse.RawResponse));
if (downloadResponse.RawResponse->GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
{
downloadResponse.Value.FileSize = std::stoll(
downloadResponse.RawResponse->GetHeaders().at(_internal::HttpHeaderContentLength));
downloadResponse.Value.ContentRange.Offset = 0;
downloadResponse.Value.ContentRange.Length = downloadResponse.Value.FileSize;
}
else if (
downloadResponse.RawResponse->GetStatusCode()
== Azure::Core::Http::HttpStatusCode::PartialContent)
{
const std::string& contentRange
= downloadResponse.RawResponse->GetHeaders().at(_internal::HttpHeaderContentRange);
auto bytes_pos = contentRange.find("bytes ");
auto dash_pos = contentRange.find("-", bytes_pos + 6);
auto slash_pos = contentRange.find("/", dash_pos + 1);
const int64_t rangeStartOffset = std::stoll(
std::string(contentRange.begin() + bytes_pos + 6, contentRange.begin() + dash_pos));
const int64_t rangeEndOffset = std::stoll(
std::string(contentRange.begin() + dash_pos + 1, contentRange.begin() + slash_pos));
downloadResponse.Value.ContentRange
= Azure::Core::Http::HttpRange{rangeStartOffset, rangeEndOffset - rangeStartOffset + 1};
downloadResponse.Value.FileSize = std::stoll(contentRange.substr(slash_pos + 1));
}
return downloadResponse;
}
StartFileCopyOperation ShareFileClient::StartCopy(
@ -311,33 +316,39 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const StartFileCopyOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::StartCopyOptions();
protocolLayerOptions.Metadata = options.Metadata;
auto protocolLayerOptions = _detail::FileClient::StartFileCopyOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
protocolLayerOptions.CopySource = std::move(copySource);
protocolLayerOptions.FileCopyFileAttributes = options.SmbProperties.Attributes.ToString();
if (options.SmbProperties.CreatedOn.HasValue())
if (options.SmbProperties.Attributes.GetValues().empty())
{
protocolLayerOptions.FileCopyFileCreationTime
= options.SmbProperties.CreatedOn.Value().ToString(
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
protocolLayerOptions.FileAttributes = FileCopySourceTime;
}
else
{
protocolLayerOptions.FileCopyFileCreationTime = std::string(FileCopySourceTime);
protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString();
}
if (options.SmbProperties.CreatedOn.HasValue())
{
protocolLayerOptions.FileCreationTime = options.SmbProperties.CreatedOn.Value().ToString(
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
protocolLayerOptions.FileCreationTime = std::string(FileCopySourceTime);
}
if (options.SmbProperties.LastWrittenOn.HasValue())
{
protocolLayerOptions.FileCopyFileLastWriteTime
= options.SmbProperties.LastWrittenOn.Value().ToString(
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
protocolLayerOptions.FileLastWriteTime = options.SmbProperties.LastWrittenOn.Value().ToString(
Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits);
}
else
{
protocolLayerOptions.FileCopyFileLastWriteTime = std::string(FileCopySourceTime);
protocolLayerOptions.FileLastWriteTime = std::string(FileCopySourceTime);
}
if (options.PermissionCopyMode.HasValue())
{
protocolLayerOptions.XMsFilePermissionCopyMode = options.PermissionCopyMode.Value();
protocolLayerOptions.FilePermissionCopyMode = options.PermissionCopyMode.Value();
if (options.PermissionCopyMode.Value() == Models::PermissionCopyMode::Override)
{
if (options.Permission.HasValue())
@ -356,13 +367,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else
{
protocolLayerOptions.XMsFilePermissionCopyMode = Models::PermissionCopyMode::Source;
protocolLayerOptions.FilePermissionCopyMode = Models::PermissionCopyMode::Source;
}
protocolLayerOptions.FileCopyIgnoreReadOnly = options.IgnoreReadOnly;
protocolLayerOptions.FileCopySetArchiveAttribute = options.SetArchiveAttribute;
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
auto response = _detail::ShareRestClient::File::StartCopy(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.IgnoreReadOnly = options.IgnoreReadOnly;
protocolLayerOptions.SetArchiveAttribute = options.SetArchiveAttribute;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
auto response = _detail::FileClient::StartCopy(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
StartFileCopyOperation res;
res.m_rawResponse = std::move(response.RawResponse);
@ -375,21 +386,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const AbortFileCopyOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::AbortCopyOptions();
auto protocolLayerOptions = _detail::FileClient::AbortFileCopyOptions();
protocolLayerOptions.CopyId = std::move(copyId);
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
return _detail::ShareRestClient::File::AbortCopy(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::FileClient::AbortCopy(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
Azure::Response<Models::FileProperties> ShareFileClient::GetProperties(
const GetFilePropertiesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::GetPropertiesOptions();
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
return _detail::ShareRestClient::File::GetProperties(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::FileClient::GetFilePropertiesOptions();
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::FileClient::GetProperties(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetFilePropertiesResult> ShareFileClient::SetProperties(
@ -398,7 +409,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const SetFilePropertiesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::SetHttpHeadersOptions();
auto protocolLayerOptions = _detail::FileClient::SetFileHttpHeadersOptions();
protocolLayerOptions.FileAttributes = smbProperties.Attributes.ToString();
if (protocolLayerOptions.FileAttributes.empty())
{
@ -422,8 +433,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
protocolLayerOptions.FileLastWriteTime = FilePreserveSmbProperties;
}
protocolLayerOptions.XMsContentLength = options.Size;
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
protocolLayerOptions.FileContentLength = options.Size;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
if (options.Permission.HasValue())
{
protocolLayerOptions.FilePermission = options.Permission;
@ -458,8 +469,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
protocolLayerOptions.FileContentDisposition = httpHeaders.ContentDisposition;
}
return _detail::ShareRestClient::File::SetHttpHeaders(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
return _detail::FileClient::SetHttpHeaders(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetFileMetadataResult> ShareFileClient::SetMetadata(
@ -467,11 +478,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const SetFileMetadataOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::SetMetadataOptions();
protocolLayerOptions.Metadata = std::move(metadata);
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
return _detail::ShareRestClient::File::SetMetadata(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::FileClient::SetFileMetadataOptions();
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(metadata.begin(), metadata.end());
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::FileClient::SetMetadata(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
Azure::Response<Models::UploadFileRangeResult> ShareFileClient::UploadRange(
@ -480,21 +492,20 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const UploadFileRangeOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::UploadRangeOptions();
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);
auto protocolLayerOptions = _detail::FileClient::UploadFileRangeOptions();
protocolLayerOptions.FileRangeWrite = "update";
protocolLayerOptions.Range = std::string("bytes=") + std::to_string(offset) + std::string("-")
+ std::to_string(offset + content.Length() - 1);
if (options.TransactionalContentHash.HasValue())
{
AZURE_ASSERT_MSG(
options.TransactionalContentHash.Value().Algorithm == HashAlgorithm::Md5,
"This operation only supports MD5 content hash.");
protocolLayerOptions.ContentMD5 = options.TransactionalContentHash.Value().Value;
}
protocolLayerOptions.ContentMd5 = options.TransactionalContentHash;
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
return _detail::ShareRestClient::File::UploadRange(
m_shareFileUrl, content, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::FileClient::UploadRange(
*m_pipeline, m_shareFileUrl, content, protocolLayerOptions, context);
}
Azure::Response<Models::ClearFileRangeResult> ShareFileClient::ClearRange(
@ -503,19 +514,18 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const ClearFileRangeOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::UploadRangeOptions();
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);
auto protocolLayerOptions = _detail::FileClient::UploadFileRangeOptions();
protocolLayerOptions.FileRangeWrite = "clear";
protocolLayerOptions.Range = std::string("bytes=") + std::to_string(offset) + std::string("-")
+ std::to_string(offset + length - 1);
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
auto response = _detail::ShareRestClient::File::UploadRange(
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
auto response = _detail::FileClient::UploadRange(
*m_pipeline,
m_shareFileUrl,
*Azure::Core::IO::_internal::NullBodyStream::GetNullBodyStream(),
*m_pipeline,
context,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::ClearFileRangeResult ret;
ret.ETag = std::move(response.Value.ETag);
ret.IsServerEncrypted = response.Value.IsServerEncrypted;
@ -528,26 +538,26 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const GetFileRangeListOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::GetRangeListOptions();
auto protocolLayerOptions = _detail::FileClient::GetFileRangeListOptions();
if (options.Range.HasValue())
{
if (options.Range.Value().Length.HasValue())
{
protocolLayerOptions.XMsRange = std::string("bytes=")
protocolLayerOptions.Range = std::string("bytes=")
+ std::to_string(options.Range.Value().Offset) + std::string("-")
+ std::to_string(options.Range.Value().Offset + options.Range.Value().Length.Value()
- 1);
}
else
{
protocolLayerOptions.XMsRange = std::string("bytes=")
protocolLayerOptions.Range = std::string("bytes=")
+ std::to_string(options.Range.Value().Offset) + std::string("-");
}
}
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
return _detail::ShareRestClient::File::GetRangeList(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::FileClient::GetRangeList(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
Azure::Response<Models::GetFileRangeListResult> ShareFileClient::GetRangeListDiff(
@ -555,41 +565,38 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const GetFileRangeListOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::GetRangeListOptions();
auto protocolLayerOptions = _detail::FileClient::GetFileRangeListOptions();
if (options.Range.HasValue())
{
if (options.Range.Value().Length.HasValue())
{
protocolLayerOptions.XMsRange = std::string("bytes=")
protocolLayerOptions.Range = std::string("bytes=")
+ std::to_string(options.Range.Value().Offset) + std::string("-")
+ std::to_string(options.Range.Value().Offset + options.Range.Value().Length.Value()
- 1);
}
else
{
protocolLayerOptions.XMsRange = std::string("bytes=")
protocolLayerOptions.Range = std::string("bytes=")
+ std::to_string(options.Range.Value().Offset) + std::string("-");
}
}
protocolLayerOptions.PrevShareSnapshot = std::move(previousShareSnapshot);
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
return _detail::ShareRestClient::File::GetRangeList(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.Prevsharesnapshot = std::move(previousShareSnapshot);
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::FileClient::GetRangeList(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
ListFileHandlesPagedResponse ShareFileClient::ListHandles(
const ListFileHandlesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::ListHandlesOptions();
if (options.ContinuationToken.HasValue() && !options.ContinuationToken.Value().empty())
{
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
}
auto protocolLayerOptions = _detail::FileClient::ListFileHandlesOptions();
protocolLayerOptions.Marker = options.ContinuationToken;
protocolLayerOptions.MaxResults = options.PageSizeHint;
auto response = _detail::ShareRestClient::File::ListHandles(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
auto response = _detail::FileClient::ListHandles(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
ListFileHandlesPagedResponse pagedResponse;
@ -597,7 +604,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
pagedResponse.m_shareFileClient = std::make_shared<ShareFileClient>(*this);
pagedResponse.m_operationOptions = options;
pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string());
pagedResponse.NextPageToken = response.Value.ContinuationToken;
if (!response.Value.NextMarker.empty())
{
pagedResponse.NextPageToken = response.Value.NextMarker;
}
pagedResponse.RawResponse = std::move(response.RawResponse);
return pagedResponse;
@ -609,10 +619,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::File::ForceCloseHandlesOptions();
auto protocolLayerOptions = _detail::FileClient::ForceFileCloseHandlesOptions();
protocolLayerOptions.HandleId = handleId;
auto result = _detail::ShareRestClient::File::ForceCloseHandles(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
auto result = _detail::FileClient::ForceCloseHandles(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
return Azure::Response<Models::ForceCloseFileHandleResult>(
Models::ForceCloseFileHandleResult(), std::move(result.RawResponse));
}
@ -621,14 +631,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const ForceCloseAllFileHandlesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::File::ForceCloseHandlesOptions();
auto protocolLayerOptions = _detail::FileClient::ForceFileCloseHandlesOptions();
protocolLayerOptions.HandleId = FileAllHandles;
if (options.ContinuationToken.HasValue() && !options.ContinuationToken.Value().empty())
{
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
}
auto response = _detail::ShareRestClient::File::ForceCloseHandles(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.Marker = options.ContinuationToken;
auto response = _detail::FileClient::ForceCloseHandles(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
ForceCloseAllFileHandlesPagedResponse pagedResponse;
@ -637,7 +644,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
pagedResponse.m_shareFileClient = std::make_shared<ShareFileClient>(*this);
pagedResponse.m_operationOptions = options;
pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string());
pagedResponse.NextPageToken = response.Value.ContinuationToken.ValueOr(std::string());
pagedResponse.NextPageToken = response.Value.ContinuationToken;
pagedResponse.RawResponse = std::move(response.RawResponse);
return pagedResponse;
@ -880,8 +887,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const UploadFileFromOptions& options,
const Azure::Core::Context& context) const
{
_detail::ShareRestClient::File::CreateOptions protocolLayerOptions;
protocolLayerOptions.XMsContentLength = bufferSize;
_detail::FileClient::CreateFileOptions protocolLayerOptions;
protocolLayerOptions.FileContentLength = bufferSize;
protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString();
if (protocolLayerOptions.FileAttributes.empty())
{
@ -943,11 +950,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
AZURE_ASSERT_MSG(
options.HttpHeaders.ContentHash.Algorithm == HashAlgorithm::Md5,
"This operation only supports MD5 content hash.");
protocolLayerOptions.ContentMd5 = options.HttpHeaders.ContentHash;
protocolLayerOptions.FileContentMD5 = options.HttpHeaders.ContentHash.Value;
}
protocolLayerOptions.Metadata = options.Metadata;
auto createResult = _detail::ShareRestClient::File::Create(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
auto createResult
= _detail::FileClient::Create(*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
auto uploadPageFunc = [&](int64_t offset, int64_t length, int64_t chunkId, int64_t numChunks) {
(void)chunkId;
@ -984,8 +992,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
_internal::FileReader fileReader(fileName);
_detail::ShareRestClient::File::CreateOptions protocolLayerOptions;
protocolLayerOptions.XMsContentLength = fileReader.GetFileSize();
_detail::FileClient::CreateFileOptions protocolLayerOptions;
protocolLayerOptions.FileContentLength = fileReader.GetFileSize();
protocolLayerOptions.FileAttributes = options.SmbProperties.Attributes.ToString();
if (protocolLayerOptions.FileAttributes.empty())
{
@ -1047,11 +1055,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
AZURE_ASSERT_MSG(
options.HttpHeaders.ContentHash.Algorithm == HashAlgorithm::Md5,
"This operation only supports MD5 content hash.");
protocolLayerOptions.ContentMd5 = options.HttpHeaders.ContentHash;
protocolLayerOptions.FileContentMD5 = options.HttpHeaders.ContentHash.Value;
}
protocolLayerOptions.Metadata = options.Metadata;
auto createResult = _detail::ShareRestClient::File::Create(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
protocolLayerOptions.Metadata
= std::map<std::string, std::string>(options.Metadata.begin(), options.Metadata.end());
auto createResult
= _detail::FileClient::Create(*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
auto uploadPageFunc = [&](int64_t offset, int64_t length, int64_t chunkId, int64_t numChunks) {
(void)chunkId;
@ -1091,41 +1100,40 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
AZURE_ASSERT_MSG(sourceRange.Length.HasValue(), "Source length cannot be null.");
int64_t rangeLength = sourceRange.Length.Value();
auto protocolLayerOptions = _detail::ShareRestClient::File::UploadRangeFromUrlOptions();
protocolLayerOptions.TargetRange = std::string("bytes=") + std::to_string(destinationOffset)
auto protocolLayerOptions = _detail::FileClient::UploadFileRangeFromUriOptions();
protocolLayerOptions.Range = std::string("bytes=") + std::to_string(destinationOffset)
+ std::string("-") + std::to_string(destinationOffset + rangeLength - 1);
protocolLayerOptions.ContentLength = 0;
protocolLayerOptions.CopySource = sourceUri;
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
if (options.TransactionalContentHash.HasValue())
{
AZURE_ASSERT_MSG(
options.TransactionalContentHash.Value().Algorithm == HashAlgorithm::Crc64,
"This operation only supports CRC64 content hash.");
protocolLayerOptions.SourceContentCrc64 = options.TransactionalContentHash.Value().Value;
}
protocolLayerOptions.SourceContentCrc64 = options.TransactionalContentHash;
if (options.SourceAccessCondition.IfMatchContentHash.HasValue())
{
AZURE_ASSERT_MSG(
options.SourceAccessCondition.IfMatchContentHash.Value().Algorithm
== HashAlgorithm::Crc64,
"This operation only supports CRC64 Source-If-Match condition.");
protocolLayerOptions.SourceIfMatchCrc64
= options.SourceAccessCondition.IfMatchContentHash.Value().Value;
}
protocolLayerOptions.SourceIfMatchCrc64 = options.SourceAccessCondition.IfMatchContentHash;
if (options.SourceAccessCondition.IfNoneMatchContentHash.HasValue())
{
AZURE_ASSERT_MSG(
options.SourceAccessCondition.IfNoneMatchContentHash.Value().Algorithm
== HashAlgorithm::Crc64,
"This operation only supports CRC64 Source-If-None-Match condition.");
protocolLayerOptions.SourceIfNoneMatchCrc64
= options.SourceAccessCondition.IfNoneMatchContentHash.Value().Value;
}
protocolLayerOptions.SourceIfNoneMatchCrc64
= 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::FileRangeWriteFromUrl::Update;
return _detail::ShareRestClient::File::UploadRangeFromUrl(
m_shareFileUrl, *m_pipeline, context, protocolLayerOptions);
return _detail::FileClient::UploadRangeFromUri(
*m_pipeline, m_shareFileUrl, protocolLayerOptions, context);
}
}}}} // namespace Azure::Storage::Files::Shares

View File

@ -22,15 +22,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
(void)options;
if (m_fileClient.HasValue())
{
_detail::ShareRestClient::File::AcquireLeaseOptions protocolLayerOptions;
protocolLayerOptions.ProposedLeaseIdOptional = GetLeaseId();
protocolLayerOptions.LeaseDuration = static_cast<int32_t>(duration.count());
_detail::FileClient::AcquireFileLeaseOptions protocolLayerOptions;
protocolLayerOptions.ProposedLeaseId = GetLeaseId();
protocolLayerOptions.Duration = static_cast<int32_t>(duration.count());
auto response = _detail::ShareRestClient::File::AcquireLease(
m_fileClient.Value().m_shareFileUrl,
auto response = _detail::FileClient::AcquireLease(
*(m_fileClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_fileClient.Value().m_shareFileUrl,
protocolLayerOptions,
context);
Models::AcquireLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);
@ -42,15 +42,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (m_shareClient.HasValue())
{
_detail::ShareRestClient::Share::AcquireLeaseOptions protocolLayerOptions;
protocolLayerOptions.ProposedLeaseIdOptional = GetLeaseId();
protocolLayerOptions.LeaseDuration = static_cast<int32_t>(duration.count());
_detail::ShareClient::AcquireShareLeaseOptions protocolLayerOptions;
protocolLayerOptions.ProposedLeaseId = GetLeaseId();
protocolLayerOptions.Duration = static_cast<int32_t>(duration.count());
auto response = _detail::ShareRestClient::Share::AcquireLease(
m_shareClient.Value().m_shareUrl,
auto response = _detail::ShareClient::AcquireLease(
*(m_shareClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_shareClient.Value().m_shareUrl,
protocolLayerOptions,
context);
Models::AcquireLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);
@ -73,19 +73,19 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
(void)options;
if (m_fileClient.HasValue())
{
AZURE_ASSERT_MSG(false, "Share lease doesn't support renew");
AZURE_ASSERT_MSG(false, "File lease doesn't support renew");
AZURE_NOT_IMPLEMENTED();
}
else if (m_shareClient.HasValue())
{
_detail::ShareRestClient::Share::RenewLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = GetLeaseId();
_detail::ShareClient::RenewShareLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseId = GetLeaseId();
auto response = _detail::ShareRestClient::Share::RenewLease(
m_shareClient.Value().m_shareUrl,
auto response = _detail::ShareClient::RenewLease(
*(m_shareClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_shareClient.Value().m_shareUrl,
protocolLayerOptions,
context);
Models::RenewLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);
@ -108,14 +108,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
(void)options;
if (m_fileClient.HasValue())
{
_detail::ShareRestClient::File::ReleaseLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = GetLeaseId();
_detail::FileClient::ReleaseFileLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseId = GetLeaseId();
auto response = _detail::ShareRestClient::File::ReleaseLease(
m_fileClient.Value().m_shareFileUrl,
auto response = _detail::FileClient::ReleaseLease(
*(m_fileClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_fileClient.Value().m_shareFileUrl,
protocolLayerOptions,
context);
Models::ReleaseLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);
@ -126,14 +126,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (m_shareClient.HasValue())
{
_detail::ShareRestClient::Share::ReleaseLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = GetLeaseId();
_detail::ShareClient::ReleaseShareLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseId = GetLeaseId();
auto response = _detail::ShareRestClient::Share::ReleaseLease(
m_shareClient.Value().m_shareUrl,
auto response = _detail::ShareClient::ReleaseLease(
*(m_shareClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_shareClient.Value().m_shareUrl,
protocolLayerOptions,
context);
Models::ReleaseLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);
@ -156,15 +156,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
(void)options;
if (m_fileClient.HasValue())
{
_detail::ShareRestClient::File::ChangeLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = GetLeaseId();
protocolLayerOptions.ProposedLeaseIdOptional = proposedLeaseId;
_detail::FileClient::ChangeFileLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseId = GetLeaseId();
protocolLayerOptions.ProposedLeaseId = proposedLeaseId;
auto response = _detail::ShareRestClient::File::ChangeLease(
m_fileClient.Value().m_shareFileUrl,
auto response = _detail::FileClient::ChangeLease(
*(m_fileClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_fileClient.Value().m_shareFileUrl,
protocolLayerOptions,
context);
{
std::lock_guard<std::mutex> guard(m_mutex);
@ -181,15 +181,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (m_shareClient.HasValue())
{
_detail::ShareRestClient::Share::ChangeLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = GetLeaseId();
protocolLayerOptions.ProposedLeaseIdOptional = proposedLeaseId;
_detail::ShareClient::ChangeShareLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseId = GetLeaseId();
protocolLayerOptions.ProposedLeaseId = proposedLeaseId;
auto response = _detail::ShareRestClient::Share::ChangeLease(
m_shareClient.Value().m_shareUrl,
auto response = _detail::ShareClient::ChangeLease(
*(m_shareClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_shareClient.Value().m_shareUrl,
protocolLayerOptions,
context);
{
std::lock_guard<std::mutex> guard(m_mutex);
@ -217,13 +217,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
(void)options;
if (m_fileClient.HasValue())
{
_detail::ShareRestClient::File::BreakLeaseOptions protocolLayerOptions;
_detail::FileClient::BreakFileLeaseOptions protocolLayerOptions;
auto response = _detail::ShareRestClient::File::BreakLease(
m_fileClient.Value().m_shareFileUrl,
auto response = _detail::FileClient::BreakLease(
*(m_fileClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_fileClient.Value().m_shareFileUrl,
protocolLayerOptions,
context);
Models::BreakLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);
@ -234,13 +234,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
else if (m_shareClient.HasValue())
{
_detail::ShareRestClient::Share::BreakLeaseOptions protocolLayerOptions;
_detail::ShareClient::BreakShareLeaseOptions protocolLayerOptions;
auto response = _detail::ShareClient::BreakLease(
auto response = _detail::ShareRestClient::Share::BreakLease(
m_shareClient.Value().m_shareUrl,
*(m_shareClient.Value().m_pipeline),
context,
protocolLayerOptions);
m_shareClient.Value().m_shareUrl,
protocolLayerOptions,
context);
Models::BreakLeaseResult ret;
ret.ETag = std::move(response.Value.ETag);

View File

@ -1,50 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include "azure/storage/files/shares/protocol/share_rest_client.hpp"
namespace Azure { namespace Storage { namespace Files { namespace Shares {
namespace Models {
const AccessTier AccessTier::TransactionOptimized("TransactionOptimized");
const AccessTier AccessTier::Hot("Hot");
const AccessTier AccessTier::Cool("Cool");
const AccessTier AccessTier::Premium("Premium");
const PermissionCopyMode PermissionCopyMode::Source("source");
const PermissionCopyMode PermissionCopyMode::Override("override");
const DeleteSnapshotsOption DeleteSnapshotsOption::Include("include");
const LeaseDuration LeaseDuration::Infinite("infinite");
const LeaseDuration LeaseDuration::Fixed("fixed");
const LeaseState LeaseState::Available("available");
const LeaseState LeaseState::Leased("leased");
const LeaseState LeaseState::Expired("expired");
const LeaseState LeaseState::Breaking("breaking");
const LeaseState LeaseState::Broken("broken");
const LeaseStatus LeaseStatus::Locked("locked");
const LeaseStatus LeaseStatus::Unlocked("unlocked");
const CopyStatus CopyStatus::Pending("pending");
const CopyStatus CopyStatus::Success("success");
const CopyStatus CopyStatus::Aborted("aborted");
const CopyStatus CopyStatus::Failed("failed");
} // namespace Models
namespace _detail {
const FileRangeWrite FileRangeWrite::Update("update");
const FileRangeWrite FileRangeWrite::Clear("clear");
const FileRangeWriteFromUrl FileRangeWriteFromUrl::Update("update");
const LeaseAction LeaseAction::Acquire("acquire");
const LeaseAction LeaseAction::Release("release");
const LeaseAction LeaseAction::Change("change");
const LeaseAction LeaseAction::Renew("renew");
const LeaseAction LeaseAction::Break("break");
} // namespace _detail
}}}} // namespace Azure::Storage::Files::Shares

View File

@ -5,6 +5,7 @@
#include <azure/core/credentials/credentials.hpp>
#include <azure/core/http/policies/policy.hpp>
#include <azure/storage/common/crypt.hpp>
#include <azure/storage/common/internal/constants.hpp>
#include <azure/storage/common/internal/shared_key_policy.hpp>
#include <azure/storage/common/internal/storage_per_retry_policy.hpp>
@ -87,25 +88,25 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const ListSharesOptions& options,
const Azure::Core::Context& context) const
{
auto protocolLayerOptions = _detail::ShareRestClient::Service::ListSharesSinglePageOptions();
protocolLayerOptions.IncludeFlags = options.ListSharesIncludeFlags;
if (options.ContinuationToken.HasValue() && !options.ContinuationToken.Value().empty())
{
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
}
auto protocolLayerOptions = _detail::ServiceClient::ListServiceSharesSegmentOptions();
protocolLayerOptions.Include = options.ListSharesIncludeFlags;
protocolLayerOptions.Marker = options.ContinuationToken;
protocolLayerOptions.MaxResults = options.PageSizeHint;
protocolLayerOptions.Prefix = options.Prefix;
auto response = _detail::ShareRestClient::Service::ListSharesSinglePage(
m_serviceUrl, *m_pipeline, context, protocolLayerOptions);
auto response = _detail::ServiceClient::ListSharesSegment(
*m_pipeline, m_serviceUrl, protocolLayerOptions, context);
ListSharesPagedResponse pagedResponse;
pagedResponse.ServiceEndpoint = std::move(response.Value.ServiceEndpoint);
pagedResponse.Prefix = std::move(response.Value.Prefix);
pagedResponse.Shares = std::move(response.Value.Items);
pagedResponse.Prefix = response.Value.Prefix.ValueOr(std::string());
pagedResponse.Shares = std::move(response.Value.ShareItems);
pagedResponse.m_shareServiceClient = std::make_shared<ShareServiceClient>(*this);
pagedResponse.m_operationOptions = options;
pagedResponse.CurrentPageToken = options.ContinuationToken.ValueOr(std::string());
pagedResponse.NextPageToken = response.Value.ContinuationToken;
if (!response.Value.NextMarker.empty())
{
pagedResponse.NextPageToken = response.Value.NextMarker;
}
pagedResponse.RawResponse = std::move(response.RawResponse);
return pagedResponse;
@ -117,10 +118,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Service::SetPropertiesOptions();
protocolLayerOptions.ServiceProperties = std::move(properties);
return _detail::ShareRestClient::Service::SetProperties(
m_serviceUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ServiceClient::SetServicePropertiesOptions();
protocolLayerOptions.ShareServiceProperties = std::move(properties);
return _detail::ServiceClient::SetProperties(
*m_pipeline, m_serviceUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ShareServiceProperties> ShareServiceClient::GetProperties(
@ -128,9 +129,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Azure::Core::Context& context) const
{
(void)options;
auto protocolLayerOptions = _detail::ShareRestClient::Service::GetPropertiesOptions();
auto result = _detail::ShareRestClient::Service::GetProperties(
m_serviceUrl, *m_pipeline, context, protocolLayerOptions);
auto protocolLayerOptions = _detail::ServiceClient::GetServicePropertiesOptions();
auto result = _detail::ServiceClient::GetProperties(
*m_pipeline, m_serviceUrl, protocolLayerOptions, context);
Models::ShareServiceProperties ret;
ret.Cors = std::move(result.Value.Cors);
ret.HourMetrics = std::move(result.Value.HourMetrics);

View File

@ -0,0 +1,919 @@
# Azure Storage C++ Protocol Layer
> see https://aka.ms/autorest
## Configuration
```yaml
package-name: azure-storage-files-shares
namespace: Azure::Storage::Files::Shares
output-folder: generated
clear-output-folder: true
input-file: https://raw.githubusercontent.com/Jinming-Hu/azure-storage-api-specs/main/Microsoft.FileStorage/preview/2020-02-10/file.json
```
## ModelFour Options
```yaml
modelerfour:
naming:
property: pascal
parameter: pascal
```
## Customizations for Track 2 Generator
See the [AutoRest samples](https://github.com/Azure/autorest/tree/master/Samples/3b-custom-transformations)
for more about how we're customizing things.
### Fix Generator Warnings
```yaml
directive:
- from: swagger-document
where: $.info
transform: >
delete $["x-ms-code-generation-settings"];
```
### Delete Unused Query Parameters and Headers
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"].*.*.parameters
transform: >
$ = $.filter(p => !(p["$ref"] && (p["$ref"].endsWith("#/parameters/Timeout") || p["$ref"].endsWith("#/parameters/ClientRequestId"))));
- from: swagger-document
where: $["x-ms-paths"].*.*.responses.*.headers
transform: >
for (const h in $) {
if (["x-ms-client-request-id", "x-ms-request-id", "x-ms-version", "Date"].includes(h)) {
delete $[h];
}
}
```
### Delete Unused Operations
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]
transform: >
delete $["/{shareName}?restype=share&comp=undelete"].put;
```
### API Version
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.ApiVersion = {
"type": "string",
"x-ms-export": true,
"x-namespace": "_detail",
"x-ms-enum": {
"name": "ApiVersion",
"modelAsString": false
},
"enum": ["2020-02-10"],
"description": "The version used for the operations to Azure storage services."
};
- from: swagger-document
where: $.parameters
transform: >
$.ApiVersionParameter.enum[0] = "2020-02-10";
```
### Rename Operations
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]
transform: >
$["/{shareName}/{directory}/{fileName}?comp=range&fromURL"].put.operationId = "File_UploadRangeFromUri";
```
### Define names for return types
```yaml
directive:
- from: swagger-document
where: $
transform: >
const operationReturnTypeNames = new Map(Object.entries({
"Directory_ForceCloseHandles": "ForceCloseDirectoryHandlesResult",
}));
for (const url in $["x-ms-paths"]) {
for (const verb in $["x-ms-paths"][url]) {
const operation = $["x-ms-paths"][url][verb];
if (!operationReturnTypeNames.has(operation.operationId)) {
continue;
}
const returnTypeName = operationReturnTypeNames.get(operation.operationId);
const status_codes = Object.keys(operation.responses).filter(s => s !== "default");
const emptySchemaDefinition = {
"type": "object",
"x-ms-client-name": returnTypeName,
"x-ms-sealed": false,
"properties": {
"__placeHolder": {"type": "integer"}
}
};
$.definitions[returnTypeName] = emptySchemaDefinition;
status_codes.map(i => {
operation.responses[i].schema = {"$ref": `#/definitions/${returnTypeName}`};
});
}
}
```
### Return Type namespace
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.ListHandlesResponse["x-namespace"] = "_detail";
$.ListSharesResponse["x-namespace"] = "_detail";
$.FilesAndDirectoriesListSegment["x-namespace"] = "_detail";
$.ListFilesAndDirectoriesSegmentResponse["x-namespace"] = "_detail";
- from: swagger-document
where: $
transform: >
const operations = [
"Share_AcquireLease",
"Share_ReleaseLease",
"Share_ChangeLease",
"Share_RenewLease",
"Share_BreakLease",
"File_AcquireLease",
"File_ReleaseLease",
"File_ChangeLease",
"File_BreakLease",
"File_StartCopy",
"Directory_ForceCloseHandles",
"File_ForceCloseHandles",
];
for (const url in $["x-ms-paths"]) {
for (const verb in $["x-ms-paths"][url]) {
if (!operations.includes($["x-ms-paths"][url][verb].operationId)) continue;
const operation = $["x-ms-paths"][url][verb];
const status_codes = Object.keys(operation.responses).filter(s => s !== "default");
status_codes.forEach((status_code, i) => {
if (!operation.responses[status_code].schema) {
const operationId = operation.operationId;
const clientName = operationId.substr(0, operationId.indexOf("_"));
const operationName = operationId.substr(operationId.indexOf("_") + 1);
let operationWords = operationName.split(/(?=[A-Z])/);
operationWords.splice(1, 0, clientName);
const defaultReturnTypeName = operationWords.join("") + "Result";
operation.responses[status_code].schema = {
"type": "object",
"x-ms-sealed": false,
"x-ms-client-name": defaultReturnTypeName,
"x-namespace": "_detail",
"properties": {
"__placeHolder": {"type": "integer"}
}
};
} else if (operation.responses[status_code].schema["$ref"]) {
let obj = $;
for (const p of operation.responses[status_code].schema["$ref"].split("/").slice(1)) {
obj = obj[p];
}
obj["x-namespace"] = "_detail";
} else {
operation.responses[status_code].schema["x-namespace"] = "_detail";
}
});
}
}
```
### Global Changes for Definitions, Types etc.
```yaml
directive:
- from: swagger-document
where: $.parameters
transform: >
$.ListSharesInclude.items["x-ms-enum"].name = "ListSharesIncludeFlags";
$.AccessTierOptional.enum.push("Premium");
$.AccessTierOptional["x-ms-enum"].name = "AccessTier";
$.AccessTierOptional["x-ms-enum"].modelAsString = false;
$.DeleteSnapshots["x-ms-enum"].name = "DeleteSnapshotsOption";
$.DeleteSnapshots.enum = ["__placeHolder", "include"];
$.FileCopyPermissionCopyMode["x-ms-enum"].name = "PermissionCopyMode";
$.MaxResults["x-ms-client-name"] = "MaxResults";
delete $.FileCreationTime.format;
delete $.FileLastWriteTime.format;
- from: swagger-document
where: $.definitions
transform: >
$.ContentRange = {"type": "object", "x-ms-format": "range", properties: {"__placeHolder" : {"type": "integer"}}};
$.Range = $.ContentRange;
$.ClearRange = $.Range;
$.LeaseStatus["x-ms-enum"]["name"] = "LeaseStatus";
$.LeaseState["x-ms-enum"]["name"] = "LeaseState";
$.FileAttributes = {
"type": "string",
"x-ms-separator": " | ",
"enum": ["ReadOnly", "Hidden", "System", "None", "Directory", "Archive", "Temporary", "Offline", "NotContentIndexed", "NoScrubData"],
"x-ms-enum": {
"name": "FileAttributes",
"modelAsString": false
},
"description": "Attributes for a file or directory."
};
$.FileSmbProperties = {
"type": "object",
"properties": {
"PermissionKey": {"type": "string", "x-nullable": true, "description": "Permission key for the directory or file."},
"Attributes": {"$ref": "#/definitions/FileAttributes", "description": "Attributes for the file or directory."},
"CreatedOn": {"type": "string", "format": "date-time", "x-nullable": true, "description": "Creation time for the file or directory."},
"LastWrittenOn": {"type": "string", "format": "date-time", "x-nullable": true, "description": "Last write time for the file or directory."},
"ChangedOn": {"type": "string", "format": "date-time", "x-nullable": true, "description": "Changed time for the file or directory."},
"FileId": {"type": "string", "description": "The fileId of the file."},
"ParentFileId": {"type": "string", "description": "The parentId of the file."}
},
"description": "The SMB related properties for the file."
};
$.AccessTier = {
"type": "string",
"enum": ["TransactionOptimized", "Hot", "Cool", "Premium"],
"x-ms-enum": {
"name": "AccessTier",
"modelAsString": false
},
"description": "Specifies the access tier of the share."
};
$.Metadata = {"type": "object", "x-ms-format": "caseinsensitivemap", properties: {"__placeHolder" : {"type": "integer"}}, "description": "A set of name-value pairs associated with the share or file."};
$.CopyStatus = {
"type": "string",
"enum": ["pending", "success", "aborted", "failed"],
"x-ms-enum": {
"name": "CopyStatus",
"modelAsString": false
},
"description": "Status of a copy operation."
};
$.HashAlgorithm = {
"type": "string",
"x-ms-external": true,
"x-namespace": "::Azure::Storage",
"enum": ["Md5", "Crc64"],
"x-ms-enum": {
"name": "HashAlgorithm",
"modelAsString": false
}
};
$.ContentHash = {
"type": "object",
"x-ms-external": true,
"x-namespace": "::Azure::Storage",
"properties": {
"Value": {"type": "string", "format": "byte", "x-ms-xml": {"name": "Content-MD5"}},
"Algorithm": {"$ref": "#/definitions/HashAlgorithm", "x-ms-xml": {"name": ""}}
}
};
$.FileHttpHeaders = {
"type": "object",
"properties": {
"Content-Type": {"type": "string", "description": "MIME content type of the file."},
"Content-Encoding": {"type": "string", "description": "Specifies which content encodings have been applied to the file."},
"Content-Language": {"type": "string", "description": "Specifies the natural languages used by this file."},
"Content-Hash": {"$ref": "#/definitions/ContentHash", "x-ms-xml": {"name": "."}, "description": "Hash of the file content."},
"Content-Disposition": {"type": "string", "description": "Conveys additional information about how to process the resource payload, and also can be used to attach additional metadata." },
"Cache-Control": {"type": "string", "description": "Specifies directives for caching mechanisms." }
},
"description": "Standard HTTP properties supported files."
};
$.SharePermission["x-namespace"] = "_detail";
- from: swagger-document
where: $["x-ms-paths"].*.*.responses.*.headers
transform: >
for (var header in $) {
if (header === "x-ms-lease-status") {
$[header]["x-ms-enum"]["name"] = "LeaseStatus";
}
if (header === "x-ms-lease-state") {
$[header]["x-ms-enum"]["name"] = "LeaseState";
}
if (header === "x-ms-copy-status") {
$[header]["x-ms-enum"]["name"] = "CopyStatus";
}
if (header === "x-ms-meta") {
$[header]["x-ms-format"] = "caseinsensitivemap";
}
}
```
### GetFileServiceProperties
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.Metrics["type"] = "object";
delete $.Metrics.required;
$.Metrics.properties["IncludeAPIs"]["x-ms-client-name"] = "IncludeApis";
$.Metrics.properties["IncludeAPIs"]["x-nullable"] = true;
$.SmbSettings = $.ShareSmbSettings;
delete $.ShareSmbSettings;
$.ShareProtocolSettings.properties["Smb"]["$ref"] = "#/definitions/SmbSettings";
$.ShareProtocolSettings.properties["Settings"] = $.ShareProtocolSettings.properties["Smb"];
delete $.ShareProtocolSettings.properties["Smb"];
$.ProtocolSettings = $.ShareProtocolSettings;
delete $.ShareProtocolSettings;
$.StorageServiceProperties.properties["Protocol"]["$ref"] = "#/definitions/ProtocolSettings";
$.ShareServiceProperties = $.StorageServiceProperties;
delete $.StorageServiceProperties;
$.ShareServiceProperties.xml = { "name": "StorageServiceProperties" };
$.ShareServiceProperties.properties["Protocol"]["x-nullable"] = true;
- from: swagger-document
where: $.parameters
transform: >
$.ShareServiceProperties = $.StorageServiceProperties;
$.ShareServiceProperties.name = "ShareServiceProperties";
$.ShareServiceProperties.schema["$ref"] = "#/definitions/ShareServiceProperties";
delete $.StorageServiceProperties;
- from: swagger-document
where: $["x-ms-paths"]["/?restype=service&comp=properties"]
transform: >
$.put.parameters[0]["$ref"] = "#/parameters/ShareServiceProperties";
$.get.responses["200"].schema["$ref"] = "#/definitions/ShareServiceProperties";
```
### GetShareStatistics
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
delete $.ShareStats;
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share&comp=stats"].get.responses["200"]
transform: >
$.schema = {
"description": "Stats for the share.",
"type": "object",
"x-ms-sealed": false,
"x-ms-client-name": "ShareStatistics",
"xml": {"name": "ShareStats"},
"properties": {
"ShareUsageBytes": {
"description": "The approximate size of the data stored in bytes. Note that this value may not include all recently created or recently resized files.",
"type": "integer",
"format": "int64",
"x-ms-client-name": "ShareUsageInBytes"
}
}
};
```
### ListShares
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.ListSharesResponse.properties["ShareItems"]["x-ms-xml"] = {"name": "Shares"};
$.ShareItemDetails = $.ShareProperties;
delete $.ShareProperties;
$.ShareItemDetails.properties["Quota"]["format"] = "int64";
$.ShareItemDetails.properties["AccessTierChangeTime"]["x-ms-client-name"] = "AccessTierChangedOn";
$.ShareItemDetails.properties["AccessTier"] = {"$ref": "#/definitions/AccessTier"};
$.ShareItemDetails.properties["DeletedTime"]["x-ms-client-name"] = "DeletedOn";
$.ShareItemDetails.required.push("RemainingRetentionDays", "LeaseStatus", "LeaseState", "LeaseDuration");
$.ShareItem.properties["Details"] = {"$ref": "#/definitions/ShareItemDetails", "x-ms-xml": {"name": "Properties"}};
delete $.ShareItem.properties["Properties"];
delete $.ShareItem.required;
```
### CreateShare
```yaml
directive:
- from: swagger-document
where: $.parameters
transform: >
$.ShareQuota["format"] = "int64";
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share"].put.responses["201"]
transform: >
$.schema = {
"type": "object",
"x-ms-client-name": "CreateShareResult",
"x-ms-sealed": false,
"properties": {
"Created": {"type": "boolean", "x-ms-client-default": true, "x-ms-xml": {"name": ""}, "description": "Indicates if the share was successfully created by this operation."}
}
};
```
### GetShareProperties
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share"].get.responses["200"].headers
transform: >
$["x-ms-share-quota"]["format"] = "int64";
$["x-ms-share-provisioned-iops"]["x-nullable"] = true;
$["x-ms-share-provisioned-ingress-mbps"]["x-nullable"] = true;
$["x-ms-share-provisioned-egress-mbps"]["x-nullable"] = true;
$["x-ms-share-next-allowed-quota-downgrade-time"]["x-nullable"] = true;
$["x-ms-lease-duration"]["x-nullable"] = true;
$["x-ms-lease-state"]["x-nullable"] = true;
$["x-ms-lease-status"]["x-nullable"] = true;
$["x-ms-access-tier-change-time"]["x-nullable"] = true;
$["x-ms-access-tier-change-time"]["x-ms-client-name"] = "AccessTierChangedOn";
$["x-ms-access-tier-transition-state"]["x-nullable"] = true;
$["x-ms-access-tier-transition-state"].description = "Returns the transition state between access tiers, when present.";
$["x-ms-share-provisioned-iops"].description = "Returns the current share provisioned IOPS.";
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share"].get.responses["200"]
transform: >
$.schema = {
"type": "object",
"x-ms-client-name": "ShareProperties",
"x-ms-sealed": false,
"properties": {
"AccessTier": {"$ref": "#/definitions/AccessTier", "x-nullable": true, "x-ms-xml": {"name": ""}}
}
};
```
### GetShareAccessPolicy
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.AccessPolicy.required = ["Permission"];
$.AccessPolicy.properties["Start"]["x-ms-client-name"] = "StartsOn";
$.AccessPolicy.properties["Expiry"]["x-ms-client-name"] = "ExpiresOn";
$.SignedIdentifier.properties["AccessPolicy"]["x-ms-client-name"] = "Policy";
delete $.SignedIdentifier.required;
delete $.SignedIdentifiers.items.xml;
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share&comp=acl"].get.responses["200"]
transform: >
$.schema = {
"type": "object",
"x-ms-client-name": "ShareAccessPolicy",
"x-ms-sealed": "false",
"xml": {"name": "."},
"properties": {
"SignedIdentifiers": {"$ref": "#/definitions/SignedIdentifiers"}
}
};
```
### DeleteShare
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share"].delete.responses["202"]
transform: >
$.schema = {
"type": "object",
"x-ms-client-name": "DeleteShareResult",
"x-ms-sealed": false,
"properties": {
"Deleted": {"type": "boolean", "x-ms-client-default": true, "x-ms-xml": {"name": ""}, "description": "Indicates if the share was successfully deleted by this operation."},
}
};
```
### ListFilesAndDirectories
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.ListFilesAndDirectoriesSegmentResponse.properties["Segment"]["x-ms-xml"] = {"name": "Entries"};
$.FileItemDetails = $.FileProperty;
$.FileItemDetails.properties["Content-Length"]["x-ms-client-name"] = "FileSize";
delete $.FileProperty;
$.FileItem.properties["Details"] = {"$ref": "#/definitions/FileItemDetails"};
delete $.FileItem.properties["Properties"];
delete $.FileItem.required;
$.FilesAndDirectoriesListSegment.properties["DirectoryItems"]["x-ms-xml"] = {"name": "."};
$.FilesAndDirectoriesListSegment.properties["FileItems"]["x-ms-xml"] = {"name": "."};
$.FileItem.properties["Details"]["x-ms-xml"] = {"name": "Properties"};
```
### ListHandles
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
delete $.HandleItem.required;
$.HandleItem.properties["OpenTime"]["x-ms-client-name"] = "OpenedOn";
$.HandleItem.properties["LastReconnectTime"]["x-ms-client-name"] = "LastReconnectedOn";
```
### ForceCloseFileHandles
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=forceclosehandles"].put.responses["200"].headers
transform: >
$["x-ms-marker"]["x-ms-client-name"] = "ContinuationToken";
$["x-ms-marker"]["x-nullable"] = true;
```
### ForceCloseDirectoryHandles
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}?comp=forceclosehandles"].put.responses["200"].headers
transform: >
$["x-ms-marker"]["x-ms-client-name"] = "ContinuationToken";
$["x-ms-marker"]["x-nullable"] = true;
```
### CreateDirecotry
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory"].put.responses["201"]
transform: >
$.headers["x-ms-file-permission-key"]["x-ms-client-path"] = "SmbProperties.PermissionKey";
$.headers["x-ms-file-attributes"]["x-ms-client-path"] = "SmbProperties.Attributes";
$.headers["x-ms-file-creation-time"]["x-ms-client-path"] = "SmbProperties.CreatedOn";
$.headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "SmbProperties.LastWrittenOn";
$.headers["x-ms-file-change-time"]["x-ms-client-path"] = "SmbProperties.ChangedOn";
$.headers["x-ms-file-id"]["x-ms-client-path"] = "SmbProperties.FileId";
$.headers["x-ms-file-parent-id"]["x-ms-client-path"] = "SmbProperties.ParentFileId";
$.schema = {
"type": "object",
"x-ms-client-name": "CreateDirectoryResult",
"x-ms-sealed": false,
"properties": {
"Created": {"type": "boolean", "x-ms-client-default": true, "x-ms-xml": {"name": ""}, "description": "Indicates if the directory was successfully created by this operation."},
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}}
}
};
```
### DeleteDirectory
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory"].delete.responses["202"]
transform: >
$.schema = {
"type": "object",
"x-ms-client-name": "DeleteDirectoryResult",
"x-ms-sealed": false,
"properties": {
"Deleted": {"type": "boolean", "x-ms-client-default": true, "x-ms-xml": {"name": ""}, "description": "Indicates if the directory was successfully deleted by this operation."}
}
};
```
### GetDirectoryProperties
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory"].get.responses["200"]
transform: >
$.headers["x-ms-file-permission-key"]["x-ms-client-path"] = "SmbProperties.PermissionKey";
$.headers["x-ms-file-attributes"]["x-ms-client-path"] = "SmbProperties.Attributes";
$.headers["x-ms-file-creation-time"]["x-ms-client-path"] = "SmbProperties.CreatedOn";
$.headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "SmbProperties.LastWrittenOn";
$.headers["x-ms-file-change-time"]["x-ms-client-path"] = "SmbProperties.ChangedOn";
$.headers["x-ms-file-id"]["x-ms-client-path"] = "SmbProperties.FileId";
$.headers["x-ms-file-parent-id"]["x-ms-client-path"] = "SmbProperties.ParentFileId";
$.schema = {
"type": "object",
"x-ms-client-name": "DirectoryProperties",
"x-ms-sealed": false,
"properties": {
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}}
}
};
```
### SetDirectoryProperties
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}?restype=directory&comp=properties"].put.responses["200"]
transform: >
$.headers["x-ms-file-permission-key"]["x-ms-client-path"] = "SmbProperties.PermissionKey";
$.headers["x-ms-file-attributes"]["x-ms-client-path"] = "SmbProperties.Attributes";
$.headers["x-ms-file-creation-time"]["x-ms-client-path"] = "SmbProperties.CreatedOn";
$.headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "SmbProperties.LastWrittenOn";
$.headers["x-ms-file-change-time"]["x-ms-client-path"] = "SmbProperties.ChangedOn";
$.headers["x-ms-file-id"]["x-ms-client-path"] = "SmbProperties.FileId";
$.headers["x-ms-file-parent-id"]["x-ms-client-path"] = "SmbProperties.ParentFileId";
$.schema = {
"type": "object",
"x-ms-client-name": "SetDirectoryPropertiesResult",
"x-ms-sealed": false,
"properties": {
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}}
}
};
```
### CreateFile
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"].put.responses["201"]
transform: >
$.headers["x-ms-file-permission-key"]["x-ms-client-path"] = "SmbProperties.PermissionKey";
$.headers["x-ms-file-attributes"]["x-ms-client-path"] = "SmbProperties.Attributes";
$.headers["x-ms-file-creation-time"]["x-ms-client-path"] = "SmbProperties.CreatedOn";
$.headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "SmbProperties.LastWrittenOn";
$.headers["x-ms-file-change-time"]["x-ms-client-path"] = "SmbProperties.ChangedOn";
$.headers["x-ms-file-id"]["x-ms-client-path"] = "SmbProperties.FileId";
$.headers["x-ms-file-parent-id"]["x-ms-client-path"] = "SmbProperties.ParentFileId";
$.schema = {
"type": "object",
"x-ms-client-name": "CreateFileResult",
"x-ms-sealed": false,
"properties": {
"Created": {"type": "boolean", "x-ms-client-default": true, "x-ms-xml": {"name": ""}, "description": "Indicates if the file was successfully created by this operation."},
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}}
}
};
```
### GetFileProperties
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"].head.responses["200"]
transform: >
$.headers["x-ms-file-permission-key"]["x-ms-client-path"] = "SmbProperties.PermissionKey";
$.headers["x-ms-file-attributes"]["x-ms-client-path"] = "SmbProperties.Attributes";
$.headers["x-ms-file-creation-time"]["x-ms-client-path"] = "SmbProperties.CreatedOn";
$.headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "SmbProperties.LastWrittenOn";
$.headers["x-ms-file-change-time"]["x-ms-client-path"] = "SmbProperties.ChangedOn";
$.headers["x-ms-file-id"]["x-ms-client-path"] = "SmbProperties.FileId";
$.headers["x-ms-file-parent-id"]["x-ms-client-path"] = "SmbProperties.ParentFileId";
$.headers["Content-Length"]["x-ms-client-name"] = "FileSize";
$.headers["Content-Type"]["x-ms-client-path"] = "HttpHeaders.ContentType";
$.headers["Content-Type"]["x-nullable"] = true;
$.headers["Content-Encoding"]["x-ms-client-path"] = "HttpHeaders.ContentEncoding";
$.headers["Content-Encoding"]["x-nullable"] = true;
$.headers["Cache-Control"]["x-ms-client-path"] = "HttpHeaders.CacheControl";
$.headers["Cache-Control"]["x-nullable"] = true;
$.headers["Content-Disposition"]["x-ms-client-path"] = "HttpHeaders.ContentDisposition";
$.headers["Content-Disposition"]["x-nullable"] = true;
$.headers["Content-Language"]["x-ms-client-path"] = "HttpHeaders.ContentLanguage";
$.headers["Content-Language"]["x-nullable"] = true;
$.headers["Content-MD5"]["x-ms-client-path"] = "HttpHeaders.ContentHash";
$.headers["Content-MD5"]["x-nullable"] = true;
$.headers["x-ms-copy-completion-time"]["x-ms-client-name"] = "CopyCompletedOn";
$.headers["x-ms-copy-completion-time"]["x-nullable"] = true;
$.headers["x-ms-copy-status-description"]["x-nullable"] = true;
$.headers["x-ms-copy-id"]["x-nullable"] = true;
$.headers["x-ms-copy-progress"]["x-nullable"] = true;
$.headers["x-ms-copy-source"]["x-nullable"] = true;
$.headers["x-ms-copy-status"]["x-nullable"] = true;
$.headers["x-ms-lease-duration"]["x-nullable"] = true;
$.headers["x-ms-lease-state"]["x-nullable"] = true;
$.headers["x-ms-lease-status"]["x-nullable"] = true;
delete $.headers["x-ms-type"];
$.schema = {
"type": "object",
"x-ms-client-name": "FileProperties",
"x-ms-sealed": false,
"properties": {
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}},
"HttpHeaders": {"$ref": "#/definitions/FileHttpHeaders", "x-ms-xml": {"name": ""}}
}
};
```
### SetFileProperties
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=properties"].put.responses["200"]
transform: >
$.headers["x-ms-file-permission-key"]["x-ms-client-path"] = "SmbProperties.PermissionKey";
$.headers["x-ms-file-attributes"]["x-ms-client-path"] = "SmbProperties.Attributes";
$.headers["x-ms-file-creation-time"]["x-ms-client-path"] = "SmbProperties.CreatedOn";
$.headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "SmbProperties.LastWrittenOn";
$.headers["x-ms-file-change-time"]["x-ms-client-path"] = "SmbProperties.ChangedOn";
$.headers["x-ms-file-id"]["x-ms-client-path"] = "SmbProperties.FileId";
$.headers["x-ms-file-parent-id"]["x-ms-client-path"] = "SmbProperties.ParentFileId";
$.schema = {
"type": "object",
"x-ms-client-name": "SetFilePropertiesResult",
"x-ms-sealed": false,
"properties": {
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}}
}
};
```
### DownloadFile
```yaml
directive:
- from: swagger-document
where: $.definitions
transform: >
$.DownloadFileDetails = {
"type": "object",
"required": ["ETag", "LastModified", "IsServerEncrypted", "SmbProperties"],
"properties": {
"ETag": {"type": "string", "format": "etag", "description": "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."},
"LastModified": {"type": "string", "format": "date-time-rfc1123", "description": "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."},
"Metadata": {"$ref": "#/definitions/Metadata"},
"CopyId": {"type": "string", "description": " String identifier for this copy operation. Use with Get File Properties to check the status of this copy operation, or pass to Abort Copy File to abort a pending copy."},
"CopySource": {"type": "string", "description": "URL up to 2 KB in length that specifies the source file or file used in the last attempted Copy File operation where this file was the destination file. This header does not appear if this file has never been the destination in a Copy File operation, or if this file has been modified after a concluded Copy File operation using Set File Properties, Put File, or Put Block List."},
"CopyStatus": {"$ref": "#/definitions/CopyStatus"},
"CopyStatusDescription": {"type": "string", "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this file has never been the destination in a Copy File operation, or if this file has been modified after a concluded Copy File operation using Set File Properties, Put File, or Put Block List"},
"CopyProgress": {"type": "string", "description": "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. This header does not appear if this file has never been the destination in a Copy File operation, or if this file has been modified after a concluded Copy File operation using Set File Properties, Put File, or Put Block List"},
"CopyCompletedOn": {"type": "string", "format": "date-time-rfc1123", "description": "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. This header does not appear if a copy is pending, if this file has never been the destination in a Copy File operation, or if this file has been modified after a concluded Copy File operation using Set File Properties, Put File, or Put Block List."},
"IsServerEncrypted": {"type": "boolean", "description": "True if the file data and 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)."},
"SmbProperties": {"$ref": "#/definitions/FileSmbProperties", "x-ms-xml": {"name": ""}},
"LeaseDuration": {"$ref": "#/definitions/LeaseDuration"},
"LeaseState": {"$ref": "#/definitions/LeaseState"},
"LeaseStatus": {"$ref": "#/definitions/LeaseStatus"}
}
};
$.DownloadFileResult = {
"type": "object",
"x-ms-sealed": false,
"properties": {
"BodyStream": {"type": "object", "format": "file", "description": "Content of the file or file range."},
"ContentRange": {"$ref": "#/definitions/ContentRange", "x-ms-xml": {"name": ""}, "description": "Indicates the range of bytes returned."},
"FileSize": {"type": "integer", "format": "int64", "x-ms-xml": {"name": ""}},
"TransactionalContentHash": {"$ref": "#/definitions/ContentHash", "x-nullable": true, "x-ms-xml": {"name": ""}, "description": "MD5 hash for the downloaded range of data."},
"HttpHeaders": {"$ref": "#/definitions/FileHttpHeaders", "x-ms-xml": {"name": ""}},
"Details": {"$ref": "#/definitions/DownloadFileDetails", "x-ms-xml": {"name": ""}}
}
};
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"].get.responses
transform: >
for (const status_code of ["200", "206"]) {
$[status_code].headers["ETag"]["x-ms-client-path"] = "Details.ETag";
$[status_code].headers["Last-Modified"]["x-ms-client-path"] = "Details.LastModified";
$[status_code].headers["x-ms-meta"]["x-ms-client-path"] = "Details.Metadata";
$[status_code].headers["Content-Type"]["x-ms-client-path"] = "HttpHeaders.ContentType";
$[status_code].headers["Content-Type"]["x-nullable"] = true;
$[status_code].headers["Content-Encoding"]["x-ms-client-path"] = "HttpHeaders.ContentEncoding";
$[status_code].headers["Content-Encoding"]["x-nullable"] = true;
$[status_code].headers["Cache-Control"]["x-ms-client-path"] = "HttpHeaders.CacheControl";
$[status_code].headers["Cache-Control"]["x-nullable"] = true;
$[status_code].headers["Content-Disposition"]["x-ms-client-path"] = "HttpHeaders.ContentDisposition";
$[status_code].headers["Content-Disposition"]["x-nullable"] = true;
$[status_code].headers["Content-Language"]["x-ms-client-path"] = "HttpHeaders.ContentLanguage";
$[status_code].headers["Content-Language"]["x-nullable"] = true;
$[status_code].headers["x-ms-copy-completion-time"]["x-ms-client-path"] = "Details.CopyCompletedOn";
$[status_code].headers["x-ms-copy-status-description"]["x-ms-client-path"] = "Details.CopyStatusDescription";
$[status_code].headers["x-ms-copy-id"]["x-ms-client-path"] = "Details.CopyId";
$[status_code].headers["x-ms-copy-progress"]["x-ms-client-path"] = "Details.CopyProgress";
$[status_code].headers["x-ms-copy-source"]["x-ms-client-path"] = "Details.CopySource";
$[status_code].headers["x-ms-copy-status"]["x-ms-client-path"] = "Details.CopyStatus";
$[status_code].headers["x-ms-lease-duration"]["x-ms-client-path"] = "Details.LeaseDuration";
$[status_code].headers["x-ms-lease-state"]["x-ms-client-path"] = "Details.LeaseState";
$[status_code].headers["x-ms-lease-status"]["x-ms-client-path"] = "Details.LeaseStatus";
$[status_code].headers["x-ms-server-encrypted"]["x-ms-client-path"] = "Details.IsServerEncrypted";
$[status_code].headers["x-ms-file-permission-key"]["x-ms-client-path"] = "Details.SmbProperties.PermissionKey";
$[status_code].headers["x-ms-file-attributes"]["x-ms-client-path"] = "Details.SmbProperties.Attributes";
$[status_code].headers["x-ms-file-creation-time"]["x-ms-client-path"] = "Details.SmbProperties.CreatedOn";
$[status_code].headers["x-ms-file-last-write-time"]["x-ms-client-path"] = "Details.SmbProperties.LastWrittenOn";
$[status_code].headers["x-ms-file-change-time"]["x-ms-client-path"] = "Details.SmbProperties.ChangedOn";
$[status_code].headers["x-ms-file-id"]["x-ms-client-path"] = "Details.SmbProperties.FileId";
$[status_code].headers["x-ms-file-parent-id"]["x-ms-client-path"] = "Details.SmbProperties.ParentFileId";
delete $[status_code].headers["Accept-Ranges"];
delete $[status_code].headers["Content-Length"];
delete $[status_code].headers["Content-Range"];
$[status_code].schema = {"$ref": "#/definitions/DownloadFileResult"};
}
$["200"].headers["Content-MD5"] = {"type": "string", "format": "byte", "x-ms-client-name": "TransactionalContentHash", "x-ms-client-path": "HttpHeaders.ContentHash", "x-nullable": true};
$["206"].headers["Content-MD5"] = {"type": "string", "format": "byte", "x-ms-client-name": "TransactionalContentHash", "x-nullable": true};
$["200"].headers["x-ms-content-md5"] = {"type": "string", "format": "byte", "x-ms-client-path": "HttpHeaders.ContentHash", "x-nullable": true};
$["206"].headers["x-ms-content-md5"] = $["200"].headers["x-ms-content-md5"];
```
### DeleteFile
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}"].delete.responses["202"]
transform: >
$.schema = {
"type": "object",
"x-ms-client-name": "DeleteFileResult",
"x-ms-sealed": false,
"properties": {
"Deleted": {"type": "boolean", "x-ms-client-default": true, "x-ms-xml": {"name": ""}, "description": "Indicates if the file was successfully deleted by this operation."}
}
};
```
### UploadFileRange
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=range"].put.parameters
transform: >
for (const p of $) {
if (p["x-ms-client-name"] && p["x-ms-client-name"] === "FileRangeWrite") {
delete p["x-ms-enum"];
delete p["enum"];
delete p["default"];
}
}
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=range"].put.responses["201"].headers
transform: >
$["Content-MD5"]["x-ms-client-name"] = "TransactionalContentHash";
$["Content-MD5"]["x-ms-client-default"] = "";
$["Content-MD5"]["x-nullable"] = true;
$["x-ms-request-server-encrypted"]["x-ms-client-default"] = false;
$["x-ms-request-server-encrypted"]["x-nullable"] = true;
```
### UploadFileRangeFromUri
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=range&fromURL"].put.responses["201"].headers
transform: >
$["x-ms-content-crc64"]["x-ms-client-name"] = "TransactionalContentHash";
$["x-ms-content-crc64"]["x-ms-client-default"] = "";
$["x-ms-content-crc64"]["x-nullable"] = true;
$["x-ms-request-server-encrypted"]["x-ms-client-default"] = false;
$["x-ms-request-server-encrypted"]["x-nullable"] = true;
```
### GetFileRangeList
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=rangelist"].get.responses["200"]
transform: >
$.headers["x-ms-content-length"]["x-ms-client-name"] = "FileSize";
$.schema = {
"x-ms-client-name": "GetFileRangeListResult",
"x-ms-sealed": false,
"xml": {"name": "Ranges"},
"type": "object",
"properties": {
"Range": {
"type": "array",
"x-ms-client-name": "Ranges",
"x-ms-xml": {"name": "."},
"items": {"$ref": "#/definitions/Range"}
},
"ClearRange": {
"type": "array",
"x-ms-client-name": "ClearRanges",
"x-ms-xml": {"name": "."},
"items": {"$ref": "#/definitions/ClearRange"}
}
}
};
```
### BreakFileLease
```yaml
directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}/{directory}/{fileName}?comp=lease&break"].put.responses["202"].headers
transform: >
delete $["x-ms-lease-id"];
```

View File

@ -2,8 +2,8 @@
"networkCallRecords": [
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "0711a2aa-ae9e-42ca-754f-3301bb67cdc5",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "7578973b-1466-4073-7dd0-4d0805c4bf24",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -12,20 +12,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:44 GMT",
"etag": "\"0x8D9CF33032861AF\"",
"last-modified": "Tue, 04 Jan 2022 03:33:45 GMT",
"date": "Fri, 25 Feb 2022 09:37:12 GMT",
"etag": "\"0x8D9F84266BCB14B\"",
"last-modified": "Fri, 25 Feb 2022 09:37:12 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "0711a2aa-ae9e-42ca-754f-3301bb67cdc5",
"x-ms-request-id": "c5e663a6-d01a-003f-031b-0177a4000000",
"x-ms-client-request-id": "7578973b-1466-4073-7dd0-4d0805c4bf24",
"x-ms-request-id": "185c5f07-e01a-003c-622b-2af305000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestpremiumshare?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "44427081-fc2b-4a60-7281-4515b8c3e0fa",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "d05b4197-b142-4d5c-44d4-27c1fd4a532a",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -34,20 +34,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:44 GMT",
"etag": "\"0x8D9CF330334F600\"",
"last-modified": "Tue, 04 Jan 2022 03:33:45 GMT",
"date": "Fri, 25 Feb 2022 09:37:13 GMT",
"etag": "\"0x8D9F842677996FF\"",
"last-modified": "Fri, 25 Feb 2022 09:37:13 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "44427081-fc2b-4a60-7281-4515b8c3e0fa",
"x-ms-request-id": "987a41c4-c01a-001a-521b-013839000000",
"x-ms-client-request-id": "d05b4197-b142-4d5c-44d4-27c1fd4a532a",
"x-ms-request-id": "61aed4d1-401a-0059-052b-2ade65000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/premiumshare?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "0ff6e30d-2d61-4bd4-76f7-69f08bc4544f",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "baf0fbc5-e307-4e85-4515-9dfc00d32773",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -56,19 +56,19 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:44 GMT",
"etag": "\"0x8D9CF330334F600\"",
"last-modified": "Tue, 04 Jan 2022 03:33:45 GMT",
"date": "Fri, 25 Feb 2022 09:37:14 GMT",
"etag": "\"0x8D9F842677996FF\"",
"last-modified": "Fri, 25 Feb 2022 09:37:13 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-access-tier": "Premium",
"x-ms-client-request-id": "0ff6e30d-2d61-4bd4-76f7-69f08bc4544f",
"x-ms-client-request-id": "baf0fbc5-e307-4e85-4515-9dfc00d32773",
"x-ms-enabled-protocols": "SMB",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "987a41ca-c01a-001a-531b-013839000000",
"x-ms-share-next-allowed-quota-downgrade-time": "Tue, 04 Jan 2022 03:33:45 GMT",
"x-ms-request-id": "da56bb13-f01a-005c-422b-2a0cbe000000",
"x-ms-share-next-allowed-quota-downgrade-time": "Fri, 25 Feb 2022 09:37:13 GMT",
"x-ms-share-provisioned-egress-mbps": "110",
"x-ms-share-provisioned-ingress-mbps": "110",
"x-ms-share-provisioned-iops": "3100",
@ -79,95 +79,95 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "aab72950-72cc-4a4c-439b-191246d97093",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "6b7e87b5-05e9-48dc-40dd-bfb66f501495",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
"Response": {
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><EnumerationResults ServiceEndpoint=\"https://sharespremiumrecord.file.core.windows.net/\"><Prefix>premiumshare</Prefix><Shares><Share><Name>premiumshare</Name><Properties><Last-Modified>Tue, 04 Jan 2022 03:33:45 GMT</Last-Modified><Etag>\"0x8D9CF330334F600\"</Etag><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><Quota>100</Quota><EnabledProtocols>SMB</EnabledProtocols><AccessTier>Premium</AccessTier><ProvisionedIops>3100</ProvisionedIops><ProvisionedIngressMBps>110</ProvisionedIngressMBps><ProvisionedEgressMBps>110</ProvisionedEgressMBps><NextAllowedQuotaDowngradeTime>Tue, 04 Jan 2022 03:33:45 GMT</NextAllowedQuotaDowngradeTime><DefaultEncryptionScope>$account-encryption-key</DefaultEncryptionScope><DenyEncryptionScopeOverride>false</DenyEncryptionScopeOverride></Properties></Share></Shares><NextMarker /></EnumerationResults>",
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><EnumerationResults ServiceEndpoint=\"https://premiumfileut.file.core.windows.net/\"><Prefix>premiumshare</Prefix><Shares><Share><Name>premiumshare</Name><Properties><Last-Modified>Fri, 25 Feb 2022 09:37:13 GMT</Last-Modified><Etag>\"0x8D9F842677996FF\"</Etag><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><Quota>100</Quota><EnabledProtocols>SMB</EnabledProtocols><AccessTier>Premium</AccessTier><ProvisionedIops>3100</ProvisionedIops><ProvisionedIngressMBps>110</ProvisionedIngressMBps><ProvisionedEgressMBps>110</ProvisionedEgressMBps><NextAllowedQuotaDowngradeTime>Fri, 25 Feb 2022 09:37:13 GMT</NextAllowedQuotaDowngradeTime><DefaultEncryptionScope>$account-encryption-key</DefaultEncryptionScope><DenyEncryptionScopeOverride>false</DenyEncryptionScopeOverride></Properties></Share></Shares><NextMarker /></EnumerationResults>",
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-type": "application/xml",
"date": "Tue, 04 Jan 2022 03:33:44 GMT",
"date": "Fri, 25 Feb 2022 09:37:15 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"transfer-encoding": "chunked",
"x-ms-client-request-id": "aab72950-72cc-4a4c-439b-191246d97093",
"x-ms-request-id": "987a41cc-c01a-001a-541b-013839000000",
"x-ms-client-request-id": "6b7e87b5-05e9-48dc-40dd-bfb66f501495",
"x-ms-request-id": "9b7e8b0e-c01a-009c-322b-2af480000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net?comp=list&prefix=premiumshare"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "5bf701a8-3a47-4e1a-4f62-e1eb4988e673",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "f76fa7c6-636f-48ff-42ec-e5e9bb4c94d4",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
"Response": {
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:987a41ce-c01a-001a-551b-013839000000\nTime:2022-01-04T03:33:45.4069855Z</Message><HeaderName>x-ms-access-tier</HeaderName><HeaderValue>Hot</HeaderValue></Error>",
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:ff9ff323-301a-00c5-462b-2a7303000000\nTime:2022-02-25T09:37:17.0122004Z</Message><HeaderName>x-ms-access-tier</HeaderName><HeaderValue>Hot</HeaderValue></Error>",
"REASON_PHRASE": "The value for one of the HTTP headers is not in the correct format.",
"STATUS_CODE": "400",
"content-length": "325",
"content-type": "application/xml",
"date": "Tue, 04 Jan 2022 03:33:44 GMT",
"date": "Fri, 25 Feb 2022 09:37:16 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "5bf701a8-3a47-4e1a-4f62-e1eb4988e673",
"x-ms-client-request-id": "f76fa7c6-636f-48ff-42ec-e5e9bb4c94d4",
"x-ms-error-code": "InvalidHeaderValue",
"x-ms-request-id": "987a41ce-c01a-001a-551b-013839000000",
"x-ms-request-id": "ff9ff323-301a-00c5-462b-2a7303000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "3b8efb2d-3334-4184-49e2-e196cba57d0f",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "c4bb8d41-6d36-448a-799f-244fc932bcad",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
"Response": {
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:c7d64aae-901a-00e3-3f1b-013b1b000000\nTime:2022-01-04T03:33:45.4437987Z</Message><HeaderName>x-ms-access-tier</HeaderName><HeaderValue>Cool</HeaderValue></Error>",
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:01dca1be-b01a-0062-4b2b-2a9bc1000000\nTime:2022-02-25T09:37:18.1177573Z</Message><HeaderName>x-ms-access-tier</HeaderName><HeaderValue>Cool</HeaderValue></Error>",
"REASON_PHRASE": "The value for one of the HTTP headers is not in the correct format.",
"STATUS_CODE": "400",
"content-length": "326",
"content-type": "application/xml",
"date": "Tue, 04 Jan 2022 03:33:44 GMT",
"date": "Fri, 25 Feb 2022 09:37:17 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "3b8efb2d-3334-4184-49e2-e196cba57d0f",
"x-ms-client-request-id": "c4bb8d41-6d36-448a-799f-244fc932bcad",
"x-ms-error-code": "InvalidHeaderValue",
"x-ms-request-id": "c7d64aae-901a-00e3-3f1b-013b1b000000",
"x-ms-request-id": "01dca1be-b01a-0062-4b2b-2a9bc1000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "22834a79-f9da-4abe-5c41-02afc060b019",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "d23cf134-4906-445e-625d-c34b21131650",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
"Response": {
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:692a80d6-201a-00e6-7c1b-01e9c0000000\nTime:2022-01-04T03:33:45.4851608Z</Message><HeaderName>x-ms-access-tier</HeaderName><HeaderValue>TransactionOptimized</HeaderValue></Error>",
"BODY": "<?xml version=\"1.0\" encoding=\"utf-8\"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.\nRequestId:f3cdb96f-e01a-008b-5f2b-2a5d8b000000\nTime:2022-02-25T09:37:19.1856618Z</Message><HeaderName>x-ms-access-tier</HeaderName><HeaderValue>TransactionOptimized</HeaderValue></Error>",
"REASON_PHRASE": "The value for one of the HTTP headers is not in the correct format.",
"STATUS_CODE": "400",
"content-length": "342",
"content-type": "application/xml",
"date": "Tue, 04 Jan 2022 03:33:45 GMT",
"date": "Fri, 25 Feb 2022 09:37:18 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "22834a79-f9da-4abe-5c41-02afc060b019",
"x-ms-client-request-id": "d23cf134-4906-445e-625d-c34b21131650",
"x-ms-error-code": "InvalidHeaderValue",
"x-ms-request-id": "692a80d6-201a-00e6-7c1b-01e9c0000000",
"x-ms-request-id": "f3cdb96f-e01a-008b-5f2b-2a5d8b000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "41342f02-4d86-488b-5cb4-5501ff50332c",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "ed077086-1073-4051-7c3c-5ae3dca33ba4",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -176,20 +176,20 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:45 GMT",
"etag": "\"0x8D9CF33034CAF5F\"",
"last-modified": "Tue, 04 Jan 2022 03:33:45 GMT",
"date": "Fri, 25 Feb 2022 09:37:20 GMT",
"etag": "\"0x8D9F8426B5895E9\"",
"last-modified": "Fri, 25 Feb 2022 09:37:20 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "41342f02-4d86-488b-5cb4-5501ff50332c",
"x-ms-request-id": "12dc2c61-001a-010a-5e1b-01035c000000",
"x-ms-client-request-id": "ed077086-1073-4051-7c3c-5ae3dca33ba4",
"x-ms-request-id": "04df7bb3-701a-001f-3a2b-2aeae2000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/premiumshare?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "628ebb8e-96f6-4bea-73e9-a15fbe2d6bca",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "13de348f-7f41-4526-4668-cf9b1c273d81",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
@ -198,10 +198,30 @@
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:45 GMT",
"date": "Fri, 25 Feb 2022 09:37:20 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "628ebb8e-96f6-4bea-73e9-a15fbe2d6bca",
"x-ms-request-id": "c5e663a9-d01a-003f-041b-0177a4000000",
"x-ms-client-request-id": "13de348f-7f41-4526-4668-cf9b1c273d81",
"x-ms-request-id": "7d4642bc-401a-0076-402b-2ad3ae000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/premiumshare?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "d29d41fb-cad2-4af8-7b44-7ddc461da6d6",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
"Response": {
"BODY": "",
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:37:22 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "d29d41fb-cad2-4af8-7b44-7ddc461da6d6",
"x-ms-request-id": "eaddb71a-d01a-007a-092b-2ac782000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestpremiumshare?restype=share"

View File

@ -2,8 +2,8 @@
"networkCallRecords": [
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "295b7880-3ca9-41a1-4da3-6ea8cda3e358",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "e62c1e61-e4a1-4c42-6ed6-5af5baf5fb70",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -12,20 +12,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F2951BBC\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:15 GMT",
"etag": "\"0x8D9F84221100989\"",
"last-modified": "Fri, 25 Feb 2022 09:35:15 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "295b7880-3ca9-41a1-4da3-6ea8cda3e358",
"x-ms-request-id": "8ff3dfce-c01a-006e-451b-01ea28000000",
"x-ms-client-request-id": "e62c1e61-e4a1-4c42-6ed6-5af5baf5fb70",
"x-ms-request-id": "ccee356c-f01a-0042-722a-2a6342000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsharemetadata?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "616c01bb-66e1-431e-4ebd-f289f522ee70",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "773648d7-9b14-4abd-5733-0c336fcff0bd",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -34,20 +34,20 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F29A56E9\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:16 GMT",
"etag": "\"0x8D9F84221B7AA64\"",
"last-modified": "Fri, 25 Feb 2022 09:35:16 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "616c01bb-66e1-431e-4ebd-f289f522ee70",
"x-ms-request-id": "8ff3dfd1-c01a-006e-461b-01ea28000000",
"x-ms-client-request-id": "773648d7-9b14-4abd-5733-0c336fcff0bd",
"x-ms-request-id": "547a731e-701a-002e-542a-2a88d5000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsharemetadata?comp=metadata&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "95c27344-12d3-4a11-57da-8eeef53662de",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "5fb67b30-0e48-45d1-5988-c688ee42c820",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -56,13 +56,14 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F29A56E9\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:16 GMT",
"etag": "\"0x8D9F84221B7AA64\"",
"last-modified": "Fri, 25 Feb 2022 09:35:16 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:17 GMT",
"x-ms-client-request-id": "95c27344-12d3-4a11-57da-8eeef53662de",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:15 GMT",
"x-ms-client-request-id": "5fb67b30-0e48-45d1-5988-c688ee42c820",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
@ -72,7 +73,7 @@
"x-ms-meta-meta2": "value",
"x-ms-meta-meta3": "value",
"x-ms-meta-meta4": "value",
"x-ms-request-id": "8ff3dfd2-c01a-006e-471b-01ea28000000",
"x-ms-request-id": "c18ef70f-901a-006b-2c2a-2a5d36000000",
"x-ms-share-quota": "5120",
"x-ms-version": "2020-02-10"
},
@ -80,8 +81,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "055f1adc-961d-484c-7b3f-8f17b8ed0efa",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "9441c599-a70f-428d-50dd-6f18c3f42051",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -90,20 +91,20 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F29D3CAC\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:20 GMT",
"etag": "\"0x8D9F84223D273A3\"",
"last-modified": "Fri, 25 Feb 2022 09:35:20 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "055f1adc-961d-484c-7b3f-8f17b8ed0efa",
"x-ms-request-id": "8ff3dfd3-c01a-006e-481b-01ea28000000",
"x-ms-client-request-id": "9441c599-a70f-428d-50dd-6f18c3f42051",
"x-ms-request-id": "11f8c10d-201a-000c-382b-2a4dca000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsharemetadata?comp=metadata&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "e38fd482-e2ea-4f74-49b4-ac7e2e3ea013",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "7217bee2-42f7-4761-47ce-fa8f4f303b33",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -112,13 +113,14 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F29D3CAC\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:20 GMT",
"etag": "\"0x8D9F84223D273A3\"",
"last-modified": "Fri, 25 Feb 2022 09:35:20 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:17 GMT",
"x-ms-client-request-id": "e38fd482-e2ea-4f74-49b4-ac7e2e3ea013",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:15 GMT",
"x-ms-client-request-id": "7217bee2-42f7-4761-47ce-fa8f4f303b33",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
@ -128,7 +130,7 @@
"x-ms-meta-meta2": "value",
"x-ms-meta-meta3": "value",
"x-ms-meta-meta4": "value",
"x-ms-request-id": "8ff3dfd4-c01a-006e-491b-01ea28000000",
"x-ms-request-id": "8653f46c-201a-007e-4c2b-2a4a85000000",
"x-ms-share-quota": "5120",
"x-ms-version": "2020-02-10"
},
@ -136,8 +138,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "ba18f280-6072-482c-4dfb-4903c82f85d3",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "57552b53-ddca-4168-73df-c15e142cbda5",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -146,20 +148,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F2A03DAE\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:21 GMT",
"etag": "\"0x8D9F84224FCE54D\"",
"last-modified": "Fri, 25 Feb 2022 09:35:22 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "ba18f280-6072-482c-4dfb-4903c82f85d3",
"x-ms-request-id": "8ff3dfd5-c01a-006e-4a1b-01ea28000000",
"x-ms-client-request-id": "57552b53-ddca-4168-73df-c15e142cbda5",
"x-ms-request-id": "17a9267c-901a-0019-4b2b-2a5a79000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/sharemetadata1?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "eece654a-eb70-4fdb-520b-94bb1c4682c7",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "8c460df5-62ae-4642-53f8-94eddd8f378d",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -168,20 +170,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F2A28744\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:22 GMT",
"etag": "\"0x8D9F84225A149A0\"",
"last-modified": "Fri, 25 Feb 2022 09:35:23 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "eece654a-eb70-4fdb-520b-94bb1c4682c7",
"x-ms-request-id": "8ff3dfd7-c01a-006e-4b1b-01ea28000000",
"x-ms-client-request-id": "8c460df5-62ae-4642-53f8-94eddd8f378d",
"x-ms-request-id": "3cd7720d-101a-0028-642b-2abb6a000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/sharemetadata2?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "02c390ba-2309-446b-4c17-814d3daf8cc0",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "204dd409-c086-4b6f-5ec9-45f0f9358158",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -190,13 +192,14 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F2A03DAE\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:23 GMT",
"etag": "\"0x8D9F84224FCE54D\"",
"last-modified": "Fri, 25 Feb 2022 09:35:22 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:17 GMT",
"x-ms-client-request-id": "02c390ba-2309-446b-4c17-814d3daf8cc0",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:22 GMT",
"x-ms-client-request-id": "204dd409-c086-4b6f-5ec9-45f0f9358158",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
@ -206,7 +209,7 @@
"x-ms-meta-meta2": "value",
"x-ms-meta-meta3": "value",
"x-ms-meta-meta4": "value",
"x-ms-request-id": "8ff3dfd9-c01a-006e-4c1b-01ea28000000",
"x-ms-request-id": "11299ac6-401a-0068-212b-2abc52000000",
"x-ms-share-quota": "5120",
"x-ms-version": "2020-02-10"
},
@ -214,8 +217,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "4da3a5a0-7cc6-4cb0-4278-cb53e97c6c20",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "8d329a02-798a-4a88-6ddb-96d92e4f9e4c",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -224,13 +227,14 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"etag": "\"0x8D9CF32F2A28744\"",
"last-modified": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:25 GMT",
"etag": "\"0x8D9F84225A149A0\"",
"last-modified": "Fri, 25 Feb 2022 09:35:23 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:17 GMT",
"x-ms-client-request-id": "4da3a5a0-7cc6-4cb0-4278-cb53e97c6c20",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:23 GMT",
"x-ms-client-request-id": "8d329a02-798a-4a88-6ddb-96d92e4f9e4c",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
@ -240,7 +244,7 @@
"x-ms-meta-meta2": "value",
"x-ms-meta-meta3": "value",
"x-ms-meta-meta4": "value",
"x-ms-request-id": "8ff3dfda-c01a-006e-4d1b-01ea28000000",
"x-ms-request-id": "88876d84-101a-0065-1e2b-2a7486000000",
"x-ms-share-quota": "5120",
"x-ms-version": "2020-02-10"
},
@ -248,8 +252,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "73a21a9e-ab11-40b0-6075-fb4fc7a334fa",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "479064df-fa3b-4e2b-44fd-227862f6a28a",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
@ -258,10 +262,50 @@
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:17 GMT",
"date": "Fri, 25 Feb 2022 09:35:26 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "73a21a9e-ab11-40b0-6075-fb4fc7a334fa",
"x-ms-request-id": "8ff3dfdb-c01a-006e-4e1b-01ea28000000",
"x-ms-client-request-id": "479064df-fa3b-4e2b-44fd-227862f6a28a",
"x-ms-request-id": "79f68ac6-c01a-0082-2a2b-2a9b7c000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/sharemetadata1?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "4f5a6223-b131-4cd3-4486-185503719859",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
"Response": {
"BODY": "",
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:35:26 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "4f5a6223-b131-4cd3-4486-185503719859",
"x-ms-request-id": "185c5db5-e01a-003c-232b-2af305000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/sharemetadata2?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "cf15dbbb-5b67-439d-7ee7-ebd4933ff0d7",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
"Response": {
"BODY": "",
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:35:27 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "cf15dbbb-5b67-439d-7ee7-ebd4933ff0d7",
"x-ms-request-id": "a4e7bf1a-a01a-003d-702b-2aacd9000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestsharemetadata?restype=share"

View File

@ -2,8 +2,8 @@
"networkCallRecords": [
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "82ff9877-8813-4253-7f94-adb4f02edd89",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "9b5d8c1a-5290-40e8-4151-9fd91b4d4034",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -12,20 +12,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6EB1335\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:35:56 GMT",
"etag": "\"0x8D9F84239465905\"",
"last-modified": "Fri, 25 Feb 2022 09:35:56 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "82ff9877-8813-4253-7f94-adb4f02edd89",
"x-ms-request-id": "d4bc312e-601a-0048-271b-01a230000000",
"x-ms-client-request-id": "9b5d8c1a-5290-40e8-4151-9fd91b4d4034",
"x-ms-request-id": "7be8b293-a01a-004f-492b-2aab96000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "d4b3c6b4-f6fa-42a7-77dc-03c328a5b5ed",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "2707df9c-d561-4cae-48c7-a4134a1a356e",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -34,20 +34,20 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6F71A92\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:35:56 GMT",
"etag": "\"0x8D9F84239D8B835\"",
"last-modified": "Fri, 25 Feb 2022 09:35:57 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "d4b3c6b4-f6fa-42a7-77dc-03c328a5b5ed",
"x-ms-request-id": "d4bc3131-601a-0048-281b-01a230000000",
"x-ms-client-request-id": "2707df9c-d561-4cae-48c7-a4134a1a356e",
"x-ms-request-id": "36716902-c01a-0049-312b-2a9829000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "08da48e3-5588-488e-4927-c97b0ea7162f",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "a1507114-1631-4391-6dd8-e5a4afd57339",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -56,18 +56,19 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6F71A92\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:35:57 GMT",
"etag": "\"0x8D9F84239D8B835\"",
"last-modified": "Fri, 25 Feb 2022 09:35:57 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:24 GMT",
"x-ms-client-request-id": "08da48e3-5588-488e-4927-c97b0ea7162f",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:56 GMT",
"x-ms-client-request-id": "a1507114-1631-4391-6dd8-e5a4afd57339",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "d4bc3132-601a-0048-291b-01a230000000",
"x-ms-request-id": "beef454d-901a-007b-712b-2a985e000000",
"x-ms-share-quota": "32",
"x-ms-version": "2020-02-10"
},
@ -75,8 +76,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "454932da-b709-4aeb-64ae-1b8a687fd82d",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "f995689a-e346-442b-6928-9f0d7a39982e",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -85,20 +86,20 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6FB86B9\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:35:58 GMT",
"etag": "\"0x8D9F8423AF91956\"",
"last-modified": "Fri, 25 Feb 2022 09:35:59 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "454932da-b709-4aeb-64ae-1b8a687fd82d",
"x-ms-request-id": "d4bc3133-601a-0048-2a1b-01a230000000",
"x-ms-client-request-id": "f995689a-e346-442b-6928-9f0d7a39982e",
"x-ms-request-id": "44b0bd05-501a-005b-7f2b-2ae3f9000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "f34fd70a-30e3-4ca9-651b-79490be32ee4",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "efdd8b6b-7d74-4c30-4569-653513ea3b6d",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -107,18 +108,19 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6FB86B9\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:35:59 GMT",
"etag": "\"0x8D9F8423AF91956\"",
"last-modified": "Fri, 25 Feb 2022 09:35:59 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:24 GMT",
"x-ms-client-request-id": "f34fd70a-30e3-4ca9-651b-79490be32ee4",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:56 GMT",
"x-ms-client-request-id": "efdd8b6b-7d74-4c30-4569-653513ea3b6d",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "d4bc3134-601a-0048-2b1b-01a230000000",
"x-ms-request-id": "37c319b5-e01a-0085-242b-2af71f000000",
"x-ms-share-quota": "64",
"x-ms-version": "2020-02-10"
},
@ -126,8 +128,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "adb5dc84-043a-4313-547d-647a72ef8841",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "5f47a121-4c32-45ac-492b-a8be97e7a5ce",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -136,20 +138,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6FE4A4A\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:36:00 GMT",
"etag": "\"0x8D9F8423C25CE3B\"",
"last-modified": "Fri, 25 Feb 2022 09:36:01 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "adb5dc84-043a-4313-547d-647a72ef8841",
"x-ms-request-id": "d4bc3135-601a-0048-2c1b-01a230000000",
"x-ms-client-request-id": "5f47a121-4c32-45ac-492b-a8be97e7a5ce",
"x-ms-request-id": "3af7be6f-b01a-0053-7f2b-2af9f6000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/shareproperties1?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "28081b0b-db2f-4c9e-6ac3-8ce8a73f7c00",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "54346be5-5724-4092-504e-3f921a6277b6",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
@ -158,20 +160,20 @@
"REASON_PHRASE": "Created",
"STATUS_CODE": "201",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F7006CDA\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:36:01 GMT",
"etag": "\"0x8D9F8423CC45560\"",
"last-modified": "Fri, 25 Feb 2022 09:36:02 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "28081b0b-db2f-4c9e-6ac3-8ce8a73f7c00",
"x-ms-request-id": "d4bc3137-601a-0048-2d1b-01a230000000",
"x-ms-client-request-id": "54346be5-5724-4092-504e-3f921a6277b6",
"x-ms-request-id": "700c3ba8-401a-0047-5e2b-2ab199000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/shareproperties2?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "7eb40cff-8be6-4980-5425-db1a6ade2d95",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "0fbebd58-6fac-438e-55e6-1aec77d0325b",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -180,18 +182,19 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F6FE4A4A\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:36:02 GMT",
"etag": "\"0x8D9F8423C25CE3B\"",
"last-modified": "Fri, 25 Feb 2022 09:36:01 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:24 GMT",
"x-ms-client-request-id": "7eb40cff-8be6-4980-5425-db1a6ade2d95",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:36:01 GMT",
"x-ms-client-request-id": "0fbebd58-6fac-438e-55e6-1aec77d0325b",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "d4bc3139-601a-0048-2e1b-01a230000000",
"x-ms-request-id": "9d5cea07-a01a-0070-1f2b-2a6335000000",
"x-ms-share-quota": "32",
"x-ms-version": "2020-02-10"
},
@ -199,8 +202,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "ae9ec301-2b21-42aa-672f-4d27c31913c7",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "b9003bd5-e880-4d0d-6c0c-a20c82a7fec2",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
@ -209,18 +212,19 @@
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F7006CDA\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:36:04 GMT",
"etag": "\"0x8D9F8423CC45560\"",
"last-modified": "Fri, 25 Feb 2022 09:36:02 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:24 GMT",
"x-ms-client-request-id": "ae9ec301-2b21-42aa-672f-4d27c31913c7",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:36:02 GMT",
"x-ms-client-request-id": "b9003bd5-e880-4d0d-6c0c-a20c82a7fec2",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "d4bc313a-601a-0048-2f1b-01a230000000",
"x-ms-request-id": "f3f5dc89-f01a-0030-4d2b-2a640d000000",
"x-ms-share-quota": "64",
"x-ms-version": "2020-02-10"
},
@ -228,59 +232,8 @@
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "463c2a7c-e835-4a16-47c3-843306c3a234",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
"Response": {
"BODY": "",
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F7052244\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "463c2a7c-e835-4a16-47c3-843306c3a234",
"x-ms-request-id": "d4bc313b-601a-0048-301b-01a230000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "315c3e92-739b-456c-4402-941965e33139",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
"Response": {
"BODY": "",
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"etag": "\"0x8D9CF32F7052244\"",
"last-modified": "Tue, 04 Jan 2022 03:33:24 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Tue, 04 Jan 2022 03:33:24 GMT",
"x-ms-client-request-id": "315c3e92-739b-456c-4402-941965e33139",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "d4bc313c-601a-0048-311b-01a230000000",
"x-ms-share-quota": "5120",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Linux 5.4.0-1063-azure x86_64 #66~18.04.1-Ubuntu SMP Thu Oct 21 09:59:28 UTC 2021)",
"x-ms-client-request-id": "d36affcc-0d5f-49c6-6e8d-e85fa0e98ced",
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "ea53e474-37e3-47f2-4fdb-372b6147835e",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
@ -289,10 +242,102 @@
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Tue, 04 Jan 2022 03:33:24 GMT",
"date": "Fri, 25 Feb 2022 09:36:04 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "d36affcc-0d5f-49c6-6e8d-e85fa0e98ced",
"x-ms-request-id": "d4bc313d-601a-0048-321b-01a230000000",
"x-ms-client-request-id": "ea53e474-37e3-47f2-4fdb-372b6147835e",
"x-ms-request-id": "a2aaf8bf-301a-0096-3d2b-2ad313000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/shareproperties1?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "5602210b-28a7-4baf-6a8c-2a5420e3054b",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
"Response": {
"BODY": "",
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:36:05 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "5602210b-28a7-4baf-6a8c-2a5420e3054b",
"x-ms-request-id": "d28347b7-d01a-0027-562b-2acd06000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/shareproperties2?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "c91f2b17-4c67-4087-4c44-5c22633eaa97",
"x-ms-version": "2020-02-10"
},
"Method": "PUT",
"Response": {
"BODY": "",
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:36:06 GMT",
"etag": "\"0x8D9F8423FDA3C1D\"",
"last-modified": "Fri, 25 Feb 2022 09:36:07 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "c91f2b17-4c67-4087-4c44-5c22633eaa97",
"x-ms-request-id": "f827a746-801a-0058-242b-2a029d000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?comp=properties&restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "7c75d26d-78cc-4f75-4648-afff8c5e37af",
"x-ms-version": "2020-02-10"
},
"Method": "GET",
"Response": {
"BODY": "",
"REASON_PHRASE": "OK",
"STATUS_CODE": "200",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:36:07 GMT",
"etag": "\"0x8D9F8423FDA3C1D\"",
"last-modified": "Fri, 25 Feb 2022 09:36:07 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"vary": "Origin",
"x-ms-access-tier": "TransactionOptimized",
"x-ms-access-tier-change-time": "Fri, 25 Feb 2022 09:35:56 GMT",
"x-ms-client-request-id": "7c75d26d-78cc-4f75-4648-afff8c5e37af",
"x-ms-has-immutability-policy": "false",
"x-ms-has-legal-hold": "false",
"x-ms-lease-state": "available",
"x-ms-lease-status": "unlocked",
"x-ms-request-id": "32baddbd-901a-0009-452b-2a9f11000000",
"x-ms-share-quota": "5120",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?restype=share"
},
{
"Headers": {
"user-agent": "azsdk-cpp-storage-files-shares/12.3.0-beta.1 (Windows 10 Pro 6.3 19041 19041.1.amd64fre.vb_release.191206-1406)",
"x-ms-client-request-id": "4dbd7392-40c7-4c54-6e11-8e3419d00f93",
"x-ms-version": "2020-02-10"
},
"Method": "DELETE",
"Response": {
"BODY": "",
"REASON_PHRASE": "Accepted",
"STATUS_CODE": "202",
"content-length": "0",
"date": "Fri, 25 Feb 2022 09:36:08 GMT",
"server": "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-client-request-id": "4dbd7392-40c7-4c54-6e11-8e3419d00f93",
"x-ms-request-id": "a4fcf515-701a-0011-162b-2a4076000000",
"x-ms-version": "2020-02-10"
},
"Url": "https://REDACTED.file.core.windows.net/fileshareclienttestshareproperties?restype=share"

View File

@ -5,6 +5,7 @@
#include <algorithm>
#include <chrono>
#include <unordered_map>
#include <azure/storage/common/crypt.hpp>
@ -39,7 +40,7 @@ namespace Azure { namespace Storage { namespace Test {
m_shareClient = std::make_shared<Files::Shares::ShareClient>(
Files::Shares::ShareClient::CreateFromConnectionString(
StandardStorageConnectionString(), m_shareName, m_options));
m_shareClient->Create();
m_shareClient->CreateIfNotExists();
}
void FileShareClientTest::TearDown()
@ -155,6 +156,8 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_EQ(metadata1, result);
result = client2.GetProperties().Value.Metadata;
EXPECT_EQ(metadata2, result);
client1.DeleteIfExists();
client2.DeleteIfExists();
}
}
@ -195,6 +198,8 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_EQ(quota32GB, result);
result = client2.GetProperties().Value.Quota;
EXPECT_EQ(quota64GB, result);
client1.DeleteIfExists();
client2.DeleteIfExists();
}
{
@ -501,18 +506,15 @@ namespace Azure { namespace Storage { namespace Test {
{
EXPECT_NE(shareClients.find(shareItem.Name), shareClients.end());
properties = shareClients.at(shareItem.Name).GetProperties().Value;
EXPECT_EQ(true, shareItem.Details.AccessTier.HasValue() && properties.AccessTier.HasValue());
ASSERT_TRUE(shareItem.Details.AccessTier.HasValue());
ASSERT_TRUE(properties.AccessTier.HasValue());
EXPECT_EQ(shareItem.Details.AccessTier.Value(), properties.AccessTier.Value());
EXPECT_EQ(
true,
shareItem.Details.AccessTierChangedOn.HasValue()
&& properties.AccessTierChangedOn.HasValue());
ASSERT_TRUE(shareItem.Details.AccessTierChangedOn.HasValue());
ASSERT_TRUE(properties.AccessTierChangedOn.HasValue());
EXPECT_EQ(
shareItem.Details.AccessTierChangedOn.Value(), properties.AccessTierChangedOn.Value());
EXPECT_EQ(
false,
shareItem.Details.AccessTierTransitionState.HasValue()
|| properties.AccessTierTransitionState.HasValue());
EXPECT_FALSE(shareItem.Details.AccessTierTransitionState.HasValue());
EXPECT_FALSE(properties.AccessTierTransitionState.HasValue());
}
}
@ -556,5 +558,6 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_EQ(Files::Shares::Models::AccessTier::Premium, properties.AccessTier.Value());
EXPECT_FALSE(properties.AccessTierTransitionState.HasValue());
EXPECT_FALSE(properties.AccessTierChangedOn.HasValue());
shareClient.DeleteIfExists();
}
}}} // namespace Azure::Storage::Test

View File

@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT
#include <azure/storage/files/shares/share_file_attributes.hpp>
#include "test/ut/test_base.hpp"
#include "azure/storage/files/shares/rest_client.hpp"
namespace Azure { namespace Storage { namespace Test {
TEST(ShareFileAttributes, EqualOperator)