| | | 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 append blob specific access conditions. |
| | | 11 | | /// </summary> |
| | | 12 | | public class AppendBlobRequestConditions : BlobRequestConditions |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// IfAppendPositionEqual ensures that the AppendBlock operation |
| | | 16 | | /// succeeds only if the append position is equal to a value. |
| | | 17 | | /// </summary> |
| | 424 | 18 | | public long? IfAppendPositionEqual { get; set; } |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// IfMaxSizeLessThanOrEqual ensures that the AppendBlock operation |
| | | 22 | | /// succeeds only if the append blob's size is less than or equal to |
| | | 23 | | /// a value. |
| | | 24 | | /// </summary> |
| | 372 | 25 | | public long? IfMaxSizeLessThanOrEqual { get; set; } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Collect any request conditions. Conditions should be separated by |
| | | 29 | | /// a semicolon. |
| | | 30 | | /// </summary> |
| | | 31 | | /// <param name="conditions">The collected conditions.</param> |
| | | 32 | | internal override void AddConditions(StringBuilder conditions) |
| | | 33 | | { |
| | 0 | 34 | | base.AddConditions(conditions); |
| | | 35 | | |
| | 0 | 36 | | if (IfAppendPositionEqual != null) |
| | | 37 | | { |
| | 0 | 38 | | conditions.Append(nameof(IfAppendPositionEqual)).Append('=').Append(IfAppendPositionEqual).Append(';'); |
| | | 39 | | } |
| | | 40 | | |
| | 0 | 41 | | if (IfMaxSizeLessThanOrEqual != null) |
| | | 42 | | { |
| | 0 | 43 | | conditions.Append(nameof(IfMaxSizeLessThanOrEqual)).Append('=').Append(IfMaxSizeLessThanOrEqual).Append( |
| | | 44 | | } |
| | 0 | 45 | | } |
| | | 46 | | } |
| | | 47 | | } |