| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using System.ComponentModel; |
| | 6 | |
|
| | 7 | | namespace Azure.Storage.Blobs.Models |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// Provides the version state of a successfully released blob or container |
| | 11 | | /// object. |
| | 12 | | /// </summary> |
| | 13 | | public class ReleasedObjectInfo |
| | 14 | | { |
| | 15 | | /// <summary> |
| | 16 | | /// The ETag contains a value that you can use to perform operations |
| | 17 | | /// conditionally. If the request version is 2011-08-18 or newer, the |
| | 18 | | /// ETag value will be in quotes. |
| | 19 | | /// </summary> |
| 68 | 20 | | public ETag ETag { get; } |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Returns the date and time the object was last modified. Any |
| | 24 | | /// operation that modifies the blob or container, including an update |
| | 25 | | /// of the object's metadata or properties, changes the last-modified |
| | 26 | | /// time of the object. |
| | 27 | | /// </summary> |
| 68 | 28 | | public DateTimeOffset LastModified { get; } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Creates a new <see cref="ReleasedObjectInfo"/>. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="eTag"> |
| | 34 | | /// The <see cref="ETag"/> contains a value that you can use to perform |
| | 35 | | /// operations conditionally. |
| | 36 | | /// </param> |
| | 37 | | /// <param name="lastModified"> |
| | 38 | | /// The date and time the object was last modified. |
| | 39 | | /// </param> |
| 116 | 40 | | public ReleasedObjectInfo(ETag eTag, DateTimeOffset lastModified) |
| | 41 | | { |
| 116 | 42 | | ETag = eTag; |
| 116 | 43 | | LastModified = lastModified; |
| 116 | 44 | | } |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// Creates a new <see cref="ReleasedObjectInfo"/>. |
| | 48 | | /// </summary> |
| | 49 | | /// <param name="info">A released <see cref="BlobInfo"/>.</param> |
| | 50 | | internal ReleasedObjectInfo(BlobInfo info) |
| 76 | 51 | | : this(info.ETag, info.LastModified) |
| | 52 | | { |
| 76 | 53 | | } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// Creates a new <see cref="ReleasedObjectInfo"/>. |
| | 57 | | /// </summary> |
| | 58 | | /// <param name="info">A released <see cref="BlobContainerInfo"/>.</param> |
| | 59 | | internal ReleasedObjectInfo(BlobContainerInfo info) |
| 40 | 60 | | : this(info.ETag, info.LastModified) |
| | 61 | | { |
| 40 | 62 | | } |
| | 63 | |
|
| | 64 | | /// <summary> |
| | 65 | | /// Creates a string representation of a |
| | 66 | | /// <see cref="ReleasedObjectInfo"/>. |
| | 67 | | /// </summary> |
| | 68 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 69 | | public override string ToString() => base.ToString(); |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// Check if two <see cref="ReleasedObjectInfo"/> instances are equal. |
| | 73 | | /// </summary> |
| | 74 | | /// <param name="obj">The instance to compare to.</param> |
| | 75 | | /// <returns>True if they're equal, false otherwise.</returns> |
| | 76 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 77 | | public override bool Equals(object obj) => base.Equals(obj); |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// Get a hash code for the <see cref="ReleasedObjectInfo"/>. |
| | 81 | | /// </summary> |
| | 82 | | /// <returns>Hash code for the <see cref="ReleasedObjectInfo"/>.</returns> |
| | 83 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 84 | | public override int GetHashCode() => base.GetHashCode(); |
| | 85 | | } |
| | 86 | | } |