|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +#nullable disable |
| 5 | + |
| 6 | +using System; |
| 7 | +using System.ComponentModel; |
| 8 | + |
| 9 | +namespace Azure.Maps |
| 10 | +{ |
| 11 | + /// <summary> The LocalizedMapView. </summary> |
| 12 | + public readonly struct LocalizedMapView : IEquatable<LocalizedMapView> |
| 13 | + { |
| 14 | + private readonly string _value; |
| 15 | + |
| 16 | + /// <summary> Initializes a new instance of <see cref="LocalizedMapView"/>. </summary> |
| 17 | + /// <exception cref="ArgumentNullException"> <paramref name="value"/> is null. </exception> |
| 18 | + public LocalizedMapView(string value) |
| 19 | + { |
| 20 | + _value = value ?? throw new ArgumentNullException(nameof(value)); |
| 21 | + } |
| 22 | + |
| 23 | + private const string AEValue = "AE"; |
| 24 | + private const string ARValue = "AR"; |
| 25 | + private const string BHValue = "BH"; |
| 26 | + private const string INValue = "IN"; |
| 27 | + private const string IQValue = "IQ"; |
| 28 | + private const string JOValue = "JO"; |
| 29 | + private const string KWValue = "KW"; |
| 30 | + private const string LBValue = "LB"; |
| 31 | + private const string MAValue = "MA"; |
| 32 | + private const string OMValue = "OM"; |
| 33 | + private const string PKValue = "PK"; |
| 34 | + private const string PSValue = "PS"; |
| 35 | + private const string QAValue = "QA"; |
| 36 | + private const string SAValue = "SA"; |
| 37 | + private const string SYValue = "SY"; |
| 38 | + private const string YEValue = "YE"; |
| 39 | + private const string AutoValue = "Auto"; |
| 40 | + private const string UnifiedValue = "Unified"; |
| 41 | + |
| 42 | + /// <summary> United Arab Emirates (Arabic View). </summary> |
| 43 | + public static LocalizedMapView AE { get; } = new LocalizedMapView(AEValue); |
| 44 | + /// <summary> Argentina (Argentinian View). </summary> |
| 45 | + public static LocalizedMapView AR { get; } = new LocalizedMapView(ARValue); |
| 46 | + /// <summary> Bahrain (Arabic View). </summary> |
| 47 | + public static LocalizedMapView BH { get; } = new LocalizedMapView(BHValue); |
| 48 | + /// <summary> India (Indian View). </summary> |
| 49 | + public static LocalizedMapView IN { get; } = new LocalizedMapView(INValue); |
| 50 | + /// <summary> Iraq (Arabic View). </summary> |
| 51 | + public static LocalizedMapView IQ { get; } = new LocalizedMapView(IQValue); |
| 52 | + /// <summary> Jordan (Arabic View). </summary> |
| 53 | + public static LocalizedMapView JO { get; } = new LocalizedMapView(JOValue); |
| 54 | + /// <summary> Kuwait (Arabic View). </summary> |
| 55 | + public static LocalizedMapView KW { get; } = new LocalizedMapView(KWValue); |
| 56 | + /// <summary> Lebanon (Arabic View). </summary> |
| 57 | + public static LocalizedMapView LB { get; } = new LocalizedMapView(LBValue); |
| 58 | + /// <summary> Morocco (Moroccan View). </summary> |
| 59 | + public static LocalizedMapView MA { get; } = new LocalizedMapView(MAValue); |
| 60 | + /// <summary> Oman (Arabic View). </summary> |
| 61 | + public static LocalizedMapView OM { get; } = new LocalizedMapView(OMValue); |
| 62 | + /// <summary> Pakistan (Pakistani View). </summary> |
| 63 | + public static LocalizedMapView PK { get; } = new LocalizedMapView(PKValue); |
| 64 | + /// <summary> Palestinian Authority (Arabic View). </summary> |
| 65 | + public static LocalizedMapView PS { get; } = new LocalizedMapView(PSValue); |
| 66 | + /// <summary> Qatar (Arabic View). </summary> |
| 67 | + public static LocalizedMapView QA { get; } = new LocalizedMapView(QAValue); |
| 68 | + /// <summary> Saudi Arabia (Arabic View). </summary> |
| 69 | + public static LocalizedMapView SA { get; } = new LocalizedMapView(SAValue); |
| 70 | + /// <summary> Syria (Arabic View). </summary> |
| 71 | + public static LocalizedMapView SY { get; } = new LocalizedMapView(SYValue); |
| 72 | + /// <summary> Yemen (Arabic View). </summary> |
| 73 | + public static LocalizedMapView YE { get; } = new LocalizedMapView(YEValue); |
| 74 | + /// <summary> Return the map data based on the IP address of the request. </summary> |
| 75 | + public static LocalizedMapView Auto { get; } = new LocalizedMapView(AutoValue); |
| 76 | + /// <summary> Unified View (Others). </summary> |
| 77 | + public static LocalizedMapView Unified { get; } = new LocalizedMapView(UnifiedValue); |
| 78 | + /// <summary> Determines if two <see cref="LocalizedMapView"/> values are the same. </summary> |
| 79 | + public static bool operator ==(LocalizedMapView left, LocalizedMapView right) => left.Equals(right); |
| 80 | + /// <summary> Determines if two <see cref="LocalizedMapView"/> values are not the same. </summary> |
| 81 | + public static bool operator !=(LocalizedMapView left, LocalizedMapView right) => !left.Equals(right); |
| 82 | + /// <summary> Converts a string to a <see cref="LocalizedMapView"/>. </summary> |
| 83 | + public static implicit operator LocalizedMapView(string value) => new LocalizedMapView(value); |
| 84 | + |
| 85 | + /// <inheritdoc /> |
| 86 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 87 | + public override bool Equals(object obj) => obj is LocalizedMapView other && Equals(other); |
| 88 | + /// <inheritdoc /> |
| 89 | + public bool Equals(LocalizedMapView other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); |
| 90 | + |
| 91 | + /// <inheritdoc /> |
| 92 | + [EditorBrowsable(EditorBrowsableState.Never)] |
| 93 | + public override int GetHashCode() => _value?.GetHashCode() ?? 0; |
| 94 | + /// <inheritdoc /> |
| 95 | + public override string ToString() => _value; |
| 96 | + } |
| 97 | +} |
0 commit comments