| | 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.ChangeFeed |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// The name of the API operation associated with a <see cref="BlobChangeFeedEventData"/>. |
| | 11 | | /// </summary> |
| | 12 | | public readonly struct BlobOperationName : IEquatable<BlobOperationName> |
| | 13 | | { |
| | 14 | | private readonly string _value; |
| | 15 | |
|
| | 16 | | /// <summary> |
| | 17 | | /// Constructor. |
| | 18 | | /// </summary> |
| | 19 | | /// <param name="value"></param> |
| 59216 | 20 | | public BlobOperationName(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } |
| | 21 | |
|
| | 22 | | /// <summary> |
| | 23 | | /// Unspecified Api. |
| | 24 | | /// </summary> |
| 0 | 25 | | public static BlobOperationName UnspecifiedApi { get; } = new BlobOperationName("UnspecifiedApi"); |
| | 26 | |
|
| | 27 | | /// <summary> |
| | 28 | | /// Put Blob. |
| | 29 | | /// </summary> |
| 6 | 30 | | public static BlobOperationName PutBlob { get; } = new BlobOperationName("PutBlob"); |
| | 31 | |
|
| | 32 | | /// <summary> |
| | 33 | | /// Put Block List. |
| | 34 | | /// </summary> |
| 0 | 35 | | public static BlobOperationName PutBlockList { get; } = new BlobOperationName("PutBlockList"); |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Copy Blob. |
| | 39 | | /// </summary> |
| 0 | 40 | | public static BlobOperationName CopyBlob { get; } = new BlobOperationName("CopyBlob"); |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Delete Blob. |
| | 44 | | /// </summary> |
| 0 | 45 | | public static BlobOperationName DeleteBlob { get; } = new BlobOperationName("DeleteBlob"); |
| | 46 | |
|
| | 47 | | /// <summary> |
| | 48 | | /// Set Blob Metadata. |
| | 49 | | /// </summary> |
| 0 | 50 | | public static BlobOperationName SetBlobMetadata { get; } = new BlobOperationName("SetBlobMetadata"); |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Control Event. |
| | 54 | | /// </summary> |
| 0 | 55 | | public static BlobOperationName ControlEvent { get; } = new BlobOperationName("ControlEvent"); |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Undelete Blob. |
| | 59 | | /// </summary> |
| 0 | 60 | | public static BlobOperationName UndeleteBlob { get; } = new BlobOperationName("UndeleteBlob"); |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Set Blob Properties. |
| | 64 | | /// </summary> |
| 0 | 65 | | public static BlobOperationName SetBlobProperties { get; } = new BlobOperationName("SetBlobProperties"); |
| | 66 | |
|
| | 67 | | /// <summary> |
| | 68 | | /// Snapshot Blob. |
| | 69 | | /// </summary> |
| 0 | 70 | | public static BlobOperationName SnapshotBlob { get; } = new BlobOperationName("SnapshotBlob"); |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Set Blob Tier. |
| | 74 | | /// </summary> |
| 0 | 75 | | public static BlobOperationName SetBlobTier { get; } = new BlobOperationName("SetBlobTier"); |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Abort Copy Blob. |
| | 79 | | /// </summary> |
| 0 | 80 | | public static BlobOperationName AbortCopyBlob { get; } = new BlobOperationName("AbortCopyBlob"); |
| | 81 | |
|
| | 82 | | ///<inheritdoc/> |
| 0 | 83 | | public static bool operator ==(BlobOperationName left, BlobOperationName right) => left.Equals(right); |
| | 84 | |
|
| | 85 | | ///<inheritdoc/> |
| 0 | 86 | | public static bool operator !=(BlobOperationName left, BlobOperationName right) => !left.Equals(right); |
| | 87 | |
|
| | 88 | | ///<inheritdoc/> |
| 0 | 89 | | public static implicit operator BlobOperationName(string value) => new BlobOperationName(value); |
| | 90 | |
|
| | 91 | | ///<inheritdoc/> |
| | 92 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 93 | | public override bool Equals(object obj) => obj is BlobOperationName other && Equals(other); |
| | 94 | |
|
| | 95 | | ///<inheritdoc/> |
| 4 | 96 | | public bool Equals(BlobOperationName other) => string.Equals(_value, other._value, StringComparison.Ordinal); |
| | 97 | |
|
| | 98 | | ///<inheritdoc/> |
| | 99 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 100 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 101 | |
|
| | 102 | | ///<inheritdoc/> |
| 0 | 103 | | public override string ToString() => _value; |
| | 104 | | } |
| | 105 | | } |