| | 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.Network.Models |
| | 12 | | { |
| | 13 | | /// <summary> Network protocol this rule applies to. </summary> |
| | 14 | | public readonly partial struct SecurityRuleProtocol : IEquatable<SecurityRuleProtocol> |
| | 15 | | { |
| | 16 | | private readonly string _value; |
| | 17 | |
|
| | 18 | | /// <summary> Determines if two <see cref="SecurityRuleProtocol"/> values are the same. </summary> |
| | 19 | | public SecurityRuleProtocol(string value) |
| | 20 | | { |
| 2800 | 21 | | _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 2800 | 22 | | } |
| | 23 | |
|
| | 24 | | private const string TcpValue = "Tcp"; |
| | 25 | | private const string UdpValue = "Udp"; |
| | 26 | | private const string IcmpValue = "Icmp"; |
| | 27 | | private const string EspValue = "Esp"; |
| | 28 | | private const string AsteriskValue = "*"; |
| | 29 | | private const string AhValue = "Ah"; |
| | 30 | |
|
| | 31 | | /// <summary> Tcp. </summary> |
| 18 | 32 | | public static SecurityRuleProtocol Tcp { get; } = new SecurityRuleProtocol(TcpValue); |
| | 33 | | /// <summary> Udp. </summary> |
| 18 | 34 | | public static SecurityRuleProtocol Udp { get; } = new SecurityRuleProtocol(UdpValue); |
| | 35 | | /// <summary> Icmp. </summary> |
| 0 | 36 | | public static SecurityRuleProtocol Icmp { get; } = new SecurityRuleProtocol(IcmpValue); |
| | 37 | | /// <summary> Esp. </summary> |
| 0 | 38 | | public static SecurityRuleProtocol Esp { get; } = new SecurityRuleProtocol(EspValue); |
| | 39 | | /// <summary> *. </summary> |
| 6 | 40 | | public static SecurityRuleProtocol Asterisk { get; } = new SecurityRuleProtocol(AsteriskValue); |
| | 41 | | /// <summary> Ah. </summary> |
| 0 | 42 | | public static SecurityRuleProtocol Ah { get; } = new SecurityRuleProtocol(AhValue); |
| | 43 | | /// <summary> Determines if two <see cref="SecurityRuleProtocol"/> values are the same. </summary> |
| 0 | 44 | | public static bool operator ==(SecurityRuleProtocol left, SecurityRuleProtocol right) => left.Equals(right); |
| | 45 | | /// <summary> Determines if two <see cref="SecurityRuleProtocol"/> values are not the same. </summary> |
| 0 | 46 | | public static bool operator !=(SecurityRuleProtocol left, SecurityRuleProtocol right) => !left.Equals(right); |
| | 47 | | /// <summary> Converts a string to a <see cref="SecurityRuleProtocol"/>. </summary> |
| 0 | 48 | | public static implicit operator SecurityRuleProtocol(string value) => new SecurityRuleProtocol(value); |
| | 49 | |
|
| | 50 | | /// <inheritdoc /> |
| | 51 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 52 | | public override bool Equals(object obj) => obj is SecurityRuleProtocol other && Equals(other); |
| | 53 | | /// <inheritdoc /> |
| 32 | 54 | | public bool Equals(SecurityRuleProtocol other) => string.Equals(_value, other._value, StringComparison.Invariant |
| | 55 | |
|
| | 56 | | /// <inheritdoc /> |
| | 57 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| 0 | 58 | | public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| | 59 | | /// <inheritdoc /> |
| 104 | 60 | | public override string ToString() => _value; |
| | 61 | | } |
| | 62 | | } |