| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System; |
| | | 5 | | using System.Text; |
| | | 6 | | |
| | | 7 | | namespace Azure.Storage.Blobs.Models |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Specifies page blob specific access conditions. |
| | | 11 | | /// </summary> |
| | | 12 | | public class PageBlobRequestConditions : BlobRequestConditions |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// IfSequenceNumberLessThan ensures that the page blob operation |
| | | 16 | | /// succeeds only if the blob's sequence number is less than a value. |
| | | 17 | | /// </summary> |
| | 496 | 18 | | public long? IfSequenceNumberLessThan { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// IfSequenceNumberLessThanOrEqual ensures that the page blob |
| | | 22 | | /// operation succeeds only if the blob's sequence number is less than |
| | | 23 | | /// or equal to a value. |
| | | 24 | | /// </summary> |
| | 496 | 25 | | public long? IfSequenceNumberLessThanOrEqual { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// IfSequenceNumberEqual ensures that the page blob operation |
| | | 29 | | /// succeeds only if the blob's sequence number is equal to a value. |
| | | 30 | | /// </summary> |
| | 496 | 31 | | public long? IfSequenceNumberEqual { get; set; } |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Collect any request conditions. Conditions should be separated by |
| | | 35 | | /// a semicolon. |
| | | 36 | | /// </summary> |
| | | 37 | | /// <param name="conditions">The collected conditions.</param> |
| | | 38 | | internal override void AddConditions(StringBuilder conditions) |
| | | 39 | | { |
| | 0 | 40 | | base.AddConditions(conditions); |
| | | 41 | | |
| | 0 | 42 | | if (IfSequenceNumberLessThan != null) |
| | | 43 | | { |
| | 0 | 44 | | conditions.Append(nameof(IfSequenceNumberLessThan)).Append('=').Append(IfSequenceNumberLessThan).Append( |
| | | 45 | | } |
| | | 46 | | |
| | 0 | 47 | | if (IfSequenceNumberLessThanOrEqual != null) |
| | | 48 | | { |
| | 0 | 49 | | conditions.Append(nameof(IfSequenceNumberLessThanOrEqual)).Append('=').Append(IfSequenceNumberLessThanOr |
| | | 50 | | } |
| | | 51 | | |
| | 0 | 52 | | if (IfSequenceNumberEqual != null) |
| | | 53 | | { |
| | 0 | 54 | | conditions.Append(nameof(IfSequenceNumberEqual)).Append('=').Append(IfSequenceNumberEqual).Append(';'); |
| | | 55 | | } |
| | 0 | 56 | | } |
| | | 57 | | } |
| | | 58 | | } |