BlobBaseClient
The BlobBaseClient allows you to manipulate Azure Storage
blobs.
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.Storage.Blobs.Models;
using Azure.Storage.Common;
using Azure.Storage.Cryptography;
using Azure.Storage.Sas;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
namespace Azure.Storage.Blobs.Specialized
{
public class BlobBaseClient
{
private protected readonly Uri _uri;
internal readonly BlobClientConfiguration _clientConfiguration;
private readonly ClientSideEncryptionOptions _clientSideEncryption;
private string _snapshot;
private string _blobVersionId;
private string _accountName;
private string _containerName;
private string _name;
private readonly BlobRestClient _blobRestClient;
private BlobContainerClient _parentBlobContainerClient;
public virtual Uri Uri => _uri;
internal virtual BlobClientConfiguration ClientConfiguration => _clientConfiguration;
internal virtual ClientSideEncryptionOptions ClientSideEncryption => _clientSideEncryption;
internal virtual bool UsingClientSideEncryption => (object)ClientSideEncryption != null;
public virtual string AccountName {
get {
SetNameFieldsIfNull();
return _accountName;
}
}
public virtual string BlobContainerName {
get {
SetNameFieldsIfNull();
return _containerName;
}
}
public virtual string Name {
get {
SetNameFieldsIfNull();
return _name;
}
}
public virtual bool CanGenerateSasUri => (object)ClientConfiguration.SharedKeyCredential != null;
internal virtual BlobRestClient BlobRestClient => _blobRestClient;
protected BlobBaseClient()
{
}
public BlobBaseClient(string connectionString, string blobContainerName, string blobName)
: this(connectionString, blobContainerName, blobName, null)
{
}
public BlobBaseClient(string connectionString, string blobContainerName, string blobName, BlobClientOptions options)
{
Argument.AssertNotNull(blobContainerName, "blobContainerName");
Argument.AssertNotNull(blobName, "blobName");
if (options == null)
options = new BlobClientOptions(BlobClientOptions.ServiceVersion.V2025_01_05);
StorageConnectionString storageConnectionString = StorageConnectionString.Parse(connectionString);
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(storageConnectionString.BlobEndpoint) {
BlobContainerName = blobContainerName,
BlobName = blobName
};
_uri = blobUriBuilder.ToUri();
_clientConfiguration = new BlobClientConfiguration(options.Build(storageConnectionString.Credentials), storageConnectionString.Credentials as StorageSharedKeyCredential, new ClientDiagnostics(options, null), options.Version, options.CustomerProvidedKey, options.TransferValidation, options.EncryptionScope, options.TrimBlobNameSlashes);
ClientSideEncryptionOptions clientSideEncryptionOptions = options._clientSideEncryptionOptions;
_clientSideEncryption = ((clientSideEncryptionOptions != null) ? clientSideEncryptionOptions.Clone() : null);
_blobRestClient = BuildBlobRestClient(_uri);
BlobErrors.VerifyHttpsCustomerProvidedKey(_uri, _clientConfiguration.CustomerProvidedKey);
BlobErrors.VerifyCpkAndEncryptionScopeNotBothSet(_clientConfiguration.CustomerProvidedKey, _clientConfiguration.EncryptionScope);
}
public BlobBaseClient(Uri blobUri, BlobClientOptions options = null)
: this(blobUri, null, options, null, null, null)
{
}
public BlobBaseClient(Uri blobUri, StorageSharedKeyCredential credential, BlobClientOptions options = null)
: this(blobUri, credential.AsPolicy(), options, credential, null, null)
{
}
public BlobBaseClient(Uri blobUri, AzureSasCredential credential, BlobClientOptions options = null)
: this(blobUri, credential.AsPolicy<BlobUriBuilder>(blobUri), options, null, credential, null)
{
}
public BlobBaseClient(Uri blobUri, TokenCredential credential, BlobClientOptions options = null)
{
object value;
BlobAudience? audience;
BlobAudience blobAudience;
if (options == null)
value = null;
else {
audience = options.Audience;
if (!audience.HasValue)
value = null;
else {
blobAudience = audience.GetValueOrDefault();
value = blobAudience.ToString();
}
}
object scope;
if (!string.IsNullOrEmpty((string)value)) {
audience = options.Audience;
blobAudience = audience.Value;
scope = blobAudience.CreateDefaultScope();
} else {
blobAudience = BlobAudience.DefaultAudience;
scope = blobAudience.CreateDefaultScope();
}
this..ctor(blobUri, credential.AsPolicy((string)scope, options), options, null, null, credential);
Errors.VerifyHttpsTokenAuth(blobUri);
}
internal BlobBaseClient(Uri blobUri, HttpPipelinePolicy authentication, BlobClientOptions options, StorageSharedKeyCredential storageSharedKeyCredential, AzureSasCredential sasCredential, TokenCredential tokenCredential)
{
Argument.AssertNotNull(blobUri, "blobUri");
if (options == null)
options = new BlobClientOptions(BlobClientOptions.ServiceVersion.V2025_01_05);
_uri = blobUri;
if (!string.IsNullOrEmpty(blobUri.Query)) {
UriQueryParamsCollection uriQueryParamsCollection = new UriQueryParamsCollection(blobUri.Query);
if (uriQueryParamsCollection.ContainsKey("snapshot"))
_snapshot = HttpUtility.ParseQueryString(blobUri.Query).Get("snapshot");
if (uriQueryParamsCollection.ContainsKey("versionid"))
_blobVersionId = HttpUtility.ParseQueryString(blobUri.Query).Get("versionid");
}
_clientConfiguration = new BlobClientConfiguration(options.Build(authentication), storageSharedKeyCredential, tokenCredential, sasCredential, new ClientDiagnostics(options, null), options.Version, options.CustomerProvidedKey, options.TransferValidation, options.EncryptionScope, options.TrimBlobNameSlashes);
ClientSideEncryptionOptions clientSideEncryptionOptions = options._clientSideEncryptionOptions;
_clientSideEncryption = ((clientSideEncryptionOptions != null) ? clientSideEncryptionOptions.Clone() : null);
_blobRestClient = BuildBlobRestClient(blobUri);
BlobErrors.VerifyHttpsCustomerProvidedKey(_uri, _clientConfiguration.CustomerProvidedKey);
BlobErrors.VerifyCpkAndEncryptionScopeNotBothSet(_clientConfiguration.CustomerProvidedKey, _clientConfiguration.EncryptionScope);
}
internal BlobBaseClient(Uri blobUri, BlobClientConfiguration clientConfiguration, ClientSideEncryptionOptions clientSideEncryption)
{
_uri = blobUri;
if (!string.IsNullOrEmpty(blobUri.Query)) {
UriQueryParamsCollection uriQueryParamsCollection = new UriQueryParamsCollection(blobUri.Query);
if (uriQueryParamsCollection.ContainsKey("snapshot"))
_snapshot = HttpUtility.ParseQueryString(blobUri.Query).Get("snapshot");
if (uriQueryParamsCollection.ContainsKey("versionid"))
_blobVersionId = HttpUtility.ParseQueryString(blobUri.Query).Get("versionid");
}
_clientConfiguration = clientConfiguration;
_clientSideEncryption = ((clientSideEncryption != null) ? clientSideEncryption.Clone() : null);
_blobRestClient = BuildBlobRestClient(blobUri);
BlobErrors.VerifyHttpsCustomerProvidedKey(_uri, _clientConfiguration.CustomerProvidedKey);
BlobErrors.VerifyCpkAndEncryptionScopeNotBothSet(_clientConfiguration.CustomerProvidedKey, _clientConfiguration.EncryptionScope);
}
private BlobRestClient BuildBlobRestClient(Uri blobUri)
{
return new BlobRestClient(_clientConfiguration.ClientDiagnostics, _clientConfiguration.Pipeline, blobUri.AbsoluteUri, _clientConfiguration.Version.ToVersionString());
}
public virtual BlobBaseClient WithSnapshot(string snapshot)
{
return WithSnapshotCore(snapshot);
}
protected virtual BlobBaseClient WithSnapshotCore(string snapshot)
{
_snapshot = snapshot;
return new BlobBaseClient(new BlobUriBuilder(Uri) {
Snapshot = snapshot
}.ToUri(), ClientConfiguration, ClientSideEncryption);
}
public virtual BlobBaseClient WithVersion(string versionId)
{
return WithVersionCore(versionId);
}
private protected virtual BlobBaseClient WithVersionCore(string versionId)
{
_blobVersionId = versionId;
return new BlobBaseClient(new BlobUriBuilder(Uri) {
VersionId = versionId
}.ToUri(), ClientConfiguration, ClientSideEncryption);
}
public virtual BlobBaseClient WithCustomerProvidedKey(CustomerProvidedKey? customerProvidedKey)
{
return WithCustomerProvidedKeyCore(customerProvidedKey);
}
private protected virtual BlobBaseClient WithCustomerProvidedKeyCore(CustomerProvidedKey? customerProvidedKey)
{
BlobClientConfiguration blobClientConfiguration = BlobClientConfiguration.DeepCopy(ClientConfiguration);
blobClientConfiguration.CustomerProvidedKey = customerProvidedKey;
Uri uri = Uri;
BlobClientConfiguration clientConfiguration = blobClientConfiguration;
object clientSideEncryption = (object)ClientSideEncryption;
return new BlobBaseClient(uri, clientConfiguration, (clientSideEncryption != null) ? clientSideEncryption.Clone() : null);
}
public virtual BlobBaseClient WithEncryptionScope(string encryptionScope)
{
return WithEncryptionScopeCore(encryptionScope);
}
private protected virtual BlobBaseClient WithEncryptionScopeCore(string encryptionScope)
{
BlobClientConfiguration blobClientConfiguration = BlobClientConfiguration.DeepCopy(ClientConfiguration);
blobClientConfiguration.EncryptionScope = encryptionScope;
Uri uri = Uri;
BlobClientConfiguration clientConfiguration = blobClientConfiguration;
object clientSideEncryption = (object)ClientSideEncryption;
return new BlobBaseClient(uri, clientConfiguration, (clientSideEncryption != null) ? clientSideEncryption.Clone() : null);
}
protected internal virtual BlobLeaseClient GetBlobLeaseClientCore(string leaseId)
{
return new BlobLeaseClient(this, leaseId);
}
private void SetNameFieldsIfNull()
{
if (_name == null || _containerName == null || _accountName == null) {
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes);
_name = blobUriBuilder.BlobName;
_containerName = blobUriBuilder.BlobContainerName;
_accountName = blobUriBuilder.AccountName;
}
}
[AsyncStateMachine(typeof(<GetCopyAuthorizationHeaderAsync>d__47))]
protected static Task<HttpAuthorization> GetCopyAuthorizationHeaderAsync(BlobBaseClient client, CancellationToken cancellationToken = default(CancellationToken))
{
<GetCopyAuthorizationHeaderAsync>d__47 stateMachine = default(<GetCopyAuthorizationHeaderAsync>d__47);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<HttpAuthorization>.Create();
stateMachine.client = client;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadInfo> Download()
{
return Download(CancellationToken.None);
}
[AsyncStateMachine(typeof(<DownloadAsync>d__49))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadInfo>> DownloadAsync()
{
<DownloadAsync>d__49 stateMachine = default(<DownloadAsync>d__49);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadInfo> Download(CancellationToken cancellationToken = default(CancellationToken))
{
return Download(default(HttpRange), null, false, cancellationToken);
}
[AsyncStateMachine(typeof(<DownloadAsync>d__51))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadInfo>> DownloadAsync(CancellationToken cancellationToken)
{
<DownloadAsync>d__51 stateMachine = default(<DownloadAsync>d__51);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadInfo> Download(HttpRange range = default(HttpRange), BlobRequestConditions conditions = null, bool rangeGetContentHash = false, CancellationToken cancellationToken = default(CancellationToken))
{
return DownloadInternal(range, conditions, rangeGetContentHash, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadAsync>d__53))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadInfo>> DownloadAsync(HttpRange range = default(HttpRange), BlobRequestConditions conditions = null, bool rangeGetContentHash = false, CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadAsync>d__53 stateMachine = default(<DownloadAsync>d__53);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.rangeGetContentHash = rangeGetContentHash;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadInternal>d__54))]
private Task<Response<BlobDownloadInfo>> DownloadInternal(HttpRange range, BlobRequestConditions conditions, bool rangeGetContentHash, bool async, CancellationToken cancellationToken)
{
<DownloadInternal>d__54 stateMachine = default(<DownloadInternal>d__54);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.rangeGetContentHash = rangeGetContentHash;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadStreamingResult> DownloadStreaming(HttpRange range, BlobRequestConditions conditions, bool rangeGetContentHash, CancellationToken cancellationToken)
{
return DownloadStreaming(range, conditions, rangeGetContentHash, null, cancellationToken);
}
[AsyncStateMachine(typeof(<DownloadStreamingAsync>d__56))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadStreamingResult>> DownloadStreamingAsync(HttpRange range, BlobRequestConditions conditions, bool rangeGetContentHash, CancellationToken cancellationToken)
{
<DownloadStreamingAsync>d__56 stateMachine = default(<DownloadStreamingAsync>d__56);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadStreamingResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.rangeGetContentHash = rangeGetContentHash;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadStreamingResult> DownloadStreaming(HttpRange range, BlobRequestConditions conditions, bool rangeGetContentHash, IProgress<long> progressHandler, CancellationToken cancellationToken)
{
return DownloadStreamingDirect(range, conditions, rangeGetContentHash.ToValidationOptions(), progressHandler, "BlobBaseClient.DownloadStreaming", false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadStreamingAsync>d__58))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadStreamingResult>> DownloadStreamingAsync(HttpRange range, BlobRequestConditions conditions, bool rangeGetContentHash, IProgress<long> progressHandler, CancellationToken cancellationToken)
{
<DownloadStreamingAsync>d__58 stateMachine = default(<DownloadStreamingAsync>d__58);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadStreamingResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.rangeGetContentHash = rangeGetContentHash;
stateMachine.progressHandler = progressHandler;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobDownloadStreamingResult> DownloadStreaming(BlobDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
{
return DownloadStreamingDirect(options?.Range ?? default(HttpRange), options?.Conditions, options?.TransferValidation, options?.ProgressHandler, "BlobBaseClient.DownloadStreaming", false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadStreamingAsync>d__60))]
public virtual Task<Response<BlobDownloadStreamingResult>> DownloadStreamingAsync(BlobDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadStreamingAsync>d__60 stateMachine = default(<DownloadStreamingAsync>d__60);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadStreamingResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadStreamingDirect>d__61))]
private ValueTask<Response<BlobDownloadStreamingResult>> DownloadStreamingDirect(HttpRange range, BlobRequestConditions conditions, DownloadTransferValidationOptions transferValidationOverride, IProgress<long> progressHandler, string operationName, bool async, CancellationToken cancellationToken)
{
<DownloadStreamingDirect>d__61 stateMachine = default(<DownloadStreamingDirect>d__61);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder<Response<BlobDownloadStreamingResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.transferValidationOverride = transferValidationOverride;
stateMachine.progressHandler = progressHandler;
stateMachine.operationName = operationName;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadStreamingInternal>d__62))]
internal virtual ValueTask<Response<BlobDownloadStreamingResult>> DownloadStreamingInternal(HttpRange range, BlobRequestConditions conditions, DownloadTransferValidationOptions transferValidationOverride, IProgress<long> progressHandler, string operationName, bool async, CancellationToken cancellationToken)
{
<DownloadStreamingInternal>d__62 stateMachine = default(<DownloadStreamingInternal>d__62);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder<Response<BlobDownloadStreamingResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.transferValidationOverride = transferValidationOverride;
stateMachine.progressHandler = progressHandler;
stateMachine.operationName = operationName;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<StartDownloadAsync>d__63))]
private ValueTask<Response<BlobDownloadStreamingResult>> StartDownloadAsync(HttpRange range, BlobRequestConditions conditions, DownloadTransferValidationOptions validationOptions, long startOffset = 0, bool async = true, CancellationToken cancellationToken = default(CancellationToken))
{
<StartDownloadAsync>d__63 stateMachine = default(<StartDownloadAsync>d__63);
stateMachine.<>t__builder = AsyncValueTaskMethodBuilder<Response<BlobDownloadStreamingResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.range = range;
stateMachine.conditions = conditions;
stateMachine.validationOptions = validationOptions;
stateMachine.startOffset = startOffset;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobDownloadResult> DownloadContent()
{
return DownloadContent(CancellationToken.None);
}
[AsyncStateMachine(typeof(<DownloadContentAsync>d__65))]
public virtual Task<Response<BlobDownloadResult>> DownloadContentAsync()
{
<DownloadContentAsync>d__65 stateMachine = default(<DownloadContentAsync>d__65);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobDownloadResult> DownloadContent(CancellationToken cancellationToken = default(CancellationToken))
{
return DownloadContent((BlobRequestConditions)null, cancellationToken);
}
[AsyncStateMachine(typeof(<DownloadContentAsync>d__67))]
public virtual Task<Response<BlobDownloadResult>> DownloadContentAsync(CancellationToken cancellationToken)
{
<DownloadContentAsync>d__67 stateMachine = default(<DownloadContentAsync>d__67);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadResult> DownloadContent(BlobRequestConditions conditions, CancellationToken cancellationToken)
{
return DownloadContentInternal(conditions, null, default(HttpRange), null, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadContentAsync>d__69))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadResult>> DownloadContentAsync(BlobRequestConditions conditions, CancellationToken cancellationToken)
{
<DownloadContentAsync>d__69 stateMachine = default(<DownloadContentAsync>d__69);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<BlobDownloadResult> DownloadContent(BlobRequestConditions conditions, IProgress<long> progressHandler, HttpRange range, CancellationToken cancellationToken)
{
return DownloadContentInternal(conditions, progressHandler, range, null, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadContentAsync>d__71))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response<BlobDownloadResult>> DownloadContentAsync(BlobRequestConditions conditions, IProgress<long> progressHandler, HttpRange range, CancellationToken cancellationToken)
{
<DownloadContentAsync>d__71 stateMachine = default(<DownloadContentAsync>d__71);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.conditions = conditions;
stateMachine.progressHandler = progressHandler;
stateMachine.range = range;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobDownloadResult> DownloadContent(BlobDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
{
return DownloadContentInternal(options?.Conditions, options?.ProgressHandler, options?.Range ?? default(HttpRange), options?.TransferValidation, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadContentAsync>d__73))]
public virtual Task<Response<BlobDownloadResult>> DownloadContentAsync(BlobDownloadOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadContentAsync>d__73 stateMachine = default(<DownloadContentAsync>d__73);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadContentInternal>d__74))]
private Task<Response<BlobDownloadResult>> DownloadContentInternal(BlobRequestConditions conditions, IProgress<long> progressHandler, HttpRange range, DownloadTransferValidationOptions transferValidationOverride, bool async, CancellationToken cancellationToken)
{
<DownloadContentInternal>d__74 stateMachine = default(<DownloadContentInternal>d__74);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobDownloadResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.conditions = conditions;
stateMachine.progressHandler = progressHandler;
stateMachine.range = range;
stateMachine.transferValidationOverride = transferValidationOverride;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response DownloadTo(Stream destination)
{
return DownloadTo(destination, CancellationToken.None);
}
public virtual Response DownloadTo(string path)
{
return DownloadTo(path, CancellationToken.None);
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__77))]
public virtual Task<Response> DownloadToAsync(Stream destination)
{
<DownloadToAsync>d__77 stateMachine = default(<DownloadToAsync>d__77);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.destination = destination;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__78))]
public virtual Task<Response> DownloadToAsync(string path)
{
<DownloadToAsync>d__78 stateMachine = default(<DownloadToAsync>d__78);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.path = path;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response DownloadTo(Stream destination, CancellationToken cancellationToken)
{
return DownloadTo(destination, null, default(StorageTransferOptions), cancellationToken);
}
public virtual Response DownloadTo(string path, CancellationToken cancellationToken)
{
return DownloadTo(path, null, default(StorageTransferOptions), cancellationToken);
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__81))]
public virtual Task<Response> DownloadToAsync(Stream destination, CancellationToken cancellationToken)
{
<DownloadToAsync>d__81 stateMachine = default(<DownloadToAsync>d__81);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.destination = destination;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__82))]
public virtual Task<Response> DownloadToAsync(string path, CancellationToken cancellationToken)
{
<DownloadToAsync>d__82 stateMachine = default(<DownloadToAsync>d__82);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.path = path;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response DownloadTo(Stream destination, BlobDownloadToOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
return StagedDownloadAsync(destination, options?.Conditions, options?.ProgressHandler, options?.TransferOptions ?? default(StorageTransferOptions), options?.TransferValidation, false, cancellationToken).EnsureCompleted();
}
public virtual Response DownloadTo(string path, BlobDownloadToOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
using (Stream destination = File.Create(path))
return StagedDownloadAsync(destination, options?.Conditions, options?.ProgressHandler, options?.TransferOptions ?? default(StorageTransferOptions), options?.TransferValidation, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__85))]
public virtual Task<Response> DownloadToAsync(Stream destination, BlobDownloadToOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadToAsync>d__85 stateMachine = default(<DownloadToAsync>d__85);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.destination = destination;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__86))]
public virtual Task<Response> DownloadToAsync(string path, BlobDownloadToOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadToAsync>d__86 stateMachine = default(<DownloadToAsync>d__86);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.path = path;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response DownloadTo(Stream destination, BlobRequestConditions conditions = null, StorageTransferOptions transferOptions = default(StorageTransferOptions), CancellationToken cancellationToken = default(CancellationToken))
{
return StagedDownloadAsync(destination, conditions, null, transferOptions, null, false, cancellationToken).EnsureCompleted();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response DownloadTo(string path, BlobRequestConditions conditions = null, StorageTransferOptions transferOptions = default(StorageTransferOptions), CancellationToken cancellationToken = default(CancellationToken))
{
using (Stream destination = File.Create(path))
return StagedDownloadAsync(destination, conditions, null, transferOptions, null, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__89))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response> DownloadToAsync(Stream destination, BlobRequestConditions conditions = null, StorageTransferOptions transferOptions = default(StorageTransferOptions), CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadToAsync>d__89 stateMachine = default(<DownloadToAsync>d__89);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.destination = destination;
stateMachine.conditions = conditions;
stateMachine.transferOptions = transferOptions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DownloadToAsync>d__90))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Response> DownloadToAsync(string path, BlobRequestConditions conditions = null, StorageTransferOptions transferOptions = default(StorageTransferOptions), CancellationToken cancellationToken = default(CancellationToken))
{
<DownloadToAsync>d__90 stateMachine = default(<DownloadToAsync>d__90);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.path = path;
stateMachine.conditions = conditions;
stateMachine.transferOptions = transferOptions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<StagedDownloadAsync>d__91))]
internal Task<Response> StagedDownloadAsync(Stream destination, BlobRequestConditions conditions = null, IProgress<long> progressHandler = null, StorageTransferOptions transferOptions = default(StorageTransferOptions), DownloadTransferValidationOptions transferValidationOverride = null, bool async = true, CancellationToken cancellationToken = default(CancellationToken))
{
<StagedDownloadAsync>d__91 stateMachine = default(<StagedDownloadAsync>d__91);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.destination = destination;
stateMachine.conditions = conditions;
stateMachine.progressHandler = progressHandler;
stateMachine.transferOptions = transferOptions;
stateMachine.transferValidationOverride = transferValidationOverride;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Stream OpenRead(BlobOpenReadOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
return OpenReadInternal(options?.Position ?? 0, options?.BufferSize, options?.Conditions, options?.AllowModifications ?? false, options?.TransferValidation, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<OpenReadAsync>d__93))]
public virtual Task<Stream> OpenReadAsync(BlobOpenReadOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
<OpenReadAsync>d__93 stateMachine = default(<OpenReadAsync>d__93);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Stream>.Create();
stateMachine.<>4__this = this;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Stream OpenRead(long position = 0, int? bufferSize = default(int?), BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return OpenReadInternal(position, bufferSize, conditions, false, null, false, cancellationToken).EnsureCompleted();
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Stream OpenRead(bool allowBlobModifications, long position = 0, int? bufferSize = default(int?), CancellationToken cancellationToken = default(CancellationToken))
{
return OpenReadInternal(position, bufferSize, allowBlobModifications ? new BlobRequestConditions() : null, allowBlobModifications, null, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<OpenReadAsync>d__96))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Stream> OpenReadAsync(long position = 0, int? bufferSize = default(int?), BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<OpenReadAsync>d__96 stateMachine = default(<OpenReadAsync>d__96);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Stream>.Create();
stateMachine.<>4__this = this;
stateMachine.position = position;
stateMachine.bufferSize = bufferSize;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<OpenReadAsync>d__97))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<Stream> OpenReadAsync(bool allowBlobModifications, long position = 0, int? bufferSize = default(int?), CancellationToken cancellationToken = default(CancellationToken))
{
<OpenReadAsync>d__97 stateMachine = default(<OpenReadAsync>d__97);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Stream>.Create();
stateMachine.<>4__this = this;
stateMachine.allowBlobModifications = allowBlobModifications;
stateMachine.position = position;
stateMachine.bufferSize = bufferSize;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<OpenReadInternal>d__98))]
internal Task<Stream> OpenReadInternal(long position, int? bufferSize, BlobRequestConditions conditions, bool allowModifications, DownloadTransferValidationOptions transferValidationOverride, bool async, CancellationToken cancellationToken)
{
<OpenReadInternal>d__98 stateMachine = default(<OpenReadInternal>d__98);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Stream>.Create();
stateMachine.<>4__this = this;
stateMachine.position = position;
stateMachine.bufferSize = bufferSize;
stateMachine.conditions = conditions;
stateMachine.allowModifications = allowModifications;
stateMachine.transferValidationOverride = transferValidationOverride;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual CopyFromUriOperation StartCopyFromUri(Uri source, BlobCopyFromUriOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
Response<BlobCopyInfo> val = StartCopyFromUriInternal(source, options?.Metadata, options?.Tags, options?.AccessTier, options?.SourceConditions, options?.DestinationConditions, options?.RehydratePriority, options?.ShouldSealDestination, options?.DestinationImmutabilityPolicy, options?.LegalHold, false, cancellationToken).EnsureCompleted();
return new CopyFromUriOperation(this, val.get_Value().CopyId, val.GetRawResponse(), cancellationToken);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual CopyFromUriOperation StartCopyFromUri(Uri source, IDictionary<string, string> metadata = null, AccessTier? accessTier = default(AccessTier?), BlobRequestConditions sourceConditions = null, BlobRequestConditions destinationConditions = null, RehydratePriority? rehydratePriority = default(RehydratePriority?), CancellationToken cancellationToken = default(CancellationToken))
{
Response<BlobCopyInfo> val = StartCopyFromUriInternal(source, metadata, null, accessTier, sourceConditions, destinationConditions, rehydratePriority, null, null, null, false, cancellationToken).EnsureCompleted();
return new CopyFromUriOperation(this, val.get_Value().CopyId, val.GetRawResponse(), cancellationToken);
}
[AsyncStateMachine(typeof(<StartCopyFromUriAsync>d__101))]
public virtual Task<CopyFromUriOperation> StartCopyFromUriAsync(Uri source, BlobCopyFromUriOptions options, CancellationToken cancellationToken = default(CancellationToken))
{
<StartCopyFromUriAsync>d__101 stateMachine = default(<StartCopyFromUriAsync>d__101);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<CopyFromUriOperation>.Create();
stateMachine.<>4__this = this;
stateMachine.source = source;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<StartCopyFromUriAsync>d__102))]
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Task<CopyFromUriOperation> StartCopyFromUriAsync(Uri source, IDictionary<string, string> metadata = null, AccessTier? accessTier = default(AccessTier?), BlobRequestConditions sourceConditions = null, BlobRequestConditions destinationConditions = null, RehydratePriority? rehydratePriority = default(RehydratePriority?), CancellationToken cancellationToken = default(CancellationToken))
{
<StartCopyFromUriAsync>d__102 stateMachine = default(<StartCopyFromUriAsync>d__102);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<CopyFromUriOperation>.Create();
stateMachine.<>4__this = this;
stateMachine.source = source;
stateMachine.metadata = metadata;
stateMachine.accessTier = accessTier;
stateMachine.sourceConditions = sourceConditions;
stateMachine.destinationConditions = destinationConditions;
stateMachine.rehydratePriority = rehydratePriority;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<StartCopyFromUriInternal>d__103))]
private Task<Response<BlobCopyInfo>> StartCopyFromUriInternal(Uri source, IDictionary<string, string> metadata, IDictionary<string, string> tags, AccessTier? accessTier, BlobRequestConditions sourceConditions, BlobRequestConditions destinationConditions, RehydratePriority? rehydratePriority, bool? sealBlob, BlobImmutabilityPolicy destinationImmutabilityPolicy, bool? legalHold, bool async, CancellationToken cancellationToken)
{
<StartCopyFromUriInternal>d__103 stateMachine = default(<StartCopyFromUriInternal>d__103);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobCopyInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.source = source;
stateMachine.metadata = metadata;
stateMachine.tags = tags;
stateMachine.accessTier = accessTier;
stateMachine.sourceConditions = sourceConditions;
stateMachine.destinationConditions = destinationConditions;
stateMachine.rehydratePriority = rehydratePriority;
stateMachine.sealBlob = sealBlob;
stateMachine.destinationImmutabilityPolicy = destinationImmutabilityPolicy;
stateMachine.legalHold = legalHold;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response AbortCopyFromUri(string copyId, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return AbortCopyFromUriInternal(copyId, conditions, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<AbortCopyFromUriAsync>d__105))]
public virtual Task<Response> AbortCopyFromUriAsync(string copyId, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<AbortCopyFromUriAsync>d__105 stateMachine = default(<AbortCopyFromUriAsync>d__105);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.copyId = copyId;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<AbortCopyFromUriInternal>d__106))]
private Task<Response> AbortCopyFromUriInternal(string copyId, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<AbortCopyFromUriInternal>d__106 stateMachine = default(<AbortCopyFromUriInternal>d__106);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.copyId = copyId;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobCopyInfo> SyncCopyFromUri(Uri source, BlobCopyFromUriOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
{
return SyncCopyFromUriInternal(source, options?.Metadata, options?.Tags, options?.AccessTier, options?.SourceConditions, options?.DestinationConditions, options?.DestinationImmutabilityPolicy, options?.LegalHold, options?.SourceAuthentication, options?.CopySourceTagsMode, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SyncCopyFromUriAsync>d__108))]
public virtual Task<Response<BlobCopyInfo>> SyncCopyFromUriAsync(Uri source, BlobCopyFromUriOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
{
<SyncCopyFromUriAsync>d__108 stateMachine = default(<SyncCopyFromUriAsync>d__108);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobCopyInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.source = source;
stateMachine.options = options;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SyncCopyFromUriInternal>d__109))]
private Task<Response<BlobCopyInfo>> SyncCopyFromUriInternal(Uri source, IDictionary<string, string> metadata, IDictionary<string, string> tags, AccessTier? accessTier, BlobRequestConditions sourceConditions, BlobRequestConditions destinationConditions, BlobImmutabilityPolicy destinationImmutabilityPolicy, bool? legalHold, HttpAuthorization sourceAuthentication, BlobCopySourceTagsMode? copySourceTags, bool async, CancellationToken cancellationToken)
{
<SyncCopyFromUriInternal>d__109 stateMachine = default(<SyncCopyFromUriInternal>d__109);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobCopyInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.source = source;
stateMachine.metadata = metadata;
stateMachine.tags = tags;
stateMachine.accessTier = accessTier;
stateMachine.sourceConditions = sourceConditions;
stateMachine.destinationConditions = destinationConditions;
stateMachine.destinationImmutabilityPolicy = destinationImmutabilityPolicy;
stateMachine.legalHold = legalHold;
stateMachine.sourceAuthentication = sourceAuthentication;
stateMachine.copySourceTags = copySourceTags;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response Delete(DeleteSnapshotsOption snapshotsOption = DeleteSnapshotsOption.None, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return DeleteInternal(snapshotsOption, conditions, false, cancellationToken, null).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DeleteAsync>d__111))]
public virtual Task<Response> DeleteAsync(DeleteSnapshotsOption snapshotsOption = DeleteSnapshotsOption.None, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<DeleteAsync>d__111 stateMachine = default(<DeleteAsync>d__111);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.snapshotsOption = snapshotsOption;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<bool> DeleteIfExists(DeleteSnapshotsOption snapshotsOption = DeleteSnapshotsOption.None, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return DeleteIfExistsInternal(snapshotsOption, conditions ?? null, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DeleteIfExistsAsync>d__113))]
public virtual Task<Response<bool>> DeleteIfExistsAsync(DeleteSnapshotsOption snapshotsOption = DeleteSnapshotsOption.None, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<DeleteIfExistsAsync>d__113 stateMachine = default(<DeleteIfExistsAsync>d__113);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<bool>>.Create();
stateMachine.<>4__this = this;
stateMachine.snapshotsOption = snapshotsOption;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DeleteIfExistsInternal>d__114))]
internal Task<Response<bool>> DeleteIfExistsInternal(DeleteSnapshotsOption snapshotsOption, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<DeleteIfExistsInternal>d__114 stateMachine = default(<DeleteIfExistsInternal>d__114);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<bool>>.Create();
stateMachine.<>4__this = this;
stateMachine.snapshotsOption = snapshotsOption;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DeleteInternal>d__115))]
private Task<Response> DeleteInternal(DeleteSnapshotsOption snapshotsOption, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken, string operationName = null)
{
<DeleteInternal>d__115 stateMachine = default(<DeleteInternal>d__115);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.snapshotsOption = snapshotsOption;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.operationName = operationName;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<bool> Exists(CancellationToken cancellationToken = default(CancellationToken))
{
return ExistsInternal(false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<ExistsAsync>d__117))]
public virtual Task<Response<bool>> ExistsAsync(CancellationToken cancellationToken = default(CancellationToken))
{
<ExistsAsync>d__117 stateMachine = default(<ExistsAsync>d__117);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<bool>>.Create();
stateMachine.<>4__this = this;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<ExistsInternal>d__118))]
private Task<Response<bool>> ExistsInternal(bool async, CancellationToken cancellationToken)
{
<ExistsInternal>d__118 stateMachine = default(<ExistsInternal>d__118);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<bool>>.Create();
stateMachine.<>4__this = this;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response Undelete(CancellationToken cancellationToken = default(CancellationToken))
{
return UndeleteInternal(false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<UndeleteAsync>d__120))]
public virtual Task<Response> UndeleteAsync(CancellationToken cancellationToken = default(CancellationToken))
{
<UndeleteAsync>d__120 stateMachine = default(<UndeleteAsync>d__120);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<UndeleteInternal>d__121))]
private Task<Response> UndeleteInternal(bool async, CancellationToken cancellationToken)
{
<UndeleteInternal>d__121 stateMachine = default(<UndeleteInternal>d__121);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobProperties> GetProperties(BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
RequestContext val = new RequestContext();
val.set_CancellationToken(cancellationToken);
return GetPropertiesInternal(conditions, false, val, null).EnsureCompleted();
}
[AsyncStateMachine(typeof(<GetPropertiesAsync>d__123))]
public virtual Task<Response<BlobProperties>> GetPropertiesAsync(BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<GetPropertiesAsync>d__123 stateMachine = default(<GetPropertiesAsync>d__123);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobProperties>>.Create();
stateMachine.<>4__this = this;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<GetPropertiesInternal>d__124))]
internal Task<Response<BlobProperties>> GetPropertiesInternal(BlobRequestConditions conditions, bool async, RequestContext context, string operationName = null)
{
<GetPropertiesInternal>d__124 stateMachine = default(<GetPropertiesInternal>d__124);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobProperties>>.Create();
stateMachine.<>4__this = this;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.context = context;
stateMachine.operationName = operationName;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobInfo> SetHttpHeaders(BlobHttpHeaders httpHeaders = null, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return SetHttpHeadersInternal(httpHeaders, conditions, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SetHttpHeadersAsync>d__126))]
public virtual Task<Response<BlobInfo>> SetHttpHeadersAsync(BlobHttpHeaders httpHeaders = null, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<SetHttpHeadersAsync>d__126 stateMachine = default(<SetHttpHeadersAsync>d__126);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.httpHeaders = httpHeaders;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SetHttpHeadersInternal>d__127))]
private Task<Response<BlobInfo>> SetHttpHeadersInternal(BlobHttpHeaders httpHeaders, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<SetHttpHeadersInternal>d__127 stateMachine = default(<SetHttpHeadersInternal>d__127);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.httpHeaders = httpHeaders;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobInfo> SetMetadata(IDictionary<string, string> metadata, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return SetMetadataInternal(metadata, conditions, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SetMetadataAsync>d__129))]
public virtual Task<Response<BlobInfo>> SetMetadataAsync(IDictionary<string, string> metadata, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<SetMetadataAsync>d__129 stateMachine = default(<SetMetadataAsync>d__129);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.metadata = metadata;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SetMetadataInternal>d__130))]
internal Task<Response<BlobInfo>> SetMetadataInternal(IDictionary<string, string> metadata, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<SetMetadataInternal>d__130 stateMachine = default(<SetMetadataInternal>d__130);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.metadata = metadata;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobSnapshotInfo> CreateSnapshot(IDictionary<string, string> metadata = null, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return CreateSnapshotInternal(metadata, conditions, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<CreateSnapshotAsync>d__132))]
public virtual Task<Response<BlobSnapshotInfo>> CreateSnapshotAsync(IDictionary<string, string> metadata = null, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<CreateSnapshotAsync>d__132 stateMachine = default(<CreateSnapshotAsync>d__132);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobSnapshotInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.metadata = metadata;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<CreateSnapshotInternal>d__133))]
private Task<Response<BlobSnapshotInfo>> CreateSnapshotInternal(IDictionary<string, string> metadata, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<CreateSnapshotInternal>d__133 stateMachine = default(<CreateSnapshotInternal>d__133);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobSnapshotInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.metadata = metadata;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response SetAccessTier(AccessTier accessTier, BlobRequestConditions conditions = null, RehydratePriority? rehydratePriority = default(RehydratePriority?), CancellationToken cancellationToken = default(CancellationToken))
{
return SetAccessTierInternal(accessTier, conditions, rehydratePriority, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SetAccessTierAsync>d__135))]
public virtual Task<Response> SetAccessTierAsync(AccessTier accessTier, BlobRequestConditions conditions = null, RehydratePriority? rehydratePriority = default(RehydratePriority?), CancellationToken cancellationToken = default(CancellationToken))
{
<SetAccessTierAsync>d__135 stateMachine = default(<SetAccessTierAsync>d__135);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.accessTier = accessTier;
stateMachine.conditions = conditions;
stateMachine.rehydratePriority = rehydratePriority;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SetAccessTierInternal>d__136))]
private Task<Response> SetAccessTierInternal(AccessTier accessTier, BlobRequestConditions conditions, RehydratePriority? rehydratePriority, bool async, CancellationToken cancellationToken)
{
<SetAccessTierInternal>d__136 stateMachine = default(<SetAccessTierInternal>d__136);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.accessTier = accessTier;
stateMachine.conditions = conditions;
stateMachine.rehydratePriority = rehydratePriority;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<GetBlobTagResult> GetTags(BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetTagsInternal(false, conditions, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<GetTagsAsync>d__138))]
public virtual Task<Response<GetBlobTagResult>> GetTagsAsync(BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<GetTagsAsync>d__138 stateMachine = default(<GetTagsAsync>d__138);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<GetBlobTagResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<GetTagsInternal>d__139))]
private Task<Response<GetBlobTagResult>> GetTagsInternal(bool async, BlobRequestConditions conditions, CancellationToken cancellationToken)
{
<GetTagsInternal>d__139 stateMachine = default(<GetTagsInternal>d__139);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<GetBlobTagResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.async = async;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response SetTags(IDictionary<string, string> tags, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return SetTagsInternal(tags, conditions, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SetTagsAsync>d__141))]
public virtual Task<Response> SetTagsAsync(IDictionary<string, string> tags, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<SetTagsAsync>d__141 stateMachine = default(<SetTagsAsync>d__141);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.tags = tags;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SetTagsInternal>d__142))]
private Task<Response> SetTagsInternal(IDictionary<string, string> tags, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<SetTagsInternal>d__142 stateMachine = default(<SetTagsInternal>d__142);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.tags = tags;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobImmutabilityPolicy> SetImmutabilityPolicy(BlobImmutabilityPolicy immutabilityPolicy, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return SetImmutabilityPolicyInternal(immutabilityPolicy, conditions, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SetImmutabilityPolicyAsync>d__144))]
public virtual Task<Response<BlobImmutabilityPolicy>> SetImmutabilityPolicyAsync(BlobImmutabilityPolicy immutabilityPolicy, BlobRequestConditions conditions = null, CancellationToken cancellationToken = default(CancellationToken))
{
<SetImmutabilityPolicyAsync>d__144 stateMachine = default(<SetImmutabilityPolicyAsync>d__144);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobImmutabilityPolicy>>.Create();
stateMachine.<>4__this = this;
stateMachine.immutabilityPolicy = immutabilityPolicy;
stateMachine.conditions = conditions;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SetImmutabilityPolicyInternal>d__145))]
private Task<Response<BlobImmutabilityPolicy>> SetImmutabilityPolicyInternal(BlobImmutabilityPolicy immutabilityPolicy, BlobRequestConditions conditions, bool async, CancellationToken cancellationToken)
{
<SetImmutabilityPolicyInternal>d__145 stateMachine = default(<SetImmutabilityPolicyInternal>d__145);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobImmutabilityPolicy>>.Create();
stateMachine.<>4__this = this;
stateMachine.immutabilityPolicy = immutabilityPolicy;
stateMachine.conditions = conditions;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response DeleteImmutabilityPolicy(CancellationToken cancellationToken = default(CancellationToken))
{
return DeleteImmutabilityPolicyInternal(false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<DeleteImmutabilityPolicyAsync>d__147))]
public virtual Task<Response> DeleteImmutabilityPolicyAsync(CancellationToken cancellationToken = default(CancellationToken))
{
<DeleteImmutabilityPolicyAsync>d__147 stateMachine = default(<DeleteImmutabilityPolicyAsync>d__147);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<DeleteImmutabilityPolicyInternal>d__148))]
private Task<Response> DeleteImmutabilityPolicyInternal(bool async, CancellationToken cancellationToken)
{
<DeleteImmutabilityPolicyInternal>d__148 stateMachine = default(<DeleteImmutabilityPolicyInternal>d__148);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response>.Create();
stateMachine.<>4__this = this;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<BlobLegalHoldResult> SetLegalHold(bool hasLegalHold, CancellationToken cancellationToken = default(CancellationToken))
{
return SetLegalHoldInternal(hasLegalHold, false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<SetLegalHoldAsync>d__150))]
public virtual Task<Response<BlobLegalHoldResult>> SetLegalHoldAsync(bool hasLegalHold, CancellationToken cancellationToken = default(CancellationToken))
{
<SetLegalHoldAsync>d__150 stateMachine = default(<SetLegalHoldAsync>d__150);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobLegalHoldResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.hasLegalHold = hasLegalHold;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<SetLegalHoldInternal>d__151))]
private Task<Response<BlobLegalHoldResult>> SetLegalHoldInternal(bool hasLegalHold, bool async, CancellationToken cancellationToken)
{
<SetLegalHoldInternal>d__151 stateMachine = default(<SetLegalHoldInternal>d__151);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<BlobLegalHoldResult>>.Create();
stateMachine.<>4__this = this;
stateMachine.hasLegalHold = hasLegalHold;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
public virtual Response<AccountInfo> GetAccountInfo(CancellationToken cancellationToken = default(CancellationToken))
{
return GetAccountInfoInternal(false, cancellationToken).EnsureCompleted();
}
[AsyncStateMachine(typeof(<GetAccountInfoAsync>d__153))]
public virtual Task<Response<AccountInfo>> GetAccountInfoAsync(CancellationToken cancellationToken = default(CancellationToken))
{
<GetAccountInfoAsync>d__153 stateMachine = default(<GetAccountInfoAsync>d__153);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<AccountInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[AsyncStateMachine(typeof(<GetAccountInfoInternal>d__154))]
private Task<Response<AccountInfo>> GetAccountInfoInternal(bool async, CancellationToken cancellationToken)
{
<GetAccountInfoInternal>d__154 stateMachine = default(<GetAccountInfoInternal>d__154);
stateMachine.<>t__builder = AsyncTaskMethodBuilder<Response<AccountInfo>>.Create();
stateMachine.<>4__this = this;
stateMachine.async = async;
stateMachine.cancellationToken = cancellationToken;
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateSasUri(BlobSasPermissions permissions, DateTimeOffset expiresOn)
{
string stringToSign;
return GenerateSasUri(permissions, expiresOn, out stringToSign);
}
[EditorBrowsable(EditorBrowsableState.Never)]
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateSasUri(BlobSasPermissions permissions, DateTimeOffset expiresOn, out string stringToSign)
{
return GenerateSasUri(new BlobSasBuilder(permissions, expiresOn) {
BlobContainerName = BlobContainerName,
BlobName = Name,
Snapshot = _snapshot,
BlobVersionId = _blobVersionId,
EncryptionScope = _clientConfiguration.EncryptionScope
}, out stringToSign);
}
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateSasUri(BlobSasBuilder builder)
{
string stringToSign;
return GenerateSasUri(builder, out stringToSign);
}
[EditorBrowsable(EditorBrowsableState.Never)]
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateSasUri(BlobSasBuilder builder, out string stringToSign)
{
if (builder == null)
throw Errors.ArgumentNull("builder");
builder = BlobSasBuilder.DeepCopy(builder);
SetBuilderAndValidate(builder);
return new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes) {
Sas = builder.ToSasQueryParameters(ClientConfiguration.SharedKeyCredential, out stringToSign)
}.ToUri();
}
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateUserDelegationSasUri(BlobSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey)
{
string stringToSign;
return GenerateUserDelegationSasUri(permissions, expiresOn, userDelegationKey, out stringToSign);
}
[EditorBrowsable(EditorBrowsableState.Never)]
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateUserDelegationSasUri(BlobSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey, out string stringToSign)
{
return GenerateUserDelegationSasUri(new BlobSasBuilder(permissions, expiresOn) {
BlobContainerName = BlobContainerName,
BlobName = Name,
Snapshot = _snapshot,
BlobVersionId = _blobVersionId,
EncryptionScope = _clientConfiguration.EncryptionScope
}, userDelegationKey, out stringToSign);
}
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateUserDelegationSasUri(BlobSasBuilder builder, UserDelegationKey userDelegationKey)
{
string stringToSign;
return GenerateUserDelegationSasUri(builder, userDelegationKey, out stringToSign);
}
[EditorBrowsable(EditorBrowsableState.Never)]
[CallerShouldAudit("https://aka.ms/azsdk/callershouldaudit/storage-blobs")]
public virtual Uri GenerateUserDelegationSasUri(BlobSasBuilder builder, UserDelegationKey userDelegationKey, out string stringToSign)
{
BlobSasBuilder blobSasBuilder = builder;
if (blobSasBuilder == null)
throw Errors.ArgumentNull("builder");
builder = blobSasBuilder;
UserDelegationKey userDelegationKey2 = userDelegationKey;
if (userDelegationKey2 == null)
throw Errors.ArgumentNull("userDelegationKey");
userDelegationKey = userDelegationKey2;
builder = BlobSasBuilder.DeepCopy(builder);
SetBuilderAndValidate(builder);
if (string.IsNullOrEmpty(AccountName))
throw Errors.SasClientMissingData("AccountName");
return new BlobUriBuilder(Uri, ClientConfiguration.TrimBlobNameSlashes) {
Sas = builder.ToSasQueryParameters(userDelegationKey, AccountName, out stringToSign)
}.ToUri();
}
protected internal virtual BlobContainerClient GetParentBlobContainerClientCore()
{
if (_parentBlobContainerClient == null) {
BlobUriBuilder blobUriBuilder = new BlobUriBuilder(Uri) {
BlobName = null,
VersionId = null,
Snapshot = null
};
_parentBlobContainerClient = new BlobContainerClient(blobUriBuilder.ToUri(), ClientConfiguration, ClientSideEncryption);
}
return _parentBlobContainerClient;
}
private void SetBuilderAndValidate(BlobSasBuilder builder)
{
if (builder.BlobContainerName == null) {
string text = builder.BlobContainerName = BlobContainerName;
}
if (builder.BlobName == null) {
string text = builder.BlobName = Name;
}
if (builder.Snapshot == null) {
string text = builder.Snapshot = _snapshot;
}
if (builder.BlobVersionId == null) {
string text = builder.BlobVersionId = _blobVersionId;
}
if (builder.EncryptionScope == null) {
string text = builder.EncryptionScope = _clientConfiguration.EncryptionScope;
}
if (!builder.BlobContainerName.Equals(BlobContainerName, StringComparison.InvariantCulture))
throw Errors.SasNamesNotMatching("BlobContainerName", "BlobSasBuilder", "BlobContainerName");
if (!builder.BlobName.Equals(Name, StringComparison.InvariantCulture))
throw Errors.SasNamesNotMatching("BlobName", "BlobSasBuilder", "Name");
if (string.Compare(_snapshot, builder.Snapshot, StringComparison.InvariantCulture) != 0)
throw Errors.SasNamesNotMatching("Snapshot", "BlobSasBuilder");
if (string.Compare(_blobVersionId, builder.BlobVersionId, StringComparison.InvariantCulture) != 0)
throw Errors.SasNamesNotMatching("BlobVersionId", "BlobSasBuilder");
}
}
}