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