| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.ComponentModel; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Compute.Models |
| | 12 | | { |
| | 13 | | /// <summary> The state of the disk. </summary> |
| | 14 | | public readonly partial struct DiskState : IEquatable<DiskState> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="DiskState"/> values are the same. </summary> |
| | 19 | | public DiskState(string value) |
| | 20 | | { |
| 228 | 21 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 228 | 22 | | } |
| | 23 | |
|
| | 24 | | private const string UnattachedValue = "Unattached"; |
| | 25 | | private const string AttachedValue = "Attached"; |
| | 26 | | private const string ReservedValue = "Reserved"; |
| | 27 | | private const string ActiveSASValue = "ActiveSAS"; |
| | 28 | | private const string ReadyToUploadValue = "ReadyToUpload"; |
| | 29 | | private const string ActiveUploadValue = "ActiveUpload"; |
| | 30 | |
|
| | 31 | | /// <summary> The disk is not being used and can be attached to a VM. </summary> |
| 0 | 32 | | public static DiskState Unattached { get; } = new DiskState(UnattachedValue); |
| | 33 | | /// <summary> The disk is currently mounted to a running VM. </summary> |
| 0 | 34 | | public static DiskState Attached { get; } = new DiskState(AttachedValue); |
| | 35 | | /// <summary> The disk is mounted to a stopped-deallocated VM. </summary> |
| 0 | 36 | | public static DiskState Reserved { get; } = new DiskState(ReservedValue); |
| | 37 | | /// <summary> The disk currently has an Active SAS Uri associated with it. </summary> |
| 0 | 38 | | public static DiskState ActiveSAS { get; } = new DiskState(ActiveSASValue); |
| | 39 | | /// <summary> A disk is ready to be created by upload by requesting a write token. </summary> |
| 0 | 40 | | public static DiskState ReadyToUpload { get; } = new DiskState(ReadyToUploadValue); |
| | 41 | | /// <summary> A disk is created for upload and a write token has been issued for uploading to it. </summary> |
| 0 | 42 | | public static DiskState ActiveUpload { get; } = new DiskState(ActiveUploadValue); |
| | 43 | | /// <summary> Determines if two <see cref="DiskState"/> values are the same. </summary> |
| 0 | 44 | | public static bool operator ==(DiskState left, DiskState right) => left.Equals(right); |
| | 45 | | /// <summary> Determines if two <see cref="DiskState"/> values are not the same. </summary> |
| 0 | 46 | | public static bool operator !=(DiskState left, DiskState right) => !left.Equals(right); |
| | 47 | | /// <summary> Converts a string to a <see cref="DiskState"/>. </summary> |
| 0 | 48 | | public static implicit operator DiskState(string value) => new DiskState(value); |
| | 49 | |
|
| | 50 | | /// <inheritdoc /> |
| | 51 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 52 | | public override bool Equals(object obj) => obj is DiskState other && Equals(other); |
| | 53 | | /// <inheritdoc /> |
| 0 | 54 | | public bool Equals(DiskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgno |
| | 55 | |
|
| | 56 | | /// <inheritdoc /> |
| | 57 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 58 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 59 | | /// <inheritdoc /> |
| 0 | 60 | | public override string ToString() => _value; |
| | 61 | | } |
| | 62 | | } |