TextTranslationSkill.java

  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License.
  3. //
  4. // Code generated by Microsoft (R) AutoRest Code Generator.
  5. // Changes may cause incorrect behavior and will be lost if the code is
  6. // regenerated.
  7. package com.azure.search.documents.indexes.models;

  8. import com.azure.core.annotation.Fluent;
  9. import com.fasterxml.jackson.annotation.JsonCreator;
  10. import com.fasterxml.jackson.annotation.JsonProperty;
  11. import com.fasterxml.jackson.annotation.JsonTypeId;
  12. import com.fasterxml.jackson.annotation.JsonTypeInfo;
  13. import com.fasterxml.jackson.annotation.JsonTypeName;
  14. import java.util.List;

  15. /** A skill to translate text from one language to another. */
  16. @JsonTypeInfo(
  17.         use = JsonTypeInfo.Id.NAME,
  18.         include = JsonTypeInfo.As.EXISTING_PROPERTY,
  19.         property = "@odata.type",
  20.         visible = true)
  21. @JsonTypeName("#Microsoft.Skills.Text.TranslationSkill")
  22. @Fluent
  23. public final class TextTranslationSkill extends SearchIndexerSkill {

  24.     /*
  25.      * Identifies the concrete type of the skill.
  26.      */
  27.     @JsonTypeId
  28.     @JsonProperty(value = "@odata.type", required = true)
  29.     private String odataType = "#Microsoft.Skills.Text.TranslationSkill";

  30.     /*
  31.      * The language code to translate documents into for documents that don't
  32.      * specify the to language explicitly.
  33.      */
  34.     @JsonProperty(value = "defaultToLanguageCode", required = true)
  35.     private TextTranslationSkillLanguage defaultToLanguageCode;

  36.     /*
  37.      * The language code to translate documents from for documents that don't
  38.      * specify the from language explicitly.
  39.      */
  40.     @JsonProperty(value = "defaultFromLanguageCode")
  41.     private TextTranslationSkillLanguage defaultFromLanguageCode;

  42.     /*
  43.      * The language code to translate documents from when neither the
  44.      * fromLanguageCode input nor the defaultFromLanguageCode parameter are
  45.      * provided, and the automatic language detection is unsuccessful. Default
  46.      * is en.
  47.      */
  48.     @JsonProperty(value = "suggestedFrom")
  49.     private TextTranslationSkillLanguage suggestedFrom;

  50.     /**
  51.      * Creates an instance of TextTranslationSkill class.
  52.      *
  53.      * @param inputs the inputs value to set.
  54.      * @param outputs the outputs value to set.
  55.      * @param defaultToLanguageCode the defaultToLanguageCode value to set.
  56.      */
  57.     @JsonCreator
  58.     public TextTranslationSkill(
  59.             @JsonProperty(value = "inputs", required = true) List<InputFieldMappingEntry> inputs,
  60.             @JsonProperty(value = "outputs", required = true) List<OutputFieldMappingEntry> outputs,
  61.             @JsonProperty(value = "defaultToLanguageCode", required = true)
  62.                     TextTranslationSkillLanguage defaultToLanguageCode) {
  63.         super(inputs, outputs);
  64.         this.defaultToLanguageCode = defaultToLanguageCode;
  65.     }

  66.     /**
  67.      * Get the defaultToLanguageCode property: The language code to translate documents into for documents that don't
  68.      * specify the to language explicitly.
  69.      *
  70.      * @return the defaultToLanguageCode value.
  71.      */
  72.     public TextTranslationSkillLanguage getDefaultToLanguageCode() {
  73.         return this.defaultToLanguageCode;
  74.     }

  75.     /**
  76.      * Get the defaultFromLanguageCode property: The language code to translate documents from for documents that don't
  77.      * specify the from language explicitly.
  78.      *
  79.      * @return the defaultFromLanguageCode value.
  80.      */
  81.     public TextTranslationSkillLanguage getDefaultFromLanguageCode() {
  82.         return this.defaultFromLanguageCode;
  83.     }

  84.     /**
  85.      * Set the defaultFromLanguageCode property: The language code to translate documents from for documents that don't
  86.      * specify the from language explicitly.
  87.      *
  88.      * @param defaultFromLanguageCode the defaultFromLanguageCode value to set.
  89.      * @return the TextTranslationSkill object itself.
  90.      */
  91.     public TextTranslationSkill setDefaultFromLanguageCode(TextTranslationSkillLanguage defaultFromLanguageCode) {
  92.         this.defaultFromLanguageCode = defaultFromLanguageCode;
  93.         return this;
  94.     }

  95.     /**
  96.      * Get the suggestedFrom property: The language code to translate documents from when neither the fromLanguageCode
  97.      * input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is
  98.      * unsuccessful. Default is en.
  99.      *
  100.      * @return the suggestedFrom value.
  101.      */
  102.     public TextTranslationSkillLanguage getSuggestedFrom() {
  103.         return this.suggestedFrom;
  104.     }

  105.     /**
  106.      * Set the suggestedFrom property: The language code to translate documents from when neither the fromLanguageCode
  107.      * input nor the defaultFromLanguageCode parameter are provided, and the automatic language detection is
  108.      * unsuccessful. Default is en.
  109.      *
  110.      * @param suggestedFrom the suggestedFrom value to set.
  111.      * @return the TextTranslationSkill object itself.
  112.      */
  113.     public TextTranslationSkill setSuggestedFrom(TextTranslationSkillLanguage suggestedFrom) {
  114.         this.suggestedFrom = suggestedFrom;
  115.         return this;
  116.     }
  117. }