<PackageReference Include="Azure.Storage.Blobs" Version="12.24.1" />

PageBlobRestClient

using Azure.Core; using Azure.Core.Pipeline; using Azure.Storage.Blobs.Models; using System; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; namespace Azure.Storage.Blobs { internal class PageBlobRestClient { private readonly HttpPipeline _pipeline; private readonly string _url; private readonly string _version; internal ClientDiagnostics ClientDiagnostics { get; } public PageBlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { if (clientDiagnostics == null) throw new ArgumentNullException("clientDiagnostics"); ClientDiagnostics = clientDiagnostics; if (pipeline == null) throw new ArgumentNullException("pipeline"); _pipeline = pipeline; if (url == null) throw new ArgumentNullException("url"); _url = url; if (version == null) throw new ArgumentNullException("version"); _version = version; } internal HttpMessage CreateCreateRequest(long contentLength, long blobContentLength, int? timeout, PremiumPageBlobAccessTier? tier, string blobContentType, string blobContentEncoding, string blobContentLanguage, byte[] blobContentMD5, string blobCacheControl, IDictionary<string, string> metadata, string leaseId, string blobContentDisposition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, long? blobSequenceNumber, string blobTagsString, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode, bool? legalHold) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-blob-type", "PageBlob"); if (tier.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-access-tier", tier.Value.ToString()); } if (blobContentType != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-type", blobContentType); } if (blobContentEncoding != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-encoding", blobContentEncoding); } if (blobContentLanguage != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-language", blobContentLanguage); } if (blobContentMD5 != null) val2.get_Headers().Add("x-ms-blob-content-md5", blobContentMD5, "D"); if (blobCacheControl != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-cache-control", blobCacheControl); } if (metadata != null) val2.get_Headers().Add("x-ms-meta-", metadata); if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (blobContentDisposition != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-disposition", blobContentDisposition); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } val2.get_Headers().Add("x-ms-blob-content-length", blobContentLength); if (blobSequenceNumber.HasValue) val2.get_Headers().Add("x-ms-blob-sequence-number", blobSequenceNumber.Value); headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (blobTagsString != null) { headers = val2.get_Headers(); headers.Add("x-ms-tags", blobTagsString); } if (immutabilityPolicyExpiry.HasValue) val2.get_Headers().Add("x-ms-immutability-policy-until-date", immutabilityPolicyExpiry.Value, "R"); if (immutabilityPolicyMode.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-immutability-policy-mode", immutabilityPolicyMode.Value.ToSerialString()); } if (legalHold.HasValue) val2.get_Headers().Add("x-ms-legal-hold", legalHold.Value); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<CreateAsync>d__8))] public Task<ResponseWithHeaders<PageBlobCreateHeaders>> CreateAsync(long contentLength, long blobContentLength, int? timeout = default(int?), PremiumPageBlobAccessTier? tier = default(PremiumPageBlobAccessTier?), string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, long? blobSequenceNumber = default(long?), string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = default(DateTimeOffset?), BlobImmutabilityPolicyMode? immutabilityPolicyMode = default(BlobImmutabilityPolicyMode?), bool? legalHold = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { <CreateAsync>d__8 stateMachine = default(<CreateAsync>d__8); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobCreateHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.contentLength = contentLength; stateMachine.blobContentLength = blobContentLength; stateMachine.timeout = timeout; stateMachine.tier = tier; stateMachine.blobContentType = blobContentType; stateMachine.blobContentEncoding = blobContentEncoding; stateMachine.blobContentLanguage = blobContentLanguage; stateMachine.blobContentMD5 = blobContentMD5; stateMachine.blobCacheControl = blobCacheControl; stateMachine.metadata = metadata; stateMachine.leaseId = leaseId; stateMachine.blobContentDisposition = blobContentDisposition; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.blobSequenceNumber = blobSequenceNumber; stateMachine.blobTagsString = blobTagsString; stateMachine.immutabilityPolicyExpiry = immutabilityPolicyExpiry; stateMachine.immutabilityPolicyMode = immutabilityPolicyMode; stateMachine.legalHold = legalHold; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobCreateHeaders> Create(long contentLength, long blobContentLength, int? timeout = default(int?), PremiumPageBlobAccessTier? tier = default(PremiumPageBlobAccessTier?), string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, long? blobSequenceNumber = default(long?), string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = default(DateTimeOffset?), BlobImmutabilityPolicyMode? immutabilityPolicyMode = default(BlobImmutabilityPolicyMode?), bool? legalHold = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateCreateRequest(contentLength, blobContentLength, timeout, tier, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold); try { _pipeline.Send(val, cancellationToken); PageBlobCreateHeaders headers = new PageBlobCreateHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } internal HttpMessage CreateUploadPagesRequest(long contentLength, Stream body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, int? timeout, string range, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, long? ifSequenceNumberLessThanOrEqualTo, long? ifSequenceNumberLessThan, long? ifSequenceNumberEqualTo, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string structuredBodyType, long? structuredContentLength) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "page", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-page-write", "update"); if (transactionalContentCrc64 != null) val2.get_Headers().Add("x-ms-content-crc64", transactionalContentCrc64, "D"); if (range != null) { headers = val2.get_Headers(); headers.Add("x-ms-range", range); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (ifSequenceNumberLessThanOrEqualTo.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-le", ifSequenceNumberLessThanOrEqualTo.Value); if (ifSequenceNumberLessThan.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-lt", ifSequenceNumberLessThan.Value); if (ifSequenceNumberEqualTo.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-eq", ifSequenceNumberEqualTo.Value); if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (structuredBodyType != null) { headers = val2.get_Headers(); headers.Add("x-ms-structured-body", structuredBodyType); } if (structuredContentLength.HasValue) val2.get_Headers().Add("x-ms-structured-content-length", structuredContentLength.Value); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); val2.get_Headers().Add("Content-Length", contentLength); if (transactionalContentMD5 != null) val2.get_Headers().Add("Content-MD5", transactionalContentMD5, "D"); headers = val2.get_Headers(); headers.Add("Content-Type", "application/octet-stream"); val2.set_Content(RequestContent.Create(body)); return val; } [AsyncStateMachine(typeof(<UploadPagesAsync>d__11))] public Task<ResponseWithHeaders<PageBlobUploadPagesHeaders>> UploadPagesAsync(long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = default(int?), string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = default(long?), long? ifSequenceNumberLessThan = default(long?), long? ifSequenceNumberEqualTo = default(long?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string structuredBodyType = null, long? structuredContentLength = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { <UploadPagesAsync>d__11 stateMachine = default(<UploadPagesAsync>d__11); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobUploadPagesHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.contentLength = contentLength; stateMachine.body = body; stateMachine.transactionalContentMD5 = transactionalContentMD5; stateMachine.transactionalContentCrc64 = transactionalContentCrc64; stateMachine.timeout = timeout; stateMachine.range = range; stateMachine.leaseId = leaseId; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.ifSequenceNumberLessThanOrEqualTo = ifSequenceNumberLessThanOrEqualTo; stateMachine.ifSequenceNumberLessThan = ifSequenceNumberLessThan; stateMachine.ifSequenceNumberEqualTo = ifSequenceNumberEqualTo; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.structuredBodyType = structuredBodyType; stateMachine.structuredContentLength = structuredContentLength; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobUploadPagesHeaders> UploadPages(long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = default(int?), string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = default(long?), long? ifSequenceNumberLessThan = default(long?), long? ifSequenceNumberEqualTo = default(long?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string structuredBodyType = null, long? structuredContentLength = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { if (body != null) { HttpMessage val = CreateUploadPagesRequest(contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, structuredBodyType, structuredContentLength); try { _pipeline.Send(val, cancellationToken); PageBlobUploadPagesHeaders headers = new PageBlobUploadPagesHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("body"); } internal HttpMessage CreateClearPagesRequest(long contentLength, int? timeout, string range, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, long? ifSequenceNumberLessThanOrEqualTo, long? ifSequenceNumberLessThan, long? ifSequenceNumberEqualTo, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "page", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-page-write", "clear"); if (range != null) { headers = val2.get_Headers(); headers.Add("x-ms-range", range); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (ifSequenceNumberLessThanOrEqualTo.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-le", ifSequenceNumberLessThanOrEqualTo.Value); if (ifSequenceNumberLessThan.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-lt", ifSequenceNumberLessThan.Value); if (ifSequenceNumberEqualTo.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-eq", ifSequenceNumberEqualTo.Value); if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<ClearPagesAsync>d__14))] public Task<ResponseWithHeaders<PageBlobClearPagesHeaders>> ClearPagesAsync(long contentLength, int? timeout = default(int?), string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = default(long?), long? ifSequenceNumberLessThan = default(long?), long? ifSequenceNumberEqualTo = default(long?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { <ClearPagesAsync>d__14 stateMachine = default(<ClearPagesAsync>d__14); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobClearPagesHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.contentLength = contentLength; stateMachine.timeout = timeout; stateMachine.range = range; stateMachine.leaseId = leaseId; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.ifSequenceNumberLessThanOrEqualTo = ifSequenceNumberLessThanOrEqualTo; stateMachine.ifSequenceNumberLessThan = ifSequenceNumberLessThan; stateMachine.ifSequenceNumberEqualTo = ifSequenceNumberEqualTo; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobClearPagesHeaders> ClearPages(long contentLength, int? timeout = default(int?), string range = null, string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, long? ifSequenceNumberLessThanOrEqualTo = default(long?), long? ifSequenceNumberLessThan = default(long?), long? ifSequenceNumberEqualTo = default(long?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateClearPagesRequest(contentLength, timeout, range, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); try { _pipeline.Send(val, cancellationToken); PageBlobClearPagesHeaders headers = new PageBlobClearPagesHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } internal HttpMessage CreateUploadPagesFromURLRequest(string sourceUrl, string sourceRange, long contentLength, string range, byte[] sourceContentMD5, byte[] sourceContentcrc64, int? timeout, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, string leaseId, long? ifSequenceNumberLessThanOrEqualTo, long? ifSequenceNumberLessThan, long? ifSequenceNumberEqualTo, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, DateTimeOffset? sourceIfModifiedSince, DateTimeOffset? sourceIfUnmodifiedSince, string sourceIfMatch, string sourceIfNoneMatch, string copySourceAuthorization) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "page", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-page-write", "update"); headers = val2.get_Headers(); headers.Add("x-ms-copy-source", sourceUrl); headers = val2.get_Headers(); headers.Add("x-ms-source-range", sourceRange); if (sourceContentMD5 != null) val2.get_Headers().Add("x-ms-source-content-md5", sourceContentMD5, "D"); if (sourceContentcrc64 != null) val2.get_Headers().Add("x-ms-source-content-crc64", sourceContentcrc64, "D"); headers = val2.get_Headers(); headers.Add("x-ms-range", range); if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifSequenceNumberLessThanOrEqualTo.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-le", ifSequenceNumberLessThanOrEqualTo.Value); if (ifSequenceNumberLessThan.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-lt", ifSequenceNumberLessThan.Value); if (ifSequenceNumberEqualTo.HasValue) val2.get_Headers().Add("x-ms-if-sequence-number-eq", ifSequenceNumberEqualTo.Value); if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } if (sourceIfModifiedSince.HasValue) val2.get_Headers().Add("x-ms-source-if-modified-since", sourceIfModifiedSince.Value, "R"); if (sourceIfUnmodifiedSince.HasValue) val2.get_Headers().Add("x-ms-source-if-unmodified-since", sourceIfUnmodifiedSince.Value, "R"); if (sourceIfMatch != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-match", sourceIfMatch); } if (sourceIfNoneMatch != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-none-match", sourceIfNoneMatch); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (copySourceAuthorization != null) { headers = val2.get_Headers(); headers.Add("x-ms-copy-source-authorization", copySourceAuthorization); } headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<UploadPagesFromURLAsync>d__17))] public Task<ResponseWithHeaders<PageBlobUploadPagesFromURLHeaders>> UploadPagesFromURLAsync(string sourceUrl, string sourceRange, long contentLength, string range, byte[] sourceContentMD5 = null, byte[] sourceContentcrc64 = null, int? timeout = default(int?), string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, string leaseId = null, long? ifSequenceNumberLessThanOrEqualTo = default(long?), long? ifSequenceNumberLessThan = default(long?), long? ifSequenceNumberEqualTo = default(long?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, DateTimeOffset? sourceIfModifiedSince = default(DateTimeOffset?), DateTimeOffset? sourceIfUnmodifiedSince = default(DateTimeOffset?), string sourceIfMatch = null, string sourceIfNoneMatch = null, string copySourceAuthorization = null, CancellationToken cancellationToken = default(CancellationToken)) { <UploadPagesFromURLAsync>d__17 stateMachine = default(<UploadPagesFromURLAsync>d__17); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobUploadPagesFromURLHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.sourceUrl = sourceUrl; stateMachine.sourceRange = sourceRange; stateMachine.contentLength = contentLength; stateMachine.range = range; stateMachine.sourceContentMD5 = sourceContentMD5; stateMachine.sourceContentcrc64 = sourceContentcrc64; stateMachine.timeout = timeout; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.leaseId = leaseId; stateMachine.ifSequenceNumberLessThanOrEqualTo = ifSequenceNumberLessThanOrEqualTo; stateMachine.ifSequenceNumberLessThan = ifSequenceNumberLessThan; stateMachine.ifSequenceNumberEqualTo = ifSequenceNumberEqualTo; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.sourceIfModifiedSince = sourceIfModifiedSince; stateMachine.sourceIfUnmodifiedSince = sourceIfUnmodifiedSince; stateMachine.sourceIfMatch = sourceIfMatch; stateMachine.sourceIfNoneMatch = sourceIfNoneMatch; stateMachine.copySourceAuthorization = copySourceAuthorization; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobUploadPagesFromURLHeaders> UploadPagesFromURL(string sourceUrl, string sourceRange, long contentLength, string range, byte[] sourceContentMD5 = null, byte[] sourceContentcrc64 = null, int? timeout = default(int?), string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, string leaseId = null, long? ifSequenceNumberLessThanOrEqualTo = default(long?), long? ifSequenceNumberLessThan = default(long?), long? ifSequenceNumberEqualTo = default(long?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, DateTimeOffset? sourceIfModifiedSince = default(DateTimeOffset?), DateTimeOffset? sourceIfUnmodifiedSince = default(DateTimeOffset?), string sourceIfMatch = null, string sourceIfNoneMatch = null, string copySourceAuthorization = null, CancellationToken cancellationToken = default(CancellationToken)) { if (sourceUrl == null) throw new ArgumentNullException("sourceUrl"); if (sourceRange == null) throw new ArgumentNullException("sourceRange"); if (range != null) { HttpMessage val = CreateUploadPagesFromURLRequest(sourceUrl, sourceRange, contentLength, range, sourceContentMD5, sourceContentcrc64, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, copySourceAuthorization); try { _pipeline.Send(val, cancellationToken); PageBlobUploadPagesFromURLHeaders headers = new PageBlobUploadPagesFromURLHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("range"); } internal HttpMessage CreateGetPageRangesRequest(string snapshot, int? timeout, string range, string leaseId, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string marker, int? maxresults) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Get()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "pagelist", true); if (snapshot != null) rawRequestUriBuilder.AppendQuery("snapshot", snapshot, true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); if (marker != null) rawRequestUriBuilder.AppendQuery("marker", marker, true); if (maxresults.HasValue) rawRequestUriBuilder.AppendQuery("maxresults", maxresults.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (range != null) { headers = val2.get_Headers(); headers.Add("x-ms-range", range); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<GetPageRangesAsync>d__20))] public Task<ResponseWithHeaders<PageList, PageBlobGetPageRangesHeaders>> GetPageRangesAsync(string snapshot = null, int? timeout = default(int?), string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { <GetPageRangesAsync>d__20 stateMachine = default(<GetPageRangesAsync>d__20); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageList, PageBlobGetPageRangesHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.snapshot = snapshot; stateMachine.timeout = timeout; stateMachine.range = range; stateMachine.leaseId = leaseId; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.marker = marker; stateMachine.maxresults = maxresults; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageList, PageBlobGetPageRangesHeaders> GetPageRanges(string snapshot = null, int? timeout = default(int?), string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateGetPageRangesRequest(snapshot, timeout, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, marker, maxresults); try { _pipeline.Send(val, cancellationToken); PageBlobGetPageRangesHeaders headers = new PageBlobGetPageRangesHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); PageList value = null; XElement xElement = XDocument.Load(val.get_Response().get_ContentStream(), LoadOptions.PreserveWhitespace).Element("PageList"); if (xElement != null) value = PageList.DeserializePageList(xElement); return ResponseWithHeaders.FromValue(value, headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } internal HttpMessage CreateGetPageRangesDiffRequest(string snapshot, int? timeout, string prevsnapshot, string prevSnapshotUrl, string range, string leaseId, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string marker, int? maxresults) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Get()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "pagelist", true); if (snapshot != null) rawRequestUriBuilder.AppendQuery("snapshot", snapshot, true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); if (prevsnapshot != null) rawRequestUriBuilder.AppendQuery("prevsnapshot", prevsnapshot, true); if (marker != null) rawRequestUriBuilder.AppendQuery("marker", marker, true); if (maxresults.HasValue) rawRequestUriBuilder.AppendQuery("maxresults", maxresults.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (prevSnapshotUrl != null) { headers = val2.get_Headers(); headers.Add("x-ms-previous-snapshot-url", prevSnapshotUrl); } if (range != null) { headers = val2.get_Headers(); headers.Add("x-ms-range", range); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<GetPageRangesDiffAsync>d__23))] public Task<ResponseWithHeaders<PageList, PageBlobGetPageRangesDiffHeaders>> GetPageRangesDiffAsync(string snapshot = null, int? timeout = default(int?), string prevsnapshot = null, string prevSnapshotUrl = null, string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { <GetPageRangesDiffAsync>d__23 stateMachine = default(<GetPageRangesDiffAsync>d__23); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageList, PageBlobGetPageRangesDiffHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.snapshot = snapshot; stateMachine.timeout = timeout; stateMachine.prevsnapshot = prevsnapshot; stateMachine.prevSnapshotUrl = prevSnapshotUrl; stateMachine.range = range; stateMachine.leaseId = leaseId; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.marker = marker; stateMachine.maxresults = maxresults; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageList, PageBlobGetPageRangesDiffHeaders> GetPageRangesDiff(string snapshot = null, int? timeout = default(int?), string prevsnapshot = null, string prevSnapshotUrl = null, string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateGetPageRangesDiffRequest(snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, marker, maxresults); try { _pipeline.Send(val, cancellationToken); PageBlobGetPageRangesDiffHeaders headers = new PageBlobGetPageRangesDiffHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); PageList value = null; XElement xElement = XDocument.Load(val.get_Response().get_ContentStream(), LoadOptions.PreserveWhitespace).Element("PageList"); if (xElement != null) value = PageList.DeserializePageList(xElement); return ResponseWithHeaders.FromValue(value, headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } internal HttpMessage CreateResizeRequest(long blobContentLength, int? timeout, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "properties", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } val2.get_Headers().Add("x-ms-blob-content-length", blobContentLength); headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<ResizeAsync>d__26))] public Task<ResponseWithHeaders<PageBlobResizeHeaders>> ResizeAsync(long blobContentLength, int? timeout = default(int?), string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { <ResizeAsync>d__26 stateMachine = default(<ResizeAsync>d__26); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobResizeHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.blobContentLength = blobContentLength; stateMachine.timeout = timeout; stateMachine.leaseId = leaseId; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobResizeHeaders> Resize(long blobContentLength, int? timeout = default(int?), string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateResizeRequest(blobContentLength, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); try { _pipeline.Send(val, cancellationToken); PageBlobResizeHeaders headers = new PageBlobResizeHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } internal HttpMessage CreateUpdateSequenceNumberRequest(SequenceNumberAction sequenceNumberAction, int? timeout, string leaseId, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, long? blobSequenceNumber) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "properties", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-sequence-number-action", sequenceNumberAction.ToSerialString()); if (blobSequenceNumber.HasValue) val2.get_Headers().Add("x-ms-blob-sequence-number", blobSequenceNumber.Value); headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<UpdateSequenceNumberAsync>d__29))] public Task<ResponseWithHeaders<PageBlobUpdateSequenceNumberHeaders>> UpdateSequenceNumberAsync(SequenceNumberAction sequenceNumberAction, int? timeout = default(int?), string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, long? blobSequenceNumber = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { <UpdateSequenceNumberAsync>d__29 stateMachine = default(<UpdateSequenceNumberAsync>d__29); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobUpdateSequenceNumberHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.sequenceNumberAction = sequenceNumberAction; stateMachine.timeout = timeout; stateMachine.leaseId = leaseId; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.blobSequenceNumber = blobSequenceNumber; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobUpdateSequenceNumberHeaders> UpdateSequenceNumber(SequenceNumberAction sequenceNumberAction, int? timeout = default(int?), string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, long? blobSequenceNumber = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateUpdateSequenceNumberRequest(sequenceNumberAction, timeout, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobSequenceNumber); try { _pipeline.Send(val, cancellationToken); PageBlobUpdateSequenceNumberHeaders headers = new PageBlobUpdateSequenceNumberHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } internal HttpMessage CreateCopyIncrementalRequest(string copySource, int? timeout, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "incrementalcopy", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); RequestHeaders headers; if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-copy-source", copySource); headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<CopyIncrementalAsync>d__32))] public Task<ResponseWithHeaders<PageBlobCopyIncrementalHeaders>> CopyIncrementalAsync(string copySource, int? timeout = default(int?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { <CopyIncrementalAsync>d__32 stateMachine = default(<CopyIncrementalAsync>d__32); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageBlobCopyIncrementalHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.copySource = copySource; stateMachine.timeout = timeout; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageBlobCopyIncrementalHeaders> CopyIncremental(string copySource, int? timeout = default(int?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { if (copySource != null) { HttpMessage val = CreateCopyIncrementalRequest(copySource, timeout, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags); try { _pipeline.Send(val, cancellationToken); PageBlobCopyIncrementalHeaders headers = new PageBlobCopyIncrementalHeaders(val.get_Response()); if (val.get_Response().get_Status() != 202) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("copySource"); } internal HttpMessage CreateGetPageRangesNextPageRequest(string nextLink, string snapshot, int? timeout, string range, string leaseId, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string marker, int? maxresults) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Get()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendRawNextLink(nextLink, false); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (range != null) { headers = val2.get_Headers(); headers.Add("x-ms-range", range); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<GetPageRangesNextPageAsync>d__35))] public Task<ResponseWithHeaders<PageList, PageBlobGetPageRangesHeaders>> GetPageRangesNextPageAsync(string nextLink, string snapshot = null, int? timeout = default(int?), string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { <GetPageRangesNextPageAsync>d__35 stateMachine = default(<GetPageRangesNextPageAsync>d__35); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageList, PageBlobGetPageRangesHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.nextLink = nextLink; stateMachine.snapshot = snapshot; stateMachine.timeout = timeout; stateMachine.range = range; stateMachine.leaseId = leaseId; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.marker = marker; stateMachine.maxresults = maxresults; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageList, PageBlobGetPageRangesHeaders> GetPageRangesNextPage(string nextLink, string snapshot = null, int? timeout = default(int?), string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { if (nextLink != null) { HttpMessage val = CreateGetPageRangesNextPageRequest(nextLink, snapshot, timeout, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, marker, maxresults); try { _pipeline.Send(val, cancellationToken); PageBlobGetPageRangesHeaders headers = new PageBlobGetPageRangesHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); PageList value = null; XElement xElement = XDocument.Load(val.get_Response().get_ContentStream(), LoadOptions.PreserveWhitespace).Element("PageList"); if (xElement != null) value = PageList.DeserializePageList(xElement); return ResponseWithHeaders.FromValue(value, headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("nextLink"); } internal HttpMessage CreateGetPageRangesDiffNextPageRequest(string nextLink, string snapshot, int? timeout, string prevsnapshot, string prevSnapshotUrl, string range, string leaseId, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string marker, int? maxresults) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Get()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendRawNextLink(nextLink, false); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (prevSnapshotUrl != null) { headers = val2.get_Headers(); headers.Add("x-ms-previous-snapshot-url", prevSnapshotUrl); } if (range != null) { headers = val2.get_Headers(); headers.Add("x-ms-range", range); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<GetPageRangesDiffNextPageAsync>d__38))] public Task<ResponseWithHeaders<PageList, PageBlobGetPageRangesDiffHeaders>> GetPageRangesDiffNextPageAsync(string nextLink, string snapshot = null, int? timeout = default(int?), string prevsnapshot = null, string prevSnapshotUrl = null, string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { <GetPageRangesDiffNextPageAsync>d__38 stateMachine = default(<GetPageRangesDiffNextPageAsync>d__38); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<PageList, PageBlobGetPageRangesDiffHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.nextLink = nextLink; stateMachine.snapshot = snapshot; stateMachine.timeout = timeout; stateMachine.prevsnapshot = prevsnapshot; stateMachine.prevSnapshotUrl = prevSnapshotUrl; stateMachine.range = range; stateMachine.leaseId = leaseId; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.marker = marker; stateMachine.maxresults = maxresults; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<PageList, PageBlobGetPageRangesDiffHeaders> GetPageRangesDiffNextPage(string nextLink, string snapshot = null, int? timeout = default(int?), string prevsnapshot = null, string prevSnapshotUrl = null, string range = null, string leaseId = null, DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string marker = null, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { if (nextLink != null) { HttpMessage val = CreateGetPageRangesDiffNextPageRequest(nextLink, snapshot, timeout, prevsnapshot, prevSnapshotUrl, range, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, marker, maxresults); try { _pipeline.Send(val, cancellationToken); PageBlobGetPageRangesDiffHeaders headers = new PageBlobGetPageRangesDiffHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); PageList value = null; XElement xElement = XDocument.Load(val.get_Response().get_ContentStream(), LoadOptions.PreserveWhitespace).Element("PageList"); if (xElement != null) value = PageList.DeserializePageList(xElement); return ResponseWithHeaders.FromValue(value, headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("nextLink"); } } }