rename return types of some Get operations (#1819)

This commit is contained in:
JinmingHu 2021-03-16 12:30:30 +08:00 committed by GitHub
parent 009260c50a
commit 100eba49e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 569 additions and 657 deletions

View File

@ -12,6 +12,13 @@
- Changed the return type of `StartCopyFromUri` and `StartCopyIncremental` API from a `Response<T>` to the particular `Operation<T>` type called `StartCopyBlobOperation` directly.
- String conversion functions of extensible enums were renamed from `Get()` to `ToString()`.
- Moved `SecondaryHostForRetryReads` out of retry options, now it's under `BlobClientOptions`.
- Changed return type of `BlobServiceClient::GetUserDelegationKey` to `UserDelegationKey`.
- Changed return type of `BlobServiceClient::GetProperties` to `BlobServiceProperties`.
- Changed return type of `BlobServiceClient::GetAccountInfo` to `AccountInfo`.
- Changed return type of `BlobServiceClient::GetStatistics` to `ServiceStatistics`.
- Changed return type of `BlobContainerClient::GetProperties` to `BlobContainerProperties`.
- Changed return type of `BlobContainerClient::GetAccessPolicy` to `BlobContainerAccessPolicy`.
- Changed return type of `BlobClient::GetProperties` to `BlobProperties`.
### Other Changes and Improvements

View File

@ -148,9 +148,9 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A GetBlobPropertiesResult describing the blob's properties.
* @return A BlobProperties describing the blob's properties.
*/
Azure::Response<Models::GetBlobPropertiesResult> GetProperties(
Azure::Response<Models::BlobProperties> GetProperties(
const GetBlobPropertiesOptions& options = GetBlobPropertiesOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;
@ -337,7 +337,7 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return Tags on successfully getting tags.
* @return GetBlobTagsResult on successfully getting tags.
*/
Azure::Response<Models::GetBlobTagsResult> GetTags(
const GetBlobTagsOptions& options = GetBlobTagsOptions(),

View File

@ -180,9 +180,9 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A GetBlobContainerPropertiesResult describing the container and its properties.
* @return A BlobContainerProperties describing the container and its properties.
*/
Azure::Response<Models::GetBlobContainerPropertiesResult> GetProperties(
Azure::Response<Models::BlobContainerProperties> GetProperties(
const GetBlobContainerPropertiesOptions& options = GetBlobContainerPropertiesOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;
@ -239,9 +239,9 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A GetBlobContainerAccessPolicyResult describing the container's access policy.
* @return A BlobContainerAccessPolicy describing the container's access policy.
*/
Azure::Response<Models::GetBlobContainerAccessPolicyResult> GetAccessPolicy(
Azure::Response<Models::BlobContainerAccessPolicy> GetAccessPolicy(
const GetBlobContainerAccessPolicyOptions& options = GetBlobContainerAccessPolicyOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

View File

@ -70,7 +70,7 @@ namespace Azure { namespace Storage { namespace Blobs {
} // namespace Models
class StartCopyBlobOperation : public Azure::Core::Operation<Models::GetBlobPropertiesResult> {
class StartCopyBlobOperation : public Azure::Core::Operation<Models::BlobProperties> {
public:
std::string RequestId;
Azure::ETag ETag;
@ -80,7 +80,7 @@ namespace Azure { namespace Storage { namespace Blobs {
Azure::Nullable<std::string> VersionId;
public:
Models::GetBlobPropertiesResult Value() const override { return m_pollResult; }
Models::BlobProperties Value() const override { return m_pollResult; }
StartCopyBlobOperation() = default;
@ -100,7 +100,7 @@ namespace Azure { namespace Storage { namespace Blobs {
std::unique_ptr<Azure::Core::Http::RawResponse> PollInternal(
Azure::Core::Context& context) override;
Azure::Response<Models::GetBlobPropertiesResult> PollUntilDoneInternal(
Azure::Response<Models::BlobProperties> PollUntilDoneInternal(
std::chrono::milliseconds period,
Azure::Core::Context& context) override;
@ -115,7 +115,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
std::shared_ptr<BlobClient> m_blobClient;
Models::GetBlobPropertiesResult m_pollResult;
Models::BlobProperties m_pollResult;
friend class Blobs::BlobClient;
friend class Blobs::PageBlobClient;

View File

@ -109,9 +109,9 @@ namespace Azure { namespace Storage { namespace Blobs {
* will be truncated to second.
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A deserialized GetUserDelegationKeyResult instance.
* @return A deserialized UserDelegationKey instance.
*/
Azure::Response<Models::GetUserDelegationKeyResult> GetUserDelegationKey(
Azure::Response<Models::UserDelegationKey> GetUserDelegationKey(
const Azure::DateTime& expiresOn,
const GetUserDelegationKeyOptions& options = GetUserDelegationKeyOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;
@ -139,9 +139,9 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A GetServicePropertiesResult describing the service properties.
* @return A BlobServiceProperties describing the service properties.
*/
Azure::Response<Models::GetServicePropertiesResult> GetProperties(
Azure::Response<Models::BlobServiceProperties> GetProperties(
const GetServicePropertiesOptions& options = GetServicePropertiesOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;
@ -150,9 +150,9 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return GetAccountInfoResult describing the account.
* @return AccountInfo describing the account.
*/
Azure::Response<Models::GetAccountInfoResult> GetAccountInfo(
Azure::Response<Models::AccountInfo> GetAccountInfo(
const GetAccountInfoOptions& options = GetAccountInfoOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;
@ -163,9 +163,9 @@ namespace Azure { namespace Storage { namespace Blobs {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A BlobServiceStatistics describing the service replication statistics.
* @return A ServiceStatistics describing the service replication statistics.
*/
Azure::Response<Models::GetServiceStatisticsResult> GetStatistics(
Azure::Response<Models::ServiceStatistics> GetStatistics(
const GetBlobServiceStatisticsOptions& options = GetBlobServiceStatisticsOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

View File

@ -94,7 +94,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::AppendBlob::Create(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::CreateAppendBlobResult> AppendBlobClient::CreateIfNotExists(
@ -145,7 +145,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::AppendBlob::AppendBlock(
context, *m_pipeline, m_blobUrl, content, protocolLayerOptions);
*m_pipeline, m_blobUrl, content, protocolLayerOptions, context);
}
Azure::Response<Models::AppendBlockFromUriResult> AppendBlobClient::AppendBlockFromUri(
@ -173,7 +173,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::AppendBlob::AppendBlockFromUri(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SealAppendBlobResult> AppendBlobClient::Seal(
@ -189,7 +189,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::AppendBlob::Seal(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
}}} // namespace Azure::Storage::Blobs

View File

@ -186,7 +186,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
auto downloadResponse = _detail::BlobRestClient::Blob::Download(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
{
// In case network failure during reading the body
@ -458,7 +458,7 @@ namespace Azure { namespace Storage { namespace Blobs {
return ret;
}
Azure::Response<Models::GetBlobPropertiesResult> BlobClient::GetProperties(
Azure::Response<Models::BlobProperties> BlobClient::GetProperties(
const GetBlobPropertiesOptions& options,
const Azure::Core::Context& context) const
{
@ -476,7 +476,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.EncryptionAlgorithm = m_customerProvidedKey.GetValue().Algorithm;
}
auto response = _detail::BlobRestClient::Blob::GetProperties(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
if (response->Tier.HasValue() && !response->IsAccessTierInferred.HasValue())
{
response->IsAccessTierInferred = false;
@ -510,7 +510,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::Blob::SetHttpHeaders(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetBlobMetadataResult> BlobClient::SetMetadata(
@ -534,7 +534,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::Blob::SetMetadata(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetBlobAccessTierResult> BlobClient::SetAccessTier(
@ -546,7 +546,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.Tier = tier;
protocolLayerOptions.RehydratePriority = options.RehydratePriority;
return _detail::BlobRestClient::Blob::SetAccessTier(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
StartCopyBlobOperation BlobClient::StartCopyFromUri(
@ -574,7 +574,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.SourceIfTags = options.SourceAccessConditions.TagConditions;
auto response = _detail::BlobRestClient::Blob::StartCopyFromUri(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
StartCopyBlobOperation res;
res.m_rawResponse = response.ExtractRawResponse();
res.RequestId = std::move(response->RequestId);
@ -596,7 +596,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.CopyId = copyId;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::BlobRestClient::Blob::AbortCopyFromUri(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::CreateBlobSnapshotResult> BlobClient::CreateSnapshot(
@ -619,7 +619,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::Blob::CreateSnapshot(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::DeleteBlobResult> BlobClient::Delete(
@ -635,7 +635,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::Blob::Delete(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::DeleteBlobResult> BlobClient::DeleteIfExists(
@ -667,7 +667,7 @@ namespace Azure { namespace Storage { namespace Blobs {
(void)options;
_detail::BlobRestClient::Blob::UndeleteBlobOptions protocolLayerOptions;
return _detail::BlobRestClient::Blob::Undelete(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::SetBlobTagsResult> BlobClient::SetTags(
@ -679,7 +679,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.Tags = std::move(tags);
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::Blob::SetTags(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::GetBlobTagsResult> BlobClient::GetTags(
@ -689,7 +689,7 @@ namespace Azure { namespace Storage { namespace Blobs {
_detail::BlobRestClient::Blob::GetBlobTagsOptions protocolLayerOptions;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::Blob::GetTags(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
}
}}} // namespace Azure::Storage::Blobs

View File

@ -158,7 +158,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.DefaultEncryptionScope = options.DefaultEncryptionScope;
protocolLayerOptions.PreventEncryptionScopeOverride = options.PreventEncryptionScopeOverride;
return _detail::BlobRestClient::BlobContainer::Create(
context, *m_pipeline, m_blobContainerUrl, protocolLayerOptions);
*m_pipeline, m_blobContainerUrl, protocolLayerOptions, context);
}
Azure::Response<Models::CreateBlobContainerResult> BlobContainerClient::CreateIfNotExists(
@ -193,7 +193,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
return _detail::BlobRestClient::BlobContainer::Delete(
context, *m_pipeline, m_blobContainerUrl, protocolLayerOptions);
*m_pipeline, m_blobContainerUrl, protocolLayerOptions, context);
}
Azure::Response<Models::DeleteBlobContainerResult> BlobContainerClient::DeleteIfExists(
@ -219,17 +219,17 @@ namespace Azure { namespace Storage { namespace Blobs {
}
}
Azure::Response<Models::GetBlobContainerPropertiesResult> BlobContainerClient::GetProperties(
Azure::Response<Models::BlobContainerProperties> BlobContainerClient::GetProperties(
const GetBlobContainerPropertiesOptions& options,
const Azure::Core::Context& context) const
{
_detail::BlobRestClient::BlobContainer::GetBlobContainerPropertiesOptions protocolLayerOptions;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::BlobRestClient::BlobContainer::GetProperties(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::SetBlobContainerMetadataResult> BlobContainerClient::SetMetadata(
@ -242,7 +242,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
return _detail::BlobRestClient::BlobContainer::SetMetadata(
context, *m_pipeline, m_blobContainerUrl, protocolLayerOptions);
*m_pipeline, m_blobContainerUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ListBlobsSinglePageResult> BlobContainerClient::ListBlobsSinglePage(
@ -255,10 +255,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.MaxResults = options.PageSizeHint;
protocolLayerOptions.Include = options.Include;
auto response = _detail::BlobRestClient::BlobContainer::ListBlobsSinglePage(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
for (auto& i : response->Items)
{
if (i.Details.Tier.HasValue() && !i.Details.IsAccessTierInferred.HasValue())
@ -291,10 +291,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.MaxResults = options.PageSizeHint;
protocolLayerOptions.Include = options.Include;
auto response = _detail::BlobRestClient::BlobContainer::ListBlobsByHierarchySinglePage(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
for (auto& i : response->Items)
{
if (i.VersionId.HasValue() && !i.IsCurrentVersion.HasValue())
@ -305,7 +305,7 @@ namespace Azure { namespace Storage { namespace Blobs {
return response;
}
Azure::Response<Models::GetBlobContainerAccessPolicyResult> BlobContainerClient::GetAccessPolicy(
Azure::Response<Models::BlobContainerAccessPolicy> BlobContainerClient::GetAccessPolicy(
const GetBlobContainerAccessPolicyOptions& options,
const Azure::Core::Context& context) const
{
@ -313,10 +313,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return _detail::BlobRestClient::BlobContainer::GetAccessPolicy(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::SetBlobContainerAccessPolicyResult> BlobContainerClient::SetAccessPolicy(
@ -331,7 +331,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
return _detail::BlobRestClient::BlobContainer::SetAccessPolicy(
context, *m_pipeline, m_blobContainerUrl, protocolLayerOptions);
*m_pipeline, m_blobContainerUrl, protocolLayerOptions, context);
}
Azure::Response<Models::DeleteBlobResult> BlobContainerClient::DeleteBlob(

View File

@ -31,10 +31,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
auto response = _detail::BlobRestClient::Blob::AcquireLease(
context,
*(m_blobClient.GetValue().m_pipeline),
m_blobClient.GetValue().m_blobUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::AcquireBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -60,10 +60,10 @@ namespace Azure { namespace Storage { namespace Blobs {
std::abort();
}
auto response = _detail::BlobRestClient::BlobContainer::AcquireLease(
context,
*(m_blobContainerClient.GetValue().m_pipeline),
m_blobContainerClient.GetValue().m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::AcquireBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -95,10 +95,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
auto response = _detail::BlobRestClient::Blob::RenewLease(
context,
*(m_blobClient.GetValue().m_pipeline),
m_blobClient.GetValue().m_blobUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::RenewBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -124,10 +124,10 @@ namespace Azure { namespace Storage { namespace Blobs {
}
auto response = _detail::BlobRestClient::BlobContainer::RenewLease(
context,
*(m_blobContainerClient.GetValue().m_pipeline),
m_blobContainerClient.GetValue().m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::RenewBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -159,10 +159,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
auto response = _detail::BlobRestClient::Blob::ReleaseLease(
context,
*(m_blobClient.GetValue().m_pipeline),
m_blobClient.GetValue().m_blobUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::ReleaseBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -187,10 +187,10 @@ namespace Azure { namespace Storage { namespace Blobs {
}
auto response = _detail::BlobRestClient::BlobContainer::ReleaseLease(
context,
*(m_blobContainerClient.GetValue().m_pipeline),
m_blobContainerClient.GetValue().m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::ReleaseBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -223,10 +223,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
auto response = _detail::BlobRestClient::Blob::ChangeLease(
context,
*(m_blobClient.GetValue().m_pipeline),
m_blobClient.GetValue().m_blobUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::ChangeBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -253,10 +253,10 @@ namespace Azure { namespace Storage { namespace Blobs {
}
auto response = _detail::BlobRestClient::BlobContainer::ChangeLease(
context,
*(m_blobContainerClient.GetValue().m_pipeline),
m_blobContainerClient.GetValue().m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::ChangeBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -288,10 +288,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
auto response = _detail::BlobRestClient::Blob::BreakLease(
context,
*(m_blobClient.GetValue().m_pipeline),
m_blobClient.GetValue().m_blobUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::BreakBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);
@ -316,10 +316,10 @@ namespace Azure { namespace Storage { namespace Blobs {
}
auto response = _detail::BlobRestClient::BlobContainer::BreakLease(
context,
*(m_blobContainerClient.GetValue().m_pipeline),
m_blobContainerClient.GetValue().m_blobContainerUrl,
protocolLayerOptions);
protocolLayerOptions,
context);
Models::BreakBlobLeaseResult ret;
ret.RequestId = std::move(response->RequestId);

View File

@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Blobs {
return response.ExtractRawResponse();
}
Azure::Response<Models::GetBlobPropertiesResult> StartCopyBlobOperation::PollUntilDoneInternal(
Azure::Response<Models::BlobProperties> StartCopyBlobOperation::PollUntilDoneInternal(
std::chrono::milliseconds period,
Azure::Core::Context& context)
{
@ -42,7 +42,7 @@ namespace Azure { namespace Storage { namespace Blobs {
if (m_status == Azure::Core::OperationStatus::Succeeded)
{
return Azure::Response<Models::GetBlobPropertiesResult>(
return Azure::Response<Models::BlobProperties>(
m_pollResult, std::make_unique<Azure::Core::Http::RawResponse>(rawResponse));
}
else if (m_status == Azure::Core::OperationStatus::Failed)

View File

@ -141,13 +141,13 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.MaxResults = options.PageSizeHint;
protocolLayerOptions.Include = options.Include;
return _detail::BlobRestClient::Service::ListBlobContainersSinglePage(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_serviceUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::GetUserDelegationKeyResult> BlobServiceClient::GetUserDelegationKey(
Azure::Response<Models::UserDelegationKey> BlobServiceClient::GetUserDelegationKey(
const Azure::DateTime& expiresOn,
const GetUserDelegationKeyOptions& options,
const Azure::Core::Context& context) const
@ -156,10 +156,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.StartsOn = options.startsOn;
protocolLayerOptions.ExpiresOn = expiresOn;
return _detail::BlobRestClient::Service::GetUserDelegationKey(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_serviceUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::SetServicePropertiesResult> BlobServiceClient::SetProperties(
@ -171,43 +171,43 @@ namespace Azure { namespace Storage { namespace Blobs {
_detail::BlobRestClient::Service::SetServicePropertiesOptions protocolLayerOptions;
protocolLayerOptions.Properties = std::move(properties);
return _detail::BlobRestClient::Service::SetProperties(
context, *m_pipeline, m_serviceUrl, protocolLayerOptions);
*m_pipeline, m_serviceUrl, protocolLayerOptions, context);
}
Azure::Response<Models::GetServicePropertiesResult> BlobServiceClient::GetProperties(
Azure::Response<Models::BlobServiceProperties> BlobServiceClient::GetProperties(
const GetServicePropertiesOptions& options,
const Azure::Core::Context& context) const
{
(void)options;
_detail::BlobRestClient::Service::GetServicePropertiesOptions protocolLayerOptions;
return _detail::BlobRestClient::Service::GetProperties(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_serviceUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::GetAccountInfoResult> BlobServiceClient::GetAccountInfo(
Azure::Response<Models::AccountInfo> BlobServiceClient::GetAccountInfo(
const GetAccountInfoOptions& options,
const Azure::Core::Context& context) const
{
(void)options;
_detail::BlobRestClient::Service::GetAccountInfoOptions protocolLayerOptions;
return _detail::BlobRestClient::Service::GetAccountInfo(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_serviceUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::GetServiceStatisticsResult> BlobServiceClient::GetStatistics(
Azure::Response<Models::ServiceStatistics> BlobServiceClient::GetStatistics(
const GetBlobServiceStatisticsOptions& options,
const Azure::Core::Context& context) const
{
(void)options;
_detail::BlobRestClient::Service::GetServiceStatisticsOptions protocolLayerOptions;
return _detail::BlobRestClient::Service::GetStatistics(
context, *m_pipeline, m_serviceUrl, protocolLayerOptions);
*m_pipeline, m_serviceUrl, protocolLayerOptions, context);
}
Azure::Response<Models::FindBlobsByTagsSinglePageResult>
@ -221,10 +221,10 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.ContinuationToken = options.ContinuationToken;
protocolLayerOptions.MaxResults = options.PageSizeHint;
return _detail::BlobRestClient::Service::FindBlobsByTagsSinglePage(
Storage::_detail::WithReplicaStatus(context),
*m_pipeline,
m_serviceUrl,
protocolLayerOptions);
protocolLayerOptions,
Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<BlobContainerClient> BlobServiceClient::CreateBlobContainer(
@ -262,7 +262,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.DeletedBlobContainerName = deletedBlobContainerName;
protocolLayerOptions.DeletedBlobContainerVersion = deletedBlobContainerVersion;
auto response = _detail::BlobRestClient::BlobContainer::Undelete(
context, *m_pipeline, Azure::Core::Url(blobContainerClient.GetUrl()), protocolLayerOptions);
*m_pipeline, Azure::Core::Url(blobContainerClient.GetUrl()), protocolLayerOptions, context);
return Azure::Response<BlobContainerClient>(
std::move(blobContainerClient), response.ExtractRawResponse());

View File

@ -102,7 +102,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::BlockBlob::Upload(
context, *m_pipeline, m_blobUrl, content, protocolLayerOptions);
*m_pipeline, m_blobUrl, content, protocolLayerOptions, context);
}
Azure::Response<Models::UploadBlockBlobFromResult> BlockBlobClient::UploadFrom(
@ -258,7 +258,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::BlockBlob::StageBlock(
context, *m_pipeline, m_blobUrl, content, protocolLayerOptions);
*m_pipeline, m_blobUrl, content, protocolLayerOptions, context);
}
Azure::Response<Models::StageBlockFromUriResult> BlockBlobClient::StageBlockFromUri(
@ -285,7 +285,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::BlockBlob::StageBlockFromUri(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::CommitBlockListResult> BlockBlobClient::CommitBlockList(
@ -316,7 +316,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::BlockBlob::CommitBlockList(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::GetBlockListResult> BlockBlobClient::GetBlockList(
@ -328,7 +328,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::BlockBlob::GetBlockList(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
}
}}} // namespace Azure::Storage::Blobs

View File

@ -101,7 +101,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::PageBlob::Create(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::CreatePageBlobResult> PageBlobClient::CreateIfNotExists(
@ -154,7 +154,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::PageBlob::UploadPages(
context, *m_pipeline, m_blobUrl, content, protocolLayerOptions);
*m_pipeline, m_blobUrl, content, protocolLayerOptions, context);
}
Azure::Response<Models::UploadPageBlobPagesFromUriResult> PageBlobClient::UploadPagesFromUri(
@ -184,7 +184,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::PageBlob::UploadPagesFromUri(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ClearPageBlobPagesResult> PageBlobClient::ClearPages(
@ -208,7 +208,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::PageBlob::ClearPages(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::ResizePageBlobResult> PageBlobClient::Resize(
@ -232,7 +232,7 @@ namespace Azure { namespace Storage { namespace Blobs {
}
protocolLayerOptions.EncryptionScope = m_encryptionScope;
return _detail::BlobRestClient::PageBlob::Resize(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
}
Azure::Response<Models::GetPageBlobPageRangesResult> PageBlobClient::GetPageRanges(
@ -248,7 +248,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::PageBlob::GetPageRanges(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::GetPageBlobPageRangesResult> PageBlobClient::GetPageRangesDiff(
@ -266,7 +266,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::PageBlob::GetPageRanges(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
}
Azure::Response<Models::GetPageBlobPageRangesResult> PageBlobClient::GetManagedDiskPageRangesDiff(
@ -284,7 +284,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch;
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
return _detail::BlobRestClient::PageBlob::GetPageRanges(
Storage::_detail::WithReplicaStatus(context), *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, Storage::_detail::WithReplicaStatus(context));
}
StartCopyBlobOperation PageBlobClient::StartCopyIncremental(
@ -301,7 +301,7 @@ namespace Azure { namespace Storage { namespace Blobs {
protocolLayerOptions.IfTags = options.AccessConditions.TagConditions;
auto response = _detail::BlobRestClient::PageBlob::StartCopyIncremental(
context, *m_pipeline, m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
StartCopyBlobOperation res;
res.m_rawResponse = response.ExtractRawResponse();
res.RequestId = std::move(response->RequestId);

View File

@ -54,7 +54,6 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_FALSE(blobContentInfo->EncryptionKeySha256.HasValue());
auto properties = *appendBlobClient.GetProperties();
EXPECT_FALSE(properties.RequestId.empty());
EXPECT_TRUE(properties.CommittedBlockCount.HasValue());
EXPECT_EQ(properties.CommittedBlockCount.GetValue(), 0);
EXPECT_EQ(properties.BlobSize, 0);

View File

@ -116,7 +116,6 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(IsValidTime(res->LastModified));
auto res2 = m_blobContainerClient->GetProperties();
EXPECT_FALSE(res2->RequestId.empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(_detail::HttpHeaderRequestId).empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(_detail::HttpHeaderDate).empty());
EXPECT_FALSE(res2.GetRawResponse().GetHeaders().at(_detail::HttpHeaderXMsVersion).empty());
@ -404,9 +403,6 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(IsValidTime(ret->LastModified));
auto ret2 = container_client.GetAccessPolicy();
EXPECT_FALSE(ret2->RequestId.empty());
EXPECT_EQ(ret2->ETag, ret->ETag);
EXPECT_EQ(ret2->LastModified, ret->LastModified);
EXPECT_EQ(ret2->AccessType, options.AccessType);
EXPECT_EQ(ret2->SignedIdentifiers, options.SignedIdentifiers);

View File

@ -52,7 +52,7 @@ namespace Azure { namespace Storage { namespace Test {
serviceUrl,
std::make_shared<Azure::Identity::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto userDelegationKey = blobServiceClient1.GetUserDelegationKey(sasExpiresOn)->Key;
auto userDelegationKey = *blobServiceClient1.GetUserDelegationKey(sasExpiresOn);
auto verify_blob_read = [&](const std::string& sas) {
EXPECT_NO_THROW(blobClient0.Create());

View File

@ -169,7 +169,6 @@ namespace Azure { namespace Storage { namespace Test {
TEST_F(BlobServiceClientTest, GetProperties)
{
auto ret = m_blobServiceClient.GetProperties();
EXPECT_FALSE(ret->RequestId.empty());
auto properties = *ret;
auto logging = properties.Logging;
EXPECT_FALSE(logging.Version.empty());
@ -322,7 +321,6 @@ namespace Azure { namespace Storage { namespace Test {
TEST_F(BlobServiceClientTest, AccountInfo)
{
auto accountInfo = *m_blobServiceClient.GetAccountInfo();
EXPECT_FALSE(accountInfo.RequestId.empty());
EXPECT_FALSE(accountInfo.SkuName.ToString().empty());
EXPECT_FALSE(accountInfo.AccountKind.ToString().empty());
EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled);
@ -342,7 +340,6 @@ namespace Azure { namespace Storage { namespace Test {
auto secondaryServiceClient
= Blobs::BlobServiceClient(InferSecondaryUrl(m_blobServiceClient.GetUrl()), keyCredential);
auto serviceStatistics = *secondaryServiceClient.GetStatistics();
EXPECT_FALSE(serviceStatistics.RequestId.empty());
EXPECT_FALSE(serviceStatistics.GeoReplication.Status.ToString().empty());
if (serviceStatistics.GeoReplication.LastSyncedOn.HasValue())
{
@ -432,11 +429,8 @@ namespace Azure { namespace Storage { namespace Test {
std::make_shared<Azure::Identity::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto getUserDelegationKeyResult = blobServiceClient1.GetUserDelegationKey(sasExpiresOn);
auto userDelegationKey = *blobServiceClient1.GetUserDelegationKey(sasExpiresOn);
EXPECT_FALSE(getUserDelegationKeyResult->RequestId.empty());
auto userDelegationKey = getUserDelegationKeyResult->Key;
EXPECT_FALSE(userDelegationKey.SignedObjectId.empty());
EXPECT_FALSE(userDelegationKey.SignedTenantId.empty());
EXPECT_TRUE(IsValidTime(userDelegationKey.SignedStartsOn));

View File

@ -372,7 +372,6 @@ namespace Azure { namespace Storage { namespace Test {
blockBlobClient.SetHttpHeaders(m_blobUploadOptions.HttpHeaders);
auto res = blockBlobClient.GetProperties();
EXPECT_FALSE(res->RequestId.empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(_detail::HttpHeaderRequestId).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(_detail::HttpHeaderDate).empty());
EXPECT_FALSE(res.GetRawResponse().GetHeaders().at(_detail::HttpHeaderXMsVersion).empty());

View File

@ -12,6 +12,10 @@
- DataLake client constructors won't automatically convert blob url to dfs url anymore.
- String conversion functions of extensible enums were renamed from `Get()` to `ToString()`.
- Moved `SecondaryHostForRetryReads` out of retry options, now it's under `DataLakeClientOptions`.
- Changed return type of `DataLakeServiceClient::GetUserDelegationKey` to `UserDelegationKey`.
- Changed return type of `DataLakeFileSystemClient::GetProperties` to `DataLakeFileSystemProperties`.
- Changed return type of `DataLakeFileSystemClient::GetAccessPolicy` to `DataLakeFileSystemAccessPolicy`.
- Changed return type of `DataLakePathClient::GetProperties` to `DataLakePathProperties`.
## 12.0.0-beta.8 (2021-02-12)

View File

@ -159,11 +159,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* @brief Gets the properties of file system.
* @param options Optional parameters to get the metadata of this file system.
* @param context Context for cancelling long running operations.
* @return Azure::Response<Models::GetDataLakeFileSystemPropertiesResult> containing the
* @return Azure::Response<Models::DataLakeFileSystemProperties> containing the
* information when getting the file system's properties.
* @remark This request is sent to blob endpoint.
*/
Azure::Response<Models::GetDataLakeFileSystemPropertiesResult> GetProperties(
Azure::Response<Models::DataLakeFileSystemProperties> GetProperties(
const GetDataLakeFileSystemPropertiesOptions& options
= GetDataLakeFileSystemPropertiesOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;
@ -189,10 +189,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
*
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return A GetDataLakeFileSystemAccessPolicyResult describing the container's access policy.
* @return A DataLakeFileSystemAccessPolicy describing the container's access policy.
* @remark This request is sent to blob endpoint.
*/
Azure::Response<Models::GetDataLakeFileSystemAccessPolicyResult> GetAccessPolicy(
Azure::Response<Models::DataLakeFileSystemAccessPolicy> GetAccessPolicy(
const GetDataLakeFileSystemAccessPolicyOptions& options
= GetDataLakeFileSystemAccessPolicyOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

View File

@ -186,11 +186,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* @param options Optional parameters to get the properties from the resource the path points
* to.
* @param context Context for cancelling long running operations.
* @return Azure::Response<Models::GetDataLakePathPropertiesResult> containing the
* @return Azure::Response<Models::DataLakePathProperties> containing the
* properties of the path.
* @remark This request is sent to blob endpoint.
*/
Azure::Response<Models::GetDataLakePathPropertiesResult> GetProperties(
Azure::Response<Models::DataLakePathProperties> GetProperties(
const GetDataLakePathPropertiesOptions& options = GetDataLakePathPropertiesOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const;

View File

@ -15,7 +15,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
// ServiceClient models:
using GetUserDelegationKeyResult = Blobs::Models::GetUserDelegationKeyResult;
using GetUserDelegationKeyResult = Blobs::Models::UserDelegationKey;
using UserDelegationKey = Blobs::Models::UserDelegationKey;
struct FileSystemItemDetails
@ -52,23 +52,19 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
using DataLakeSignedIdentifier = Blobs::Models::BlobSignedIdentifier;
using ListDataLakeFileSystemsIncludeFlags = Blobs::Models::ListBlobContainersIncludeFlags;
struct GetDataLakeFileSystemAccessPolicyResult
struct DataLakeFileSystemAccessPolicy
{
PublicAccessType AccessType = PublicAccessType::None;
Azure::ETag ETag;
Azure::DateTime LastModified;
std::vector<DataLakeSignedIdentifier> SignedIdentifiers;
std::string RequestId;
}; // struct GetDataLakeFileSystemAccessPolicyResult
}; // struct DataLakeFileSystemAccessPolciy
using SetDataLakeFileSystemAccessPolicyResult = Blobs::Models::SetBlobContainerAccessPolicyResult;
struct GetDataLakeFileSystemPropertiesResult
struct DataLakeFileSystemProperties
{
Azure::ETag ETag;
DateTime LastModified;
Storage::Metadata Metadata;
std::string RequestId;
};
struct CreateDataLakeFileSystemResult
@ -144,7 +140,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
static std::string SerializeAcls(const std::vector<Acl>& dataLakeAclsArray);
};
struct GetDataLakePathPropertiesResult
struct DataLakePathProperties
{
Azure::ETag ETag;
DateTime LastModified;
@ -174,7 +170,6 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { nam
Azure::Nullable<std::string> IncrementalCopyDestinationSnapshot;
Azure::Nullable<std::string> VersionId;
Azure::Nullable<bool> IsCurrentVersion;
std::string RequestId;
};
struct GetDataLakePathAccessControlListResult

View File

@ -98,11 +98,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* will be truncated to second.
* @param options Optional parameters to execute this function.
* @param context Context for cancelling long running operations.
* @return Azure::Response<Models::GetUserDelegationKeyResult> containing the user
* @return Azure::Response<Models::UserDelegationKey> containing the user
* delegation key related information.
* @remark This request is sent to blob endpoint.
*/
Azure::Response<Models::GetUserDelegationKeyResult> GetUserDelegationKey(
Azure::Response<Models::UserDelegationKey> GetUserDelegationKey(
const Azure::DateTime& expiresOn,
const GetUserDelegationKeyOptions& options = GetUserDelegationKeyOptions(),
const Azure::Core::Context& context = Azure::Core::Context()) const

View File

@ -397,7 +397,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
protocolLayerOptions.ExpiryTime = std::to_string(options.TimeToExpire.GetValue().count());
}
return Blobs::_detail::BlobRestClient::Blob::ScheduleDeletion(
context, *m_pipeline, m_blobClient.m_blobUrl, protocolLayerOptions);
*m_pipeline, m_blobClient.m_blobUrl, protocolLayerOptions, context);
}
}}}} // namespace Azure::Storage::Files::DataLake

View File

@ -245,20 +245,18 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
}
Azure::Response<Models::GetDataLakeFileSystemPropertiesResult>
DataLakeFileSystemClient::GetProperties(
Azure::Response<Models::DataLakeFileSystemProperties> DataLakeFileSystemClient::GetProperties(
const GetDataLakeFileSystemPropertiesOptions& options,
const Azure::Core::Context& context) const
{
Blobs::GetBlobContainerPropertiesOptions blobOptions;
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
auto result = m_blobContainerClient.GetProperties(blobOptions, context);
Models::GetDataLakeFileSystemPropertiesResult ret;
Models::DataLakeFileSystemProperties ret;
ret.ETag = std::move(result->ETag);
ret.LastModified = std::move(result->LastModified);
ret.Metadata = std::move(result->Metadata);
ret.RequestId = std::move(result->RequestId);
return Azure::Response<Models::GetDataLakeFileSystemPropertiesResult>(
return Azure::Response<Models::DataLakeFileSystemProperties>(
std::move(ret), result.ExtractRawResponse());
}
@ -301,37 +299,33 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
protocolLayerOptions);
}
Azure::Response<Models::GetDataLakeFileSystemAccessPolicyResult>
DataLakeFileSystemClient::GetAccessPolicy(
Azure::Response<Models::DataLakeFileSystemAccessPolicy> DataLakeFileSystemClient::GetAccessPolicy(
const GetDataLakeFileSystemAccessPolicyOptions& options,
const Azure::Core::Context& context) const
{
Blobs::GetBlobContainerAccessPolicyOptions blobOptions;
blobOptions.AccessConditions.LeaseId = options.AccessConditions.LeaseId;
auto result = m_blobContainerClient.GetAccessPolicy(blobOptions, context);
Models::GetDataLakeFileSystemAccessPolicyResult ret;
if (result->AccessType == Blobs::Models::PublicAccessType::BlobContainer)
auto response = m_blobContainerClient.GetAccessPolicy(blobOptions, context);
Models::DataLakeFileSystemAccessPolicy ret;
if (response->AccessType == Blobs::Models::PublicAccessType::BlobContainer)
{
ret.AccessType = Models::PublicAccessType::FileSystem;
}
else if (result->AccessType == Blobs::Models::PublicAccessType::Blob)
else if (response->AccessType == Blobs::Models::PublicAccessType::Blob)
{
ret.AccessType = Models::PublicAccessType::Path;
}
else if (result->AccessType == Blobs::Models::PublicAccessType::None)
else if (response->AccessType == Blobs::Models::PublicAccessType::None)
{
ret.AccessType = Models::PublicAccessType::None;
}
else
{
ret.AccessType = Models::PublicAccessType(result->AccessType.ToString());
ret.AccessType = Models::PublicAccessType(response->AccessType.ToString());
}
ret.ETag = std::move(result->ETag);
ret.LastModified = std::move(result->LastModified);
ret.SignedIdentifiers = std::move(result->SignedIdentifiers);
ret.RequestId = std::move(result->RequestId);
return Azure::Response<Models::GetDataLakeFileSystemAccessPolicyResult>(
std::move(ret), result.ExtractRawResponse());
ret.SignedIdentifiers = std::move(response->SignedIdentifiers);
return Azure::Response<Models::DataLakeFileSystemAccessPolicy>(
std::move(ret), response.ExtractRawResponse());
}
Azure::Response<Models::SetDataLakeFileSystemAccessPolicyResult>

View File

@ -334,7 +334,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
}
Azure::Response<Models::GetDataLakePathPropertiesResult> DataLakePathClient::GetProperties(
Azure::Response<Models::DataLakePathProperties> DataLakePathClient::GetProperties(
const GetDataLakePathPropertiesOptions& options,
const Azure::Core::Context& context) const
{
@ -345,7 +345,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, context);
Models::GetDataLakePathPropertiesResult ret;
Models::DataLakePathProperties ret;
ret.ETag = std::move(result->ETag);
ret.LastModified = std::move(result->LastModified);
ret.CreatedOn = std::move(result->CreatedOn);
@ -377,7 +377,6 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
ret.ExpiresOn = std::move(result->ExpiresOn);
ret.LastAccessedOn = std::move(result->LastAccessedOn);
ret.FileSize = result->BlobSize;
ret.RequestId = std::move(result->RequestId);
ret.ArchiveStatus = std::move(result->ArchiveStatus);
ret.RehydratePriority = std::move(result->RehydratePriority);
ret.CopyStatusDescription = std::move(result->CopyStatusDescription);
@ -386,7 +385,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
ret.VersionId = std::move(result->VersionId);
ret.IsCurrentVersion = std::move(result->IsCurrentVersion);
ret.IsDirectory = _detail::MetadataIncidatesIsDirectory(ret.Metadata);
return Azure::Response<Models::GetDataLakePathPropertiesResult>(
return Azure::Response<Models::DataLakePathProperties>(
std::move(ret), result.ExtractRawResponse());
}

View File

@ -392,8 +392,6 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_TRUE(IsValidTime(ret->LastModified));
auto ret2 = fileSystem.GetAccessPolicy();
EXPECT_EQ(ret2->ETag, ret->ETag);
EXPECT_EQ(ret2->LastModified, ret->LastModified);
EXPECT_EQ(ret2->AccessType, options.AccessType);
for (size_t i = 0; i < ret2->SignedIdentifiers.size(); ++i)
{

View File

@ -62,7 +62,7 @@ namespace Azure { namespace Storage { namespace Test {
serviceUrl,
std::make_shared<Azure::Identity::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto userDelegationKey = serviceClient1.GetUserDelegationKey(sasExpiresOn)->Key;
auto userDelegationKey = *serviceClient1.GetUserDelegationKey(sasExpiresOn);
auto verify_file_read = [&](const std::string& sas) {
EXPECT_NO_THROW(fileClient0.Create());