| | 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.Storage.Models |
| | 12 | | { |
| | 13 | | /// <summary> The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), |
| | 14 | | public readonly partial struct Permissions : IEquatable<Permissions> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="Permissions"/> values are the same. </summary> |
| | 19 | | public Permissions(string value) |
| | 20 | | { |
| 40 | 21 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 40 | 22 | | } |
| | 23 | |
|
| | 24 | | private const string RValue = "r"; |
| | 25 | | private const string DValue = "d"; |
| | 26 | | private const string WValue = "w"; |
| | 27 | | private const string LValue = "l"; |
| | 28 | | private const string AValue = "a"; |
| | 29 | | private const string CValue = "c"; |
| | 30 | | private const string UValue = "u"; |
| | 31 | | private const string PValue = "p"; |
| | 32 | |
|
| | 33 | | /// <summary> r. </summary> |
| 0 | 34 | | public static Permissions R { get; } = new Permissions(RValue); |
| | 35 | | /// <summary> d. </summary> |
| 0 | 36 | | public static Permissions D { get; } = new Permissions(DValue); |
| | 37 | | /// <summary> w. </summary> |
| 0 | 38 | | public static Permissions W { get; } = new Permissions(WValue); |
| | 39 | | /// <summary> l. </summary> |
| 0 | 40 | | public static Permissions L { get; } = new Permissions(LValue); |
| | 41 | | /// <summary> a. </summary> |
| 0 | 42 | | public static Permissions A { get; } = new Permissions(AValue); |
| | 43 | | /// <summary> c. </summary> |
| 0 | 44 | | public static Permissions C { get; } = new Permissions(CValue); |
| | 45 | | /// <summary> u. </summary> |
| 0 | 46 | | public static Permissions U { get; } = new Permissions(UValue); |
| | 47 | | /// <summary> p. </summary> |
| 0 | 48 | | public static Permissions P { get; } = new Permissions(PValue); |
| | 49 | | /// <summary> Determines if two <see cref="Permissions"/> values are the same. </summary> |
| 0 | 50 | | public static bool operator ==(Permissions left, Permissions right) => left.Equals(right); |
| | 51 | | /// <summary> Determines if two <see cref="Permissions"/> values are not the same. </summary> |
| 0 | 52 | | public static bool operator !=(Permissions left, Permissions right) => !left.Equals(right); |
| | 53 | | /// <summary> Converts a string to a <see cref="Permissions"/>. </summary> |
| 40 | 54 | | public static implicit operator Permissions(string value) => new Permissions(value); |
| | 55 | |
|
| | 56 | | /// <inheritdoc /> |
| | 57 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 58 | | public override bool Equals(object obj) => obj is Permissions other && Equals(other); |
| | 59 | | /// <inheritdoc /> |
| 16 | 60 | | public bool Equals(Permissions other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIg |
| | 61 | |
|
| | 62 | | /// <inheritdoc /> |
| | 63 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 64 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 65 | | /// <inheritdoc /> |
| 24 | 66 | | public override string ToString() => _value; |
| | 67 | | } |
| | 68 | | } |