Rename return types for Datalake and file services. (#464)
This commit is contained in:
parent
1dce74c642
commit
3042f69d5b
@ -92,11 +92,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* @brief Create a directory. By default, the destination is overwritten and
|
||||
* if the destination already exists and has a lease the lease is broken.
|
||||
* @param options Optional parameters to create the directory the path points to.
|
||||
* @return Azure::Core::Response<DirectoryInfo>
|
||||
* @return Azure::Core::Response<CreateDirectoryResult> containing the information of the
|
||||
* created directory
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<DirectoryInfo> Create(
|
||||
const DirectoryCreateOptions& options = DirectoryCreateOptions()) const
|
||||
Azure::Core::Response<CreateDirectoryResult> Create(
|
||||
const CreateDirectoryOptions& options = CreateDirectoryOptions()) const
|
||||
{
|
||||
return PathClient::Create(PathResourceType::Directory, options);
|
||||
}
|
||||
@ -107,26 +108,28 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* @param destinationDirectoryPath The destinationPath this current directory is renaming to.
|
||||
* @param options Optional parameters to rename a resource to the resource the destination
|
||||
* directory points to.
|
||||
* @return Azure::Core::Response<DirectoryRenameInfo>
|
||||
* @return Azure::Core::Response<RenameDirectoryResult> containing the information returned when
|
||||
* renaming the directory.
|
||||
* @remark This operation will not change the URL this directory client points too, to use the
|
||||
* new name, customer needs to initialize a new directory client with the new name/path.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<DirectoryRenameInfo> Rename(
|
||||
Azure::Core::Response<RenameDirectoryResult> Rename(
|
||||
const std::string& destinationDirectoryPath,
|
||||
const DirectoryRenameOptions& options = DirectoryRenameOptions()) const;
|
||||
const RenameDirectoryOptions& options = RenameDirectoryOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the directory.
|
||||
* @param Recursive If "true", all paths beneath the directory will be deleted. If "false" and
|
||||
* the directory is non-empty, an error occurs.
|
||||
* @param options Optional parameters to delete the directory the path points to.
|
||||
* @return Azure::Core::Response<DirectoryDeleteResponse>
|
||||
* @return Azure::Core::Response<DeleteDirectoryResult> containing the information returned when
|
||||
* deleting the directory.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<DirectoryDeleteInfo> Delete(
|
||||
Azure::Core::Response<DeleteDirectoryResult> Delete(
|
||||
bool Recursive,
|
||||
const DirectoryDeleteOptions& options = DirectoryDeleteOptions()) const;
|
||||
const DeleteDirectoryOptions& options = DeleteDirectoryOptions()) const;
|
||||
|
||||
private:
|
||||
explicit DirectoryClient(
|
||||
|
||||
@ -94,13 +94,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* written, and there must not be a request entity body included with the
|
||||
* request.
|
||||
* @param options Optional parameters to append data to the resource the path points to.
|
||||
* @return Azure::Core::Response<PathAppendDataInfo>
|
||||
* @return Azure::Core::Response<AppendFileDataResult> containing the information returned when
|
||||
* appending some data to the path.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathAppendDataInfo> AppendData(
|
||||
Azure::Core::Response<AppendFileDataResult> AppendData(
|
||||
Azure::Core::Http::BodyStream* content,
|
||||
int64_t offset,
|
||||
const PathAppendDataOptions& options = PathAppendDataOptions()) const;
|
||||
const AppendFileDataOptions& options = AppendFileDataOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Flushes previous uploaded data to a file.
|
||||
@ -113,22 +114,24 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* written, and there must not be a request entity body included with the
|
||||
* request.
|
||||
* @param options Optional parameters to flush data to the resource the path points to.
|
||||
* @return Azure::Core::Response<PathFlushDataInfo>
|
||||
* @return Azure::Core::Response<FlushFileDataResult> containing the information returned when
|
||||
* flushing the data appended to the path.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathFlushDataInfo> FlushData(
|
||||
Azure::Core::Response<FlushFileDataResult> FlushData(
|
||||
int64_t endingOffset,
|
||||
const PathFlushDataOptions& options = PathFlushDataOptions()) const;
|
||||
const FlushFileDataOptions& options = FlushFileDataOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Create a file. By default, the destination is overwritten and
|
||||
* if the destination already exists and has a lease the lease is broken.
|
||||
* @param options Optional parameters to create the resource the path points to.
|
||||
* @return Azure::Core::Response<FileInfo>
|
||||
* @return Azure::Core::Response<CreateFileResult> containing the information returned when
|
||||
* creating the file.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileInfo> Create(
|
||||
const FileCreateOptions& options = FileCreateOptions()) const
|
||||
Azure::Core::Response<CreateFileResult> Create(
|
||||
const CreateFileOptions& options = CreateFileOptions()) const
|
||||
{
|
||||
return PathClient::Create(PathResourceType::File, options);
|
||||
}
|
||||
@ -139,32 +142,34 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* @param destinationFilePath The path of the file this file is renaming to.
|
||||
* @param options Optional parameters to rename a resource to the resource the destination path
|
||||
* points to.
|
||||
* @return Azure::Core::Response<FileRenameInfo>
|
||||
* @return Azure::Core::Response<RenameFileResult> containing the information returned when
|
||||
* renaming the file.
|
||||
* @remark This operation will not change the URL this file client points too, to use the
|
||||
* new name, customer needs to initialize a new file client with the new name/path.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileRenameInfo> Rename(
|
||||
Azure::Core::Response<RenameFileResult> Rename(
|
||||
const std::string& destinationFilePath,
|
||||
const FileRenameOptions& options = FileRenameOptions()) const;
|
||||
const RenameFileOptions& options = RenameFileOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the file.
|
||||
* @param options Optional parameters to delete the file the path points to.
|
||||
* @return Azure::Core::Response<FileDeleteInfo>
|
||||
* @return Azure::Core::Response<DeleteFileResult>
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileDeleteInfo> Delete(
|
||||
Azure::Core::Response<DeleteFileResult> Delete(
|
||||
const FileDeleteOptions& options = FileDeleteOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Read the contents of a file. For read operations, range requests are supported.
|
||||
* @param options Optional parameters to read the content from the resource the path points to.
|
||||
* @return Azure::Core::Response<FileReadInfo>
|
||||
* @return Azure::Core::Response<ReadFileResult> containing the information and content returned
|
||||
* when reading from a file.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileReadInfo> Read(
|
||||
const FileReadOptions& options = FileReadOptions()) const;
|
||||
Azure::Core::Response<ReadFileResult> Read(
|
||||
const ReadFileOptions& options = ReadFileOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Creates a new file, or updates the content of an existing file. Updating
|
||||
@ -172,25 +177,27 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* @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 Azure::Core::Response<FileContentInfo>
|
||||
* @return Azure::Core::Response<UploadFileFromResult> containing the information returned when
|
||||
* uploading a file from a buffer.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileContentInfo> UploadFromBuffer(
|
||||
Azure::Core::Response<UploadFileFromResult> UploadFrom(
|
||||
const uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const UploadFileOptions& options = UploadFileOptions()) const;
|
||||
const UploadFileFromOptions& options = UploadFileFromOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Creates a new file, or updates the content of an existing file. Updating
|
||||
* an existing file overwrites any existing metadata on the file.
|
||||
* @param file A file containing the content to upload.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<FileContentInfo>
|
||||
* @return Azure::Core::Response<UploadFileFromResult> containing the information returned when
|
||||
* uploading a file from a local file.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileContentInfo> UploadFromFile(
|
||||
Azure::Core::Response<UploadFileFromResult> UploadFrom(
|
||||
const std::string& file,
|
||||
const UploadFileOptions& options = UploadFileOptions()) const;
|
||||
const UploadFileFromOptions& options = UploadFileFromOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Downloads a file or a file range from the service to a memory buffer using parallel
|
||||
@ -199,25 +206,27 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* @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<FileDownloadInfo>
|
||||
* @return Azure::Core::Response<DownloadFileToResult> containing the information returned when
|
||||
* downloading a file to a local buffer.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileDownloadInfo> DownloadToBuffer(
|
||||
Azure::Core::Response<DownloadFileToResult> DownloadTo(
|
||||
uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const DownloadFileOptions& options = DownloadFileOptions()) const;
|
||||
const DownloadFileToOptions& options = DownloadFileToOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Downloads a file or a file range from the service to a file using parallel
|
||||
* requests.
|
||||
* @param file A file path to write the downloaded content to.
|
||||
* @param options Optional parameters to execute this function.
|
||||
* @return Azure::Core::Response<FileDownloadInfo>
|
||||
* @return Azure::Core::Response<DownloadFileToResult> containing the information returned when
|
||||
* downloading a file to a local file.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileDownloadInfo> DownloadToFile(
|
||||
Azure::Core::Response<DownloadFileToResult> DownloadTo(
|
||||
const std::string& file,
|
||||
const DownloadFileOptions& options = DownloadFileOptions()) const;
|
||||
const DownloadFileToOptions& options = DownloadFileToOptions()) const;
|
||||
|
||||
private:
|
||||
Blobs::BlockBlobClient m_blockBlobClient;
|
||||
|
||||
@ -108,41 +108,45 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Creates the file system.
|
||||
* @param options Optional parameters to create this file system.
|
||||
* @return Azure::Core::Response<FileSystemInfo>
|
||||
* @return Azure::Core::Response<CreateFileSystemResult> containing the information of create a
|
||||
* file system.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileSystemInfo> Create(
|
||||
const FileSystemCreateOptions& options = FileSystemCreateOptions()) const;
|
||||
Azure::Core::Response<CreateFileSystemResult> Create(
|
||||
const CreateFileSystemOptions& options = CreateFileSystemOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the file system.
|
||||
* @param options Optional parameters to delete this file system.
|
||||
* @return Azure::Core::Response<FileSystemDeleteInfo>
|
||||
* @return Azure::Core::Response<DeleteFileSystemResult> containing the information returned
|
||||
* when deleting file systems.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileSystemDeleteInfo> Delete(
|
||||
const FileSystemDeleteOptions& options = FileSystemDeleteOptions()) const;
|
||||
Azure::Core::Response<DeleteFileSystemResult> Delete(
|
||||
const DeleteFileSystemOptions& options = DeleteFileSystemOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the metadata of file system.
|
||||
* @param metadata User-defined metadata to be stored with the filesystem. Note that the string
|
||||
* may only contain ASCII characters in the ISO-8859-1 character set.
|
||||
* @param options Optional parameters to set the metadata to this file system.
|
||||
* @return Azure::Core::Response<FileSystemInfo>
|
||||
* @return Azure::Core::Response<SetFileSystemMetadataResult> containing the information
|
||||
* returned when setting the metadata onto the file system.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileSystemInfo> SetMetadata(
|
||||
Azure::Core::Response<SetFileSystemMetadataResult> SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const FileSystemSetMetadataOptions& options = FileSystemSetMetadataOptions()) const;
|
||||
const SetFileSystemMetadataOptions& options = SetFileSystemMetadataOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Gets the properties of file system.
|
||||
* @param options Optional parameters to get the metadata of this file system.
|
||||
* @return Azure::Core::Response<FileSystemProperties>
|
||||
* @return Azure::Core::Response<GetFileSystemPropertiesResult> containing the information when
|
||||
* getting the file system's properties.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<FileSystemProperties> GetProperties(
|
||||
const FileSystemGetPropertiesOptions& options = FileSystemGetPropertiesOptions()) const;
|
||||
Azure::Core::Response<GetFileSystemPropertiesResult> GetProperties(
|
||||
const GetFileSystemPropertiesOptions& options = GetFileSystemPropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief List the paths in this file system.
|
||||
@ -150,7 +154,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* filesystem are listed. If "directory" is specified, the list will only
|
||||
* include paths that share the same root.
|
||||
* @param options Optional parameters to list the paths in file system.
|
||||
* @return Azure::Core::Response<ListPathsResult>
|
||||
* @return Azure::Core::Response<ListPathsResult> containing the results when listing
|
||||
* the paths under a file system.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<ListPathsResult> ListPaths(
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
using DownloadFileOptions = Blobs::DownloadBlobToOptions;
|
||||
using DownloadFileToOptions = Blobs::DownloadBlobToOptions;
|
||||
using GetUserDelegationKeyOptions = Blobs::GetUserDelegationKeyOptions;
|
||||
|
||||
/**
|
||||
@ -79,7 +79,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for ServiceClient::ListFilesSystems
|
||||
*/
|
||||
struct ListFileSystemsOptions
|
||||
struct ListFileSystemsSegmentOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -112,7 +112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for FileSystemClient::Create
|
||||
*/
|
||||
struct FileSystemCreateOptions
|
||||
struct CreateFileSystemOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -130,7 +130,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for FileSystemClient::Delete
|
||||
*/
|
||||
struct FileSystemDeleteOptions
|
||||
struct DeleteFileSystemOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -146,7 +146,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for FileSystemClient::GetProperties
|
||||
*/
|
||||
struct FileSystemGetPropertiesOptions
|
||||
struct GetFileSystemPropertiesOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -162,7 +162,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for FileSystemClient::SetMetadata
|
||||
*/
|
||||
struct FileSystemSetMetadataOptions
|
||||
struct SetFileSystemMetadataOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -223,7 +223,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for PathClient::AppendData
|
||||
*/
|
||||
struct PathAppendDataOptions
|
||||
struct AppendFileDataOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -244,7 +244,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for PathClient::FlushData
|
||||
*/
|
||||
struct PathFlushDataOptions
|
||||
struct FlushFileDataOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -298,7 +298,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for PathClient::SetAccessControl
|
||||
*/
|
||||
struct SetAccessControlOptions
|
||||
struct SetPathAccessControlOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -368,7 +368,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* More details:
|
||||
* https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create
|
||||
*/
|
||||
struct PathCreateOptions
|
||||
struct CreatePathOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -423,7 +423,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* More details:
|
||||
* https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/delete
|
||||
*/
|
||||
struct PathDeleteOptions
|
||||
struct DeletePathOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -458,7 +458,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* More details:
|
||||
* https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/getproperties
|
||||
*/
|
||||
struct PathGetPropertiesOptions
|
||||
struct GetPathPropertiesOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -474,7 +474,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for PathClient::GetAccessControl
|
||||
*/
|
||||
struct PathAccessControlOptions
|
||||
struct GetPathAccessControlOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -493,7 +493,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* More details:
|
||||
* https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/read
|
||||
*/
|
||||
struct FileReadOptions
|
||||
struct ReadFileOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -529,7 +529,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for FileClient::Create
|
||||
*/
|
||||
struct FileRenameOptions
|
||||
struct RenameFileOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -582,7 +582,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* More details:
|
||||
* https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create
|
||||
*/
|
||||
struct DirectoryRenameOptions
|
||||
struct RenameDirectoryOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -625,7 +625,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief Optional parameters for DirectoryClient::Delete
|
||||
*/
|
||||
struct DirectoryDeleteOptions
|
||||
struct DeleteDirectoryOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
@ -647,13 +647,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
PathAccessConditions AccessConditions;
|
||||
};
|
||||
|
||||
using FileCreateOptions = PathCreateOptions;
|
||||
using DirectoryCreateOptions = PathCreateOptions;
|
||||
using CreateFileOptions = CreatePathOptions;
|
||||
using CreateDirectoryOptions = CreatePathOptions;
|
||||
|
||||
/**
|
||||
* @brief Optional parameters for FileClient::UploadFromBuffer and FileClient::UploadFromFile
|
||||
*/
|
||||
struct UploadFileOptions
|
||||
struct UploadFileFromOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
|
||||
@ -86,21 +86,23 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* @brief Creates a file or directory. By default, the destination is overwritten and
|
||||
* if the destination already exists and has a lease the lease is broken.
|
||||
* @param options Optional parameters to create the resource the path points to.
|
||||
* @return Azure::Core::Response<PathInfo>
|
||||
* @return Azure::Core::Response<CreatePathResult> containing the information returned when
|
||||
* creating a path.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathInfo> Create(
|
||||
Azure::Core::Response<CreatePathResult> Create(
|
||||
PathResourceType type,
|
||||
const PathCreateOptions& options = PathCreateOptions()) const;
|
||||
const CreatePathOptions& options = CreatePathOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Deletes the resource the path points to.
|
||||
* @param options Optional parameters to delete the reource the path points to.
|
||||
* @return Azure::Core::Response<PathDeleteInfo>
|
||||
* @return Azure::Core::Response<DeletePathResult> which is current empty but preserved for
|
||||
* future usage.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathDeleteInfo> Delete(
|
||||
const PathDeleteOptions& options = PathDeleteOptions()) const;
|
||||
Azure::Core::Response<DeletePathResult> Delete(
|
||||
const DeletePathOptions& options = DeletePathOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the owner, group, permissions, or access control list for a file or directory.
|
||||
@ -113,21 +115,23 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* permissions.
|
||||
* @param options Optional parameters to set an access control to the resource the path points
|
||||
* to.
|
||||
* @return Azure::Core::Response<PathSetAccessControlInfo>
|
||||
* @return Azure::Core::Response<SetPathAccessControlResult> containing the information returned
|
||||
* when setting path's access control.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathSetAccessControlInfo> SetAccessControl(
|
||||
Azure::Core::Response<SetPathAccessControlResult> SetAccessControl(
|
||||
std::vector<Acl> acls,
|
||||
const SetAccessControlOptions& options = SetAccessControlOptions()) const;
|
||||
const SetPathAccessControlOptions& options = SetPathAccessControlOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the properties of a resource the path points to.
|
||||
* @param options Optional parameters to set the http headers to the resource the path points
|
||||
* to.
|
||||
* @return Azure::Core::Response<SetPathHttpHeadersInfo>
|
||||
* @return Azure::Core::Response<SetPathHttpHeadersResult> containing the information returned
|
||||
* when setting the path's Http headers.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<SetPathHttpHeadersInfo> SetHttpHeaders(
|
||||
Azure::Core::Response<SetPathHttpHeadersResult> SetHttpHeaders(
|
||||
DataLakeHttpHeaders httpHeaders,
|
||||
const SetPathHttpHeadersOptions& options = SetPathHttpHeadersOptions()) const;
|
||||
|
||||
@ -137,28 +141,30 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* access control list for a path.
|
||||
* @param options Optional parameters to get the properties from the resource the path points
|
||||
* to.
|
||||
* @return Azure::Core::Response<PathProperties>
|
||||
* @return Azure::Core::Response<GetPathPropertiesResult> containing the properties of the path.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathProperties> GetProperties(
|
||||
const PathGetPropertiesOptions& options = PathGetPropertiesOptions()) const;
|
||||
Azure::Core::Response<GetPathPropertiesResult> GetProperties(
|
||||
const GetPathPropertiesOptions& options = GetPathPropertiesOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Returns all access control list stored for the given path.
|
||||
* @param options Optional parameters to get the ACLs from the resource the path points to.
|
||||
* @return Azure::Core::Response<PathAccessControl>
|
||||
* @return Azure::Core::Response<GetPathAccessControlResult> containing the access control list
|
||||
* of the path.
|
||||
* @remark This request is sent to dfs endpoint.
|
||||
*/
|
||||
Azure::Core::Response<PathAccessControl> GetAccessControls(
|
||||
const PathAccessControlOptions& options = PathAccessControlOptions()) const;
|
||||
Azure::Core::Response<GetPathAccessControlResult> GetAccessControls(
|
||||
const GetPathAccessControlOptions& options = GetPathAccessControlOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the metadata of a resource the path points to.
|
||||
* @param options Optional parameters to set the metadata to the resource the path points to.
|
||||
* @return Azure::Core::Response<SetPathMetadataInfo>
|
||||
* @return Azure::Core::Response<SetPathMetadataResult> containing the information returned when
|
||||
* setting the metadata.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<SetPathMetadataInfo> SetMetadata(
|
||||
Azure::Core::Response<SetPathMetadataResult> SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const SetPathMetadataOptions& options = SetPathMetadataOptions()) const;
|
||||
|
||||
|
||||
@ -10,26 +10,27 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
// ServiceClient models:
|
||||
|
||||
using UserDelegationKey = Blobs::GetUserDelegationKeyResult;
|
||||
using ListFileSystemsResult = ServiceListFileSystemsResponse;
|
||||
using GetUserDelegationKeyResult = Blobs::GetUserDelegationKeyResult;
|
||||
using ListFileSystemsSegmentResult = ServiceListFileSystemsResult;
|
||||
|
||||
// FileSystemClient models:
|
||||
|
||||
using FileSystemDeleteInfo = FileSystemDeleteResponse;
|
||||
using ListPathsResult = FileSystemListPathsResponse;
|
||||
using DeleteFileSystemResult = FileSystemDeleteResult;
|
||||
using ListPathsResult = FileSystemListPathsResult;
|
||||
|
||||
struct FileSystemProperties
|
||||
struct GetFileSystemPropertiesResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
std::map<std::string, std::string> Metadata;
|
||||
};
|
||||
|
||||
using FileSystemInfo = FileSystemCreateResponse;
|
||||
using CreateFileSystemResult = FileSystemCreateResult;
|
||||
using SetFileSystemMetadataResult = FileSystemCreateResult;
|
||||
|
||||
// PathClient models:
|
||||
|
||||
using PathDeleteInfo = PathDeleteResponse;
|
||||
using DeletePathResult = PathDeleteResult;
|
||||
|
||||
struct Acl
|
||||
{
|
||||
@ -67,7 +68,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
static std::string SerializeAcls(const std::vector<Acl>& dataLakeAclsArray);
|
||||
};
|
||||
|
||||
struct PathProperties
|
||||
struct GetPathPropertiesResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
@ -88,41 +89,41 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<std::string> CopyCompletionTime;
|
||||
};
|
||||
|
||||
struct PathAccessControl
|
||||
struct GetPathAccessControlResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
std::vector<Acl> Acls;
|
||||
};
|
||||
|
||||
struct SetPathHttpHeadersInfo
|
||||
struct SetPathHttpHeadersResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
};
|
||||
|
||||
struct SetPathMetadataInfo
|
||||
struct SetPathMetadataResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
};
|
||||
|
||||
struct PathInfo
|
||||
struct CreatePathResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> ETag;
|
||||
Azure::Core::Nullable<std::string> LastModified;
|
||||
Azure::Core::Nullable<int64_t> ContentLength;
|
||||
};
|
||||
|
||||
using PathSetAccessControlInfo = PathSetAccessControlResponse;
|
||||
using SetPathAccessControlResult = PathSetAccessControlResult;
|
||||
|
||||
// FileClient models:
|
||||
|
||||
using FileContentInfo = Blobs::UploadBlockBlobResult;
|
||||
using PathAppendDataInfo = PathAppendDataResponse;
|
||||
using PathFlushDataInfo = PathFlushDataResponse;
|
||||
using UploadFileFromResult = Blobs::UploadBlockBlobResult;
|
||||
using AppendFileDataResult = PathAppendDataResult;
|
||||
using FlushFileDataResult = PathFlushDataResult;
|
||||
|
||||
struct FileReadInfo
|
||||
struct ReadFileResult
|
||||
{
|
||||
std::unique_ptr<Azure::Core::Http::BodyStream> Body;
|
||||
DataLakeHttpHeaders HttpHeaders;
|
||||
@ -138,17 +139,17 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
std::map<std::string, std::string> Metadata;
|
||||
};
|
||||
|
||||
struct FileRenameInfo
|
||||
struct RenameFileResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> ETag;
|
||||
Azure::Core::Nullable<std::string> LastModified;
|
||||
};
|
||||
|
||||
struct FileDeleteInfo
|
||||
struct DeleteFileResult
|
||||
{
|
||||
};
|
||||
|
||||
struct FileDownloadInfo
|
||||
struct DownloadFileToResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
@ -159,19 +160,19 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<std::string> EncryptionKeySha256;
|
||||
};
|
||||
|
||||
using FileInfo = PathInfo;
|
||||
using CreateFileResult = CreatePathResult;
|
||||
|
||||
// DirectoryClient models:
|
||||
|
||||
struct DirectoryRenameInfo
|
||||
struct RenameDirectoryResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> ETag;
|
||||
Azure::Core::Nullable<std::string> LastModified;
|
||||
Azure::Core::Nullable<std::string> Continuation;
|
||||
};
|
||||
|
||||
using DirectorySetAccessControlRecursiveInfo = PathSetAccessControlRecursiveResponse;
|
||||
using DirectoryInfo = PathInfo;
|
||||
using DirectoryDeleteInfo = PathDeleteResponse;
|
||||
using DirectorySetAccessControlRecursiveInfo = PathSetAccessControlRecursiveResult;
|
||||
using CreateDirectoryResult = CreatePathResult;
|
||||
using DeleteDirectoryResult = PathDeleteResult;
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::DataLake
|
||||
|
||||
@ -89,11 +89,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
/**
|
||||
* @brief List the file systems from the service.
|
||||
* @param options Optional parameters to list the file systems.
|
||||
* @return Azure::Core::Response<ListFileSystemsResult>
|
||||
* @return Azure::Core::Response<ListFileSystemsSegmentResult> containing the listed result of
|
||||
* file systems and continuation token for unfinished list result.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<ListFileSystemsResult> ListFileSystems(
|
||||
const ListFileSystemsOptions& options = ListFileSystemsOptions()) const;
|
||||
Azure::Core::Response<ListFileSystemsSegmentResult> ListFileSystemsSegement(
|
||||
const ListFileSystemsSegmentOptions& options = ListFileSystemsSegmentOptions()) const;
|
||||
|
||||
/**
|
||||
* @brief Retrieves a key that can be used to delegate Active Directory authorization to
|
||||
@ -105,10 +106,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
* specified in UTC.
|
||||
* @param options Optional parameters to execute
|
||||
* this function.
|
||||
* @return Azure::Core::Response<UserDelegationKey>
|
||||
* @return Azure::Core::Response<GetUserDelegationKeyResult> containing the user delegation key
|
||||
* related information.
|
||||
* @remark This request is sent to blob endpoint.
|
||||
*/
|
||||
Azure::Core::Response<UserDelegationKey> GetUserDelegationKey(
|
||||
Azure::Core::Response<GetUserDelegationKeyResult> GetUserDelegationKey(
|
||||
const std::string& startsOn,
|
||||
const std::string& expiresOn,
|
||||
const GetUserDelegationKeyOptions& options = GetUserDelegationKeyOptions()) const
|
||||
|
||||
@ -608,35 +608,35 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
"Cannot convert " + pathGetPropertiesAction + " to PathGetPropertiesAction");
|
||||
}
|
||||
|
||||
struct ServiceListFileSystemsResponse
|
||||
struct ServiceListFileSystemsResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> Continuation;
|
||||
std::vector<FileSystem> Filesystems;
|
||||
|
||||
static ServiceListFileSystemsResponse ServiceListFileSystemsResponseFromFileSystemList(
|
||||
static ServiceListFileSystemsResult ServiceListFileSystemsResultFromFileSystemList(
|
||||
FileSystemList object)
|
||||
{
|
||||
ServiceListFileSystemsResponse result;
|
||||
ServiceListFileSystemsResult result;
|
||||
result.Filesystems = std::move(object.Filesystems);
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
struct FileSystemCreateResponse
|
||||
struct FileSystemCreateResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
std::string NamespaceEnabled;
|
||||
};
|
||||
|
||||
struct FileSystemSetPropertiesResponse
|
||||
struct FileSystemSetPropertiesResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
};
|
||||
|
||||
struct FileSystemGetPropertiesResponse
|
||||
struct FileSystemGetPropertiesResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
@ -644,25 +644,25 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
std::string NamespaceEnabled;
|
||||
};
|
||||
|
||||
struct FileSystemDeleteResponse
|
||||
struct FileSystemDeleteResult
|
||||
{
|
||||
};
|
||||
|
||||
struct FileSystemListPathsResponse
|
||||
struct FileSystemListPathsResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> Continuation;
|
||||
std::vector<Path> Paths;
|
||||
|
||||
static FileSystemListPathsResponse FileSystemListPathsResponseFromPathList(PathList object)
|
||||
static FileSystemListPathsResult FileSystemListPathsResultFromPathList(PathList object)
|
||||
{
|
||||
FileSystemListPathsResponse result;
|
||||
FileSystemListPathsResult result;
|
||||
result.Paths = std::move(object.Paths);
|
||||
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
struct PathCreateResponse
|
||||
struct PathCreateResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> ETag;
|
||||
Azure::Core::Nullable<std::string> LastModified;
|
||||
@ -670,7 +670,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<int64_t> ContentLength;
|
||||
};
|
||||
|
||||
struct PathUpdateResponse
|
||||
struct PathUpdateResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
@ -686,10 +686,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
int32_t FailureCount = int32_t();
|
||||
std::vector<AclFailedEntry> FailedEntries;
|
||||
|
||||
static PathUpdateResponse PathUpdateResponseFromSetAccessControlRecursiveResponse(
|
||||
static PathUpdateResult PathUpdateResultFromSetAccessControlRecursiveResponse(
|
||||
SetAccessControlRecursiveResponse object)
|
||||
{
|
||||
PathUpdateResponse result;
|
||||
PathUpdateResult result;
|
||||
result.DirectoriesSuccessful = object.DirectoriesSuccessful;
|
||||
result.FilesSuccessful = object.FilesSuccessful;
|
||||
result.FailureCount = object.FailureCount;
|
||||
@ -699,7 +699,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
};
|
||||
|
||||
struct PathLeaseResponse
|
||||
struct PathLeaseResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
@ -707,7 +707,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
std::string LeaseTime;
|
||||
};
|
||||
|
||||
struct PathReadResponse
|
||||
struct PathReadResult
|
||||
{
|
||||
std::unique_ptr<Azure::Core::Http::BodyStream> BodyStream;
|
||||
std::string AcceptRanges;
|
||||
@ -725,7 +725,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<std::string> ContentMD5;
|
||||
};
|
||||
|
||||
struct PathGetPropertiesResponse
|
||||
struct PathGetPropertiesResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> AcceptRanges;
|
||||
DataLakeHttpHeaders HttpHeaders;
|
||||
@ -745,18 +745,18 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Azure::Core::Nullable<LeaseStatusType> LeaseStatus;
|
||||
};
|
||||
|
||||
struct PathDeleteResponse
|
||||
struct PathDeleteResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> Continuation;
|
||||
};
|
||||
|
||||
struct PathSetAccessControlResponse
|
||||
struct PathSetAccessControlResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
};
|
||||
|
||||
struct PathSetAccessControlRecursiveResponse
|
||||
struct PathSetAccessControlRecursiveResult
|
||||
{
|
||||
Azure::Core::Nullable<std::string> Continuation;
|
||||
int32_t DirectoriesSuccessful = int32_t();
|
||||
@ -764,11 +764,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
int32_t FailureCount = int32_t();
|
||||
std::vector<AclFailedEntry> FailedEntries;
|
||||
|
||||
static PathSetAccessControlRecursiveResponse
|
||||
PathSetAccessControlRecursiveResponseFromSetAccessControlRecursiveResponse(
|
||||
static PathSetAccessControlRecursiveResult
|
||||
PathSetAccessControlRecursiveResultFromSetAccessControlRecursiveResponse(
|
||||
SetAccessControlRecursiveResponse object)
|
||||
{
|
||||
PathSetAccessControlRecursiveResponse result;
|
||||
PathSetAccessControlRecursiveResult result;
|
||||
result.DirectoriesSuccessful = object.DirectoriesSuccessful;
|
||||
result.FilesSuccessful = object.FilesSuccessful;
|
||||
result.FailureCount = object.FailureCount;
|
||||
@ -778,14 +778,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
};
|
||||
|
||||
struct PathFlushDataResponse
|
||||
struct PathFlushDataResult
|
||||
{
|
||||
std::string ETag;
|
||||
std::string LastModified;
|
||||
int64_t ContentLength = int64_t();
|
||||
};
|
||||
|
||||
struct PathAppendDataResponse
|
||||
struct PathAppendDataResult
|
||||
{
|
||||
};
|
||||
|
||||
@ -821,7 +821,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// for this request.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<ServiceListFileSystemsResponse> ListFileSystems(
|
||||
static Azure::Core::Response<ServiceListFileSystemsResult> ListFileSystems(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -857,11 +857,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
request.AddHeader(
|
||||
Details::c_HeaderApiVersionParameter, listFileSystemsOptions.ApiVersionParameter);
|
||||
return ListFileSystemsParseResponse(context, pipeline.Send(context, request));
|
||||
return ListFileSystemsParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
private:
|
||||
static Azure::Core::Response<ServiceListFileSystemsResponse> ListFileSystemsParseResponse(
|
||||
static Azure::Core::Response<ServiceListFileSystemsResult> ListFileSystemsParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -870,16 +870,16 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
// OK
|
||||
const auto& bodyBuffer = response.GetBody();
|
||||
ServiceListFileSystemsResponse result = bodyBuffer.empty()
|
||||
? ServiceListFileSystemsResponse()
|
||||
: ServiceListFileSystemsResponse::ServiceListFileSystemsResponseFromFileSystemList(
|
||||
ServiceListFileSystemsResult result = bodyBuffer.empty()
|
||||
? ServiceListFileSystemsResult()
|
||||
: ServiceListFileSystemsResult::ServiceListFileSystemsResultFromFileSystemList(
|
||||
FileSystemList::CreateFromJson(nlohmann::json::parse(bodyBuffer)));
|
||||
if (response.GetHeaders().find(Details::c_HeaderXMsContinuation)
|
||||
!= response.GetHeaders().end())
|
||||
{
|
||||
result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation);
|
||||
}
|
||||
return Azure::Core::Response<ServiceListFileSystemsResponse>(
|
||||
return Azure::Core::Response<ServiceListFileSystemsResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -916,7 +916,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// values for all properties.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<FileSystemCreateResponse> Create(
|
||||
static Azure::Core::Response<FileSystemCreateResult> Create(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -940,7 +940,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
request.AddHeader(Details::c_HeaderProperties, createOptions.Properties.GetValue());
|
||||
}
|
||||
return CreateParseResponse(context, pipeline.Send(context, request));
|
||||
return CreateParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct SetPropertiesOptions
|
||||
@ -974,7 +974,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<FileSystemSetPropertiesResponse> SetProperties(
|
||||
static Azure::Core::Response<FileSystemSetPropertiesResult> SetProperties(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1010,7 +1010,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Details::c_HeaderIfUnmodifiedSince,
|
||||
setPropertiesOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return SetPropertiesParseResponse(context, pipeline.Send(context, request));
|
||||
return SetPropertiesParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct GetPropertiesOptions
|
||||
@ -1028,7 +1028,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// for this request.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<FileSystemGetPropertiesResponse> GetProperties(
|
||||
static Azure::Core::Response<FileSystemGetPropertiesResult> GetProperties(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1048,7 +1048,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
request.AddHeader(
|
||||
Details::c_HeaderApiVersionParameter, getPropertiesOptions.ApiVersionParameter);
|
||||
return GetPropertiesParseResponse(context, pipeline.Send(context, request));
|
||||
return GetPropertiesParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct DeleteOptions
|
||||
@ -1072,7 +1072,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<FileSystemDeleteResponse> Delete(
|
||||
static Azure::Core::Response<FileSystemDeleteResult> Delete(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1101,7 +1101,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddHeader(
|
||||
Details::c_HeaderIfUnmodifiedSince, deleteOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return DeleteParseResponse(context, pipeline.Send(context, request));
|
||||
return DeleteParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct ListPathsOptions
|
||||
@ -1142,7 +1142,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// friendly names.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<FileSystemListPathsResponse> ListPaths(
|
||||
static Azure::Core::Response<FileSystemListPathsResult> ListPaths(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1185,11 +1185,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddQueryParameter(
|
||||
Details::c_QueryUpn, (listPathsOptions.Upn.GetValue() ? "true" : "false"));
|
||||
}
|
||||
return ListPathsParseResponse(context, pipeline.Send(context, request));
|
||||
return ListPathsParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
private:
|
||||
static Azure::Core::Response<FileSystemCreateResponse> CreateParseResponse(
|
||||
static Azure::Core::Response<FileSystemCreateResult> CreateParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -1197,11 +1197,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created)
|
||||
{
|
||||
// Created
|
||||
FileSystemCreateResponse result;
|
||||
FileSystemCreateResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
result.NamespaceEnabled = response.GetHeaders().at(Details::c_HeaderXMsNamespaceEnabled);
|
||||
return Azure::Core::Response<FileSystemCreateResponse>(
|
||||
return Azure::Core::Response<FileSystemCreateResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -1210,7 +1210,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<FileSystemSetPropertiesResponse> SetPropertiesParseResponse(
|
||||
static Azure::Core::Response<FileSystemSetPropertiesResult> SetPropertiesParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -1218,10 +1218,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// Ok
|
||||
FileSystemSetPropertiesResponse result;
|
||||
FileSystemSetPropertiesResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
return Azure::Core::Response<FileSystemSetPropertiesResponse>(
|
||||
return Azure::Core::Response<FileSystemSetPropertiesResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -1230,7 +1230,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<FileSystemGetPropertiesResponse> GetPropertiesParseResponse(
|
||||
static Azure::Core::Response<FileSystemGetPropertiesResult> GetPropertiesParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -1238,12 +1238,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// Ok
|
||||
FileSystemGetPropertiesResponse result;
|
||||
FileSystemGetPropertiesResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
result.Properties = response.GetHeaders().at(Details::c_HeaderXMsProperties);
|
||||
result.NamespaceEnabled = response.GetHeaders().at(Details::c_HeaderXMsNamespaceEnabled);
|
||||
return Azure::Core::Response<FileSystemGetPropertiesResponse>(
|
||||
return Azure::Core::Response<FileSystemGetPropertiesResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -1252,7 +1252,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<FileSystemDeleteResponse> DeleteParseResponse(
|
||||
static Azure::Core::Response<FileSystemDeleteResult> DeleteParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -1260,8 +1260,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted)
|
||||
{
|
||||
// Accepted
|
||||
FileSystemDeleteResponse result;
|
||||
return Azure::Core::Response<FileSystemDeleteResponse>(
|
||||
FileSystemDeleteResult result;
|
||||
return Azure::Core::Response<FileSystemDeleteResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -1270,7 +1270,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<FileSystemListPathsResponse> ListPathsParseResponse(
|
||||
static Azure::Core::Response<FileSystemListPathsResult> ListPathsParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -1279,16 +1279,16 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
// Ok
|
||||
const auto& bodyBuffer = response.GetBody();
|
||||
FileSystemListPathsResponse result = bodyBuffer.empty()
|
||||
? FileSystemListPathsResponse()
|
||||
: FileSystemListPathsResponse::FileSystemListPathsResponseFromPathList(
|
||||
FileSystemListPathsResult result = bodyBuffer.empty()
|
||||
? FileSystemListPathsResult()
|
||||
: FileSystemListPathsResult::FileSystemListPathsResultFromPathList(
|
||||
PathList::CreateFromJson(nlohmann::json::parse(bodyBuffer)));
|
||||
if (response.GetHeaders().find(Details::c_HeaderXMsContinuation)
|
||||
!= response.GetHeaders().end())
|
||||
{
|
||||
result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation);
|
||||
}
|
||||
return Azure::Core::Response<FileSystemListPathsResponse>(
|
||||
return Azure::Core::Response<FileSystemListPathsResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -1402,7 +1402,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// has not been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathCreateResponse> Create(
|
||||
static Azure::Core::Response<PathCreateResult> Create(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1525,7 +1525,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Details::c_HeaderSourceIfUnmodifiedSince,
|
||||
createOptions.SourceIfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return CreateParseResponse(context, pipeline.Send(context, request));
|
||||
return CreateParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct UpdateOptions
|
||||
@ -1658,7 +1658,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathUpdateResponse> Update(
|
||||
static Azure::Core::Response<PathUpdateResult> Update(
|
||||
std::string url,
|
||||
Azure::Core::Http::BodyStream& bodyStream,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
@ -1785,7 +1785,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddHeader(
|
||||
Details::c_HeaderIfUnmodifiedSince, updateOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return UpdateParseResponse(context, pipeline.Send(context, request));
|
||||
return UpdateParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct LeaseOptions
|
||||
@ -1843,7 +1843,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathLeaseResponse> Lease(
|
||||
static Azure::Core::Response<PathLeaseResult> Lease(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1905,7 +1905,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddHeader(
|
||||
Details::c_HeaderIfUnmodifiedSince, leaseOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return LeaseParseResponse(context, pipeline.Send(context, request));
|
||||
return LeaseParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct ReadOptions
|
||||
@ -1947,7 +1947,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathReadResponse> Read(
|
||||
static Azure::Core::Response<PathReadResult> Read(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -1998,7 +1998,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddHeader(
|
||||
Details::c_HeaderIfUnmodifiedSince, readOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return ReadParseResponse(context, pipeline.Send(context, request));
|
||||
return ReadParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct GetPropertiesOptions
|
||||
@ -2042,7 +2042,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathGetPropertiesResponse> GetProperties(
|
||||
static Azure::Core::Response<PathGetPropertiesResult> GetProperties(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -2097,7 +2097,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
Details::c_HeaderIfUnmodifiedSince,
|
||||
getPropertiesOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return GetPropertiesParseResponse(context, pipeline.Send(context, request));
|
||||
return GetPropertiesParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct DeleteOptions
|
||||
@ -2136,7 +2136,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// been modified since the specified date/time.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathDeleteResponse> Delete(
|
||||
static Azure::Core::Response<PathDeleteResult> Delete(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -2188,7 +2188,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddHeader(
|
||||
Details::c_HeaderIfUnmodifiedSince, deleteOptions.IfUnmodifiedSince.GetValue());
|
||||
}
|
||||
return DeleteParseResponse(context, pipeline.Send(context, request));
|
||||
return DeleteParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct SetAccessControlOptions
|
||||
@ -2233,7 +2233,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// for this request.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathSetAccessControlResponse> SetAccessControl(
|
||||
static Azure::Core::Response<PathSetAccessControlResult> SetAccessControl(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -2295,7 +2295,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
request.AddHeader(
|
||||
Details::c_HeaderApiVersionParameter, setAccessControlOptions.ApiVersionParameter);
|
||||
return SetAccessControlParseResponse(context, pipeline.Send(context, request));
|
||||
return SetAccessControlParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct SetAccessControlRecursiveOptions
|
||||
@ -2334,7 +2334,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// for this request.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathSetAccessControlRecursiveResponse> SetAccessControlRecursive(
|
||||
static Azure::Core::Response<PathSetAccessControlRecursiveResult> SetAccessControlRecursive(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -2376,7 +2376,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
request.AddHeader(
|
||||
Details::c_HeaderApiVersionParameter,
|
||||
setAccessControlRecursiveOptions.ApiVersionParameter);
|
||||
return SetAccessControlRecursiveParseResponse(context, pipeline.Send(context, request));
|
||||
return SetAccessControlRecursiveParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct FlushDataOptions
|
||||
@ -2458,7 +2458,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// for this request.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathFlushDataResponse> FlushData(
|
||||
static Azure::Core::Response<PathFlushDataResult> FlushData(
|
||||
std::string url,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
Azure::Core::Context context,
|
||||
@ -2551,7 +2551,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
request.AddHeader(
|
||||
Details::c_HeaderApiVersionParameter, flushDataOptions.ApiVersionParameter);
|
||||
return FlushDataParseResponse(context, pipeline.Send(context, request));
|
||||
return FlushDataParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
struct AppendDataOptions
|
||||
@ -2589,7 +2589,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// for this request.
|
||||
};
|
||||
|
||||
static Azure::Core::Response<PathAppendDataResponse> AppendData(
|
||||
static Azure::Core::Response<PathAppendDataResult> AppendData(
|
||||
std::string url,
|
||||
Azure::Core::Http::BodyStream& bodyStream,
|
||||
Azure::Core::Http::HttpPipeline& pipeline,
|
||||
@ -2633,11 +2633,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
request.AddHeader(
|
||||
Details::c_HeaderApiVersionParameter, appendDataOptions.ApiVersionParameter);
|
||||
return AppendDataParseResponse(context, pipeline.Send(context, request));
|
||||
return AppendDataParseResult(context, pipeline.Send(context, request));
|
||||
}
|
||||
|
||||
private:
|
||||
static Azure::Core::Response<PathCreateResponse> CreateParseResponse(
|
||||
static Azure::Core::Response<PathCreateResult> CreateParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -2645,7 +2645,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created)
|
||||
{
|
||||
// The file or directory was created.
|
||||
PathCreateResponse result;
|
||||
PathCreateResult result;
|
||||
if (response.GetHeaders().find(Details::c_HeaderETag) != response.GetHeaders().end())
|
||||
{
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
@ -2666,8 +2666,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
result.ContentLength
|
||||
= std::stoll(response.GetHeaders().at(Details::c_HeaderContentLength));
|
||||
}
|
||||
return Azure::Core::Response<PathCreateResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathCreateResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2675,7 +2674,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathUpdateResponse> UpdateParseResponse(
|
||||
static Azure::Core::Response<PathUpdateResult> UpdateParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -2685,9 +2684,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
// The data was flushed (written) to the file or the properties were set successfully.
|
||||
// Response body is optional and is valid only for "SetAccessControlRecursive"
|
||||
const auto& bodyBuffer = response.GetBody();
|
||||
PathUpdateResponse result = bodyBuffer.empty()
|
||||
? PathUpdateResponse()
|
||||
: PathUpdateResponse::PathUpdateResponseFromSetAccessControlRecursiveResponse(
|
||||
PathUpdateResult result = bodyBuffer.empty()
|
||||
? PathUpdateResult()
|
||||
: PathUpdateResult::PathUpdateResultFromSetAccessControlRecursiveResponse(
|
||||
SetAccessControlRecursiveResponse::CreateFromJson(
|
||||
nlohmann::json::parse(bodyBuffer)));
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
@ -2742,19 +2741,17 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation);
|
||||
}
|
||||
return Azure::Core::Response<PathUpdateResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathUpdateResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted)
|
||||
{
|
||||
// The uploaded data was accepted.
|
||||
PathUpdateResponse result;
|
||||
PathUpdateResult result;
|
||||
if (response.GetHeaders().find("content-md5") != response.GetHeaders().end())
|
||||
{
|
||||
result.ContentMD5 = response.GetHeaders().at("content-md5");
|
||||
}
|
||||
return Azure::Core::Response<PathUpdateResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathUpdateResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2762,7 +2759,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathLeaseResponse> LeaseParseResponse(
|
||||
static Azure::Core::Response<PathLeaseResult> LeaseParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -2770,7 +2767,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// The "renew", "change" or "release" action was successful.
|
||||
PathLeaseResponse result;
|
||||
PathLeaseResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
if (response.GetHeaders().find(Details::c_HeaderXMsLeaseId)
|
||||
@ -2778,13 +2775,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
result.LeaseId = response.GetHeaders().at(Details::c_HeaderXMsLeaseId);
|
||||
}
|
||||
return Azure::Core::Response<PathLeaseResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathLeaseResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Created)
|
||||
{
|
||||
// A new lease has been created. The "acquire" action was successful.
|
||||
PathLeaseResponse result;
|
||||
PathLeaseResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
if (response.GetHeaders().find(Details::c_HeaderXMsLeaseId)
|
||||
@ -2792,18 +2788,16 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
result.LeaseId = response.GetHeaders().at(Details::c_HeaderXMsLeaseId);
|
||||
}
|
||||
return Azure::Core::Response<PathLeaseResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathLeaseResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted)
|
||||
{
|
||||
// The "break" lease action was successful.
|
||||
PathLeaseResponse result;
|
||||
PathLeaseResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
result.LeaseTime = response.GetHeaders().at(Details::c_HeaderXMsLeaseTime);
|
||||
return Azure::Core::Response<PathLeaseResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathLeaseResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2811,7 +2805,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathReadResponse> ReadParseResponse(
|
||||
static Azure::Core::Response<PathReadResult> ReadParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -2819,7 +2813,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// Ok
|
||||
PathReadResponse result;
|
||||
PathReadResult result;
|
||||
result.BodyStream = response.GetBodyStream();
|
||||
if (response.GetHeaders().find(Details::c_HeaderAcceptRanges)
|
||||
!= response.GetHeaders().end())
|
||||
@ -2878,12 +2872,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
= LeaseStateTypeFromString(response.GetHeaders().at(Details::c_HeaderXMsLeaseState));
|
||||
result.LeaseStatus = LeaseStatusTypeFromString(
|
||||
response.GetHeaders().at(Details::c_HeaderXMsLeaseStatus));
|
||||
return Azure::Core::Response<PathReadResponse>(std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathReadResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::PartialContent)
|
||||
{
|
||||
// Partial content
|
||||
PathReadResponse result;
|
||||
PathReadResult result;
|
||||
result.BodyStream = response.GetBodyStream();
|
||||
if (response.GetHeaders().find(Details::c_HeaderAcceptRanges)
|
||||
!= response.GetHeaders().end())
|
||||
@ -2947,7 +2941,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
= LeaseStateTypeFromString(response.GetHeaders().at(Details::c_HeaderXMsLeaseState));
|
||||
result.LeaseStatus = LeaseStatusTypeFromString(
|
||||
response.GetHeaders().at(Details::c_HeaderXMsLeaseStatus));
|
||||
return Azure::Core::Response<PathReadResponse>(std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathReadResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2955,7 +2949,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathGetPropertiesResponse> GetPropertiesParseResponse(
|
||||
static Azure::Core::Response<PathGetPropertiesResult> GetPropertiesParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -2963,7 +2957,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// Returns all properties for the file or directory.
|
||||
PathGetPropertiesResponse result;
|
||||
PathGetPropertiesResult result;
|
||||
if (response.GetHeaders().find(Details::c_HeaderAcceptRanges)
|
||||
!= response.GetHeaders().end())
|
||||
{
|
||||
@ -3050,7 +3044,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
result.LeaseStatus = LeaseStatusTypeFromString(
|
||||
response.GetHeaders().at(Details::c_HeaderXMsLeaseStatus));
|
||||
}
|
||||
return Azure::Core::Response<PathGetPropertiesResponse>(
|
||||
return Azure::Core::Response<PathGetPropertiesResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -3059,7 +3053,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathDeleteResponse> DeleteParseResponse(
|
||||
static Azure::Core::Response<PathDeleteResult> DeleteParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -3067,14 +3061,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// The file was deleted.
|
||||
PathDeleteResponse result;
|
||||
PathDeleteResult result;
|
||||
if (response.GetHeaders().find(Details::c_HeaderXMsContinuation)
|
||||
!= response.GetHeaders().end())
|
||||
{
|
||||
result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation);
|
||||
}
|
||||
return Azure::Core::Response<PathDeleteResponse>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
return Azure::Core::Response<PathDeleteResult>(std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3082,7 +3075,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathSetAccessControlResponse> SetAccessControlParseResponse(
|
||||
static Azure::Core::Response<PathSetAccessControlResult> SetAccessControlParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -3090,10 +3083,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// Set directory access control response.
|
||||
PathSetAccessControlResponse result;
|
||||
PathSetAccessControlResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
return Azure::Core::Response<PathSetAccessControlResponse>(
|
||||
return Azure::Core::Response<PathSetAccessControlResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -3102,8 +3095,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathSetAccessControlRecursiveResponse>
|
||||
SetAccessControlRecursiveParseResponse(
|
||||
static Azure::Core::Response<PathSetAccessControlRecursiveResult>
|
||||
SetAccessControlRecursiveParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -3112,10 +3105,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
// Set directory access control recursive response.
|
||||
const auto& bodyBuffer = response.GetBody();
|
||||
PathSetAccessControlRecursiveResponse result = bodyBuffer.empty()
|
||||
? PathSetAccessControlRecursiveResponse()
|
||||
: PathSetAccessControlRecursiveResponse::
|
||||
PathSetAccessControlRecursiveResponseFromSetAccessControlRecursiveResponse(
|
||||
PathSetAccessControlRecursiveResult result = bodyBuffer.empty()
|
||||
? PathSetAccessControlRecursiveResult()
|
||||
: PathSetAccessControlRecursiveResult::
|
||||
PathSetAccessControlRecursiveResultFromSetAccessControlRecursiveResponse(
|
||||
SetAccessControlRecursiveResponse::CreateFromJson(
|
||||
nlohmann::json::parse(bodyBuffer)));
|
||||
if (response.GetHeaders().find(Details::c_HeaderXMsContinuation)
|
||||
@ -3123,7 +3116,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
result.Continuation = response.GetHeaders().at(Details::c_HeaderXMsContinuation);
|
||||
}
|
||||
return Azure::Core::Response<PathSetAccessControlRecursiveResponse>(
|
||||
return Azure::Core::Response<PathSetAccessControlRecursiveResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -3132,7 +3125,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathFlushDataResponse> FlushDataParseResponse(
|
||||
static Azure::Core::Response<PathFlushDataResult> FlushDataParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -3140,7 +3133,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Ok)
|
||||
{
|
||||
// The data was flushed (written) to the file successfully.
|
||||
PathFlushDataResponse result;
|
||||
PathFlushDataResult result;
|
||||
result.ETag = response.GetHeaders().at(Details::c_HeaderETag);
|
||||
result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified);
|
||||
if (response.GetHeaders().find(Details::c_HeaderContentLength)
|
||||
@ -3149,7 +3142,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
result.ContentLength
|
||||
= std::stoll(response.GetHeaders().at(Details::c_HeaderContentLength));
|
||||
}
|
||||
return Azure::Core::Response<PathFlushDataResponse>(
|
||||
return Azure::Core::Response<PathFlushDataResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
@ -3158,7 +3151,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
}
|
||||
}
|
||||
|
||||
static Azure::Core::Response<PathAppendDataResponse> AppendDataParseResponse(
|
||||
static Azure::Core::Response<PathAppendDataResult> AppendDataParseResult(
|
||||
Azure::Core::Context context,
|
||||
std::unique_ptr<Azure::Core::Http::RawResponse> responsePtr)
|
||||
{
|
||||
@ -3166,8 +3159,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
if (response.GetStatusCode() == Azure::Core::Http::HttpStatusCode::Accepted)
|
||||
{
|
||||
// Append data to file control response.
|
||||
PathAppendDataResponse result;
|
||||
return Azure::Core::Response<PathAppendDataResponse>(
|
||||
PathAppendDataResult result;
|
||||
return Azure::Core::Response<PathAppendDataResult>(
|
||||
std::move(result), std::move(responsePtr));
|
||||
}
|
||||
else
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -73,45 +73,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<ShareInfo> The information containing the version and modified
|
||||
* time of a share.
|
||||
* @return Azure::Core::Response<CreateShareResult> containing the information including the
|
||||
* version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<ShareInfo> Create(
|
||||
Azure::Core::Response<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<ShareDeleteInfo> Currently empty and reserved for future usage.
|
||||
* @return Azure::Core::Response<ShareDeleteResult> currently empty and reserved for future
|
||||
* usage.
|
||||
*/
|
||||
Azure::Core::Response<ShareDeleteInfo> Delete(
|
||||
Azure::Core::Response<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<ShareSnapshotInfo> Containing the information for ths snapshot.
|
||||
* @return Azure::Core::Response<CreateShareSnapshotResult> containing the information for ths
|
||||
* snapshot.
|
||||
*/
|
||||
Azure::Core::Response<ShareSnapshotInfo> CreateSnapshot(
|
||||
Azure::Core::Response<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<FileShareProperties> Containing the information for ths share
|
||||
* or one of its snapshot.
|
||||
* @return Azure::Core::Response<GetSharePropertiesResult> containing the properties for ths
|
||||
* share or one of its snapshot.
|
||||
*/
|
||||
Azure::Core::Response<FileShareProperties> GetProperties(
|
||||
Azure::Core::Response<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<SetShareQuotaInfo> The information containing the version
|
||||
* and modified time of a share.
|
||||
* @return Azure::Core::Response<SetShareQuotaResult> containing the information including the
|
||||
* version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<SetShareQuotaInfo> SetQuota(
|
||||
Azure::Core::Response<SetShareQuotaResult> SetQuota(
|
||||
int32_t quota,
|
||||
const SetShareQuotaOptions& options = SetShareQuotaOptions()) const;
|
||||
|
||||
@ -119,18 +121,18 @@ 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<SetShareMetadataInfo> The information containing the version
|
||||
* and modified time of a share.
|
||||
* @return Azure::Core::Response<SetShareMetadataResult> containing the information including
|
||||
* the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<SetShareMetadataInfo> SetMetadata(
|
||||
Azure::Core::Response<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<std::vector<SignedIdentifier>> The access policy of the
|
||||
* share.
|
||||
* @return Azure::Core::Response<GetShareAccessPolicyResult> containing the access policy of
|
||||
* the share.
|
||||
*/
|
||||
Azure::Core::Response<GetShareAccessPolicyResult> GetAccessPolicy(
|
||||
const GetShareAccessPolicyOptions& options = GetShareAccessPolicyOptions()) const;
|
||||
@ -139,30 +141,30 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* @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<SetAccessPolicyInfo> The information containing the version
|
||||
* and modified time of a share.
|
||||
* @return Azure::Core::Response<SetShareAccessPolicyResult> containing the information
|
||||
* including the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<SetAccessPolicyInfo> SetAccessPolicy(
|
||||
Azure::Core::Response<SetShareAccessPolicyResult> SetAccessPolicy(
|
||||
const std::vector<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<ShareStatistics> The information containing the bytes used in
|
||||
* by the share, the version and modified time of a share.
|
||||
* @return Azure::Core::Response<GetShareStatisticsResult> containing the information including
|
||||
* the bytes used in by the share, the version and modified time of a share.
|
||||
*/
|
||||
Azure::Core::Response<ShareStatistics> GetStatistics(
|
||||
Azure::Core::Response<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<SharePermissionInfo> The information containing the permission
|
||||
* key of the permission.
|
||||
* @return Azure::Core::Response<CreateSharePermissionResult> containing the information
|
||||
* including the permission key of the permission.
|
||||
*/
|
||||
Azure::Core::Response<SharePermissionInfo> CreatePermission(
|
||||
Azure::Core::Response<CreateSharePermissionResult> CreatePermission(
|
||||
const std::string& permission,
|
||||
const CreateSharePermissionOptions& options = CreateSharePermissionOptions()) const;
|
||||
|
||||
@ -170,9 +172,10 @@ 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<std::string> The permission sting with specified key.
|
||||
* @return Azure::Core::Response<GetSharePermissionResult> containing the permission string with
|
||||
* specified key.
|
||||
*/
|
||||
Azure::Core::Response<std::string> GetPermission(
|
||||
Azure::Core::Response<GetSharePermissionResult> GetPermission(
|
||||
const std::string& permissionKey,
|
||||
const GetSharePermissionOptions& options = GetSharePermissionOptions()) const;
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
std::vector<std::unique_ptr<Azure::Core::Http::HttpPolicy>> PerRetryPolicies;
|
||||
};
|
||||
|
||||
struct ListSharesOptions
|
||||
struct ListSharesSegmentOptions
|
||||
{
|
||||
/**
|
||||
* @brief Context for cancelling long running operations.
|
||||
|
||||
@ -9,19 +9,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
// ServiceClient models:
|
||||
|
||||
using ListSharesSegmentResult = ServiceListSharesSegmentResponse;
|
||||
using SetServicePropertiesInfo = ServiceSetPropertiesResponse;
|
||||
using ListSharesSegmentResult = ServiceListSharesSegmentResult;
|
||||
using SetServicePropertiesResult = ServiceSetPropertiesResult;
|
||||
using GetServicePropertiesResult = StorageServiceProperties;
|
||||
|
||||
// ShareClient models:
|
||||
using ShareInfo = ShareCreateResponse;
|
||||
using ShareDeleteInfo = ShareDeleteResponse;
|
||||
using ShareSnapshotInfo = ShareCreateSnapshotResponse;
|
||||
using FileShareProperties = ShareGetPropertiesResponse;
|
||||
using SetShareQuotaInfo = ShareSetQuotaResponse;
|
||||
using SetShareMetadataInfo = ShareSetMetadataResponse;
|
||||
using SetAccessPolicyInfo = ShareSetAccessPolicyResponse;
|
||||
using ShareStatistics = ShareGetStatisticsResponse;
|
||||
using SharePermissionInfo = ShareCreatePermissionResponse;
|
||||
using GetShareAccessPolicyResult = ShareGetAccessPolicyResponse;
|
||||
using CreateShareResult = ShareCreateResult;
|
||||
using DeleteShareResult = ShareDeleteResult;
|
||||
using CreateShareSnapshotResult = ShareCreateSnapshotResult;
|
||||
using GetSharePropertiesResult = ShareGetPropertiesResult;
|
||||
using SetShareQuotaResult = ShareSetQuotaResult;
|
||||
using SetShareMetadataResult = ShareSetMetadataResult;
|
||||
using SetShareAccessPolicyResult = ShareSetAccessPolicyResult;
|
||||
using GetShareStatisticsResult = ShareGetStatisticsResult;
|
||||
using CreateSharePermissionResult = ShareCreatePermissionResult;
|
||||
using GetShareAccessPolicyResult = ShareGetAccessPolicyResult;
|
||||
using GetSharePermissionResult = ShareGetPermissionResult;
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
|
||||
@ -83,24 +83,26 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
* returned and information used for future list operation on valid result not yet returned.
|
||||
*/
|
||||
Azure::Core::Response<ListSharesSegmentResult> ListSharesSegment(
|
||||
const ListSharesOptions& options = ListSharesOptions()) const;
|
||||
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<ServiceProperties> The service's properties.
|
||||
* @return Azure::Core::Response<SetServicePropertiesResult> The infromation returned when
|
||||
* setting the service properties.
|
||||
*/
|
||||
Azure::Core::Response<SetServicePropertiesInfo> SetProperties(
|
||||
Azure::Core::Response<SetServicePropertiesResult> SetProperties(
|
||||
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<ServiceProperties> The service's properties.
|
||||
* @return Azure::Core::Response<GetServicePropertiesResult> The result containing service's
|
||||
* properties.
|
||||
*/
|
||||
Azure::Core::Response<StorageServiceProperties> GetProperties(
|
||||
Azure::Core::Response<GetServicePropertiesResult> GetProperties(
|
||||
const GetServicePropertiesOptions& options = GetServicePropertiesOptions()) const;
|
||||
|
||||
private:
|
||||
|
||||
@ -89,7 +89,7 @@ void DataLakeGettingStarted()
|
||||
std::vector<FileSystem> fileSystems;
|
||||
do
|
||||
{
|
||||
auto response = serviceClient.ListFileSystems();
|
||||
auto response = serviceClient.ListFileSystemsSegement();
|
||||
if (response->Continuation.HasValue())
|
||||
{
|
||||
continuation = response->Continuation.GetValue();
|
||||
|
||||
@ -128,9 +128,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
return FileClient(std::move(builder), std::move(blobClient), m_pipeline);
|
||||
}
|
||||
|
||||
Azure::Core::Response<DirectoryRenameInfo> DirectoryClient::Rename(
|
||||
Azure::Core::Response<RenameDirectoryResult> DirectoryClient::Rename(
|
||||
const std::string& destinationPath,
|
||||
const DirectoryRenameOptions& options) const
|
||||
const RenameDirectoryOptions& options) const
|
||||
{
|
||||
Azure::Core::Nullable<std::string> destinationFileSystem = options.DestinationFileSystem;
|
||||
if (!destinationFileSystem.HasValue() || destinationFileSystem.GetValue().empty())
|
||||
@ -159,16 +159,17 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
auto result = DataLakeRestClient::Path::Create(
|
||||
destinationDfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
// At this point, there is not more exception thrown, meaning the rename is successful.
|
||||
auto ret = DirectoryRenameInfo();
|
||||
auto ret = RenameDirectoryResult();
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
ret.Continuation = std::move(result->Continuation);
|
||||
return Azure::Core::Response<DirectoryRenameInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<RenameDirectoryResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<DirectoryDeleteInfo> DirectoryClient::Delete(
|
||||
Azure::Core::Response<DeleteDirectoryResult> DirectoryClient::Delete(
|
||||
bool Recursive,
|
||||
const DirectoryDeleteOptions& options) const
|
||||
const DeleteDirectoryOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::DeleteOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Continuation = options.Continuation;
|
||||
|
||||
@ -196,10 +196,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathAppendDataResponse> FileClient::AppendData(
|
||||
Azure::Core::Response<AppendFileDataResult> FileClient::AppendData(
|
||||
Azure::Core::Http::BodyStream* content,
|
||||
int64_t offset,
|
||||
const PathAppendDataOptions& options) const
|
||||
const AppendFileDataOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::AppendDataOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Position = offset;
|
||||
@ -210,9 +210,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_dfsUri.ToString(), *content, *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathFlushDataResponse> FileClient::FlushData(
|
||||
Azure::Core::Response<FlushFileDataResult> FileClient::FlushData(
|
||||
int64_t endingOffset,
|
||||
const PathFlushDataOptions& options) const
|
||||
const FlushFileDataOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::FlushDataOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Position = endingOffset;
|
||||
@ -234,9 +234,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_dfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileRenameInfo> FileClient::Rename(
|
||||
Azure::Core::Response<RenameFileResult> FileClient::Rename(
|
||||
const std::string& destinationPath,
|
||||
const FileRenameOptions& options) const
|
||||
const RenameFileOptions& options) const
|
||||
{
|
||||
Azure::Core::Nullable<std::string> destinationFileSystem = options.DestinationFileSystem;
|
||||
if (!destinationFileSystem.HasValue() || destinationFileSystem.GetValue().empty())
|
||||
@ -264,13 +264,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
auto result = DataLakeRestClient::Path::Create(
|
||||
destinationDfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
// At this point, there is not more exception thrown, meaning the rename is successful.
|
||||
auto ret = FileRenameInfo();
|
||||
auto ret = RenameFileResult();
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
return Azure::Core::Response<FileRenameInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<RenameFileResult>(std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileDeleteInfo> FileClient::Delete(const FileDeleteOptions& options) const
|
||||
Azure::Core::Response<DeleteFileResult> FileClient::Delete(const FileDeleteOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::DeleteOptions protocolLayerOptions;
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
@ -280,11 +280,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
auto result = DataLakeRestClient::Path::Delete(
|
||||
m_dfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
auto ret = FileDeleteInfo();
|
||||
return Azure::Core::Response<FileDeleteInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
auto ret = DeleteFileResult();
|
||||
return Azure::Core::Response<DeleteFileResult>(std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileReadInfo> FileClient::Read(const FileReadOptions& options) const
|
||||
Azure::Core::Response<ReadFileResult> FileClient::Read(const ReadFileOptions& options) const
|
||||
{
|
||||
Blobs::DownloadBlobOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
@ -296,7 +296,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
blobOptions.AccessConditions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
|
||||
auto result = m_blobClient.Download(blobOptions);
|
||||
FileReadInfo ret;
|
||||
ReadFileResult ret;
|
||||
ret.Body = std::move(result->BodyStream);
|
||||
ret.HttpHeaders = FromBlobHttpHeaders(std::move(result->HttpHeaders));
|
||||
Azure::Core::Nullable<int64_t> RangeOffset;
|
||||
@ -320,12 +320,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
? FromBlobLeaseStatus(result->LeaseStatus.GetValue())
|
||||
: ret.LeaseStatus;
|
||||
ret.Metadata = std::move(result->Metadata);
|
||||
return Azure::Core::Response<FileReadInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<ReadFileResult>(std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileContentInfo> FileClient::UploadFromFile(
|
||||
Azure::Core::Response<UploadFileFromResult> FileClient::UploadFrom(
|
||||
const std::string& file,
|
||||
const UploadFileOptions& options) const
|
||||
const UploadFileFromOptions& options) const
|
||||
{
|
||||
Blobs::UploadBlockBlobFromOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
@ -336,10 +336,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
return m_blockBlobClient.UploadFrom(file, blobOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileContentInfo> FileClient::UploadFromBuffer(
|
||||
Azure::Core::Response<UploadFileFromResult> FileClient::UploadFrom(
|
||||
const uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const UploadFileOptions& options) const
|
||||
const UploadFileFromOptions& options) const
|
||||
{
|
||||
Blobs::UploadBlockBlobFromOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
@ -350,13 +350,13 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
return m_blockBlobClient.UploadFrom(buffer, bufferSize, blobOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileDownloadInfo> FileClient::DownloadToBuffer(
|
||||
Azure::Core::Response<DownloadFileToResult> FileClient::DownloadTo(
|
||||
uint8_t* buffer,
|
||||
std::size_t bufferSize,
|
||||
const DownloadFileOptions& options) const
|
||||
const DownloadFileToOptions& options) const
|
||||
{
|
||||
auto result = m_blockBlobClient.DownloadTo(buffer, bufferSize, options);
|
||||
FileDownloadInfo ret;
|
||||
DownloadFileToResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
ret.ContentLength = result->ContentLength;
|
||||
@ -364,15 +364,15 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
ret.Metadata = std::move(result->Metadata);
|
||||
ret.ServerEncrypted = std::move(result->ServerEncrypted);
|
||||
ret.EncryptionKeySha256 = std::move(result->EncryptionKeySha256);
|
||||
return Azure::Core::Response<FileDownloadInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<DownloadFileToResult>(std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileDownloadInfo> FileClient::DownloadToFile(
|
||||
Azure::Core::Response<DownloadFileToResult> FileClient::DownloadTo(
|
||||
const std::string& file,
|
||||
const DownloadFileOptions& options) const
|
||||
const DownloadFileToOptions& options) const
|
||||
{
|
||||
auto result = m_blockBlobClient.DownloadTo(file, options);
|
||||
FileDownloadInfo ret;
|
||||
DownloadFileToResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
ret.ContentLength = result->ContentLength;
|
||||
@ -380,7 +380,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
ret.Metadata = std::move(result->Metadata);
|
||||
ret.ServerEncrypted = std::move(result->ServerEncrypted);
|
||||
ret.EncryptionKeySha256 = std::move(result->EncryptionKeySha256);
|
||||
return Azure::Core::Response<FileDownloadInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<DownloadFileToResult>(std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::DataLake
|
||||
|
||||
@ -167,21 +167,22 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
return DirectoryClient(builder, m_blobContainerClient.GetBlobClient(path), m_pipeline);
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileSystemInfo> FileSystemClient::Create(
|
||||
const FileSystemCreateOptions& options) const
|
||||
Azure::Core::Response<CreateFileSystemResult> FileSystemClient::Create(
|
||||
const CreateFileSystemOptions& options) const
|
||||
{
|
||||
Blobs::CreateContainerOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
blobOptions.Metadata = options.Metadata;
|
||||
auto result = m_blobContainerClient.Create(blobOptions);
|
||||
FileSystemInfo ret;
|
||||
CreateFileSystemResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
return Azure::Core::Response<FileSystemInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<CreateFileSystemResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileSystemDeleteResponse> FileSystemClient::Delete(
|
||||
const FileSystemDeleteOptions& options) const
|
||||
Azure::Core::Response<FileSystemDeleteResult> FileSystemClient::Delete(
|
||||
const DeleteFileSystemOptions& options) const
|
||||
{
|
||||
Blobs::DeleteContainerOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
@ -189,41 +190,43 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
blobOptions.AccessConditions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
|
||||
auto result = m_blobContainerClient.Delete(blobOptions);
|
||||
FileSystemDeleteResponse ret;
|
||||
return Azure::Core::Response<FileSystemDeleteResponse>(
|
||||
FileSystemDeleteResult ret;
|
||||
return Azure::Core::Response<FileSystemDeleteResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileSystemProperties> FileSystemClient::GetProperties(
|
||||
const FileSystemGetPropertiesOptions& options) const
|
||||
Azure::Core::Response<GetFileSystemPropertiesResult> FileSystemClient::GetProperties(
|
||||
const GetFileSystemPropertiesOptions& options) const
|
||||
{
|
||||
Blobs::GetContainerPropertiesOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
|
||||
auto result = m_blobContainerClient.GetProperties(blobOptions);
|
||||
FileSystemProperties ret;
|
||||
GetFileSystemPropertiesResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
ret.Metadata = std::move(result->Metadata);
|
||||
return Azure::Core::Response<FileSystemProperties>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<GetFileSystemPropertiesResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileSystemInfo> FileSystemClient::SetMetadata(
|
||||
Azure::Core::Response<SetFileSystemMetadataResult> FileSystemClient::SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const FileSystemSetMetadataOptions& options) const
|
||||
const SetFileSystemMetadataOptions& options) const
|
||||
{
|
||||
Blobs::SetContainerMetadataOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
blobOptions.AccessConditions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
|
||||
blobOptions.AccessConditions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
auto result = m_blobContainerClient.SetMetadata(metadata, blobOptions);
|
||||
FileSystemInfo ret;
|
||||
SetFileSystemMetadataResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
return Azure::Core::Response<FileSystemInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<SetFileSystemMetadataResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileSystemListPathsResponse> FileSystemClient::ListPaths(
|
||||
Azure::Core::Response<ListPathsResult> FileSystemClient::ListPaths(
|
||||
bool recursive,
|
||||
const ListPathsOptions& options) const
|
||||
{
|
||||
|
||||
@ -178,9 +178,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathSetAccessControlInfo> PathClient::SetAccessControl(
|
||||
Azure::Core::Response<SetPathAccessControlResult> PathClient::SetAccessControl(
|
||||
std::vector<Acl> acls,
|
||||
const SetAccessControlOptions& options) const
|
||||
const SetPathAccessControlOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::SetAccessControlOptions protocolLayerOptions;
|
||||
protocolLayerOptions.LeaseIdOptional = options.AccessConditions.LeaseId;
|
||||
@ -196,7 +196,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_dfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetPathHttpHeadersInfo> PathClient::SetHttpHeaders(
|
||||
Azure::Core::Response<SetPathHttpHeadersResult> PathClient::SetHttpHeaders(
|
||||
DataLakeHttpHeaders httpHeaders,
|
||||
const SetPathHttpHeadersOptions& options) const
|
||||
{
|
||||
@ -214,16 +214,16 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
blobOptions.AccessConditions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
|
||||
auto result = m_blobClient.SetHttpHeaders(blobHttpHeaders, blobOptions);
|
||||
SetPathHttpHeadersInfo ret;
|
||||
SetPathHttpHeadersResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
return Azure::Core::Response<SetPathHttpHeadersInfo>(
|
||||
return Azure::Core::Response<SetPathHttpHeadersResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathInfo> PathClient::Create(
|
||||
Azure::Core::Response<CreatePathResult> PathClient::Create(
|
||||
PathResourceType type,
|
||||
const PathCreateOptions& options) const
|
||||
const CreatePathOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::CreateOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Resource = type;
|
||||
@ -242,15 +242,14 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
protocolLayerOptions.Permissions = options.Permissions;
|
||||
auto result = DataLakeRestClient::Path::Create(
|
||||
m_dfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
auto ret = PathInfo();
|
||||
auto ret = CreatePathResult();
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
ret.ContentLength = std::move(result->ContentLength);
|
||||
return Azure::Core::Response<PathInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<CreatePathResult>(std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathDeleteResponse> PathClient::Delete(
|
||||
const PathDeleteOptions& options) const
|
||||
Azure::Core::Response<DeletePathResult> PathClient::Delete(const DeletePathOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::DeleteOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Continuation = options.Continuation;
|
||||
@ -264,8 +263,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
m_dfsUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathProperties> PathClient::GetProperties(
|
||||
const PathGetPropertiesOptions& options) const
|
||||
Azure::Core::Response<GetPathPropertiesResult> PathClient::GetProperties(
|
||||
const GetPathPropertiesOptions& options) const
|
||||
{
|
||||
Blobs::GetBlobPropertiesOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
@ -275,7 +274,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
blobOptions.AccessConditions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
|
||||
auto result = m_blobClient.GetProperties(blobOptions);
|
||||
PathProperties ret;
|
||||
GetPathPropertiesResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
ret.CreationTime = std::move(result->CreationTime);
|
||||
@ -301,11 +300,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
ret.CopyStatus = std::move(result->CopyStatus);
|
||||
ret.CopyProgress = std::move(result->CopyProgress);
|
||||
ret.CopyCompletionTime = std::move(result->CopyCompletionTime);
|
||||
return Azure::Core::Response<PathProperties>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<GetPathPropertiesResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<PathAccessControl> PathClient::GetAccessControls(
|
||||
const PathAccessControlOptions& options) const
|
||||
Azure::Core::Response<GetPathAccessControlResult> PathClient::GetAccessControls(
|
||||
const GetPathAccessControlOptions& options) const
|
||||
{
|
||||
DataLakeRestClient::Path::GetPropertiesOptions protocolLayerOptions;
|
||||
protocolLayerOptions.Action = PathGetPropertiesAction::GetAccessControl;
|
||||
@ -321,7 +321,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
{
|
||||
acl = Acl::DeserializeAcls(result->ACL.GetValue());
|
||||
}
|
||||
auto ret = PathAccessControl{};
|
||||
auto ret = GetPathAccessControlResult{};
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
if (!acl.HasValue())
|
||||
@ -329,10 +329,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
throw std::runtime_error("Got null value returned when getting access control.");
|
||||
}
|
||||
ret.Acls = std::move(acl.GetValue());
|
||||
return Azure::Core::Response<PathAccessControl>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<GetPathAccessControlResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetPathMetadataInfo> PathClient::SetMetadata(
|
||||
Azure::Core::Response<SetPathMetadataResult> PathClient::SetMetadata(
|
||||
const std::map<std::string, std::string>& metadata,
|
||||
const SetPathMetadataOptions& options) const
|
||||
{
|
||||
@ -344,9 +345,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
blobOptions.AccessConditions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
|
||||
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
|
||||
auto result = m_blobClient.SetMetadata(metadata, blobOptions);
|
||||
SetPathMetadataInfo ret;
|
||||
SetPathMetadataResult ret;
|
||||
ret.ETag = std::move(result->ETag);
|
||||
ret.LastModified = std::move(result->LastModified);
|
||||
return Azure::Core::Response<SetPathMetadataInfo>(std::move(ret), result.ExtractRawResponse());
|
||||
return Azure::Core::Response<SetPathMetadataResult>(
|
||||
std::move(ret), result.ExtractRawResponse());
|
||||
}
|
||||
}}}} // namespace Azure::Storage::Files::DataLake
|
||||
|
||||
@ -156,8 +156,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
builder, m_blobServiceClient.GetBlobContainerClient(fileSystemName), m_pipeline);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListFileSystemsResult> ServiceClient::ListFileSystems(
|
||||
const ListFileSystemsOptions& options) const
|
||||
Azure::Core::Response<ListFileSystemsSegmentResult> ServiceClient::ListFileSystemsSegement(
|
||||
const ListFileSystemsSegmentOptions& options) const
|
||||
{
|
||||
Blobs::ListContainersSegmentOptions blobOptions;
|
||||
blobOptions.Context = options.Context;
|
||||
@ -165,10 +165,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
blobOptions.Marker = options.Continuation;
|
||||
blobOptions.MaxResults = options.MaxResults;
|
||||
auto result = m_blobServiceClient.ListBlobContainersSegment(blobOptions);
|
||||
auto response = ListFileSystemsResult();
|
||||
auto response = ListFileSystemsSegmentResult();
|
||||
response.Continuation = result->NextMarker.empty() ? response.Continuation : result->NextMarker;
|
||||
response.Filesystems = FileSystemsFromContainerItems(result->Items);
|
||||
return Azure::Core::Response<ListFileSystemsResult>(
|
||||
return Azure::Core::Response<ListFileSystemsSegmentResult>(
|
||||
std::move(response), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_pipeline = std::make_shared<Azure::Core::Http::HttpPipeline>(policies);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ShareInfo> ShareClient::Create(const CreateShareOptions& options) const
|
||||
Azure::Core::Response<CreateShareResult> ShareClient::Create(
|
||||
const CreateShareOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Share::CreateOptions();
|
||||
protocolLayerOptions.Metadata = options.Metadata;
|
||||
@ -119,7 +120,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ShareDeleteResponse> ShareClient::Delete(
|
||||
Azure::Core::Response<DeleteShareResult> ShareClient::Delete(
|
||||
const DeleteShareOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Share::DeleteOptions();
|
||||
@ -132,7 +133,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ShareSnapshotInfo> ShareClient::CreateSnapshot(
|
||||
Azure::Core::Response<CreateShareSnapshotResult> ShareClient::CreateSnapshot(
|
||||
const CreateShareSnapshotOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Share::CreateSnapshotOptions();
|
||||
@ -141,7 +142,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<FileShareProperties> ShareClient::GetProperties(
|
||||
Azure::Core::Response<GetSharePropertiesResult> ShareClient::GetProperties(
|
||||
const GetSharePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Share::GetPropertiesOptions();
|
||||
@ -150,7 +151,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetShareQuotaInfo> ShareClient::SetQuota(
|
||||
Azure::Core::Response<SetShareQuotaResult> ShareClient::SetQuota(
|
||||
int32_t quota,
|
||||
const SetShareQuotaOptions& options) const
|
||||
{
|
||||
@ -160,7 +161,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetShareMetadataInfo> ShareClient::SetMetadata(
|
||||
Azure::Core::Response<SetShareMetadataResult> ShareClient::SetMetadata(
|
||||
std::map<std::string, std::string> metadata,
|
||||
const SetShareMetadataOptions& options) const
|
||||
{
|
||||
@ -178,7 +179,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetAccessPolicyInfo> ShareClient::SetAccessPolicy(
|
||||
Azure::Core::Response<SetShareAccessPolicyResult> ShareClient::SetAccessPolicy(
|
||||
const std::vector<SignedIdentifier>& accessPolicy,
|
||||
const SetShareAccessPolicyOptions& options) const
|
||||
{
|
||||
@ -188,7 +189,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<ShareStatistics> ShareClient::GetStatistics(
|
||||
Azure::Core::Response<GetShareStatisticsResult> ShareClient::GetStatistics(
|
||||
const GetShareStatsOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Share::GetStatisticsOptions();
|
||||
@ -196,7 +197,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SharePermissionInfo> ShareClient::CreatePermission(
|
||||
Azure::Core::Response<CreateSharePermissionResult> ShareClient::CreatePermission(
|
||||
const std::string& permission,
|
||||
const CreateSharePermissionOptions& options) const
|
||||
{
|
||||
@ -206,16 +207,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<std::string> ShareClient::GetPermission(
|
||||
Azure::Core::Response<GetSharePermissionResult> ShareClient::GetPermission(
|
||||
const std::string& permissionKey,
|
||||
const GetSharePermissionOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Share::GetPermissionOptions();
|
||||
protocolLayerOptions.FilePermissionKeyRequired = permissionKey;
|
||||
auto result = ShareRestClient::Share::GetPermission(
|
||||
return ShareRestClient::Share::GetPermission(
|
||||
m_shareUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
return Azure::Core::Response<std::string>(
|
||||
std::move(result->Permission), result.ExtractRawResponse());
|
||||
}
|
||||
|
||||
}}}} // namespace Azure::Storage::Files::Shares
|
||||
|
||||
@ -115,7 +115,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
}
|
||||
|
||||
Azure::Core::Response<ListSharesSegmentResult> ServiceClient::ListSharesSegment(
|
||||
const ListSharesOptions& options) const
|
||||
const ListSharesSegmentOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Service::ListSharesSegmentOptions();
|
||||
protocolLayerOptions.ListSharesInclude = options.ListSharesInclude;
|
||||
@ -126,7 +126,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_serviceUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<SetServicePropertiesInfo> ServiceClient::SetProperties(
|
||||
Azure::Core::Response<SetServicePropertiesResult> ServiceClient::SetProperties(
|
||||
StorageServiceProperties properties,
|
||||
const SetServicePropertiesOptions& options) const
|
||||
{
|
||||
@ -136,7 +136,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
m_serviceUri.ToString(), *m_pipeline, options.Context, protocolLayerOptions);
|
||||
}
|
||||
|
||||
Azure::Core::Response<StorageServiceProperties> ServiceClient::GetProperties(
|
||||
Azure::Core::Response<GetServicePropertiesResult> ServiceClient::GetProperties(
|
||||
const GetServicePropertiesOptions& options) const
|
||||
{
|
||||
auto protocolLayerOptions = ShareRestClient::Service::GetPropertiesOptions();
|
||||
|
||||
@ -53,10 +53,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& client : directoryClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::DirectoryDeleteOptions options1;
|
||||
Files::DataLake::DeleteDirectoryOptions options1;
|
||||
options1.AccessConditions.IfModifiedSince = response->LastModified;
|
||||
EXPECT_THROW(client.Delete(false, options1), StorageError);
|
||||
Files::DataLake::DirectoryDeleteOptions options2;
|
||||
Files::DataLake::DeleteDirectoryOptions options2;
|
||||
options2.AccessConditions.IfUnmodifiedSince = response->LastModified;
|
||||
EXPECT_NO_THROW(client.Delete(false, options2));
|
||||
}
|
||||
@ -73,10 +73,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& client : directoryClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::DirectoryDeleteOptions options1;
|
||||
Files::DataLake::DeleteDirectoryOptions options1;
|
||||
options1.AccessConditions.IfNoneMatch = response->ETag;
|
||||
EXPECT_THROW(client.Delete(false, options1), StorageError);
|
||||
Files::DataLake::DirectoryDeleteOptions options2;
|
||||
Files::DataLake::DeleteDirectoryOptions options2;
|
||||
options2.AccessConditions.IfMatch = response->ETag;
|
||||
EXPECT_NO_THROW(client.Delete(false, options2));
|
||||
}
|
||||
@ -139,10 +139,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (auto& client : directoryClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::DirectoryRenameOptions options1;
|
||||
Files::DataLake::RenameDirectoryOptions options1;
|
||||
options1.SourceAccessConditions.IfModifiedSince = response->LastModified;
|
||||
EXPECT_THROW(client.Rename(LowercaseRandomString(), options1), StorageError);
|
||||
Files::DataLake::DirectoryRenameOptions options2;
|
||||
Files::DataLake::RenameDirectoryOptions options2;
|
||||
options2.SourceAccessConditions.IfUnmodifiedSince = response->LastModified;
|
||||
auto newPath = LowercaseRandomString();
|
||||
EXPECT_NO_THROW(client.Rename(newPath, options2));
|
||||
@ -161,10 +161,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (auto& client : directoryClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::DirectoryRenameOptions options1;
|
||||
Files::DataLake::RenameDirectoryOptions options1;
|
||||
options1.SourceAccessConditions.IfNoneMatch = response->ETag;
|
||||
EXPECT_THROW(client.Rename(LowercaseRandomString(), options1), StorageError);
|
||||
Files::DataLake::DirectoryRenameOptions options2;
|
||||
Files::DataLake::RenameDirectoryOptions options2;
|
||||
options2.SourceAccessConditions.IfMatch = response->ETag;
|
||||
auto newPath = LowercaseRandomString();
|
||||
EXPECT_NO_THROW(client.Rename(newPath, options2));
|
||||
@ -182,7 +182,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
{
|
||||
// Rename to a non-existing file system will fail and source is not changed.
|
||||
Files::DataLake::DirectoryRenameOptions options;
|
||||
Files::DataLake::RenameDirectoryOptions options;
|
||||
options.DestinationFileSystem = LowercaseRandomString();
|
||||
for (auto& client : directoryClient)
|
||||
{
|
||||
@ -197,7 +197,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
Files::DataLake::FileSystemClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), newfileSystemName));
|
||||
newfileSystemClient->Create();
|
||||
Files::DataLake::DirectoryRenameOptions options;
|
||||
Files::DataLake::RenameDirectoryOptions options;
|
||||
options.DestinationFileSystem = newfileSystemName;
|
||||
for (auto& client : directoryClient)
|
||||
{
|
||||
@ -227,8 +227,8 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
// Create path with metadata works
|
||||
auto client1 = m_fileSystemClient->GetDirectoryClient(LowercaseRandomString());
|
||||
auto client2 = m_fileSystemClient->GetDirectoryClient(LowercaseRandomString());
|
||||
Files::DataLake::PathCreateOptions options1;
|
||||
Files::DataLake::PathCreateOptions options2;
|
||||
Files::DataLake::CreatePathOptions options1;
|
||||
Files::DataLake::CreatePathOptions options2;
|
||||
options1.Metadata = metadata1;
|
||||
options2.Metadata = metadata2;
|
||||
|
||||
@ -278,7 +278,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (int32_t i = 0; i < 2; ++i)
|
||||
{
|
||||
auto client = m_fileSystemClient->GetDirectoryClient(LowercaseRandomString());
|
||||
Files::DataLake::PathCreateOptions options;
|
||||
Files::DataLake::CreatePathOptions options;
|
||||
options.HttpHeaders = httpHeader;
|
||||
EXPECT_NO_THROW(client.Create(options));
|
||||
directoryClient.emplace_back(std::move(client));
|
||||
|
||||
@ -122,10 +122,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (auto& client : fileClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::FileRenameOptions options1;
|
||||
Files::DataLake::RenameFileOptions options1;
|
||||
options1.SourceAccessConditions.IfModifiedSince = response->LastModified;
|
||||
EXPECT_THROW(client.Rename(LowercaseRandomString(), options1), StorageError);
|
||||
Files::DataLake::FileRenameOptions options2;
|
||||
Files::DataLake::RenameFileOptions options2;
|
||||
options2.SourceAccessConditions.IfUnmodifiedSince = response->LastModified;
|
||||
auto newPath = LowercaseRandomString();
|
||||
EXPECT_NO_THROW(client.Rename(newPath, options2));
|
||||
@ -144,10 +144,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (auto& client : fileClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::FileRenameOptions options1;
|
||||
Files::DataLake::RenameFileOptions options1;
|
||||
options1.SourceAccessConditions.IfNoneMatch = response->ETag;
|
||||
EXPECT_THROW(client.Rename(LowercaseRandomString(), options1), StorageError);
|
||||
Files::DataLake::FileRenameOptions options2;
|
||||
Files::DataLake::RenameFileOptions options2;
|
||||
options2.SourceAccessConditions.IfMatch = response->ETag;
|
||||
auto newPath = LowercaseRandomString();
|
||||
EXPECT_NO_THROW(client.Rename(newPath, options2));
|
||||
@ -165,7 +165,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
{
|
||||
// Rename to a non-existing file system will fail but will not change URI.
|
||||
Files::DataLake::FileRenameOptions options;
|
||||
Files::DataLake::RenameFileOptions options;
|
||||
options.DestinationFileSystem = LowercaseRandomString();
|
||||
for (auto& client : fileClient)
|
||||
{
|
||||
@ -180,7 +180,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
Files::DataLake::FileSystemClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), newfileSystemName));
|
||||
newfileSystemClient->Create();
|
||||
Files::DataLake::FileRenameOptions options;
|
||||
Files::DataLake::RenameFileOptions options;
|
||||
options.DestinationFileSystem = newfileSystemName;
|
||||
for (auto& client : fileClient)
|
||||
{
|
||||
@ -210,8 +210,8 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
// Create path with metadata works
|
||||
auto client1 = m_fileSystemClient->GetFileClient(LowercaseRandomString());
|
||||
auto client2 = m_fileSystemClient->GetFileClient(LowercaseRandomString());
|
||||
Files::DataLake::FileCreateOptions options1;
|
||||
Files::DataLake::FileCreateOptions options2;
|
||||
Files::DataLake::CreateFileOptions options1;
|
||||
Files::DataLake::CreateFileOptions options2;
|
||||
options1.Metadata = metadata1;
|
||||
options2.Metadata = metadata2;
|
||||
|
||||
@ -259,7 +259,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (int32_t i = 0; i < 2; ++i)
|
||||
{
|
||||
auto client = m_fileSystemClient->GetFileClient(LowercaseRandomString());
|
||||
Files::DataLake::FileCreateOptions options;
|
||||
Files::DataLake::CreateFileOptions options;
|
||||
options.HttpHeaders = httpHeader;
|
||||
EXPECT_NO_THROW(client.Create(options));
|
||||
fileClient.emplace_back(std::move(client));
|
||||
@ -336,7 +336,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
// Read Range
|
||||
{
|
||||
auto firstHalf = std::vector<uint8_t>(buffer.begin(), buffer.begin() + (bufferSize / 2));
|
||||
Files::DataLake::FileReadOptions options;
|
||||
Files::DataLake::ReadFileOptions options;
|
||||
options.Offset = 0;
|
||||
options.Length = bufferSize / 2;
|
||||
result = newFileClient->Read(options);
|
||||
@ -346,7 +346,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
{
|
||||
auto secondHalf = std::vector<uint8_t>(buffer.begin() + bufferSize / 2, buffer.end());
|
||||
Files::DataLake::FileReadOptions options;
|
||||
Files::DataLake::ReadFileOptions options;
|
||||
options.Offset = bufferSize / 2;
|
||||
options.Length = bufferSize / 2;
|
||||
result = newFileClient->Read(options);
|
||||
@ -356,10 +356,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
// Read with last modified access condition.
|
||||
auto response = newFileClient->GetProperties();
|
||||
Files::DataLake::FileReadOptions options1;
|
||||
Files::DataLake::ReadFileOptions options1;
|
||||
options1.AccessConditions.IfModifiedSince = response->LastModified;
|
||||
EXPECT_THROW(newFileClient->Read(options1), StorageError);
|
||||
Files::DataLake::FileReadOptions options2;
|
||||
Files::DataLake::ReadFileOptions options2;
|
||||
options2.AccessConditions.IfUnmodifiedSince = response->LastModified;
|
||||
EXPECT_NO_THROW(result = newFileClient->Read(options2));
|
||||
downloaded = ReadBodyStream(result->Body);
|
||||
@ -368,10 +368,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
// Read with if match access condition.
|
||||
auto response = newFileClient->GetProperties();
|
||||
Files::DataLake::FileReadOptions options1;
|
||||
Files::DataLake::ReadFileOptions options1;
|
||||
options1.AccessConditions.IfNoneMatch = response->ETag;
|
||||
EXPECT_THROW(newFileClient->Read(options1), StorageError);
|
||||
Files::DataLake::FileReadOptions options2;
|
||||
Files::DataLake::ReadFileOptions options2;
|
||||
options2.AccessConditions.IfMatch = response->ETag;
|
||||
EXPECT_NO_THROW(result = newFileClient->Read(options2));
|
||||
downloaded = ReadBodyStream(result->Body);
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "datalake_file_system_client_test.hpp"
|
||||
#include "datalake/datalake_options.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@ -117,10 +118,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (const auto& client : fileSystemClient)
|
||||
{
|
||||
auto response = client.GetProperties();
|
||||
Files::DataLake::FileSystemDeleteOptions options1;
|
||||
Files::DataLake::DeleteFileSystemOptions options1;
|
||||
options1.AccessConditions.IfModifiedSince = response->LastModified;
|
||||
EXPECT_THROW(client.Delete(options1), StorageError);
|
||||
Files::DataLake::FileSystemDeleteOptions options2;
|
||||
Files::DataLake::DeleteFileSystemOptions options2;
|
||||
options2.AccessConditions.IfUnmodifiedSince = response->LastModified;
|
||||
EXPECT_NO_THROW(client.Delete(options2));
|
||||
}
|
||||
@ -147,8 +148,8 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
AdlsGen2ConnectionString(), LowercaseRandomString());
|
||||
auto client2 = Files::DataLake::FileSystemClient::CreateFromConnectionString(
|
||||
AdlsGen2ConnectionString(), LowercaseRandomString());
|
||||
Files::DataLake::FileSystemCreateOptions options1;
|
||||
Files::DataLake::FileSystemCreateOptions options2;
|
||||
Files::DataLake::CreateFileSystemOptions options1;
|
||||
Files::DataLake::CreateFileSystemOptions options2;
|
||||
options1.Metadata = metadata1;
|
||||
options2.Metadata = metadata2;
|
||||
|
||||
@ -161,7 +162,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DataLakeFileSystemClientTest, FileSystemProperties)
|
||||
TEST_F(DataLakeFileSystemClientTest, GetFileSystemPropertiesResult)
|
||||
{
|
||||
auto metadata1 = RandomMetadata();
|
||||
auto metadata2 = RandomMetadata();
|
||||
|
||||
@ -72,8 +72,8 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
// Create path with metadata works
|
||||
auto client1 = m_fileSystemClient->GetFileClient(LowercaseRandomString());
|
||||
auto client2 = m_fileSystemClient->GetFileClient(LowercaseRandomString());
|
||||
Files::DataLake::PathCreateOptions options1;
|
||||
Files::DataLake::PathCreateOptions options2;
|
||||
Files::DataLake::CreatePathOptions options1;
|
||||
Files::DataLake::CreatePathOptions options2;
|
||||
options1.Metadata = metadata1;
|
||||
options2.Metadata = metadata2;
|
||||
|
||||
@ -86,7 +86,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DataLakePathClientTest, PathProperties)
|
||||
TEST_F(DataLakePathClientTest, GetPathPropertiesResult)
|
||||
{
|
||||
auto metadata1 = RandomMetadata();
|
||||
auto metadata2 = RandomMetadata();
|
||||
@ -124,7 +124,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
for (int32_t i = 0; i < 2; ++i)
|
||||
{
|
||||
auto client = m_fileSystemClient->GetFileClient(LowercaseRandomString());
|
||||
Files::DataLake::PathCreateOptions options;
|
||||
Files::DataLake::CreatePathOptions options;
|
||||
options.HttpHeaders = httpHeader;
|
||||
EXPECT_NO_THROW(client.Create(options));
|
||||
pathClient.emplace_back(std::move(client));
|
||||
@ -211,10 +211,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
std::vector<Files::DataLake::Acl> acls = GetValidAcls();
|
||||
|
||||
auto response = m_pathClient->GetProperties();
|
||||
Files::DataLake::SetAccessControlOptions options1;
|
||||
Files::DataLake::SetPathAccessControlOptions options1;
|
||||
options1.AccessConditions.IfModifiedSince = response->LastModified;
|
||||
EXPECT_THROW(m_pathClient->SetAccessControl(acls, options1), StorageError);
|
||||
Files::DataLake::SetAccessControlOptions options2;
|
||||
Files::DataLake::SetPathAccessControlOptions options2;
|
||||
options2.AccessConditions.IfUnmodifiedSince = response->LastModified;
|
||||
EXPECT_NO_THROW(m_pathClient->SetAccessControl(acls, options2));
|
||||
}
|
||||
@ -223,10 +223,10 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
// Set/Get Acls works with if match access condition.
|
||||
std::vector<Files::DataLake::Acl> acls = GetValidAcls();
|
||||
auto response = m_pathClient->GetProperties();
|
||||
Files::DataLake::SetAccessControlOptions options1;
|
||||
Files::DataLake::SetPathAccessControlOptions options1;
|
||||
options1.AccessConditions.IfNoneMatch = response->ETag;
|
||||
EXPECT_THROW(m_pathClient->SetAccessControl(acls, options1), StorageError);
|
||||
Files::DataLake::SetAccessControlOptions options2;
|
||||
Files::DataLake::SetPathAccessControlOptions options2;
|
||||
options2.AccessConditions.IfMatch = response->ETag;
|
||||
EXPECT_NO_THROW(m_pathClient->SetAccessControl(acls, options2));
|
||||
}
|
||||
|
||||
@ -54,14 +54,14 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
std::vector<Files::DataLake::FileSystem> result;
|
||||
std::string continuation;
|
||||
Files::DataLake::ListFileSystemsOptions options;
|
||||
Files::DataLake::ListFileSystemsSegmentOptions options;
|
||||
if (!prefix.empty())
|
||||
{
|
||||
options.Prefix = prefix;
|
||||
}
|
||||
do
|
||||
{
|
||||
auto response = m_dataLakeServiceClient->ListFileSystems(options);
|
||||
auto response = m_dataLakeServiceClient->ListFileSystemsSegement(options);
|
||||
result.insert(result.end(), response->Filesystems.begin(), response->Filesystems.end());
|
||||
if (response->Continuation.HasValue())
|
||||
{
|
||||
@ -72,7 +72,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
return result;
|
||||
}
|
||||
|
||||
TEST_F(DataLakeServiceClientTest, ListFileSystems)
|
||||
TEST_F(DataLakeServiceClientTest, ListFileSystemsSegement)
|
||||
{
|
||||
{
|
||||
// Normal list without prefix.
|
||||
@ -119,9 +119,9 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
{
|
||||
// List max result
|
||||
Files::DataLake::ListFileSystemsOptions options;
|
||||
Files::DataLake::ListFileSystemsSegmentOptions options;
|
||||
options.MaxResults = 2;
|
||||
auto response = m_dataLakeServiceClient->ListFileSystems(options);
|
||||
auto response = m_dataLakeServiceClient->ListFileSystemsSegement(options);
|
||||
EXPECT_LE(2U, response->Filesystems.size());
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,10 +174,12 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
"2127521184-1604012920-1887927527-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;"
|
||||
"0x1200a9;;;S-1-5-21-397955417-626881126-188441444-3053964)";
|
||||
|
||||
std::string expectedPermission = permission + "S:NO_ACCESS_CONTROL";
|
||||
|
||||
auto ret = m_shareClient->CreatePermission(permission);
|
||||
EXPECT_FALSE(ret->FilePermissionKey.empty());
|
||||
|
||||
auto ret2 = m_shareClient->GetPermission(ret->FilePermissionKey).ExtractValue();
|
||||
EXPECT_EQ(ret2, permission);
|
||||
auto ret2 = m_shareClient->GetPermission(ret->FilePermissionKey);
|
||||
EXPECT_EQ(expectedPermission, ret2->Permission);
|
||||
}
|
||||
}}} // namespace Azure::Storage::Test
|
||||
|
||||
@ -56,7 +56,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
{
|
||||
std::vector<Files::Shares::ShareItem> result;
|
||||
std::string continuation;
|
||||
Files::Shares::ListSharesOptions options;
|
||||
Files::Shares::ListSharesSegmentOptions options;
|
||||
if (!prefix.empty())
|
||||
{
|
||||
options.Prefix = prefix;
|
||||
@ -118,7 +118,7 @@ namespace Azure { namespace Storage { namespace Test {
|
||||
}
|
||||
{
|
||||
// List max result
|
||||
Files::Shares::ListSharesOptions options;
|
||||
Files::Shares::ListSharesSegmentOptions options;
|
||||
options.MaxResults = 2;
|
||||
auto response = m_fileShareServiceClient->ListSharesSegment(options);
|
||||
EXPECT_LE(2U, response->ShareItems.size());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user