-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
BlobChangeFeedEventType.cs
99 lines (80 loc) · 4.25 KB
/
BlobChangeFeedEventType.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
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.ComponentModel;
namespace Azure.Storage.Blobs.ChangeFeed
{
/// <summary>
/// BlobChangeFeedEventType.
/// </summary>
public readonly struct BlobChangeFeedEventType : IEquatable<BlobChangeFeedEventType>
{
private readonly string _value;
/// <summary>
/// Constructor.
/// </summary>
public BlobChangeFeedEventType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); }
/// <summary>
/// Unspecified Event Type.
/// </summary>
public static BlobChangeFeedEventType UnspecifiedEventType { get; } = new BlobChangeFeedEventType("UnspecifiedEventType");
/// <summary>
/// Blob Created.
/// </summary>
public static BlobChangeFeedEventType BlobCreated { get; } = new BlobChangeFeedEventType("BlobCreated");
/// <summary>
/// Blob Deleted.
/// </summary>
public static BlobChangeFeedEventType BlobDeleted { get; } = new BlobChangeFeedEventType("BlobDeleted");
/// <summary>
/// Blob Properties Updated.
/// </summary>
public static BlobChangeFeedEventType BlobPropertiesUpdated { get; } = new BlobChangeFeedEventType("BlobPropertiesUpdated");
/// <summary>
/// Blob Snapshot Created.
/// </summary>
public static BlobChangeFeedEventType BlobSnapshotCreated { get; } = new BlobChangeFeedEventType("BlobSnapshotCreated");
/// <summary>
/// Control.
/// </summary>
public static BlobChangeFeedEventType Control { get; } = new BlobChangeFeedEventType("Control");
/// <summary>
/// Blob Tier Changed.
/// </summary>
public static BlobChangeFeedEventType BlobTierChanged { get; } = new BlobChangeFeedEventType("BlobTierChanged");
/// <summary>
/// Blob Async Operation Initiated.
/// </summary>
public static BlobChangeFeedEventType BlobAsyncOperationInitiated { get; } = new BlobChangeFeedEventType("BlobAsyncOperationInitiated");
/// <summary>
/// Restore Point Marker Created.
/// </summary>
public static BlobChangeFeedEventType RestorePointMarkerCreated { get; } = new BlobChangeFeedEventType("RestorePointMarkerCreated");
/// <summary>
/// Compares equality of two <see cref="BlobChangeFeedEventType"/> instances.
/// </summary>
/// <param name="left">The <see cref="BlobChangeFeedEventType"/> to compare.</param>
/// <param name="right">The <see cref="BlobChangeFeedEventType"/> to compare to.</param>
/// <returns><c>true</c> if values of both BlobChangeFeedEventType are equal, otherwise <c>false</c>.</returns>
public static bool operator ==(BlobChangeFeedEventType left, BlobChangeFeedEventType right) => left.Equals(right);
/// <summary>
/// Compares inequality of two <see cref="BlobChangeFeedEventType"/> instances.
/// </summary>
/// <param name="left">The <see cref="BlobChangeFeedEventType"/> to compare.</param>
/// <param name="right">The <see cref="BlobChangeFeedEventType"/> to compare to.</param>
/// <returns><c>true</c> if values of both BlobChangeFeedEventType are not equal, otherwise <c>false</c>.</returns>
public static bool operator !=(BlobChangeFeedEventType left, BlobChangeFeedEventType right) => !left.Equals(right);
/// <summary> Converts a string to a <see cref="BlobChangeFeedEventType"/>. </summary>
public static implicit operator BlobChangeFeedEventType(string value) => new BlobChangeFeedEventType(value);
///<inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object obj) => obj is BlobChangeFeedEventType other && Equals(other);
///<inheritdoc/>
public bool Equals(BlobChangeFeedEventType other) => string.Equals(_value, other._value, StringComparison.Ordinal);
///<inheritdoc/>
[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;
///<inheritdoc/>
public override string ToString() => _value;
}
}