SearchIndexerSkill.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.JsonSubTypes;
  12. import com.fasterxml.jackson.annotation.JsonTypeInfo;
  13. import com.fasterxml.jackson.annotation.JsonTypeName;
  14. import java.util.List;

  15. /** Base type for skills. */
  16. @JsonTypeInfo(
  17.         use = JsonTypeInfo.Id.NAME,
  18.         include = JsonTypeInfo.As.PROPERTY,
  19.         property = "@odata.type",
  20.         defaultImpl = SearchIndexerSkill.class,
  21.         visible = true)
  22. @JsonTypeName("SearchIndexerSkill")
  23. @JsonSubTypes({
  24.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Util.ConditionalSkill", value = ConditionalSkill.class),
  25.     @JsonSubTypes.Type(
  26.             name = "#Microsoft.Skills.Text.KeyPhraseExtractionSkill",
  27.             value = KeyPhraseExtractionSkill.class),
  28.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Vision.OcrSkill", value = OcrSkill.class),
  29.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Vision.ImageAnalysisSkill", value = ImageAnalysisSkill.class),
  30.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.LanguageDetectionSkill", value = LanguageDetectionSkill.class),
  31.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Util.ShaperSkill", value = ShaperSkill.class),
  32.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.MergeSkill", value = MergeSkill.class),
  33.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.EntityRecognitionSkill", value = EntityRecognitionSkill.class),
  34.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.SentimentSkill", value = SentimentSkill.class),
  35.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.V3.SentimentSkill", value = SentimentSkill.class),
  36.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.V3.EntityLinkingSkill", value = EntityLinkingSkill.class),
  37.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.V3.EntityRecognitionSkill", value = EntityRecognitionSkill.class),
  38.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.SplitSkill", value = SplitSkill.class),
  39.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.CustomEntityLookupSkill", value = CustomEntityLookupSkill.class),
  40.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.TranslationSkill", value = TextTranslationSkill.class),
  41.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Util.DocumentExtractionSkill", value = DocumentExtractionSkill.class),
  42.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Custom.WebApiSkill", value = WebApiSkill.class),
  43.     @JsonSubTypes.Type(name = "#Microsoft.Skills.Text.PIIDetectionSkill", value = PiiDetectionSkill.class)
  44. })
  45. @Fluent
  46. public abstract class SearchIndexerSkill {

  47.     /*
  48.      * The name of the skill which uniquely identifies it within the skillset.
  49.      * A skill with no name defined will be given a default name of its 1-based
  50.      * index in the skills array, prefixed with the character '#'.
  51.      */
  52.     @JsonProperty(value = "name")
  53.     private String name;

  54.     /*
  55.      * The description of the skill which describes the inputs, outputs, and
  56.      * usage of the skill.
  57.      */
  58.     @JsonProperty(value = "description")
  59.     private String description;

  60.     /*
  61.      * Represents the level at which operations take place, such as the
  62.      * document root or document content (for example, /document or
  63.      * /document/content). The default is /document.
  64.      */
  65.     @JsonProperty(value = "context")
  66.     private String context;

  67.     /*
  68.      * Inputs of the skills could be a column in the source data set, or the
  69.      * output of an upstream skill.
  70.      */
  71.     @JsonProperty(value = "inputs", required = true)
  72.     private List<InputFieldMappingEntry> inputs;

  73.     /*
  74.      * The output of a skill is either a field in a search index, or a value
  75.      * that can be consumed as an input by another skill.
  76.      */
  77.     @JsonProperty(value = "outputs", required = true)
  78.     private List<OutputFieldMappingEntry> outputs;

  79.     /**
  80.      * Creates an instance of SearchIndexerSkill class.
  81.      *
  82.      * @param inputs the inputs value to set.
  83.      * @param outputs the outputs value to set.
  84.      */
  85.     @JsonCreator
  86.     public SearchIndexerSkill(
  87.             @JsonProperty(value = "inputs", required = true) List<InputFieldMappingEntry> inputs,
  88.             @JsonProperty(value = "outputs", required = true) List<OutputFieldMappingEntry> outputs) {
  89.         this.inputs = inputs;
  90.         this.outputs = outputs;
  91.     }

  92.     /**
  93.      * Get the name property: The name of the skill which uniquely identifies it within the skillset. A skill with no
  94.      * name defined will be given a default name of its 1-based index in the skills array, prefixed with the character
  95.      * '#'.
  96.      *
  97.      * @return the name value.
  98.      */
  99.     public String getName() {
  100.         return this.name;
  101.     }

  102.     /**
  103.      * Set the name property: The name of the skill which uniquely identifies it within the skillset. A skill with no
  104.      * name defined will be given a default name of its 1-based index in the skills array, prefixed with the character
  105.      * '#'.
  106.      *
  107.      * @param name the name value to set.
  108.      * @return the SearchIndexerSkill object itself.
  109.      */
  110.     public SearchIndexerSkill setName(String name) {
  111.         this.name = name;
  112.         return this;
  113.     }

  114.     /**
  115.      * Get the description property: The description of the skill which describes the inputs, outputs, and usage of the
  116.      * skill.
  117.      *
  118.      * @return the description value.
  119.      */
  120.     public String getDescription() {
  121.         return this.description;
  122.     }

  123.     /**
  124.      * Set the description property: The description of the skill which describes the inputs, outputs, and usage of the
  125.      * skill.
  126.      *
  127.      * @param description the description value to set.
  128.      * @return the SearchIndexerSkill object itself.
  129.      */
  130.     public SearchIndexerSkill setDescription(String description) {
  131.         this.description = description;
  132.         return this;
  133.     }

  134.     /**
  135.      * Get the context property: Represents the level at which operations take place, such as the document root or
  136.      * document content (for example, /document or /document/content). The default is /document.
  137.      *
  138.      * @return the context value.
  139.      */
  140.     public String getContext() {
  141.         return this.context;
  142.     }

  143.     /**
  144.      * Set the context property: Represents the level at which operations take place, such as the document root or
  145.      * document content (for example, /document or /document/content). The default is /document.
  146.      *
  147.      * @param context the context value to set.
  148.      * @return the SearchIndexerSkill object itself.
  149.      */
  150.     public SearchIndexerSkill setContext(String context) {
  151.         this.context = context;
  152.         return this;
  153.     }

  154.     /**
  155.      * Get the inputs property: Inputs of the skills could be a column in the source data set, or the output of an
  156.      * upstream skill.
  157.      *
  158.      * @return the inputs value.
  159.      */
  160.     public List<InputFieldMappingEntry> getInputs() {
  161.         return this.inputs;
  162.     }

  163.     /**
  164.      * Get the outputs property: The output of a skill is either a field in a search index, or a value that can be
  165.      * consumed as an input by another skill.
  166.      *
  167.      * @return the outputs value.
  168.      */
  169.     public List<OutputFieldMappingEntry> getOutputs() {
  170.         return this.outputs;
  171.     }
  172. }