| | 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> This enumerates the possible sources of a disk's creation. </summary> |
| | 14 | | public readonly partial struct DiskCreateOption : IEquatable<DiskCreateOption> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="DiskCreateOption"/> values are the same. </summary> |
| | 19 | | public DiskCreateOption(string value) |
| | 20 | | { |
| 426 | 21 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 426 | 22 | | } |
| | 23 | |
|
| | 24 | | private const string EmptyValue = "Empty"; |
| | 25 | | private const string AttachValue = "Attach"; |
| | 26 | | private const string FromImageValue = "FromImage"; |
| | 27 | | private const string ImportValue = "Import"; |
| | 28 | | private const string CopyValue = "Copy"; |
| | 29 | | private const string RestoreValue = "Restore"; |
| | 30 | | private const string UploadValue = "Upload"; |
| | 31 | |
|
| | 32 | | /// <summary> Create an empty data disk of a size given by diskSizeGB. </summary> |
| 42 | 33 | | public static DiskCreateOption Empty { get; } = new DiskCreateOption(EmptyValue); |
| | 34 | | /// <summary> Disk will be attached to a VM. </summary> |
| 0 | 35 | | public static DiskCreateOption Attach { get; } = new DiskCreateOption(AttachValue); |
| | 36 | | /// <summary> Create a new disk from a platform image specified by the given imageReference or galleryImageRefer |
| 0 | 37 | | public static DiskCreateOption FromImage { get; } = new DiskCreateOption(FromImageValue); |
| | 38 | | /// <summary> Create a disk by importing from a blob specified by a sourceUri in a storage account specified by |
| 30 | 39 | | public static DiskCreateOption Import { get; } = new DiskCreateOption(ImportValue); |
| | 40 | | /// <summary> Create a new disk or snapshot by copying from a disk or snapshot specified by the given sourceReso |
| 34 | 41 | | public static DiskCreateOption Copy { get; } = new DiskCreateOption(CopyValue); |
| | 42 | | /// <summary> Create a new disk by copying from a backup recovery point. </summary> |
| 0 | 43 | | public static DiskCreateOption Restore { get; } = new DiskCreateOption(RestoreValue); |
| | 44 | | /// <summary> Create a new disk by obtaining a write token and using it to directly upload the contents of the d |
| 6 | 45 | | public static DiskCreateOption Upload { get; } = new DiskCreateOption(UploadValue); |
| | 46 | | /// <summary> Determines if two <see cref="DiskCreateOption"/> values are the same. </summary> |
| 0 | 47 | | public static bool operator ==(DiskCreateOption left, DiskCreateOption right) => left.Equals(right); |
| | 48 | | /// <summary> Determines if two <see cref="DiskCreateOption"/> values are not the same. </summary> |
| 28 | 49 | | public static bool operator !=(DiskCreateOption left, DiskCreateOption right) => !left.Equals(right); |
| | 50 | | /// <summary> Converts a string to a <see cref="DiskCreateOption"/>. </summary> |
| 96 | 51 | | public static implicit operator DiskCreateOption(string value) => new DiskCreateOption(value); |
| | 52 | |
|
| | 53 | | /// <inheritdoc /> |
| | 54 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 55 | | public override bool Equals(object obj) => obj is DiskCreateOption other && Equals(other); |
| | 56 | | /// <inheritdoc /> |
| 168 | 57 | | public bool Equals(DiskCreateOption other) => string.Equals(_value, other._value, StringComparison.InvariantCult |
| | 58 | |
|
| | 59 | | /// <inheritdoc /> |
| | 60 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 61 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 62 | | /// <inheritdoc /> |
| 280 | 63 | | public override string ToString() => _value; |
| | 64 | | } |
| | 65 | | } |