Moved model types in file share service into Models namespace. (#965)
This commit is contained in:
parent
216c88483a
commit
97af13d7e6
File diff suppressed because it is too large
Load Diff
@ -102,47 +102,47 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief Creates the file share.
|
||||
* @param options Optional parameters to create this file share.
|
||||
* @return Azure::Core::Response<CreateShareResult> containing the information including the
|
||||
* version and modified time of a share.
|
||||
* @return Azure::Core::Response<Models::CreateShareResult> containing the information including
|
||||
* the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<CreateShareResult> Create(
|
||||
Azure::Core::Response<Models::CreateShareResult> Create(
|
||||
const CreateShareOptions& options = CreateShareOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the file share.
|
||||
* @param options Optional parameters to delete this file share.
|
||||
* @return Azure::Core::Response<ShareDeleteResult> currently empty and reserved for future
|
||||
* usage.
|
||||
* @return Azure::Core::Response<Models::ShareDeleteResult> currently empty and reserved for
|
||||
* future usage.
|
||||
*/
|
||||
Azure::Core::Response<DeleteShareResult> Delete(
|
||||
Azure::Core::Response<Models::DeleteShareResult> Delete(
|
||||
const DeleteShareOptions& options = DeleteShareOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Creates a snapshot for the share.
|
||||
* @param options Optional parameters to create the share snapshot.
|
||||
* @return Azure::Core::Response<CreateShareSnapshotResult> containing the information for ths
|
||||
* snapshot.
|
||||
* @return Azure::Core::Response<Models::CreateShareSnapshotResult> containing the information
|
||||
* for ths snapshot.
|
||||
*/
|
||||
Azure::Core::Response<CreateShareSnapshotResult> CreateSnapshot(
|
||||
Azure::Core::Response<Models::CreateShareSnapshotResult> CreateSnapshot(
|
||||
const CreateShareSnapshotOptions& options = CreateShareSnapshotOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the properties of the share.
|
||||
* @param options Optional parameters to get the share properties.
|
||||
* @return Azure::Core::Response<GetSharePropertiesResult> containing the properties for ths
|
||||
* share or one of its snapshot.
|
||||
* @return Azure::Core::Response<Models::GetSharePropertiesResult> containing the properties for
|
||||
* ths share or one of its snapshot.
|
||||
*/
|
||||
Azure::Core::Response<GetSharePropertiesResult> GetProperties(
|
||||
Azure::Core::Response<Models::GetSharePropertiesResult> GetProperties(
|
||||
const GetSharePropertiesOptions& options = GetSharePropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the quota of the share.
|
||||
* @param quota Specifies the maximum size of the share, in gigabytes.
|
||||
* @param options Optional parameters to set the share quota.
|
||||
* @return Azure::Core::Response<SetShareQuotaResult> containing the information including the
|
||||
* version and modified time of a share.
|
||||
* @return Azure::Core::Response<Models::SetShareQuotaResult> containing the information
|
||||
* including the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<SetShareQuotaResult> SetQuota(
|
||||
Azure::Core::Response<Models::SetShareQuotaResult> SetQuota(
|
||||
int32_t quotaInGiB,
|
||||
const SetShareQuotaOptions& options = SetShareQuotaOptions()) const;
|
||||
|
||||
@ -150,50 +150,50 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Sets the metadata to the share.
|
||||
* @param metadata A name-value pair to associate with a file storage 'Share' object..
|
||||
* @param options Optional parameters to set the share metadata.
|
||||
* @return Azure::Core::Response<SetShareMetadataResult> containing the information including
|
||||
* the version and modified time of a share.
|
||||
* @return Azure::Core::Response<Models::SetShareMetadataResult> containing the information
|
||||
* including the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<SetShareMetadataResult> SetMetadata(
|
||||
Azure::Core::Response<Models::SetShareMetadataResult> SetMetadata(
|
||||
std::map<std::string, std::string> metadata,
|
||||
const SetShareMetadataOptions& options = SetShareMetadataOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the access policy of the share.
|
||||
* @param options Optional parameters to get the share's access policy.
|
||||
* @return Azure::Core::Response<GetShareAccessPolicyResult> containing the access policy of
|
||||
* the share.
|
||||
* @return Azure::Core::Response<Models::GetShareAccessPolicyResult> containing the access
|
||||
* policy of the share.
|
||||
*/
|
||||
Azure::Core::Response<GetShareAccessPolicyResult> GetAccessPolicy(
|
||||
Azure::Core::Response<Models::GetShareAccessPolicyResult> GetAccessPolicy(
|
||||
const GetShareAccessPolicyOptions& options = GetShareAccessPolicyOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the access policy of the share.
|
||||
* @param accessPolicy Specifies the access policy to be set to the share.
|
||||
* @param options Optional parameters to Set the share's access policy.
|
||||
* @return Azure::Core::Response<SetShareAccessPolicyResult> containing the information
|
||||
* @return Azure::Core::Response<Models::SetShareAccessPolicyResult> containing the information
|
||||
* including the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<SetShareAccessPolicyResult> SetAccessPolicy(
|
||||
const std::vector<SignedIdentifier>& accessPolicy,
|
||||
Azure::Core::Response<Models::SetShareAccessPolicyResult> SetAccessPolicy(
|
||||
const std::vector<Models::SignedIdentifier>& accessPolicy,
|
||||
const SetShareAccessPolicyOptions& options = SetShareAccessPolicyOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the stats of the share.
|
||||
* @param options Optional parameters to get share's statistics.
|
||||
* @return Azure::Core::Response<GetShareStatisticsResult> containing the information including
|
||||
* the bytes used in by the share, the version and modified time of a share.
|
||||
* @return Azure::Core::Response<Models::GetShareStatisticsResult> containing the information
|
||||
* including the bytes used in by the share, the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<GetShareStatisticsResult> GetStatistics(
|
||||
Azure::Core::Response<Models::GetShareStatisticsResult> GetStatistics(
|
||||
const GetShareStatsOptions& options = GetShareStatsOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Creates a permission on the share.
|
||||
* @param permission Specifies the permission to be created on the share.
|
||||
* @param options Optional parameters to create the share's permission.
|
||||
* @return Azure::Core::Response<CreateSharePermissionResult> containing the information
|
||||
* @return Azure::Core::Response<Models::CreateSharePermissionResult> containing the information
|
||||
* including the permission key of the permission.
|
||||
*/
|
||||
Azure::Core::Response<CreateSharePermissionResult> CreatePermission(
|
||||
Azure::Core::Response<Models::CreateSharePermissionResult> CreatePermission(
|
||||
const std::string& permission,
|
||||
const CreateSharePermissionOptions& options = CreateSharePermissionOptions()) const;
|
||||
|
||||
@ -201,20 +201,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Gets the permission of the share using the specific key.
|
||||
* @param permissionKey The permission key of a permission.
|
||||
* @param options Optional parameters to get share's permission.
|
||||
* @return Azure::Core::Response<GetSharePermissionResult> containing the permission string with
|
||||
* specified key.
|
||||
* @return Azure::Core::Response<Models::GetSharePermissionResult> containing the permission
|
||||
* string with specified key.
|
||||
*/
|
||||
Azure::Core::Response<GetSharePermissionResult> GetPermission(
|
||||
Azure::Core::Response<Models::GetSharePermissionResult> GetPermission(
|
||||
const std::string& permissionKey,
|
||||
const GetSharePermissionOptions& options = GetSharePermissionOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief List files and directories under the directory.
|
||||
* @param options Optional parameters to list the files and directories under this directory.
|
||||
* @return Azure::Core::Response<ListFilesAndDirectoriesSegmentResult> containing the
|
||||
* @return Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult> containing the
|
||||
* information of the operation, directory, share and the listed result.
|
||||
*/
|
||||
Azure::Core::Response<ListFilesAndDirectoriesSegmentResult> ListFilesAndDirectoriesSegment(
|
||||
Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult>
|
||||
ListFilesAndDirectoriesSegment(
|
||||
const ListFilesAndDirectoriesSegmentOptions& options
|
||||
= ListFilesAndDirectoriesSegmentOptions()) const;
|
||||
|
||||
@ -226,9 +227,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* Azure::Storage::c_InfiniteLeaseDuration for a lease that never expires. A non-infinite lease
|
||||
* can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<AcquireShareLeaseResult> describing the lease.
|
||||
* @return Azure::Core::Response<Models::AcquireShareLeaseResult> describing the lease.
|
||||
*/
|
||||
Azure::Core::Response<AcquireShareLeaseResult> AcquireLease(
|
||||
Azure::Core::Response<Models::AcquireShareLeaseResult> AcquireLease(
|
||||
const std::string& proposedLeaseId,
|
||||
int32_t duration,
|
||||
const AcquireShareLeaseOptions& options = AcquireShareLeaseOptions()) const;
|
||||
@ -238,9 +239,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*
|
||||
* @param leaseId ID of the previously-acquired lease.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<ReleaseShareLeaseResult> describing the updated lease status.
|
||||
* @return Azure::Core::Response<Models::ReleaseShareLeaseResult> describing the updated lease
|
||||
* status.
|
||||
*/
|
||||
Azure::Core::Response<ReleaseShareLeaseResult> ReleaseLease(
|
||||
Azure::Core::Response<Models::ReleaseShareLeaseResult> ReleaseLease(
|
||||
const std::string& leaseId,
|
||||
const ReleaseShareLeaseOptions& options = ReleaseShareLeaseOptions()) const;
|
||||
|
||||
@ -250,9 +252,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param leaseId ID of the previously-acquired lease.
|
||||
* @param proposedLeaseId Proposed lease ID, in a GUID string format.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<ChangeShareLeaseResult> describing the changed lease.
|
||||
* @return Azure::Core::Response<Models::ChangeShareLeaseResult> describing the changed lease.
|
||||
*/
|
||||
Azure::Core::Response<ChangeShareLeaseResult> ChangeLease(
|
||||
Azure::Core::Response<Models::ChangeShareLeaseResult> ChangeLease(
|
||||
const std::string& leaseId,
|
||||
const std::string& proposedLeaseId,
|
||||
const ChangeShareLeaseOptions& options = ChangeShareLeaseOptions()) const;
|
||||
@ -261,9 +263,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Breaks the previously-acquired lease.
|
||||
*
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<BreakShareLeaseResult> describing the broken lease.
|
||||
* @return Azure::Core::Response<Models::BreakShareLeaseResult> describing the broken lease.
|
||||
*/
|
||||
Azure::Core::Response<BreakShareLeaseResult> BreakLease(
|
||||
Azure::Core::Response<Models::BreakShareLeaseResult> BreakLease(
|
||||
const BreakShareLeaseOptions& options = BreakShareLeaseOptions()) const;
|
||||
|
||||
/**
|
||||
@ -271,9 +273,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*
|
||||
* @param leaseId ID of the previously-acquired lease.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<BreakShareLeaseResult> describing the renewed lease.
|
||||
* @return Azure::Core::Response<Models::BreakShareLeaseResult> describing the renewed lease.
|
||||
*/
|
||||
Azure::Core::Response<RenewShareLeaseResult> RenewLease(
|
||||
Azure::Core::Response<Models::RenewShareLeaseResult> RenewLease(
|
||||
const std::string& leaseId,
|
||||
const RenewShareLeaseOptions& options = RenewShareLeaseOptions()) const;
|
||||
|
||||
|
||||
@ -105,39 +105,39 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief Creates the directory.
|
||||
* @param options Optional parameters to create this directory.
|
||||
* @return Azure::Core::Response<CreateDirectoryResult> containing the information returned when
|
||||
* creating the directory.
|
||||
* @return Azure::Core::Response<Models::CreateDirectoryResult> containing the information
|
||||
* returned when creating the directory.
|
||||
*/
|
||||
Azure::Core::Response<CreateDirectoryResult> Create(
|
||||
Azure::Core::Response<Models::CreateDirectoryResult> Create(
|
||||
const CreateDirectoryOptions& options = CreateDirectoryOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the directory.
|
||||
* @param options Optional parameters to delete this directory.
|
||||
* @return Azure::Core::Response<DeleteDirectoryResult> containing the information returned when
|
||||
* deleting the directory. Currently empty but preserved for future usage.
|
||||
* @return Azure::Core::Response<Models::DeleteDirectoryResult> containing the information
|
||||
* returned when deleting the directory. Currently empty but preserved for future usage.
|
||||
*/
|
||||
Azure::Core::Response<DeleteDirectoryResult> Delete(
|
||||
Azure::Core::Response<Models::DeleteDirectoryResult> Delete(
|
||||
const DeleteDirectoryOptions& options = DeleteDirectoryOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the properties of the directory.
|
||||
* @param options Optional parameters to get this directory's properties.
|
||||
* @return Azure::Core::Response<GetDirectoryPropertiesResult> containing the properties of the
|
||||
* directory returned from the server.
|
||||
* @return Azure::Core::Response<Models::GetDirectoryPropertiesResult> containing the properties
|
||||
* of the directory returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<GetDirectoryPropertiesResult> GetProperties(
|
||||
Azure::Core::Response<Models::GetDirectoryPropertiesResult> GetProperties(
|
||||
const GetDirectoryPropertiesOptions& options = GetDirectoryPropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the properties of the directory.
|
||||
* @param smbProperties The SMB properties to be set to the directory.
|
||||
* @param options Optional parameters to set this directory's properties.
|
||||
* @return Azure::Core::Response<SetDirectoryPropertiesResult> containing the properties of the
|
||||
* directory returned from the server.
|
||||
* @return Azure::Core::Response<Models::SetDirectoryPropertiesResult> containing the properties
|
||||
* of the directory returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<SetDirectoryPropertiesResult> SetProperties(
|
||||
FileShareSmbProperties smbProperties,
|
||||
Azure::Core::Response<Models::SetDirectoryPropertiesResult> SetProperties(
|
||||
Models::FileShareSmbProperties smbProperties,
|
||||
const SetDirectoryPropertiesOptions& options = SetDirectoryPropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
@ -145,30 +145,31 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param metadata User-defined metadata to be stored with the directory. Note that the string
|
||||
* may only contain ASCII characters in the ISO-8859-1 character set.
|
||||
* @param options Optional parameters to set this directory's metadata.
|
||||
* @return Azure::Core::Response<SetDirectoryMetadataResult> containing the information of the
|
||||
* directory returned from the server.
|
||||
* @return Azure::Core::Response<Models::SetDirectoryMetadataResult> containing the information
|
||||
* of the directory returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<SetDirectoryMetadataResult> SetMetadata(
|
||||
Azure::Core::Response<Models::SetDirectoryMetadataResult> SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const SetDirectoryMetadataOptions& options = SetDirectoryMetadataOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief List files and directories under the directory.
|
||||
* @param options Optional parameters to list the files and directories under this directory.
|
||||
* @return Azure::Core::Response<ListFilesAndDirectoriesSegmentResult> containing the
|
||||
* @return Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult> containing the
|
||||
* information of the operation, directory, share and the listed result.
|
||||
*/
|
||||
Azure::Core::Response<ListFilesAndDirectoriesSegmentResult> ListFilesAndDirectoriesSegment(
|
||||
Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult>
|
||||
ListFilesAndDirectoriesSegment(
|
||||
const ListFilesAndDirectoriesSegmentOptions& options
|
||||
= ListFilesAndDirectoriesSegmentOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief List open handles on the directory.
|
||||
* @param options Optional parameters to list this directory's open handles.
|
||||
* @return Azure::Core::Response<ListDirectoryHandlesSegmentResult> containing the information
|
||||
* of the operation and the open handles of this directory
|
||||
* @return Azure::Core::Response<Models::ListDirectoryHandlesSegmentResult> containing the
|
||||
* information of the operation and the open handles of this directory
|
||||
*/
|
||||
Azure::Core::Response<ListDirectoryHandlesSegmentResult> ListHandlesSegment(
|
||||
Azure::Core::Response<Models::ListDirectoryHandlesSegmentResult> ListHandlesSegment(
|
||||
const ListDirectoryHandlesSegmentOptions& options
|
||||
= ListDirectoryHandlesSegmentOptions()) const;
|
||||
|
||||
@ -176,21 +177,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Closes a handle opened on a directory at the service.
|
||||
* @param handleId The ID of the handle to be closed.
|
||||
* @param options Optional parameters to close one of this directory's open handles.
|
||||
* @return Azure::Core::Response<ForceCloseDirectoryHandleResult> containing the information
|
||||
* of the closed handle. Current empty but preserved for future usage.
|
||||
* @return Azure::Core::Response<Models::ForceCloseDirectoryHandleResult> containing the
|
||||
* information of the closed handle. Current empty but preserved for future usage.
|
||||
*/
|
||||
Azure::Core::Response<ForceCloseDirectoryHandleResult> ForceCloseHandle(
|
||||
Azure::Core::Response<Models::ForceCloseDirectoryHandleResult> ForceCloseHandle(
|
||||
const std::string& handleId,
|
||||
const ForceCloseDirectoryHandleOptions& options = ForceCloseDirectoryHandleOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Closes all handles opened on a directory at the service.
|
||||
* @param options Optional parameters to close all this directory's open handles.
|
||||
* @return Azure::Core::Response<ForceCloseAllDirectoryHandlesResult> containing the information
|
||||
* of the closed handles
|
||||
* @return Azure::Core::Response<Models::ForceCloseAllDirectoryHandlesResult> containing the
|
||||
* information of the closed handles
|
||||
* @remark This operation may return a marker showing that the operation can be continued.
|
||||
*/
|
||||
Azure::Core::Response<ForceCloseAllDirectoryHandlesResult> ForceCloseAllHandles(
|
||||
Azure::Core::Response<Models::ForceCloseAllDirectoryHandlesResult> ForceCloseAllHandles(
|
||||
const ForceCloseAllDirectoryHandlesOptions& options
|
||||
= ForceCloseAllDirectoryHandlesOptions()) const;
|
||||
|
||||
|
||||
@ -5,207 +5,213 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
enum class FileAttributes
|
||||
{
|
||||
/**
|
||||
* @brief The File or Directory is read-only.
|
||||
*/
|
||||
ReadOnly = 1,
|
||||
|
||||
/**
|
||||
* @brief The File or Directory is hidden, and thus is not included in an ordinary directory
|
||||
* listing.
|
||||
*/
|
||||
Hidden = 2,
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
System = 4,
|
||||
|
||||
/**
|
||||
* @brief The file or directory is a standard file that has no special attributes. This
|
||||
* attribute is valid only if it is used alone.
|
||||
*/
|
||||
None = 8,
|
||||
|
||||
/**
|
||||
* @brief The file is a directory.
|
||||
*/
|
||||
Directory = 16,
|
||||
|
||||
/**
|
||||
* @brief The file is a candidate for backup or removal.
|
||||
*/
|
||||
Archive = 32,
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
Temporary = 64,
|
||||
|
||||
/**
|
||||
* @brief The file or directory is offline. The data of the file is not immediately available.
|
||||
*/
|
||||
Offline = 128,
|
||||
|
||||
/**
|
||||
* @brief The file or directory will not be indexed by the operating system's content indexing
|
||||
* service.
|
||||
*/
|
||||
NotContentIndexed = 256,
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
NoScrubData = 512
|
||||
};
|
||||
|
||||
inline FileAttributes operator|(FileAttributes lhs, FileAttributes rhs)
|
||||
{
|
||||
using type = std::underlying_type_t<FileAttributes>;
|
||||
return static_cast<FileAttributes>(static_cast<type>(lhs) | static_cast<type>(rhs));
|
||||
}
|
||||
|
||||
inline FileAttributes& operator|=(FileAttributes& lhs, FileAttributes rhs)
|
||||
{
|
||||
lhs = lhs | rhs;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
inline FileAttributes operator&(FileAttributes lhs, FileAttributes rhs)
|
||||
{
|
||||
using type = std::underlying_type_t<FileAttributes>;
|
||||
return static_cast<FileAttributes>(static_cast<type>(lhs) & static_cast<type>(rhs));
|
||||
}
|
||||
|
||||
inline FileAttributes& operator&=(FileAttributes& lhs, FileAttributes rhs)
|
||||
{
|
||||
lhs = lhs & rhs;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
inline FileAttributes FileAttributesFromString(const std::string& fileAttributesString)
|
||||
{
|
||||
FileAttributes result = static_cast<FileAttributes>(0);
|
||||
|
||||
if (fileAttributesString == "ReadOnly")
|
||||
namespace Models {
|
||||
enum class FileAttributes
|
||||
{
|
||||
result = FileAttributes::ReadOnly;
|
||||
}
|
||||
else if (fileAttributesString == "Hidden")
|
||||
{
|
||||
result = FileAttributes::Hidden;
|
||||
}
|
||||
else if (fileAttributesString == "System")
|
||||
{
|
||||
result = FileAttributes::System;
|
||||
}
|
||||
else if (fileAttributesString == "None")
|
||||
{
|
||||
result = FileAttributes::None;
|
||||
}
|
||||
else if (fileAttributesString == "Directory")
|
||||
{
|
||||
result = FileAttributes::Directory;
|
||||
}
|
||||
else if (fileAttributesString == "Archive")
|
||||
{
|
||||
result = FileAttributes::Archive;
|
||||
}
|
||||
else if (fileAttributesString == "Offline")
|
||||
{
|
||||
result = FileAttributes::Offline;
|
||||
}
|
||||
else if (fileAttributesString == "NotContentIndexed")
|
||||
{
|
||||
result = FileAttributes::NotContentIndexed;
|
||||
}
|
||||
else if (fileAttributesString == "NoScrubData")
|
||||
{
|
||||
result = FileAttributes::NoScrubData;
|
||||
}
|
||||
/**
|
||||
* @brief The File or Directory is read-only.
|
||||
*/
|
||||
ReadOnly = 1,
|
||||
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @brief The File or Directory is hidden, and thus is not included in an ordinary directory
|
||||
* listing.
|
||||
*/
|
||||
Hidden = 2,
|
||||
|
||||
inline std::string FileAttributesToString(const FileAttributes& val)
|
||||
{
|
||||
FileAttributes value_list[] = {
|
||||
FileAttributes::ReadOnly,
|
||||
FileAttributes::Hidden,
|
||||
FileAttributes::System,
|
||||
FileAttributes::None,
|
||||
FileAttributes::Directory,
|
||||
FileAttributes::Archive,
|
||||
FileAttributes::Temporary,
|
||||
FileAttributes::Offline,
|
||||
FileAttributes::NotContentIndexed,
|
||||
FileAttributes::NoScrubData,
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
System = 4,
|
||||
|
||||
/**
|
||||
* @brief The file or directory is a standard file that has no special attributes. This
|
||||
* attribute is valid only if it is used alone.
|
||||
*/
|
||||
None = 8,
|
||||
|
||||
/**
|
||||
* @brief The file is a directory.
|
||||
*/
|
||||
Directory = 16,
|
||||
|
||||
/**
|
||||
* @brief The file is a candidate for backup or removal.
|
||||
*/
|
||||
Archive = 32,
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
Temporary = 64,
|
||||
|
||||
/**
|
||||
* @brief The file or directory is offline. The data of the file is not immediately available.
|
||||
*/
|
||||
Offline = 128,
|
||||
|
||||
/**
|
||||
* @brief The file or directory will not be indexed by the operating system's content indexing
|
||||
* service.
|
||||
*/
|
||||
NotContentIndexed = 256,
|
||||
|
||||
/**
|
||||
* @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.
|
||||
*/
|
||||
NoScrubData = 512
|
||||
};
|
||||
const char* string_list[] = {
|
||||
"ReadOnly",
|
||||
"Hidden",
|
||||
"System",
|
||||
"None",
|
||||
"Directory",
|
||||
"Archive",
|
||||
"Temporary",
|
||||
"Offline",
|
||||
"NotContentIndexed",
|
||||
"NoScrubData",
|
||||
};
|
||||
std::string result;
|
||||
for (std::size_t i = 0; i < sizeof(value_list) / sizeof(ListSharesIncludeType); ++i)
|
||||
|
||||
inline FileAttributes operator|(FileAttributes lhs, FileAttributes rhs)
|
||||
{
|
||||
if ((val & value_list[i]) == value_list[i])
|
||||
using type = std::underlying_type_t<FileAttributes>;
|
||||
return static_cast<FileAttributes>(static_cast<type>(lhs) | static_cast<type>(rhs));
|
||||
}
|
||||
|
||||
inline FileAttributes& operator|=(FileAttributes& lhs, FileAttributes rhs)
|
||||
{
|
||||
lhs = lhs | rhs;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
inline FileAttributes operator&(FileAttributes lhs, FileAttributes rhs)
|
||||
{
|
||||
using type = std::underlying_type_t<FileAttributes>;
|
||||
return static_cast<FileAttributes>(static_cast<type>(lhs) & static_cast<type>(rhs));
|
||||
}
|
||||
|
||||
inline FileAttributes& operator&=(FileAttributes& lhs, FileAttributes rhs)
|
||||
{
|
||||
lhs = lhs & rhs;
|
||||
return lhs;
|
||||
}
|
||||
} // namespace Models
|
||||
|
||||
namespace Details {
|
||||
|
||||
inline Models::FileAttributes FileAttributesFromString(const std::string& fileAttributesString)
|
||||
{
|
||||
Models::FileAttributes result = static_cast<Models::FileAttributes>(0);
|
||||
|
||||
if (fileAttributesString == "ReadOnly")
|
||||
{
|
||||
if (!result.empty())
|
||||
result = Models::FileAttributes::ReadOnly;
|
||||
}
|
||||
else if (fileAttributesString == "Hidden")
|
||||
{
|
||||
result = Models::FileAttributes::Hidden;
|
||||
}
|
||||
else if (fileAttributesString == "System")
|
||||
{
|
||||
result = Models::FileAttributes::System;
|
||||
}
|
||||
else if (fileAttributesString == "None")
|
||||
{
|
||||
result = Models::FileAttributes::None;
|
||||
}
|
||||
else if (fileAttributesString == "Directory")
|
||||
{
|
||||
result = Models::FileAttributes::Directory;
|
||||
}
|
||||
else if (fileAttributesString == "Archive")
|
||||
{
|
||||
result = Models::FileAttributes::Archive;
|
||||
}
|
||||
else if (fileAttributesString == "Offline")
|
||||
{
|
||||
result = Models::FileAttributes::Offline;
|
||||
}
|
||||
else if (fileAttributesString == "NotContentIndexed")
|
||||
{
|
||||
result = Models::FileAttributes::NotContentIndexed;
|
||||
}
|
||||
else if (fileAttributesString == "NoScrubData")
|
||||
{
|
||||
result = Models::FileAttributes::NoScrubData;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
inline std::string FileAttributesToString(const Models::FileAttributes& val)
|
||||
{
|
||||
Models::FileAttributes value_list[] = {
|
||||
Models::FileAttributes::ReadOnly,
|
||||
Models::FileAttributes::Hidden,
|
||||
Models::FileAttributes::System,
|
||||
Models::FileAttributes::None,
|
||||
Models::FileAttributes::Directory,
|
||||
Models::FileAttributes::Archive,
|
||||
Models::FileAttributes::Temporary,
|
||||
Models::FileAttributes::Offline,
|
||||
Models::FileAttributes::NotContentIndexed,
|
||||
Models::FileAttributes::NoScrubData,
|
||||
};
|
||||
const char* string_list[] = {
|
||||
"ReadOnly",
|
||||
"Hidden",
|
||||
"System",
|
||||
"None",
|
||||
"Directory",
|
||||
"Archive",
|
||||
"Temporary",
|
||||
"Offline",
|
||||
"NotContentIndexed",
|
||||
"NoScrubData",
|
||||
};
|
||||
std::string result;
|
||||
for (std::size_t i = 0; i < sizeof(value_list) / sizeof(Models::ListSharesIncludeType); ++i)
|
||||
{
|
||||
if ((val & value_list[i]) == value_list[i])
|
||||
{
|
||||
result += "|";
|
||||
if (!result.empty())
|
||||
{
|
||||
result += "|";
|
||||
}
|
||||
result += string_list[i];
|
||||
}
|
||||
result += string_list[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
inline FileAttributes FileAttributesListFromString(const std::string& fileAttributesString)
|
||||
{
|
||||
FileAttributes results = static_cast<FileAttributes>(0);
|
||||
|
||||
std::string::const_iterator cur = fileAttributesString.begin();
|
||||
|
||||
auto getSubstrTillDelimiter
|
||||
= [](char delimiter, const std::string& string, std::string::const_iterator& cur) {
|
||||
auto begin = cur;
|
||||
auto end = std::find(cur, string.end(), delimiter);
|
||||
cur = end;
|
||||
if (cur != string.end())
|
||||
{
|
||||
++cur;
|
||||
}
|
||||
return std::string(begin, end);
|
||||
};
|
||||
|
||||
while (cur != fileAttributesString.end())
|
||||
inline Models::FileAttributes FileAttributesListFromString(
|
||||
const std::string& fileAttributesString)
|
||||
{
|
||||
std::string attribute = getSubstrTillDelimiter('|', fileAttributesString, cur);
|
||||
Models::FileAttributes results = static_cast<Models::FileAttributes>(0);
|
||||
|
||||
if (!attribute.empty())
|
||||
std::string::const_iterator cur = fileAttributesString.begin();
|
||||
|
||||
auto getSubstrTillDelimiter
|
||||
= [](char delimiter, const std::string& string, std::string::const_iterator& cur) {
|
||||
auto begin = cur;
|
||||
auto end = std::find(cur, string.end(), delimiter);
|
||||
cur = end;
|
||||
if (cur != string.end())
|
||||
{
|
||||
++cur;
|
||||
}
|
||||
return std::string(begin, end);
|
||||
};
|
||||
|
||||
while (cur != fileAttributesString.end())
|
||||
{
|
||||
results |= FileAttributesFromString(attribute);
|
||||
}
|
||||
}
|
||||
std::string attribute = getSubstrTillDelimiter('|', fileAttributesString, cur);
|
||||
|
||||
return results;
|
||||
}
|
||||
if (!attribute.empty())
|
||||
{
|
||||
results |= FileAttributesFromString(attribute);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
} // namespace Details
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
@ -92,7 +92,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @return Azure::Core::Response<CreateFileResult> containing the information returned when
|
||||
* creating the file.
|
||||
*/
|
||||
Azure::Core::Response<CreateFileResult> Create(
|
||||
Azure::Core::Response<Models::CreateFileResult> Create(
|
||||
int64_t fileSize,
|
||||
const CreateFileOptions& options = CreateFileOptions()) const;
|
||||
|
||||
@ -102,17 +102,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @return Azure::Core::Response<DeleteFileResult> containing the information returned when
|
||||
* deleting the file.
|
||||
*/
|
||||
Azure::Core::Response<DeleteFileResult> Delete(
|
||||
Azure::Core::Response<Models::DeleteFileResult> Delete(
|
||||
const DeleteFileOptions& options = DeleteFileOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Open a stream for the file's content, or a range of the file's content that can be
|
||||
* used to download the server end data.
|
||||
* @param options Optional parameters to get the content of this file.
|
||||
* @return Azure::Core::Response<DownloadFileResult> containing the range or full content and
|
||||
* the information of the file.
|
||||
* @return Azure::Core::Response<Models::DownloadFileResult> containing the range or full
|
||||
* content and the information of the file.
|
||||
*/
|
||||
Azure::Core::Response<DownloadFileResult> Download(
|
||||
Azure::Core::Response<Models::DownloadFileResult> Download(
|
||||
const DownloadFileOptions& options = DownloadFileOptions()) const;
|
||||
|
||||
/**
|
||||
@ -123,10 +123,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param bufferSize Size of the memory buffer. Size must be larger or equal to size of the file
|
||||
* or file range.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<DownloadFileToResult> containing the information of the
|
||||
* @return Azure::Core::Response<Models::DownloadFileToResult> containing the information of the
|
||||
* downloaded file/file range.
|
||||
*/
|
||||
Azure::Core::Response<DownloadFileToResult> DownloadTo(
|
||||
Azure::Core::Response<Models::DownloadFileToResult> DownloadTo(
|
||||
uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const DownloadFileToOptions& options = DownloadFileToOptions()) const;
|
||||
@ -137,10 +137,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*
|
||||
* @param fileName A file path to write the downloaded content to.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<DownloadFileToResult> containing the information of the
|
||||
* @return Azure::Core::Response<Models::DownloadFileToResult> containing the information of the
|
||||
* downloaded file/file range.
|
||||
*/
|
||||
Azure::Core::Response<DownloadFileToResult> DownloadTo(
|
||||
Azure::Core::Response<Models::DownloadFileToResult> DownloadTo(
|
||||
const std::string& fileName,
|
||||
const DownloadFileToOptions& options = DownloadFileToOptions()) const;
|
||||
|
||||
@ -151,9 +151,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param buffer A memory buffer containing the content to upload.
|
||||
* @param bufferSize Size of the memory buffer.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return A UploadFilePagesResult describing the state of the updated file.
|
||||
* @return Azure::Core::Response<Models::UploadFileFromResult> describing the state of the
|
||||
* updated file.
|
||||
*/
|
||||
Azure::Core::Response<UploadFileFromResult> UploadFrom(
|
||||
Azure::Core::Response<Models::UploadFileFromResult> UploadFrom(
|
||||
const uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const UploadFileFromOptions& options = UploadFileFromOptions()) const;
|
||||
@ -164,9 +165,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*
|
||||
* @param fileName A file containing the content to upload.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return A UploadFileFromResult describing the state of the updated file.
|
||||
* @return Azure::Core::Response<Models::UploadFileFromResult> describing the state of the
|
||||
* updated file.
|
||||
*/
|
||||
Azure::Core::Response<UploadFileFromResult> UploadFrom(
|
||||
Azure::Core::Response<Models::UploadFileFromResult> UploadFrom(
|
||||
const std::string& fileName,
|
||||
const UploadFileFromOptions& options = UploadFileFromOptions()) const;
|
||||
|
||||
@ -180,9 +182,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* public file, no authentication is required to perform the copy operation. A file in a share
|
||||
* snapshot can also be specified as a copy source.
|
||||
* @param options Optional parameters to copy the content of this file.
|
||||
* @return Azure::Core::Response<StartCopyFileResult> containing the copy related information.
|
||||
* @return Azure::Core::Response<Models::StartCopyFileResult> containing the copy related
|
||||
* information.
|
||||
*/
|
||||
Azure::Core::Response<StartCopyFileResult> StartCopy(
|
||||
Azure::Core::Response<Models::StartCopyFileResult> StartCopy(
|
||||
std::string copySource,
|
||||
const StartCopyFileOptions& options = StartCopyFileOptions()) const;
|
||||
|
||||
@ -191,19 +194,20 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param copyId The copy identifier provided in the StartCopyFileResult of the original
|
||||
* StartCopy operation.
|
||||
* @param options Optional parameters to abort copying the content of this file.
|
||||
* @return Azure::Core::Response<AbortCopyFileResult> containing the abort copy related
|
||||
* @return Azure::Core::Response<Models::AbortCopyFileResult> containing the abort copy related
|
||||
* information, current empty but preserved for future usage.
|
||||
*/
|
||||
Azure::Core::Response<AbortCopyFileResult> AbortCopy(
|
||||
Azure::Core::Response<Models::AbortCopyFileResult> AbortCopy(
|
||||
std::string copyId,
|
||||
const AbortCopyFileOptions& options = AbortCopyFileOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the properties of a file.
|
||||
* @param options Optional parameters to get the properties of this file.
|
||||
* @return Azure::Core::Response<GetFilePropertiesResult> containing the file properties.
|
||||
* @return Azure::Core::Response<Models::GetFilePropertiesResult> containing the file
|
||||
* properties.
|
||||
*/
|
||||
Azure::Core::Response<GetFilePropertiesResult> GetProperties(
|
||||
Azure::Core::Response<Models::GetFilePropertiesResult> GetProperties(
|
||||
const GetFilePropertiesOptions& options = GetFilePropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
@ -211,12 +215,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param httpHeaders The Http headers to be set to the file.
|
||||
* @param smbProperties The SMB properties to be set to the file.
|
||||
* @param options Optional parameters to set this file's properties.
|
||||
* @return Azure::Core::Response<SetFilePropertiesResult> containing the properties of the
|
||||
* file returned from the server.
|
||||
* @return Azure::Core::Response<Models::SetFilePropertiesResult> containing the properties of
|
||||
* the file returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<SetFilePropertiesResult> SetProperties(
|
||||
FileShareHttpHeaders httpHeaders,
|
||||
FileShareSmbProperties smbProperties,
|
||||
Azure::Core::Response<Models::SetFilePropertiesResult> SetProperties(
|
||||
Models::FileShareHttpHeaders httpHeaders,
|
||||
Models::FileShareSmbProperties smbProperties,
|
||||
const SetFilePropertiesOptions& options = SetFilePropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
@ -224,10 +228,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param metadata User-defined metadata to be stored with the file. Note that the string
|
||||
* may only contain ASCII characters in the ISO-8859-1 character set.
|
||||
* @param options Optional parameters to set this file's metadata.
|
||||
* @return Azure::Core::Response<SetFileMetadataResult> containing the information of the
|
||||
* file returned from the server.
|
||||
* @return Azure::Core::Response<Models::SetFileMetadataResult> containing the information of
|
||||
* the file returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<SetFileMetadataResult> SetMetadata(
|
||||
Azure::Core::Response<Models::SetFileMetadataResult> SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const SetFileMetadataOptions& options = SetFileMetadataOptions()) const;
|
||||
|
||||
@ -235,10 +239,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Uploads some data to a range of the file.
|
||||
* @param offset Specifies the starting offset for the content to be written as a range.
|
||||
* @param content A BodyStream containing the content of the range to upload.
|
||||
* @return Azure::Core::Response<UploadFileRange> containing the information of the uploaded
|
||||
* range and the file returned from the server.
|
||||
* @return Azure::Core::Response<Models::UploadFileRange> containing the information of the
|
||||
* uploaded range and the file returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<UploadFileRangeResult> UploadRange(
|
||||
Azure::Core::Response<Models::UploadFileRangeResult> UploadRange(
|
||||
int64_t offset,
|
||||
Azure::Core::Http::BodyStream* content,
|
||||
const UploadFileRangeOptions& options = UploadFileRangeOptions()) const;
|
||||
@ -247,50 +251,50 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Clears some range of data within the file.
|
||||
* @param offset Specifies the starting offset for the content to be cleared within the file.
|
||||
* @param length Specifies the length for the content to be cleared within the file.
|
||||
* @return Azure::Core::Response<ClearFileRangeResult> containing the information of the cleared
|
||||
* range returned from the server.
|
||||
* @return Azure::Core::Response<Models::ClearFileRangeResult> containing the information of the
|
||||
* cleared range returned from the server.
|
||||
*/
|
||||
Azure::Core::Response<ClearFileRangeResult> ClearRange(
|
||||
Azure::Core::Response<Models::ClearFileRangeResult> ClearRange(
|
||||
int64_t offset,
|
||||
int64_t length,
|
||||
const ClearFileRangeOptions& options = ClearFileRangeOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the list of valid range from the file within specified range.
|
||||
* @return Azure::Core::Response<GetFileRangeListResult> containing the valid ranges within the
|
||||
* file for the specified range.
|
||||
* @return Azure::Core::Response<Models::GetFileRangeListResult> containing the valid ranges
|
||||
* within the file for the specified range.
|
||||
*/
|
||||
Azure::Core::Response<GetFileRangeListResult> GetRangeList(
|
||||
Azure::Core::Response<Models::GetFileRangeListResult> GetRangeList(
|
||||
const GetFileRangeListOptions& options = GetFileRangeListOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief List open handles on the file.
|
||||
* @param options Optional parameters to list this file's open handles.
|
||||
* @return Azure::Core::Response<ListFileHandlesSegmentResult> containing the information
|
||||
* of the operation and the open handles of this file
|
||||
* @return Azure::Core::Response<Models::ListFileHandlesSegmentResult> containing the
|
||||
* information of the operation and the open handles of this file
|
||||
*/
|
||||
Azure::Core::Response<ListFileHandlesSegmentResult> ListHandlesSegment(
|
||||
Azure::Core::Response<Models::ListFileHandlesSegmentResult> ListHandlesSegment(
|
||||
const ListFileHandlesSegmentOptions& options = ListFileHandlesSegmentOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Closes a handle opened on a file at the service.
|
||||
* @param handleId The ID of the handle to be closed.
|
||||
* @param options Optional parameters to close one of this file's open handles.
|
||||
* @return Azure::Core::Response<ForceCloseFileHandleResult> containing the information
|
||||
* @return Azure::Core::Response<Models::ForceCloseFileHandleResult> containing the information
|
||||
* of the closed handle. Current empty but preserved for future usage.
|
||||
*/
|
||||
Azure::Core::Response<ForceCloseFileHandleResult> ForceCloseHandle(
|
||||
Azure::Core::Response<Models::ForceCloseFileHandleResult> ForceCloseHandle(
|
||||
const std::string& handleId,
|
||||
const ForceCloseFileHandleOptions& options = ForceCloseFileHandleOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Closes all handles opened on a file at the service.
|
||||
* @param options Optional parameters to close all this file's open handles.
|
||||
* @return Azure::Core::Response<ForceCloseAllFileHandlesResult> containing the information
|
||||
* of the closed handles
|
||||
* @return Azure::Core::Response<Models::ForceCloseAllFileHandlesResult> containing the
|
||||
* information of the closed handles
|
||||
* @remark This operation may return a marker showing that the operation can be continued.
|
||||
*/
|
||||
Azure::Core::Response<ForceCloseAllFileHandlesResult> ForceCloseAllHandles(
|
||||
Azure::Core::Response<Models::ForceCloseAllFileHandlesResult> ForceCloseAllHandles(
|
||||
const ForceCloseAllFileHandlesOptions& options = ForceCloseAllFileHandlesOptions()) const;
|
||||
|
||||
/**
|
||||
@ -298,9 +302,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*
|
||||
* @param proposedLeaseId Proposed lease ID, in a GUID string format.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<AcquireFileLeaseResult> describing the lease.
|
||||
* @return Azure::Core::Response<Models::AcquireFileLeaseResult> describing the lease.
|
||||
*/
|
||||
Azure::Core::Response<AcquireFileLeaseResult> AcquireLease(
|
||||
Azure::Core::Response<Models::AcquireFileLeaseResult> AcquireLease(
|
||||
const std::string& proposedLeaseId,
|
||||
const AcquireFileLeaseOptions& options = AcquireFileLeaseOptions()) const;
|
||||
|
||||
@ -309,9 +313,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*
|
||||
* @param leaseId ID of the previously-acquired lease.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<ReleaseFileLeaseResult> describing the updated container.
|
||||
* @return Azure::Core::Response<Models::ReleaseFileLeaseResult> describing the updated
|
||||
* container.
|
||||
*/
|
||||
Azure::Core::Response<ReleaseFileLeaseResult> ReleaseLease(
|
||||
Azure::Core::Response<Models::ReleaseFileLeaseResult> ReleaseLease(
|
||||
const std::string& leaseId,
|
||||
const ReleaseFileLeaseOptions& options = ReleaseFileLeaseOptions()) const;
|
||||
|
||||
@ -321,9 +326,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @param leaseId ID of the previously-acquired lease.
|
||||
* @param proposedLeaseId Proposed lease ID, in a GUID string format.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<ChangeFileLeaseResult> describing the changed lease.
|
||||
* @return Azure::Core::Response<Models::ChangeFileLeaseResult> describing the changed lease.
|
||||
*/
|
||||
Azure::Core::Response<ChangeFileLeaseResult> ChangeLease(
|
||||
Azure::Core::Response<Models::ChangeFileLeaseResult> ChangeLease(
|
||||
const std::string& leaseId,
|
||||
const std::string& proposedLeaseId,
|
||||
const ChangeFileLeaseOptions& options = ChangeFileLeaseOptions()) const;
|
||||
@ -332,9 +337,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @brief Breaks the previously-acquired lease.
|
||||
*
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<BreakFileLeaseResult> describing the broken lease.
|
||||
* @return Azure::Core::Response<Models::BreakFileLeaseResult> describing the broken lease.
|
||||
*/
|
||||
Azure::Core::Response<BreakFileLeaseResult> BreakLease(
|
||||
Azure::Core::Response<Models::BreakFileLeaseResult> BreakLease(
|
||||
const BreakFileLeaseOptions& options = BreakFileLeaseOptions()) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -123,7 +123,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief Include this parameter to specify one or more datasets to include in the response.
|
||||
*/
|
||||
Azure::Core::Nullable<ListSharesIncludeType> ListSharesInclude;
|
||||
Azure::Core::Nullable<Models::ListSharesIncludeType> ListSharesInclude;
|
||||
};
|
||||
|
||||
struct SetServicePropertiesOptions
|
||||
@ -335,7 +335,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief SMB properties to set for the directory.
|
||||
*/
|
||||
FileShareSmbProperties SmbProperties;
|
||||
Models::FileShareSmbProperties SmbProperties;
|
||||
};
|
||||
|
||||
struct DeleteDirectoryOptions
|
||||
@ -482,12 +482,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief SMB properties to set for the file.
|
||||
*/
|
||||
FileShareSmbProperties SmbProperties;
|
||||
Models::FileShareSmbProperties SmbProperties;
|
||||
|
||||
/**
|
||||
* @brief Specifies the HttpHeaders of the file.
|
||||
*/
|
||||
FileShareHttpHeaders HttpHeaders;
|
||||
Models::FileShareHttpHeaders HttpHeaders;
|
||||
|
||||
/**
|
||||
* @brief A name-value pair to associate with a file storage object.
|
||||
@ -565,13 +565,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief SMB properties to set for the destination file.
|
||||
*/
|
||||
FileShareSmbProperties SmbProperties;
|
||||
Models::FileShareSmbProperties SmbProperties;
|
||||
|
||||
/**
|
||||
* @brief Specifies the option to copy file security descriptor from source file or to set it
|
||||
* using the value which is defined by the smb properties.
|
||||
*/
|
||||
Azure::Core::Nullable<PermissionCopyModeType> PermissionCopyMode;
|
||||
Azure::Core::Nullable<Models::PermissionCopyModeType> PermissionCopyMode;
|
||||
|
||||
/**
|
||||
* @brief Specifies the option to overwrite the target file if it already exists and has
|
||||
@ -900,7 +900,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief The standard HTTP header system properties to set.
|
||||
*/
|
||||
FileShareHttpHeaders HttpHeaders;
|
||||
Models::FileShareHttpHeaders HttpHeaders;
|
||||
|
||||
/**
|
||||
* @brief Name-value pairs associated with the file as metadata.
|
||||
@ -915,7 +915,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief SMB properties to set for the destination file.
|
||||
*/
|
||||
FileShareSmbProperties SmbProperties;
|
||||
Models::FileShareSmbProperties SmbProperties;
|
||||
|
||||
/**
|
||||
* @brief If specified the permission (security descriptor) shall be set for the directory.
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
#include "azure/storage/files/shares/share_constants.hpp"
|
||||
#include "azure/storage/files/shares/share_file_attribute.hpp"
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models {
|
||||
|
||||
// ServiceClient models:
|
||||
|
||||
@ -131,4 +131,4 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
Azure::Core::Nullable<bool> IsServerEncrypted;
|
||||
};
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
}}}}} // namespace Azure::Storage::Files::Shares::Models
|
||||
|
||||
@ -80,30 +80,31 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
/**
|
||||
* @brief List the shares from the service.
|
||||
* @param options Optional parameters to list the shares.
|
||||
* @return Azure::Core::Response<ListSharesSegmentResult> The results containing the shares
|
||||
* returned and information used for future list operation on valid result not yet returned.
|
||||
* @return Azure::Core::Response<Models::ListSharesSegmentResult> The results containing the
|
||||
* shares returned and information used for future list operation on valid result not yet
|
||||
* returned.
|
||||
*/
|
||||
Azure::Core::Response<ListSharesSegmentResult> ListSharesSegment(
|
||||
Azure::Core::Response<Models::ListSharesSegmentResult> ListSharesSegment(
|
||||
const ListSharesSegmentOptions& options = ListSharesSegmentOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Set the service's properties.
|
||||
* @param properties The properties of the service that is to be set.
|
||||
* @param options Optional parameters to set the properties of the service.
|
||||
* @return Azure::Core::Response<SetServicePropertiesResult> The infromation returned when
|
||||
* setting the service properties.
|
||||
* @return Azure::Core::Response<Models::SetServicePropertiesResult> The infromation returned
|
||||
* when setting the service properties.
|
||||
*/
|
||||
Azure::Core::Response<SetServicePropertiesResult> SetProperties(
|
||||
StorageServiceProperties properties,
|
||||
Azure::Core::Response<Models::SetServicePropertiesResult> SetProperties(
|
||||
Models::StorageServiceProperties properties,
|
||||
const SetServicePropertiesOptions& options = SetServicePropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Get the service's properties.
|
||||
* @param options Optional parameters to get the properties of the service.
|
||||
* @return Azure::Core::Response<GetServicePropertiesResult> The result containing service's
|
||||
* properties.
|
||||
* @return Azure::Core::Response<Models::GetServicePropertiesResult> The result containing
|
||||
* service's properties.
|
||||
*/
|
||||
Azure::Core::Response<GetServicePropertiesResult> GetProperties(
|
||||
Azure::Core::Response<Models::GetServicePropertiesResult> GetProperties(
|
||||
const GetServicePropertiesOptions& options = GetServicePropertiesOptions()) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -142,7 +142,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return newClient;
|
||||
}
|
||||
|
||||
Azure::Core::Response<CreateShareResult> ShareClient::Create(
|
||||
Azure::Core::Response<Models::CreateShareResult> ShareClient::Create(
|
||||
const CreateShareOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::CreateOptions();
|
||||
@ -152,19 +152,19 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<DeleteShareResult> ShareClient::Delete(
|
||||
Azure::Core::Response<Models::DeleteShareResult> ShareClient::Delete(
|
||||
const DeleteShareOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::DeleteOptions();
|
||||
if (options.IncludeSnapshots.HasValue() and options.IncludeSnapshots.GetValue())
|
||||
{
|
||||
protocolLayerOptions.XMsDeleteSnapshots = DeleteSnapshotsOptionType::Include;
|
||||
protocolLayerOptions.XMsDeleteSnapshots = Models::DeleteSnapshotsOptionType::Include;
|
||||
}
|
||||
return Details::ShareRestClient::Share::Delete(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<CreateShareSnapshotResult> ShareClient::CreateSnapshot(
|
||||
Azure::Core::Response<Models::CreateShareSnapshotResult> ShareClient::CreateSnapshot(
|
||||
const CreateShareSnapshotOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::CreateSnapshotOptions();
|
||||
@ -173,7 +173,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetSharePropertiesResult> ShareClient::GetProperties(
|
||||
Azure::Core::Response<Models::GetSharePropertiesResult> ShareClient::GetProperties(
|
||||
const GetSharePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetPropertiesOptions();
|
||||
@ -181,7 +181,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetShareQuotaResult> ShareClient::SetQuota(
|
||||
Azure::Core::Response<Models::SetShareQuotaResult> ShareClient::SetQuota(
|
||||
int32_t quotaInGiB,
|
||||
const SetShareQuotaOptions& options) const
|
||||
{
|
||||
@ -191,7 +191,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetShareMetadataResult> ShareClient::SetMetadata(
|
||||
Azure::Core::Response<Models::SetShareMetadataResult> ShareClient::SetMetadata(
|
||||
std::map<std::string, std::string> metadata,
|
||||
const SetShareMetadataOptions& options) const
|
||||
{
|
||||
@ -201,7 +201,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetShareAccessPolicyResult> ShareClient::GetAccessPolicy(
|
||||
Azure::Core::Response<Models::GetShareAccessPolicyResult> ShareClient::GetAccessPolicy(
|
||||
const GetShareAccessPolicyOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetAccessPolicyOptions();
|
||||
@ -209,8 +209,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetShareAccessPolicyResult> ShareClient::SetAccessPolicy(
|
||||
const std::vector<SignedIdentifier>& accessPolicy,
|
||||
Azure::Core::Response<Models::SetShareAccessPolicyResult> ShareClient::SetAccessPolicy(
|
||||
const std::vector<Models::SignedIdentifier>& accessPolicy,
|
||||
const SetShareAccessPolicyOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::SetAccessPolicyOptions();
|
||||
@ -219,7 +219,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetShareStatisticsResult> ShareClient::GetStatistics(
|
||||
Azure::Core::Response<Models::GetShareStatisticsResult> ShareClient::GetStatistics(
|
||||
const GetShareStatsOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Share::GetStatisticsOptions();
|
||||
@ -227,7 +227,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<CreateSharePermissionResult> ShareClient::CreatePermission(
|
||||
Azure::Core::Response<Models::CreateSharePermissionResult> ShareClient::CreatePermission(
|
||||
const std::string& permission,
|
||||
const CreateSharePermissionOptions& options) const
|
||||
{
|
||||
@ -237,7 +237,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetSharePermissionResult> ShareClient::GetPermission(
|
||||
Azure::Core::Response<Models::GetSharePermissionResult> ShareClient::GetPermission(
|
||||
const std::string& permissionKey,
|
||||
const GetSharePermissionOptions& options) const
|
||||
{
|
||||
@ -247,7 +247,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListFilesAndDirectoriesSegmentResult>
|
||||
Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult>
|
||||
ShareClient::ListFilesAndDirectoriesSegment(
|
||||
const ListFilesAndDirectoriesSegmentOptions& options) const
|
||||
{
|
||||
@ -258,7 +258,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.MaxResults = options.MaxResults;
|
||||
auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSegment(
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
ListFilesAndDirectoriesSegmentResult ret;
|
||||
Models::ListFilesAndDirectoriesSegmentResult ret;
|
||||
ret.ServiceEndpoint = std::move(result->ServiceEndpoint);
|
||||
ret.ShareName = std::move(result->ShareName);
|
||||
ret.ShareSnapshot = std::move(result->ShareSnapshot);
|
||||
@ -270,11 +270,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ret.DirectoryItems = std::move(result->Segment.DirectoryItems);
|
||||
ret.FileItems = std::move(result->Segment.FileItems);
|
||||
|
||||
return Azure::Core::Response<ListFilesAndDirectoriesSegmentResult>(
|
||||
return Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<AcquireShareLeaseResult> ShareClient::AcquireLease(
|
||||
Azure::Core::Response<Models::AcquireShareLeaseResult> ShareClient::AcquireLease(
|
||||
const std::string& proposedLeaseId,
|
||||
int32_t duration,
|
||||
const AcquireShareLeaseOptions& options) const
|
||||
@ -286,7 +286,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ChangeShareLeaseResult> ShareClient::ChangeLease(
|
||||
Azure::Core::Response<Models::ChangeShareLeaseResult> ShareClient::ChangeLease(
|
||||
const std::string& leaseId,
|
||||
const std::string& proposedLeaseId,
|
||||
const ChangeShareLeaseOptions& options) const
|
||||
@ -298,7 +298,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ReleaseShareLeaseResult> ShareClient::ReleaseLease(
|
||||
Azure::Core::Response<Models::ReleaseShareLeaseResult> ShareClient::ReleaseLease(
|
||||
const std::string& leaseId,
|
||||
const ReleaseShareLeaseOptions& options) const
|
||||
{
|
||||
@ -308,7 +308,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<BreakShareLeaseResult> ShareClient::BreakLease(
|
||||
Azure::Core::Response<Models::BreakShareLeaseResult> ShareClient::BreakLease(
|
||||
const BreakShareLeaseOptions& options) const
|
||||
{
|
||||
Details::ShareRestClient::Share::BreakLeaseOptions protocolLayerOptions;
|
||||
@ -317,7 +317,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<RenewShareLeaseResult> ShareClient::RenewLease(
|
||||
Azure::Core::Response<Models::RenewShareLeaseResult> ShareClient::RenewLease(
|
||||
const std::string& leaseId,
|
||||
const RenewShareLeaseOptions& options) const
|
||||
{
|
||||
|
||||
@ -145,15 +145,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return newClient;
|
||||
}
|
||||
|
||||
Azure::Core::Response<CreateDirectoryResult> DirectoryClient::Create(
|
||||
Azure::Core::Response<Models::CreateDirectoryResult> DirectoryClient::Create(
|
||||
const CreateDirectoryOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::CreateOptions();
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(options.SmbProperties.Attributes);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(options.SmbProperties.Attributes);
|
||||
if (protocolLayerOptions.FileAttributes.empty())
|
||||
{
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(FileAttributes::Directory);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(Models::FileAttributes::Directory);
|
||||
}
|
||||
if (options.SmbProperties.CreationTime.HasValue())
|
||||
{
|
||||
@ -187,7 +189,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<DeleteDirectoryResult> DirectoryClient::Delete(
|
||||
Azure::Core::Response<Models::DeleteDirectoryResult> DirectoryClient::Delete(
|
||||
const DeleteDirectoryOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::DeleteOptions();
|
||||
@ -195,7 +197,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetDirectoryPropertiesResult> DirectoryClient::GetProperties(
|
||||
Azure::Core::Response<Models::GetDirectoryPropertiesResult> DirectoryClient::GetProperties(
|
||||
const GetDirectoryPropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::GetPropertiesOptions();
|
||||
@ -203,12 +205,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetDirectoryPropertiesResult> DirectoryClient::SetProperties(
|
||||
FileShareSmbProperties smbProperties,
|
||||
Azure::Core::Response<Models::SetDirectoryPropertiesResult> DirectoryClient::SetProperties(
|
||||
Models::FileShareSmbProperties smbProperties,
|
||||
const SetDirectoryPropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::SetPropertiesOptions();
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(smbProperties.Attributes);
|
||||
protocolLayerOptions.FileAttributes = Details::FileAttributesToString(smbProperties.Attributes);
|
||||
if (smbProperties.CreationTime.HasValue())
|
||||
{
|
||||
protocolLayerOptions.FileCreationTime = smbProperties.CreationTime.GetValue();
|
||||
@ -241,7 +243,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetDirectoryMetadataResult> DirectoryClient::SetMetadata(
|
||||
Azure::Core::Response<Models::SetDirectoryMetadataResult> DirectoryClient::SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const SetDirectoryMetadataOptions& options) const
|
||||
{
|
||||
@ -251,7 +253,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListFilesAndDirectoriesSegmentResult>
|
||||
Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult>
|
||||
DirectoryClient::ListFilesAndDirectoriesSegment(
|
||||
const ListFilesAndDirectoriesSegmentOptions& options) const
|
||||
{
|
||||
@ -262,7 +264,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.MaxResults = options.MaxResults;
|
||||
auto result = Details::ShareRestClient::Directory::ListFilesAndDirectoriesSegment(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
ListFilesAndDirectoriesSegmentResult ret;
|
||||
Models::ListFilesAndDirectoriesSegmentResult ret;
|
||||
ret.ServiceEndpoint = std::move(result->ServiceEndpoint);
|
||||
ret.ShareName = std::move(result->ShareName);
|
||||
ret.ShareSnapshot = std::move(result->ShareSnapshot);
|
||||
@ -274,12 +276,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
ret.DirectoryItems = std::move(result->Segment.DirectoryItems);
|
||||
ret.FileItems = std::move(result->Segment.FileItems);
|
||||
|
||||
return Azure::Core::Response<ListFilesAndDirectoriesSegmentResult>(
|
||||
return Azure::Core::Response<Models::ListFilesAndDirectoriesSegmentResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListDirectoryHandlesSegmentResult> DirectoryClient::ListHandlesSegment(
|
||||
const ListDirectoryHandlesSegmentOptions& options) const
|
||||
Azure::Core::Response<Models::ListDirectoryHandlesSegmentResult>
|
||||
DirectoryClient::ListHandlesSegment(const ListDirectoryHandlesSegmentOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::ListHandlesOptions();
|
||||
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
|
||||
@ -287,15 +289,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.Recursive = options.Recursive;
|
||||
auto result = Details::ShareRestClient::Directory::ListHandles(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
ListDirectoryHandlesSegmentResult ret;
|
||||
Models::ListDirectoryHandlesSegmentResult ret;
|
||||
ret.ContinuationToken = std::move(result->ContinuationToken);
|
||||
ret.HandleList = std::move(result->HandleList);
|
||||
|
||||
return Azure::Core::Response<ListDirectoryHandlesSegmentResult>(
|
||||
return Azure::Core::Response<Models::ListDirectoryHandlesSegmentResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<ForceCloseDirectoryHandleResult> DirectoryClient::ForceCloseHandle(
|
||||
Azure::Core::Response<Models::ForceCloseDirectoryHandleResult> DirectoryClient::ForceCloseHandle(
|
||||
const std::string& handleId,
|
||||
const ForceCloseDirectoryHandleOptions& options) const
|
||||
{
|
||||
@ -303,12 +305,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.HandleId = handleId;
|
||||
auto result = Details::ShareRestClient::File::ForceCloseHandles(
|
||||
m_shareDirectoryUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
return Azure::Core::Response<ForceCloseDirectoryHandleResult>(
|
||||
ForceCloseDirectoryHandleResult(), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<Models::ForceCloseDirectoryHandleResult>(
|
||||
Models::ForceCloseDirectoryHandleResult(), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<ForceCloseAllDirectoryHandlesResult> DirectoryClient::ForceCloseAllHandles(
|
||||
const ForceCloseAllDirectoryHandlesOptions& options) const
|
||||
Azure::Core::Response<Models::ForceCloseAllDirectoryHandlesResult>
|
||||
DirectoryClient::ForceCloseAllHandles(const ForceCloseAllDirectoryHandlesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Directory::ForceCloseHandlesOptions();
|
||||
protocolLayerOptions.HandleId = c_FileAllHandles;
|
||||
|
||||
@ -132,16 +132,18 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return newClient;
|
||||
}
|
||||
|
||||
Azure::Core::Response<CreateFileResult> FileClient::Create(
|
||||
Azure::Core::Response<Models::CreateFileResult> FileClient::Create(
|
||||
int64_t fileSize,
|
||||
const CreateFileOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::CreateOptions();
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(options.SmbProperties.Attributes);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(options.SmbProperties.Attributes);
|
||||
if (protocolLayerOptions.FileAttributes.empty())
|
||||
{
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(FileAttributes::None);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(Models::FileAttributes::None);
|
||||
}
|
||||
if (options.SmbProperties.CreationTime.HasValue())
|
||||
{
|
||||
@ -201,7 +203,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<DeleteFileResult> FileClient::Delete(const DeleteFileOptions& options) const
|
||||
Azure::Core::Response<Models::DeleteFileResult> FileClient::Delete(
|
||||
const DeleteFileOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::DeleteOptions();
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
@ -209,7 +212,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<DownloadFileResult> FileClient::Download(
|
||||
Azure::Core::Response<Models::DownloadFileResult> FileClient::Download(
|
||||
const DownloadFileOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::DownloadOptions();
|
||||
@ -268,7 +271,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return downloadResponse;
|
||||
}
|
||||
|
||||
Azure::Core::Response<StartCopyFileResult> FileClient::StartCopy(
|
||||
Azure::Core::Response<Models::StartCopyFileResult> FileClient::StartCopy(
|
||||
std::string copySource,
|
||||
const StartCopyFileOptions& options) const
|
||||
{
|
||||
@ -276,7 +279,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
protocolLayerOptions.CopySource = std::move(copySource);
|
||||
protocolLayerOptions.FileCopyFileAttributes
|
||||
= FileAttributesToString(options.SmbProperties.Attributes);
|
||||
= Details::FileAttributesToString(options.SmbProperties.Attributes);
|
||||
if (options.SmbProperties.CreationTime.HasValue())
|
||||
{
|
||||
protocolLayerOptions.FileCopyFileCreationTime = options.SmbProperties.CreationTime.GetValue();
|
||||
@ -297,7 +300,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
if (options.PermissionCopyMode.HasValue())
|
||||
{
|
||||
protocolLayerOptions.XMsFilePermissionCopyMode = options.PermissionCopyMode.GetValue();
|
||||
if (options.PermissionCopyMode.GetValue() == PermissionCopyModeType::Override)
|
||||
if (options.PermissionCopyMode.GetValue() == Models::PermissionCopyModeType::Override)
|
||||
{
|
||||
if (options.Permission.HasValue())
|
||||
{
|
||||
@ -317,7 +320,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolLayerOptions.XMsFilePermissionCopyMode = PermissionCopyModeType::Source;
|
||||
protocolLayerOptions.XMsFilePermissionCopyMode = Models::PermissionCopyModeType::Source;
|
||||
}
|
||||
protocolLayerOptions.FileCopyIgnoreReadOnly = options.IgnoreReadOnly;
|
||||
protocolLayerOptions.FileCopySetArchiveAttribute = options.SetArchiveAttribute;
|
||||
@ -326,7 +329,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<AbortCopyFileResult> FileClient::AbortCopy(
|
||||
Azure::Core::Response<Models::AbortCopyFileResult> FileClient::AbortCopy(
|
||||
std::string copyId,
|
||||
const AbortCopyFileOptions& options) const
|
||||
{
|
||||
@ -337,7 +340,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetFilePropertiesResult> FileClient::GetProperties(
|
||||
Azure::Core::Response<Models::GetFilePropertiesResult> FileClient::GetProperties(
|
||||
const GetFilePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::GetPropertiesOptions();
|
||||
@ -346,13 +349,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetFilePropertiesResult> FileClient::SetProperties(
|
||||
FileShareHttpHeaders httpHeaders,
|
||||
FileShareSmbProperties smbProperties,
|
||||
Azure::Core::Response<Models::SetFilePropertiesResult> FileClient::SetProperties(
|
||||
Models::FileShareHttpHeaders httpHeaders,
|
||||
Models::FileShareSmbProperties smbProperties,
|
||||
const SetFilePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::SetHttpHeadersOptions();
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(smbProperties.Attributes);
|
||||
protocolLayerOptions.FileAttributes = Details::FileAttributesToString(smbProperties.Attributes);
|
||||
if (smbProperties.CreationTime.HasValue())
|
||||
{
|
||||
protocolLayerOptions.FileCreationTime = smbProperties.CreationTime.GetValue();
|
||||
@ -409,7 +412,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetFileMetadataResult> FileClient::SetMetadata(
|
||||
Azure::Core::Response<Models::SetFileMetadataResult> FileClient::SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const SetFileMetadataOptions& options) const
|
||||
{
|
||||
@ -420,13 +423,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<UploadFileRangeResult> FileClient::UploadRange(
|
||||
Azure::Core::Response<Models::UploadFileRangeResult> FileClient::UploadRange(
|
||||
int64_t offset,
|
||||
Azure::Core::Http::BodyStream* content,
|
||||
const UploadFileRangeOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::UploadRangeOptions();
|
||||
protocolLayerOptions.XMsWrite = FileRangeWriteType::Update;
|
||||
protocolLayerOptions.XMsWrite = Models::FileRangeWriteType::Update;
|
||||
protocolLayerOptions.ContentLength = content->Length();
|
||||
protocolLayerOptions.XMsRange = std::string("bytes=") + std::to_string(offset)
|
||||
+ std::string("-") + std::to_string(offset + content->Length() - 1);
|
||||
@ -436,13 +439,13 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *content, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ClearFileRangeResult> FileClient::ClearRange(
|
||||
Azure::Core::Response<Models::ClearFileRangeResult> FileClient::ClearRange(
|
||||
int64_t offset,
|
||||
int64_t length,
|
||||
const ClearFileRangeOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::UploadRangeOptions();
|
||||
protocolLayerOptions.XMsWrite = FileRangeWriteType::Clear;
|
||||
protocolLayerOptions.XMsWrite = Models::FileRangeWriteType::Clear;
|
||||
protocolLayerOptions.ContentLength = 0;
|
||||
protocolLayerOptions.XMsRange = std::string("bytes=") + std::to_string(offset)
|
||||
+ std::string("-") + std::to_string(offset + length - 1);
|
||||
@ -456,7 +459,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetFileRangeListResult> FileClient::GetRangeList(
|
||||
Azure::Core::Response<Models::GetFileRangeListResult> FileClient::GetRangeList(
|
||||
const GetFileRangeListOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::GetRangeListOptions();
|
||||
@ -481,7 +484,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListFileHandlesSegmentResult> FileClient::ListHandlesSegment(
|
||||
Azure::Core::Response<Models::ListFileHandlesSegmentResult> FileClient::ListHandlesSegment(
|
||||
const ListFileHandlesSegmentOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::ListHandlesOptions();
|
||||
@ -489,15 +492,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.MaxResults = options.MaxResults;
|
||||
auto result = Details::ShareRestClient::File::ListHandles(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
ListFileHandlesSegmentResult ret;
|
||||
Models::ListFileHandlesSegmentResult ret;
|
||||
ret.ContinuationToken = std::move(result->ContinuationToken);
|
||||
ret.HandleList = std::move(result->HandleList);
|
||||
|
||||
return Azure::Core::Response<ListFileHandlesSegmentResult>(
|
||||
return Azure::Core::Response<Models::ListFileHandlesSegmentResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<ForceCloseFileHandleResult> FileClient::ForceCloseHandle(
|
||||
Azure::Core::Response<Models::ForceCloseFileHandleResult> FileClient::ForceCloseHandle(
|
||||
const std::string& handleId,
|
||||
const ForceCloseFileHandleOptions& options) const
|
||||
{
|
||||
@ -505,11 +508,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
protocolLayerOptions.HandleId = handleId;
|
||||
auto result = Details::ShareRestClient::File::ForceCloseHandles(
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
return Azure::Core::Response<ForceCloseFileHandleResult>(
|
||||
ForceCloseFileHandleResult(), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<Models::ForceCloseFileHandleResult>(
|
||||
Models::ForceCloseFileHandleResult(), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<ForceCloseAllFileHandlesResult> FileClient::ForceCloseAllHandles(
|
||||
Azure::Core::Response<Models::ForceCloseAllFileHandlesResult> FileClient::ForceCloseAllHandles(
|
||||
const ForceCloseAllFileHandlesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::File::ForceCloseHandlesOptions();
|
||||
@ -519,7 +522,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<AcquireFileLeaseResult> FileClient::AcquireLease(
|
||||
Azure::Core::Response<Models::AcquireFileLeaseResult> FileClient::AcquireLease(
|
||||
const std::string& proposedLeaseId,
|
||||
const AcquireFileLeaseOptions& options) const
|
||||
{
|
||||
@ -530,7 +533,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ChangeFileLeaseResult> FileClient::ChangeLease(
|
||||
Azure::Core::Response<Models::ChangeFileLeaseResult> FileClient::ChangeLease(
|
||||
const std::string& leaseId,
|
||||
const std::string& proposedLeaseId,
|
||||
const ChangeFileLeaseOptions& options) const
|
||||
@ -542,7 +545,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ReleaseFileLeaseResult> FileClient::ReleaseLease(
|
||||
Azure::Core::Response<Models::ReleaseFileLeaseResult> FileClient::ReleaseLease(
|
||||
const std::string& leaseId,
|
||||
const ReleaseFileLeaseOptions& options) const
|
||||
{
|
||||
@ -552,7 +555,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<BreakFileLeaseResult> FileClient::BreakLease(
|
||||
Azure::Core::Response<Models::BreakFileLeaseResult> FileClient::BreakLease(
|
||||
const BreakFileLeaseOptions& options) const
|
||||
{
|
||||
Details::ShareRestClient::File::BreakLeaseOptions protocolLayerOptions;
|
||||
@ -560,7 +563,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareFileUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<DownloadFileToResult> FileClient::DownloadTo(
|
||||
Azure::Core::Response<Models::DownloadFileToResult> FileClient::DownloadTo(
|
||||
uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const DownloadFileToOptions& options) const
|
||||
@ -622,14 +625,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
firstChunk->BodyStream.reset();
|
||||
|
||||
auto returnTypeConverter = [](Azure::Core::Response<DownloadFileResult>& response) {
|
||||
DownloadFileToResult ret;
|
||||
auto returnTypeConverter = [](Azure::Core::Response<Models::DownloadFileResult>& response) {
|
||||
Models::DownloadFileToResult ret;
|
||||
ret.ETag = std::move(response->ETag);
|
||||
ret.LastModified = std::move(response->LastModified);
|
||||
ret.HttpHeaders = std::move(response->HttpHeaders);
|
||||
ret.Metadata = std::move(response->Metadata);
|
||||
ret.IsServerEncrypted = response->IsServerEncrypted;
|
||||
return Azure::Core::Response<DownloadFileToResult>(
|
||||
return Azure::Core::Response<Models::DownloadFileToResult>(
|
||||
std::move(ret),
|
||||
std::make_unique<Azure::Core::Http::RawResponse>(std::move(response.GetRawResponse())));
|
||||
};
|
||||
@ -680,7 +683,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Azure::Core::Response<DownloadFileToResult> FileClient::DownloadTo(
|
||||
Azure::Core::Response<Models::DownloadFileToResult> FileClient::DownloadTo(
|
||||
const std::string& fileName,
|
||||
const DownloadFileToOptions& options) const
|
||||
{
|
||||
@ -755,14 +758,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*(firstChunk->BodyStream), fileWriter, 0, firstChunkLength, firstChunkOptions.Context);
|
||||
firstChunk->BodyStream.reset();
|
||||
|
||||
auto returnTypeConverter = [](Azure::Core::Response<DownloadFileResult>& response) {
|
||||
DownloadFileToResult ret;
|
||||
auto returnTypeConverter = [](Azure::Core::Response<Models::DownloadFileResult>& response) {
|
||||
Models::DownloadFileToResult ret;
|
||||
ret.ETag = std::move(response->ETag);
|
||||
ret.LastModified = std::move(response->LastModified);
|
||||
ret.HttpHeaders = std::move(response->HttpHeaders);
|
||||
ret.Metadata = std::move(response->Metadata);
|
||||
ret.IsServerEncrypted = response->IsServerEncrypted;
|
||||
return Azure::Core::Response<DownloadFileToResult>(
|
||||
return Azure::Core::Response<Models::DownloadFileToResult>(
|
||||
std::move(ret),
|
||||
std::make_unique<Azure::Core::Http::RawResponse>(std::move(response.GetRawResponse())));
|
||||
};
|
||||
@ -810,17 +813,19 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Azure::Core::Response<UploadFileFromResult> FileClient::UploadFrom(
|
||||
Azure::Core::Response<Models::UploadFileFromResult> FileClient::UploadFrom(
|
||||
const uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const UploadFileFromOptions& options) const
|
||||
{
|
||||
Details::ShareRestClient::File::CreateOptions protocolLayerOptions;
|
||||
protocolLayerOptions.XMsContentLength = bufferSize;
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(options.SmbProperties.Attributes);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(options.SmbProperties.Attributes);
|
||||
if (protocolLayerOptions.FileAttributes.empty())
|
||||
{
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(FileAttributes::None);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(Models::FileAttributes::None);
|
||||
}
|
||||
if (options.SmbProperties.CreationTime.HasValue())
|
||||
{
|
||||
@ -893,14 +898,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
Storage::Details::ConcurrentTransfer(
|
||||
0, bufferSize, chunkSize, options.Concurrency, uploadPageFunc);
|
||||
|
||||
UploadFileFromResult result;
|
||||
Models::UploadFileFromResult result;
|
||||
result.IsServerEncrypted = createResult->IsServerEncrypted;
|
||||
return Azure::Core::Response<UploadFileFromResult>(
|
||||
return Azure::Core::Response<Models::UploadFileFromResult>(
|
||||
std::move(result),
|
||||
std::make_unique<Azure::Core::Http::RawResponse>(std::move(createResult.GetRawResponse())));
|
||||
}
|
||||
|
||||
Azure::Core::Response<UploadFileFromResult> FileClient::UploadFrom(
|
||||
Azure::Core::Response<Models::UploadFileFromResult> FileClient::UploadFrom(
|
||||
const std::string& fileName,
|
||||
const UploadFileFromOptions& options) const
|
||||
{
|
||||
@ -908,10 +913,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
Details::ShareRestClient::File::CreateOptions protocolLayerOptions;
|
||||
protocolLayerOptions.XMsContentLength = fileReader.GetFileSize();
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(options.SmbProperties.Attributes);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(options.SmbProperties.Attributes);
|
||||
if (protocolLayerOptions.FileAttributes.empty())
|
||||
{
|
||||
protocolLayerOptions.FileAttributes = FileAttributesToString(FileAttributes::None);
|
||||
protocolLayerOptions.FileAttributes
|
||||
= Details::FileAttributesToString(Models::FileAttributes::None);
|
||||
}
|
||||
if (options.SmbProperties.CreationTime.HasValue())
|
||||
{
|
||||
@ -984,9 +991,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
Storage::Details::ConcurrentTransfer(
|
||||
0, fileReader.GetFileSize(), chunkSize, options.Concurrency, uploadPageFunc);
|
||||
|
||||
UploadFileFromResult result;
|
||||
Models::UploadFileFromResult result;
|
||||
result.IsServerEncrypted = createResult->IsServerEncrypted;
|
||||
return Azure::Core::Response<UploadFileFromResult>(
|
||||
return Azure::Core::Response<Models::UploadFileFromResult>(
|
||||
std::move(result),
|
||||
std::make_unique<Azure::Core::Http::RawResponse>(std::move(createResult.GetRawResponse())));
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
return ShareClient(builder, m_pipeline);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListSharesSegmentResult> ShareServiceClient::ListSharesSegment(
|
||||
Azure::Core::Response<Models::ListSharesSegmentResult> ShareServiceClient::ListSharesSegment(
|
||||
const ListSharesSegmentOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Service::ListSharesSegmentOptions();
|
||||
@ -129,8 +129,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetServicePropertiesResult> ShareServiceClient::SetProperties(
|
||||
StorageServiceProperties properties,
|
||||
Azure::Core::Response<Models::SetServicePropertiesResult> ShareServiceClient::SetProperties(
|
||||
Models::StorageServiceProperties properties,
|
||||
const SetServicePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Service::SetPropertiesOptions();
|
||||
@ -139,18 +139,18 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<GetServicePropertiesResult> ShareServiceClient::GetProperties(
|
||||
Azure::Core::Response<Models::GetServicePropertiesResult> ShareServiceClient::GetProperties(
|
||||
const GetServicePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = Details::ShareRestClient::Service::GetPropertiesOptions();
|
||||
auto result = Details::ShareRestClient::Service::GetProperties(
|
||||
m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
StorageServiceProperties ret;
|
||||
Models::StorageServiceProperties ret;
|
||||
ret.Cors = std::move(result->Cors);
|
||||
ret.HourMetrics = std::move(result->HourMetrics);
|
||||
ret.MinuteMetrics = std::move(result->MinuteMetrics);
|
||||
ret.Protocol = std::move(result->Protocol);
|
||||
return Azure::Core::Response<StorageServiceProperties>(
|
||||
return Azure::Core::Response<Models::StorageServiceProperties>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
|
||||
@ -6,17 +6,17 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models {
|
||||
|
||||
bool operator==(
|
||||
const Azure::Storage::Files::Shares::SignedIdentifier& lhs,
|
||||
const Azure::Storage::Files::Shares::SignedIdentifier& rhs)
|
||||
const Azure::Storage::Files::Shares::Models::SignedIdentifier& lhs,
|
||||
const Azure::Storage::Files::Shares::Models::SignedIdentifier& rhs)
|
||||
{
|
||||
return lhs.Id == rhs.Id && lhs.Policy.Start == rhs.Policy.Start
|
||||
&& lhs.Policy.Expiry == rhs.Policy.Expiry && lhs.Policy.Permission == rhs.Policy.Permission;
|
||||
}
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
}}}}} // namespace Azure::Storage::Files::Shares::Models
|
||||
|
||||
namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
@ -39,10 +39,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
m_shareClient->Delete(deleteOptions);
|
||||
}
|
||||
|
||||
Files::Shares::FileShareHttpHeaders FileShareClientTest::GetInterestingHttpHeaders()
|
||||
Files::Shares::Models::FileShareHttpHeaders FileShareClientTest::GetInterestingHttpHeaders()
|
||||
{
|
||||
static Files::Shares::FileShareHttpHeaders result = []() {
|
||||
Files::Shares::FileShareHttpHeaders ret;
|
||||
static Files::Shares::Models::FileShareHttpHeaders result = []() {
|
||||
Files::Shares::Models::FileShareHttpHeaders ret;
|
||||
ret.CacheControl = std::string("no-cache");
|
||||
ret.ContentDisposition = std::string("attachment");
|
||||
ret.ContentEncoding = std::string("deflate");
|
||||
@ -151,10 +151,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
TEST_F(FileShareClientTest, ShareAccessPolicy)
|
||||
{
|
||||
std::vector<Files::Shares::SignedIdentifier> identifiers;
|
||||
std::vector<Files::Shares::Models::SignedIdentifier> identifiers;
|
||||
for (unsigned i = 0; i < 3; ++i)
|
||||
{
|
||||
Files::Shares::SignedIdentifier identifier;
|
||||
Files::Shares::Models::SignedIdentifier identifier;
|
||||
identifier.Id = RandomString(64);
|
||||
identifier.Policy.Start
|
||||
= ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(10), 7);
|
||||
|
||||
@ -11,7 +11,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
static void SetUpTestSuite();
|
||||
static void TearDownTestSuite();
|
||||
|
||||
static Files::Shares::FileShareHttpHeaders GetInterestingHttpHeaders();
|
||||
static Files::Shares::Models::FileShareHttpHeaders GetInterestingHttpHeaders();
|
||||
|
||||
static std::shared_ptr<Files::Shares::ShareClient> m_shareClient;
|
||||
static std::string m_shareName;
|
||||
|
||||
@ -26,10 +26,11 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
void FileShareDirectoryClientTest::TearDownTestSuite() { m_shareClient->Delete(); }
|
||||
|
||||
Files::Shares::FileShareHttpHeaders FileShareDirectoryClientTest::GetInterestingHttpHeaders()
|
||||
Files::Shares::Models::FileShareHttpHeaders
|
||||
FileShareDirectoryClientTest::GetInterestingHttpHeaders()
|
||||
{
|
||||
static Files::Shares::FileShareHttpHeaders result = []() {
|
||||
Files::Shares::FileShareHttpHeaders ret;
|
||||
static Files::Shares::Models::FileShareHttpHeaders result = []() {
|
||||
Files::Shares::Models::FileShareHttpHeaders ret;
|
||||
ret.CacheControl = std::string("no-cache");
|
||||
ret.ContentDisposition = std::string("attachment");
|
||||
ret.ContentEncoding = std::string("deflate");
|
||||
@ -40,13 +41,15 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
return result;
|
||||
}
|
||||
|
||||
std::pair<std::vector<Files::Shares::FileItem>, std::vector<Files::Shares::DirectoryItem>>
|
||||
std::pair<
|
||||
std::vector<Files::Shares::Models::FileItem>,
|
||||
std::vector<Files::Shares::Models::DirectoryItem>>
|
||||
FileShareDirectoryClientTest::ListAllFilesAndDirectories(
|
||||
const std::string& directoryPath,
|
||||
const std::string& prefix)
|
||||
{
|
||||
std::vector<Files::Shares::DirectoryItem> directoryResult;
|
||||
std::vector<Files::Shares::FileItem> fileResult;
|
||||
std::vector<Files::Shares::Models::DirectoryItem> directoryResult;
|
||||
std::vector<Files::Shares::Models::FileItem> fileResult;
|
||||
std::string continuation;
|
||||
Files::Shares::ListFilesAndDirectoriesSegmentOptions options;
|
||||
if (!prefix.empty())
|
||||
@ -63,9 +66,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
continuation = response->ContinuationToken;
|
||||
options.ContinuationToken = continuation;
|
||||
} while (!continuation.empty());
|
||||
return std::
|
||||
make_pair<std::vector<Files::Shares::FileItem>, std::vector<Files::Shares::DirectoryItem>>(
|
||||
std::move(fileResult), std::move(directoryResult));
|
||||
return std::make_pair<
|
||||
std::vector<Files::Shares::Models::FileItem>,
|
||||
std::vector<Files::Shares::Models::DirectoryItem>>(
|
||||
std::move(fileResult), std::move(directoryResult));
|
||||
}
|
||||
|
||||
TEST_F(FileShareDirectoryClientTest, CreateDeleteDirectories)
|
||||
@ -161,9 +165,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
{
|
||||
// Set permission with SetProperties works
|
||||
Files::Shares::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::FileAttributes::Directory
|
||||
| Files::Shares::FileAttributes::NotContentIndexed;
|
||||
Files::Shares::Models::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::Models::FileAttributes::Directory
|
||||
| Files::Shares::Models::FileAttributes::NotContentIndexed;
|
||||
properties.CreationTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.LastWriteTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.PermissionKey = "";
|
||||
@ -194,9 +198,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
TEST_F(FileShareDirectoryClientTest, DirectorySmbProperties)
|
||||
{
|
||||
Files::Shares::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::FileAttributes::Directory
|
||||
| Files::Shares::FileAttributes::NotContentIndexed;
|
||||
Files::Shares::Models::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::Models::FileAttributes::Directory
|
||||
| Files::Shares::Models::FileAttributes::NotContentIndexed;
|
||||
properties.CreationTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.LastWriteTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.PermissionKey = m_fileShareDirectoryClient->GetProperties()->FilePermissionKey;
|
||||
@ -275,7 +279,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto iter = std::find_if(
|
||||
result.second.begin(),
|
||||
result.second.end(),
|
||||
[&directoryNameA](const Files::Shares::DirectoryItem& item) {
|
||||
[&directoryNameA](const Files::Shares::Models::DirectoryItem& item) {
|
||||
return item.Name == directoryNameA;
|
||||
});
|
||||
EXPECT_EQ(iter->Name, directoryNameA);
|
||||
@ -283,7 +287,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
iter = std::find_if(
|
||||
result.second.begin(),
|
||||
result.second.end(),
|
||||
[&directoryNameB](const Files::Shares::DirectoryItem& item) {
|
||||
[&directoryNameB](const Files::Shares::Models::DirectoryItem& item) {
|
||||
return item.Name == directoryNameB;
|
||||
});
|
||||
EXPECT_EQ(iter->Name, directoryNameB);
|
||||
@ -297,16 +301,18 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto iter = std::find_if(
|
||||
result.second.begin(),
|
||||
result.second.end(),
|
||||
[&name](const Files::Shares::DirectoryItem& item) { return item.Name == name; });
|
||||
[&name](const Files::Shares::Models::DirectoryItem& item) {
|
||||
return item.Name == name;
|
||||
});
|
||||
EXPECT_EQ(iter->Name, name);
|
||||
EXPECT_NE(result.second.end(), iter);
|
||||
}
|
||||
for (const auto& name : fileNameSetA)
|
||||
{
|
||||
auto iter = std::find_if(
|
||||
result.first.begin(), result.first.end(), [&name](const Files::Shares::FileItem& item) {
|
||||
return item.Name == name;
|
||||
});
|
||||
result.first.begin(),
|
||||
result.first.end(),
|
||||
[&name](const Files::Shares::Models::FileItem& item) { return item.Name == name; });
|
||||
EXPECT_EQ(iter->Name, name);
|
||||
EXPECT_EQ(1024, iter->Properties.ContentLength);
|
||||
EXPECT_NE(result.first.end(), iter);
|
||||
@ -316,15 +322,17 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto iter = std::find_if(
|
||||
result.second.begin(),
|
||||
result.second.end(),
|
||||
[&name](const Files::Shares::DirectoryItem& item) { return item.Name == name; });
|
||||
[&name](const Files::Shares::Models::DirectoryItem& item) {
|
||||
return item.Name == name;
|
||||
});
|
||||
EXPECT_EQ(result.second.end(), iter);
|
||||
}
|
||||
for (const auto& name : fileNameSetB)
|
||||
{
|
||||
auto iter = std::find_if(
|
||||
result.first.begin(), result.first.end(), [&name](const Files::Shares::FileItem& item) {
|
||||
return item.Name == name;
|
||||
});
|
||||
result.first.begin(),
|
||||
result.first.end(),
|
||||
[&name](const Files::Shares::Models::FileItem& item) { return item.Name == name; });
|
||||
EXPECT_EQ(result.first.end(), iter);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,13 +12,14 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
static void SetUpTestSuite();
|
||||
static void TearDownTestSuite();
|
||||
|
||||
static std::
|
||||
pair<std::vector<Files::Shares::FileItem>, std::vector<Files::Shares::DirectoryItem>>
|
||||
ListAllFilesAndDirectories(
|
||||
const std::string& directoryPath = std::string(),
|
||||
const std::string& prefix = std::string());
|
||||
static std::pair<
|
||||
std::vector<Files::Shares::Models::FileItem>,
|
||||
std::vector<Files::Shares::Models::DirectoryItem>>
|
||||
ListAllFilesAndDirectories(
|
||||
const std::string& directoryPath = std::string(),
|
||||
const std::string& prefix = std::string());
|
||||
|
||||
static Files::Shares::FileShareHttpHeaders GetInterestingHttpHeaders();
|
||||
static Files::Shares::Models::FileShareHttpHeaders GetInterestingHttpHeaders();
|
||||
|
||||
static std::shared_ptr<Files::Shares::DirectoryClient> m_fileShareDirectoryClient;
|
||||
static std::string m_directoryName;
|
||||
|
||||
@ -132,9 +132,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
{
|
||||
// Set permission with SetProperties works
|
||||
Files::Shares::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::FileAttributes::System
|
||||
| Files::Shares::FileAttributes::NotContentIndexed;
|
||||
Files::Shares::Models::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::Models::FileAttributes::System
|
||||
| Files::Shares::Models::FileAttributes::NotContentIndexed;
|
||||
properties.CreationTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.LastWriteTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.PermissionKey = "";
|
||||
@ -165,9 +165,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
TEST_F(FileShareFileClientTest, FileSmbProperties)
|
||||
{
|
||||
Files::Shares::FileShareSmbProperties properties;
|
||||
properties.Attributes
|
||||
= Files::Shares::FileAttributes::System | Files::Shares::FileAttributes::NotContentIndexed;
|
||||
Files::Shares::Models::FileShareSmbProperties properties;
|
||||
properties.Attributes = Files::Shares::Models::FileAttributes::System
|
||||
| Files::Shares::Models::FileAttributes::NotContentIndexed;
|
||||
properties.CreationTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.LastWriteTime = ToIso8601(std::chrono::system_clock::now(), 7);
|
||||
properties.PermissionKey = m_fileClient->GetProperties()->FilePermissionKey;
|
||||
@ -227,8 +227,8 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_EQ(aLease.LeaseId, leaseId1);
|
||||
|
||||
auto properties = *m_fileClient->GetProperties();
|
||||
EXPECT_EQ(properties.LeaseState.GetValue(), Files::Shares::LeaseStateType::Leased);
|
||||
EXPECT_EQ(properties.LeaseStatus.GetValue(), Files::Shares::LeaseStatusType::Locked);
|
||||
EXPECT_EQ(properties.LeaseState.GetValue(), Files::Shares::Models::LeaseStateType::Leased);
|
||||
EXPECT_EQ(properties.LeaseStatus.GetValue(), Files::Shares::Models::LeaseStatusType::Locked);
|
||||
|
||||
std::string leaseId2 = CreateUniqueLeaseId();
|
||||
EXPECT_NE(leaseId1, leaseId2);
|
||||
@ -582,9 +582,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
fileClient.Create(fileSize);
|
||||
|
||||
auto destFileClient = m_shareClient->GetFileClient(LowercaseRandomString(10));
|
||||
Files::Shares::StartCopyFileResult result;
|
||||
Files::Shares::Models::StartCopyFileResult result;
|
||||
EXPECT_NO_THROW(result = destFileClient.StartCopy(fileClient.GetUri()).ExtractValue());
|
||||
EXPECT_EQ(Files::Shares::CopyStatusType::Success, result.CopyStatus);
|
||||
EXPECT_EQ(Files::Shares::Models::CopyStatusType::Success, result.CopyStatus);
|
||||
EXPECT_FALSE(result.CopyId.empty());
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
auto destFileClient = m_shareClient->GetFileClient(LowercaseRandomString(10));
|
||||
Files::Shares::StartCopyFileOptions copyOptions;
|
||||
copyOptions.PermissionCopyMode = Files::Shares::PermissionCopyModeType::Override;
|
||||
copyOptions.PermissionCopyMode = Files::Shares::Models::PermissionCopyModeType::Override;
|
||||
EXPECT_THROW(destFileClient.StartCopy(fileClient.GetUri(), copyOptions), std::runtime_error);
|
||||
}
|
||||
}
|
||||
@ -618,7 +618,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
EXPECT_EQ(halfContent, downloadContent);
|
||||
|
||||
EXPECT_NO_THROW(fileClient.ClearRange(512, 512));
|
||||
Files::Shares::GetFileRangeListResult result;
|
||||
Files::Shares::Models::GetFileRangeListResult result;
|
||||
EXPECT_NO_THROW(result = fileClient.GetRangeList().ExtractValue());
|
||||
EXPECT_EQ(2U, result.Ranges.size());
|
||||
EXPECT_EQ(0, result.Ranges[0].Start);
|
||||
@ -647,7 +647,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto snapshot1 = m_shareClient->CreateSnapshot()->Snapshot;
|
||||
EXPECT_NO_THROW(fileClient.ClearRange(500, 2048));
|
||||
auto snapshot2 = m_shareClient->CreateSnapshot()->Snapshot;
|
||||
Files::Shares::GetFileRangeListResult result;
|
||||
Files::Shares::Models::GetFileRangeListResult result;
|
||||
Files::Shares::GetFileRangeListOptions options;
|
||||
options.PrevShareSnapshot = snapshot1;
|
||||
EXPECT_NO_THROW(result = fileClient.GetRangeList(options).ExtractValue());
|
||||
|
||||
@ -172,7 +172,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
// Identifier
|
||||
{
|
||||
Files::Shares::SignedIdentifier identifier;
|
||||
Files::Shares::Models::SignedIdentifier identifier;
|
||||
identifier.Id = RandomString(64);
|
||||
identifier.Policy.Start
|
||||
= ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
|
||||
@ -194,7 +194,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
|
||||
// response headers override
|
||||
{
|
||||
Files::Shares::FileShareHttpHeaders headers;
|
||||
Files::Shares::Models::FileShareHttpHeaders headers;
|
||||
headers.ContentType = "application/x-binary";
|
||||
headers.ContentLanguage = "en-US";
|
||||
headers.ContentDisposition = "attachment";
|
||||
|
||||
@ -63,10 +63,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Files::Shares::ShareItem> FileShareServiceClientTest::ListAllShares(
|
||||
std::vector<Files::Shares::Models::ShareItem> FileShareServiceClientTest::ListAllShares(
|
||||
const std::string& prefix)
|
||||
{
|
||||
std::vector<Files::Shares::ShareItem> result;
|
||||
std::vector<Files::Shares::Models::ShareItem> result;
|
||||
std::string continuation;
|
||||
Files::Shares::ListSharesSegmentOptions options;
|
||||
if (!prefix.empty())
|
||||
@ -91,7 +91,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& name : m_shareNameSetA)
|
||||
{
|
||||
auto iter = std::find_if(
|
||||
result.begin(), result.end(), [&name](const Files::Shares::ShareItem& share) {
|
||||
result.begin(), result.end(), [&name](const Files::Shares::Models::ShareItem& share) {
|
||||
return share.Name == name;
|
||||
});
|
||||
EXPECT_EQ(iter->Name.substr(0U, m_sharePrefixA.size()), m_sharePrefixA);
|
||||
@ -100,7 +100,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& name : m_shareNameSetB)
|
||||
{
|
||||
auto iter = std::find_if(
|
||||
result.begin(), result.end(), [&name](const Files::Shares::ShareItem& share) {
|
||||
result.begin(), result.end(), [&name](const Files::Shares::Models::ShareItem& share) {
|
||||
return share.Name == name;
|
||||
});
|
||||
EXPECT_EQ(iter->Name.substr(0U, m_sharePrefixB.size()), m_sharePrefixB);
|
||||
@ -113,7 +113,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& name : m_shareNameSetA)
|
||||
{
|
||||
auto iter = std::find_if(
|
||||
result.begin(), result.end(), [&name](const Files::Shares::ShareItem& share) {
|
||||
result.begin(), result.end(), [&name](const Files::Shares::Models::ShareItem& share) {
|
||||
return share.Name == name;
|
||||
});
|
||||
EXPECT_EQ(iter->Name.substr(0U, m_sharePrefixA.size()), m_sharePrefixA);
|
||||
@ -122,7 +122,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& name : m_shareNameSetB)
|
||||
{
|
||||
auto iter = std::find_if(
|
||||
result.begin(), result.end(), [&name](const Files::Shares::ShareItem& share) {
|
||||
result.begin(), result.end(), [&name](const Files::Shares::Models::ShareItem& share) {
|
||||
return share.Name == name;
|
||||
});
|
||||
EXPECT_EQ(result.end(), iter);
|
||||
@ -157,7 +157,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
auto properties = *m_fileShareServiceClient->GetProperties();
|
||||
// Has to remove before set, otherwise would return failure.
|
||||
properties.Protocol = Core::Nullable<Files::Shares::ShareProtocolSettings>();
|
||||
properties.Protocol = Core::Nullable<Files::Shares::Models::ShareProtocolSettings>();
|
||||
auto originalProperties = properties;
|
||||
|
||||
properties.HourMetrics.Enabled = true;
|
||||
@ -170,7 +170,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
properties.MinuteMetrics.RetentionPolicy.Days = 3;
|
||||
properties.MinuteMetrics.IncludeApis = true;
|
||||
|
||||
Files::Shares::CorsRule corsRule;
|
||||
Files::Shares::Models::CorsRule corsRule;
|
||||
corsRule.AllowedOrigins = "http://www.example1.com";
|
||||
corsRule.AllowedMethods = "GET,PUT";
|
||||
corsRule.AllowedHeaders = "x-ms-header1,x-ms-header2";
|
||||
@ -231,7 +231,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto iter = std::find_if(
|
||||
properties.Cors.begin(),
|
||||
properties.Cors.end(),
|
||||
[&cors](const Files::Shares::CorsRule& rule) {
|
||||
[&cors](const Files::Shares::Models::CorsRule& rule) {
|
||||
return rule.AllowedOrigins == cors.AllowedOrigins;
|
||||
});
|
||||
EXPECT_EQ(iter->AllowedMethods, cors.AllowedMethods);
|
||||
@ -262,7 +262,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
properties.MinuteMetrics.RetentionPolicy.Days = 3;
|
||||
properties.MinuteMetrics.IncludeApis = true;
|
||||
|
||||
Files::Shares::CorsRule corsRule;
|
||||
Files::Shares::Models::CorsRule corsRule;
|
||||
corsRule.AllowedOrigins = "http://www.example1.com";
|
||||
corsRule.AllowedMethods = "GET,PUT";
|
||||
corsRule.AllowedHeaders = "x-ms-header1,x-ms-header2";
|
||||
@ -277,7 +277,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
corsRule.MaxAgeInSeconds = 20;
|
||||
properties.Cors.emplace_back(corsRule);
|
||||
|
||||
auto protocolSettings = Files::Shares::ShareProtocolSettings();
|
||||
auto protocolSettings = Files::Shares::Models::ShareProtocolSettings();
|
||||
protocolSettings.Settings.Multichannel.Enabled = true;
|
||||
properties.Protocol = protocolSettings;
|
||||
|
||||
@ -327,7 +327,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
auto iter = std::find_if(
|
||||
properties.Cors.begin(),
|
||||
properties.Cors.end(),
|
||||
[&cors](const Files::Shares::CorsRule& rule) {
|
||||
[&cors](const Files::Shares::Models::CorsRule& rule) {
|
||||
return rule.AllowedOrigins == cors.AllowedOrigins;
|
||||
});
|
||||
EXPECT_EQ(iter->AllowedMethods, cors.AllowedMethods);
|
||||
|
||||
@ -11,7 +11,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
static void SetUpTestSuite();
|
||||
static void TearDownTestSuite();
|
||||
|
||||
static std::vector<Files::Shares::ShareItem> ListAllShares(
|
||||
static std::vector<Files::Shares::Models::ShareItem> ListAllShares(
|
||||
const std::string& prefix = std::string());
|
||||
|
||||
static std::shared_ptr<Files::Shares::ShareServiceClient> m_fileShareServiceClient;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user