| | 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.KeyVault.Models |
| | 12 | | { |
| | 13 | | /// <summary> The KeyPermissions. </summary> |
| | 14 | | public readonly partial struct KeyPermissions : IEquatable<KeyPermissions> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="KeyPermissions"/> values are the same. </summary> |
| | 19 | | /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> |
| | 20 | | public KeyPermissions(string value) |
| | 21 | | { |
| 92 | 22 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 92 | 23 | | } |
| | 24 | |
|
| | 25 | | private const string EncryptValue = "encrypt"; |
| | 26 | | private const string DecryptValue = "decrypt"; |
| | 27 | | private const string WrapKeyValue = "wrapKey"; |
| | 28 | | private const string UnwrapKeyValue = "unwrapKey"; |
| | 29 | | private const string SignValue = "sign"; |
| | 30 | | private const string VerifyValue = "verify"; |
| | 31 | | private const string GetValue = "get"; |
| | 32 | | private const string ListValue = "list"; |
| | 33 | | private const string CreateValue = "create"; |
| | 34 | | private const string UpdateValue = "update"; |
| | 35 | | private const string ImportValue = "import"; |
| | 36 | | private const string DeleteValue = "delete"; |
| | 37 | | private const string BackupValue = "backup"; |
| | 38 | | private const string RestoreValue = "restore"; |
| | 39 | | private const string RecoverValue = "recover"; |
| | 40 | | private const string PurgeValue = "purge"; |
| | 41 | |
|
| | 42 | | /// <summary> encrypt. </summary> |
| 0 | 43 | | public static KeyPermissions Encrypt { get; } = new KeyPermissions(EncryptValue); |
| | 44 | | /// <summary> decrypt. </summary> |
| 0 | 45 | | public static KeyPermissions Decrypt { get; } = new KeyPermissions(DecryptValue); |
| | 46 | | /// <summary> wrapKey. </summary> |
| 0 | 47 | | public static KeyPermissions WrapKey { get; } = new KeyPermissions(WrapKeyValue); |
| | 48 | | /// <summary> unwrapKey. </summary> |
| 0 | 49 | | public static KeyPermissions UnwrapKey { get; } = new KeyPermissions(UnwrapKeyValue); |
| | 50 | | /// <summary> sign. </summary> |
| 0 | 51 | | public static KeyPermissions Sign { get; } = new KeyPermissions(SignValue); |
| | 52 | | /// <summary> verify. </summary> |
| 0 | 53 | | public static KeyPermissions Verify { get; } = new KeyPermissions(VerifyValue); |
| | 54 | | /// <summary> get. </summary> |
| 0 | 55 | | public static KeyPermissions Get { get; } = new KeyPermissions(GetValue); |
| | 56 | | /// <summary> list. </summary> |
| 0 | 57 | | public static KeyPermissions List { get; } = new KeyPermissions(ListValue); |
| | 58 | | /// <summary> create. </summary> |
| 0 | 59 | | public static KeyPermissions Create { get; } = new KeyPermissions(CreateValue); |
| | 60 | | /// <summary> update. </summary> |
| 0 | 61 | | public static KeyPermissions Update { get; } = new KeyPermissions(UpdateValue); |
| | 62 | | /// <summary> import. </summary> |
| 0 | 63 | | public static KeyPermissions Import { get; } = new KeyPermissions(ImportValue); |
| | 64 | | /// <summary> delete. </summary> |
| 0 | 65 | | public static KeyPermissions Delete { get; } = new KeyPermissions(DeleteValue); |
| | 66 | | /// <summary> backup. </summary> |
| 0 | 67 | | public static KeyPermissions Backup { get; } = new KeyPermissions(BackupValue); |
| | 68 | | /// <summary> restore. </summary> |
| 0 | 69 | | public static KeyPermissions Restore { get; } = new KeyPermissions(RestoreValue); |
| | 70 | | /// <summary> recover. </summary> |
| 0 | 71 | | public static KeyPermissions Recover { get; } = new KeyPermissions(RecoverValue); |
| | 72 | | /// <summary> purge. </summary> |
| 0 | 73 | | public static KeyPermissions Purge { get; } = new KeyPermissions(PurgeValue); |
| | 74 | | /// <summary> Determines if two <see cref="KeyPermissions"/> values are the same. </summary> |
| 0 | 75 | | public static bool operator ==(KeyPermissions left, KeyPermissions right) => left.Equals(right); |
| | 76 | | /// <summary> Determines if two <see cref="KeyPermissions"/> values are not the same. </summary> |
| 0 | 77 | | public static bool operator !=(KeyPermissions left, KeyPermissions right) => !left.Equals(right); |
| | 78 | | /// <summary> Converts a string to a <see cref="KeyPermissions"/>. </summary> |
| 0 | 79 | | public static implicit operator KeyPermissions(string value) => new KeyPermissions(value); |
| | 80 | |
|
| | 81 | | /// <inheritdoc /> |
| | 82 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 83 | | public override bool Equals(object obj) => obj is KeyPermissions other && Equals(other); |
| | 84 | | /// <inheritdoc /> |
| 20 | 85 | | public bool Equals(KeyPermissions other) => string.Equals(_value, other._value, StringComparison.InvariantCultur |
| | 86 | |
|
| | 87 | | /// <inheritdoc /> |
| | 88 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 89 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 90 | | /// <inheritdoc /> |
| 96 | 91 | | public override string ToString() => _value; |
| | 92 | | } |
| | 93 | | } |