| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.Search.Models |
| | 12 | | { |
| | 13 | | using Newtonsoft.Json; |
| | 14 | | using System.Collections; |
| | 15 | | using System.Collections.Generic; |
| | 16 | | using System.Linq; |
| | 17 | |
|
| | 18 | | /// <summary> |
| | 19 | | /// A skill to translate text from one language to another. |
| | 20 | | /// <see |
| | 21 | | /// href="https://docs.microsoft.com/azure/search/cognitive-search-skill-text-translation" |
| | 22 | | /// /> |
| | 23 | | /// </summary> |
| | 24 | | [Newtonsoft.Json.JsonObject("#Microsoft.Skills.Text.TranslationSkill")] |
| | 25 | | public partial class TextTranslationSkill : Skill |
| | 26 | | { |
| | 27 | | /// <summary> |
| | 28 | | /// Initializes a new instance of the TextTranslationSkill class. |
| | 29 | | /// </summary> |
| 8 | 30 | | public TextTranslationSkill() |
| | 31 | | { |
| | 32 | | CustomInit(); |
| 8 | 33 | | } |
| | 34 | |
|
| | 35 | | /// <summary> |
| | 36 | | /// Initializes a new instance of the TextTranslationSkill class. |
| | 37 | | /// </summary> |
| | 38 | | /// <param name="inputs">Inputs of the skills could be a column in the |
| | 39 | | /// source data set, or the output of an upstream skill.</param> |
| | 40 | | /// <param name="outputs">The output of a skill is either a field in a |
| | 41 | | /// search index, or a value that can be consumed as an input by |
| | 42 | | /// another skill.</param> |
| | 43 | | /// <param name="defaultToLanguageCode">The language code to translate |
| | 44 | | /// documents into for documents that don't specify the to language |
| | 45 | | /// explicitly. Possible values include: 'af', 'ar', 'bn', 'bs', 'bg', |
| | 46 | | /// 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', |
| | 47 | | /// 'et', 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', |
| | 48 | | /// 'hu', 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', |
| | 49 | | /// 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', |
| | 50 | | /// 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', |
| | 51 | | /// 'th', 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua'</param> |
| | 52 | | /// <param name="name">The name of the skill which uniquely identifies |
| | 53 | | /// it within the skillset. A skill with no name defined will be given |
| | 54 | | /// a default name of its 1-based index in the skills array, prefixed |
| | 55 | | /// with the character '#'.</param> |
| | 56 | | /// <param name="description">The description of the skill which |
| | 57 | | /// describes the inputs, outputs, and usage of the skill.</param> |
| | 58 | | /// <param name="context">Represents the level at which operations take |
| | 59 | | /// place, such as the document root or document content (for example, |
| | 60 | | /// /document or /document/content). The default is /document.</param> |
| | 61 | | /// <param name="defaultFromLanguageCode">The language code to |
| | 62 | | /// translate documents from for documents that don't specify the from |
| | 63 | | /// language explicitly. Possible values include: 'af', 'ar', 'bn', |
| | 64 | | /// 'bs', 'bg', 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', |
| | 65 | | /// 'nl', 'en', 'et', 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', |
| | 66 | | /// 'hi', 'mww', 'hu', 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', |
| | 67 | | /// 'lt', 'mg', 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', |
| | 68 | | /// 'sm', 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', 'ta', |
| | 69 | | /// 'te', 'th', 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua'</param> |
| | 70 | | /// <param name="suggestedFrom">The language code to translate |
| | 71 | | /// documents from when neither the fromLanguageCode input nor the |
| | 72 | | /// defaultFromLanguageCode parameter are provided, and the automatic |
| | 73 | | /// language detection is unsuccessful. Default is en. Possible values |
| | 74 | | /// include: 'af', 'ar', 'bn', 'bs', 'bg', 'yue', 'ca', 'zh-Hans', |
| | 75 | | /// 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fj', 'fil', 'fi', |
| | 76 | | /// 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', 'is', 'id', 'it', |
| | 77 | | /// 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', 'nb', 'fa', |
| | 78 | | /// 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', 'sk', |
| | 79 | | /// 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', |
| | 80 | | /// 'vi', 'cy', 'yua'</param> |
| | 81 | | public TextTranslationSkill(IList<InputFieldMappingEntry> inputs, IList<OutputFieldMappingEntry> outputs, TextTr |
| 8 | 82 | | : base(inputs, outputs, name, description, context) |
| | 83 | | { |
| 8 | 84 | | DefaultToLanguageCode = defaultToLanguageCode; |
| 8 | 85 | | DefaultFromLanguageCode = defaultFromLanguageCode; |
| 8 | 86 | | SuggestedFrom = suggestedFrom; |
| | 87 | | CustomInit(); |
| 8 | 88 | | } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// An initialization method that performs custom operations like setting defaults |
| | 92 | | /// </summary> |
| | 93 | | partial void CustomInit(); |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Gets or sets the language code to translate documents into for |
| | 97 | | /// documents that don't specify the to language explicitly. Possible |
| | 98 | | /// values include: 'af', 'ar', 'bn', 'bs', 'bg', 'yue', 'ca', |
| | 99 | | /// 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fj', |
| | 100 | | /// 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', 'is', |
| | 101 | | /// 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', |
| | 102 | | /// 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', |
| | 103 | | /// 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', |
| | 104 | | /// 'tr', 'uk', 'ur', 'vi', 'cy', 'yua' |
| | 105 | | /// </summary> |
| | 106 | | [JsonProperty(PropertyName = "defaultToLanguageCode")] |
| 40 | 107 | | public TextTranslationSkillLanguage DefaultToLanguageCode { get; set; } |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// Gets or sets the language code to translate documents from for |
| | 111 | | /// documents that don't specify the from language explicitly. Possible |
| | 112 | | /// values include: 'af', 'ar', 'bn', 'bs', 'bg', 'yue', 'ca', |
| | 113 | | /// 'zh-Hans', 'zh-Hant', 'hr', 'cs', 'da', 'nl', 'en', 'et', 'fj', |
| | 114 | | /// 'fil', 'fi', 'fr', 'de', 'el', 'ht', 'he', 'hi', 'mww', 'hu', 'is', |
| | 115 | | /// 'id', 'it', 'ja', 'sw', 'tlh', 'ko', 'lv', 'lt', 'mg', 'ms', 'mt', |
| | 116 | | /// 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', 'ru', 'sm', 'sr-Cyrl', |
| | 117 | | /// 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', 'ta', 'te', 'th', 'to', |
| | 118 | | /// 'tr', 'uk', 'ur', 'vi', 'cy', 'yua' |
| | 119 | | /// </summary> |
| | 120 | | [JsonProperty(PropertyName = "defaultFromLanguageCode")] |
| 40 | 121 | | public TextTranslationSkillLanguage? DefaultFromLanguageCode { get; set; } |
| | 122 | |
|
| | 123 | | /// <summary> |
| | 124 | | /// Gets or sets the language code to translate documents from when |
| | 125 | | /// neither the fromLanguageCode input nor the defaultFromLanguageCode |
| | 126 | | /// parameter are provided, and the automatic language detection is |
| | 127 | | /// unsuccessful. Default is en. Possible values include: 'af', 'ar', |
| | 128 | | /// 'bn', 'bs', 'bg', 'yue', 'ca', 'zh-Hans', 'zh-Hant', 'hr', 'cs', |
| | 129 | | /// 'da', 'nl', 'en', 'et', 'fj', 'fil', 'fi', 'fr', 'de', 'el', 'ht', |
| | 130 | | /// 'he', 'hi', 'mww', 'hu', 'is', 'id', 'it', 'ja', 'sw', 'tlh', 'ko', |
| | 131 | | /// 'lv', 'lt', 'mg', 'ms', 'mt', 'nb', 'fa', 'pl', 'pt', 'otq', 'ro', |
| | 132 | | /// 'ru', 'sm', 'sr-Cyrl', 'sr-Latn', 'sk', 'sl', 'es', 'sv', 'ty', |
| | 133 | | /// 'ta', 'te', 'th', 'to', 'tr', 'uk', 'ur', 'vi', 'cy', 'yua' |
| | 134 | | /// </summary> |
| | 135 | | [JsonProperty(PropertyName = "suggestedFrom")] |
| 40 | 136 | | public TextTranslationSkillLanguage? SuggestedFrom { get; set; } |
| | 137 | |
|
| | 138 | | /// <summary> |
| | 139 | | /// Validate the object. |
| | 140 | | /// </summary> |
| | 141 | | /// <exception cref="Rest.ValidationException"> |
| | 142 | | /// Thrown if validation fails |
| | 143 | | /// </exception> |
| | 144 | | public override void Validate() |
| | 145 | | { |
| 8 | 146 | | base.Validate(); |
| 8 | 147 | | } |
| | 148 | | } |
| | 149 | | } |