| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. See License.txt in the project root for |
| | | 3 | | // license information. |
| | | 4 | | |
| | | 5 | | namespace Microsoft.Azure.Search.Models |
| | | 6 | | { |
| | | 7 | | using System; |
| | | 8 | | using Microsoft.Azure.Search.Common; |
| | | 9 | | using Newtonsoft.Json; |
| | | 10 | | using Serialization; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Defines the format of NamedEntityRecognitionSkill supported language codes. |
| | | 14 | | /// </summary> |
| | | 15 | | [JsonConverter(typeof(ExtensibleEnumConverter<NamedEntityRecognitionSkillLanguage>))] |
| | | 16 | | [Obsolete("Use EntityRecognitionSkillLanguage instead.")] |
| | | 17 | | public struct NamedEntityRecognitionSkillLanguage : IEquatable<NamedEntityRecognitionSkillLanguage> |
| | | 18 | | { |
| | | 19 | | private readonly string _value; |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// Indicates language code "ar" (for Arabic) |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public static readonly NamedEntityRecognitionSkillLanguage Ar = new NamedEntityRecognitionSkillLanguage("ar"); |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Indicates language code "cs" (for Czech) |
| | | 28 | | /// </summary> |
| | 0 | 29 | | public static readonly NamedEntityRecognitionSkillLanguage Cs = new NamedEntityRecognitionSkillLanguage("cs"); |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Indicates language code "da" (for Danish) |
| | | 33 | | /// </summary> |
| | 0 | 34 | | public static readonly NamedEntityRecognitionSkillLanguage Da = new NamedEntityRecognitionSkillLanguage("da"); |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Indicates language code "de" (for German) |
| | | 38 | | /// </summary> |
| | 0 | 39 | | public static readonly NamedEntityRecognitionSkillLanguage De = new NamedEntityRecognitionSkillLanguage("de"); |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Indicates language code "en" (for English) |
| | | 43 | | /// </summary> |
| | 0 | 44 | | public static readonly NamedEntityRecognitionSkillLanguage En = new NamedEntityRecognitionSkillLanguage("en"); |
| | | 45 | | |
| | | 46 | | /// <summary> |
| | | 47 | | /// Indicates language code "es" (for Spanish) |
| | | 48 | | /// </summary> |
| | 0 | 49 | | public static readonly NamedEntityRecognitionSkillLanguage Es = new NamedEntityRecognitionSkillLanguage("es"); |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Indicates language code "fi" (for Finnish) |
| | | 53 | | /// </summary> |
| | 0 | 54 | | public static readonly NamedEntityRecognitionSkillLanguage Fi = new NamedEntityRecognitionSkillLanguage("fi"); |
| | | 55 | | |
| | | 56 | | /// <summary> |
| | | 57 | | /// Indicates language code "fr" (for French) |
| | | 58 | | /// </summary> |
| | 0 | 59 | | public static readonly NamedEntityRecognitionSkillLanguage Fr = new NamedEntityRecognitionSkillLanguage("fr"); |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Indicates language code "he" (for Hebrew) |
| | | 63 | | /// </summary> |
| | 0 | 64 | | public static readonly NamedEntityRecognitionSkillLanguage He = new NamedEntityRecognitionSkillLanguage("he"); |
| | | 65 | | |
| | | 66 | | /// <summary> |
| | | 67 | | /// Indicates language code "hu" (for Hungarian) |
| | | 68 | | /// </summary> |
| | 0 | 69 | | public static readonly NamedEntityRecognitionSkillLanguage Hu = new NamedEntityRecognitionSkillLanguage("hu"); |
| | | 70 | | |
| | | 71 | | /// <summary> |
| | | 72 | | /// Indicates language code "it" (for Italian) |
| | | 73 | | /// </summary> |
| | 0 | 74 | | public static readonly NamedEntityRecognitionSkillLanguage It = new NamedEntityRecognitionSkillLanguage("it"); |
| | | 75 | | |
| | | 76 | | /// <summary> |
| | | 77 | | /// Indicates language code "ko" (for Korean) |
| | | 78 | | /// </summary> |
| | 0 | 79 | | public static readonly NamedEntityRecognitionSkillLanguage Ko = new NamedEntityRecognitionSkillLanguage("ko"); |
| | | 80 | | |
| | | 81 | | /// <summary> |
| | | 82 | | /// Indicates language code "pt-br" (for Portuguese (Brazil)) |
| | | 83 | | /// </summary> |
| | 0 | 84 | | public static readonly NamedEntityRecognitionSkillLanguage PtBr = new NamedEntityRecognitionSkillLanguage("pt-br |
| | | 85 | | |
| | | 86 | | /// <summary> |
| | | 87 | | /// Indicates language code "pt" (for Portuguese) |
| | | 88 | | /// </summary> |
| | 0 | 89 | | public static readonly NamedEntityRecognitionSkillLanguage Pt = new NamedEntityRecognitionSkillLanguage("pt"); |
| | | 90 | | |
| | | 91 | | private NamedEntityRecognitionSkillLanguage(string language) |
| | | 92 | | { |
| | 0 | 93 | | Throw.IfArgumentNull(language, nameof(language)); |
| | 0 | 94 | | _value = language; |
| | 0 | 95 | | } |
| | | 96 | | |
| | | 97 | | /// <summary> |
| | | 98 | | /// Defines implicit conversion from string to NamedEntityRecognitionSkillLanguage. |
| | | 99 | | /// </summary> |
| | | 100 | | /// <param name="language">string to convert.</param> |
| | | 101 | | /// <returns>The string as a NamedEntityRecognitionSkillLanguage.</returns> |
| | | 102 | | public static implicit operator NamedEntityRecognitionSkillLanguage(string language) => |
| | 0 | 103 | | new NamedEntityRecognitionSkillLanguage(language); |
| | | 104 | | |
| | | 105 | | /// <summary> |
| | | 106 | | /// Defines explicit conversion from NamedEntityRecognitionSkillLanguage to string. |
| | | 107 | | /// </summary> |
| | | 108 | | /// <param name="language">NamedEntityRecognitionSkillLanguage to convert.</param> |
| | | 109 | | /// <returns>The NamedEntityRecognitionSkillLanguage as a string.</returns> |
| | 0 | 110 | | public static explicit operator string(NamedEntityRecognitionSkillLanguage language) => language.ToString(); |
| | | 111 | | |
| | | 112 | | /// <summary> |
| | | 113 | | /// Compares two NamedEntityRecognitionSkillLanguage values for equality. |
| | | 114 | | /// </summary> |
| | | 115 | | /// <param name="lhs">The first NamedEntityRecognitionSkillLanguage to compare.</param> |
| | | 116 | | /// <param name="rhs">The second NamedEntityRecognitionSkillLanguage to compare.</param> |
| | | 117 | | /// <returns>true if the NamedEntityRecognitionSkillLanguage objects are equal or are both null; false otherwise |
| | | 118 | | public static bool operator ==(NamedEntityRecognitionSkillLanguage lhs, NamedEntityRecognitionSkillLanguage rhs) |
| | 0 | 119 | | Equals(lhs, rhs); |
| | | 120 | | |
| | | 121 | | /// <summary> |
| | | 122 | | /// Compares two NamedEntityRecognitionSkillLanguage values for inequality. |
| | | 123 | | /// </summary> |
| | | 124 | | /// <param name="lhs">The first NamedEntityRecognitionSkillLanguage to compare.</param> |
| | | 125 | | /// <param name="rhs">The second NamedEntityRecognitionSkillLanguage to compare.</param> |
| | | 126 | | /// <returns>true if the NamedEntityRecognitionSkillLanguage objects are not equal; false otherwise.</returns> |
| | | 127 | | public static bool operator !=(NamedEntityRecognitionSkillLanguage lhs, NamedEntityRecognitionSkillLanguage rhs) |
| | 0 | 128 | | !Equals(lhs, rhs); |
| | | 129 | | |
| | | 130 | | /// <summary> |
| | | 131 | | /// Compares the NamedEntityRecognitionSkillLanguage for equality with another NamedEntityRecognitionSkillLangua |
| | | 132 | | /// </summary> |
| | | 133 | | /// <param name="other">The NamedEntityRecognitionSkillLanguage with which to compare.</param> |
| | | 134 | | /// <returns><c>true</c> if the NamedEntityRecognitionSkillLanguage objects are equal; otherwise, <c>false</c>.< |
| | 0 | 135 | | public bool Equals(NamedEntityRecognitionSkillLanguage other) => _value == other._value; |
| | | 136 | | |
| | | 137 | | /// <summary> |
| | | 138 | | /// Determines whether the specified object is equal to the current object. |
| | | 139 | | /// </summary> |
| | | 140 | | /// <param name="obj">The object to compare with the current object.</param> |
| | | 141 | | /// <returns><c>true</c> if the specified object is equal to the current object; otherwise, <c>false</c>.</retur |
| | | 142 | | public override bool Equals(object obj) => |
| | 0 | 143 | | obj is NamedEntityRecognitionSkillLanguage ? Equals((NamedEntityRecognitionSkillLanguage)obj) : false; |
| | | 144 | | |
| | | 145 | | /// <summary> |
| | | 146 | | /// Serves as the default hash function. |
| | | 147 | | /// </summary> |
| | | 148 | | /// <returns>A hash code for the current object.</returns> |
| | 0 | 149 | | public override int GetHashCode() => _value.GetHashCode(); |
| | | 150 | | |
| | | 151 | | /// <summary> |
| | | 152 | | /// Returns a string representation of the NamedEntityRecognitionSkillLanguage. |
| | | 153 | | /// </summary> |
| | | 154 | | /// <returns>The NamedEntityRecognitionSkillLanguage as a string.</returns> |
| | 0 | 155 | | public override string ToString() => _value; |
| | | 156 | | } |
| | | 157 | | } |