PiiDetectionSkill.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. /**
  16.  * Using the Text Analytics API, extracts personal information from an input text and gives you the option of masking
  17.  * it.
  18.  */
  19. @JsonTypeInfo(
  20.         use = JsonTypeInfo.Id.NAME,
  21.         include = JsonTypeInfo.As.EXISTING_PROPERTY,
  22.         property = "@odata.type",
  23.         visible = true)
  24. @JsonTypeName("#Microsoft.Skills.Text.PIIDetectionSkill")
  25. @Fluent
  26. public final class PiiDetectionSkill extends SearchIndexerSkill {
  27.     /*
  28.      * Identifies the concrete type of the skill.
  29.      */
  30.     @JsonTypeId
  31.     @JsonProperty(value = "@odata.type", required = true)
  32.     private String odataType = "#Microsoft.Skills.Text.PIIDetectionSkill";

  33.     /*
  34.      * A value indicating which language code to use. Default is en.
  35.      */
  36.     @JsonProperty(value = "defaultLanguageCode")
  37.     private String defaultLanguageCode;

  38.     /*
  39.      * A value between 0 and 1 that be used to only include entities whose
  40.      * confidence score is greater than the value specified. If not set
  41.      * (default), or if explicitly set to null, all entities will be included.
  42.      */
  43.     @JsonProperty(value = "minimumPrecision")
  44.     private Double minimumPrecision;

  45.     /*
  46.      * A parameter that provides various ways to mask the personal information
  47.      * detected in the input text. Default is 'none'.
  48.      */
  49.     @JsonProperty(value = "maskingMode")
  50.     private PiiDetectionSkillMaskingMode maskingMode;

  51.     /*
  52.      * The character used to mask the text if the maskingMode parameter is set
  53.      * to replace. Default is '*'.
  54.      */
  55.     @JsonProperty(value = "maskingCharacter")
  56.     private String maskingCharacter;

  57.     /*
  58.      * The version of the model to use when calling the Text Analytics service.
  59.      * It will default to the latest available when not specified. We recommend
  60.      * you do not specify this value unless absolutely necessary.
  61.      */
  62.     @JsonProperty(value = "modelVersion")
  63.     private String modelVersion;

  64.     /*
  65.      * A list of PII entity categories that should be extracted and masked.
  66.      */
  67.     @JsonProperty(value = "piiCategories")
  68.     private List<String> piiCategories;

  69.     /*
  70.      * If specified, will set the PII domain to include only a subset of the
  71.      * entity categories. Possible values include: 'phi', 'none'. Default is
  72.      * 'none'.
  73.      */
  74.     @JsonProperty(value = "domain")
  75.     private String domain;

  76.     /**
  77.      * Creates an instance of PiiDetectionSkill class.
  78.      *
  79.      * @param inputs the inputs value to set.
  80.      * @param outputs the outputs value to set.
  81.      */
  82.     @JsonCreator
  83.     public PiiDetectionSkill(
  84.             @JsonProperty(value = "inputs", required = true) List<InputFieldMappingEntry> inputs,
  85.             @JsonProperty(value = "outputs", required = true) List<OutputFieldMappingEntry> outputs) {
  86.         super(inputs, outputs);
  87.     }

  88.     /**
  89.      * Get the defaultLanguageCode property: A value indicating which language code to use. Default is en.
  90.      *
  91.      * @return the defaultLanguageCode value.
  92.      */
  93.     public String getDefaultLanguageCode() {
  94.         return this.defaultLanguageCode;
  95.     }

  96.     /**
  97.      * Set the defaultLanguageCode property: A value indicating which language code to use. Default is en.
  98.      *
  99.      * @param defaultLanguageCode the defaultLanguageCode value to set.
  100.      * @return the PiiDetectionSkill object itself.
  101.      */
  102.     public PiiDetectionSkill setDefaultLanguageCode(String defaultLanguageCode) {
  103.         this.defaultLanguageCode = defaultLanguageCode;
  104.         return this;
  105.     }

  106.     /**
  107.      * Get the minimumPrecision property: A value between 0 and 1 that be used to only include entities whose confidence
  108.      * score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will
  109.      * be included.
  110.      *
  111.      * @return the minimumPrecision value.
  112.      */
  113.     public Double getMinimumPrecision() {
  114.         return this.minimumPrecision;
  115.     }

  116.     /**
  117.      * Set the minimumPrecision property: A value between 0 and 1 that be used to only include entities whose confidence
  118.      * score is greater than the value specified. If not set (default), or if explicitly set to null, all entities will
  119.      * be included.
  120.      *
  121.      * @param minimumPrecision the minimumPrecision value to set.
  122.      * @return the PiiDetectionSkill object itself.
  123.      */
  124.     public PiiDetectionSkill setMinimumPrecision(Double minimumPrecision) {
  125.         this.minimumPrecision = minimumPrecision;
  126.         return this;
  127.     }

  128.     /**
  129.      * Get the maskingMode property: A parameter that provides various ways to mask the personal information detected in
  130.      * the input text. Default is 'none'.
  131.      *
  132.      * @return the maskingMode value.
  133.      */
  134.     public PiiDetectionSkillMaskingMode getMaskingMode() {
  135.         return this.maskingMode;
  136.     }

  137.     /**
  138.      * Set the maskingMode property: A parameter that provides various ways to mask the personal information detected in
  139.      * the input text. Default is 'none'.
  140.      *
  141.      * @param maskingMode the maskingMode value to set.
  142.      * @return the PiiDetectionSkill object itself.
  143.      */
  144.     public PiiDetectionSkill setMaskingMode(PiiDetectionSkillMaskingMode maskingMode) {
  145.         this.maskingMode = maskingMode;
  146.         return this;
  147.     }

  148.     /**
  149.      * Get the maskingCharacter property: The character used to mask the text if the maskingMode parameter is set to
  150.      * replace. Default is '*'.
  151.      *
  152.      * @return the maskingCharacter value.
  153.      */
  154.     public String getMaskingCharacter() {
  155.         return this.maskingCharacter;
  156.     }

  157.     /**
  158.      * Set the maskingCharacter property: The character used to mask the text if the maskingMode parameter is set to
  159.      * replace. Default is '*'.
  160.      *
  161.      * @param maskingCharacter the maskingCharacter value to set.
  162.      * @return the PiiDetectionSkill object itself.
  163.      */
  164.     public PiiDetectionSkill setMaskingCharacter(String maskingCharacter) {
  165.         this.maskingCharacter = maskingCharacter;
  166.         return this;
  167.     }

  168.     /**
  169.      * Get the modelVersion property: The version of the model to use when calling the Text Analytics service. It will
  170.      * default to the latest available when not specified. We recommend you do not specify this value unless absolutely
  171.      * necessary.
  172.      *
  173.      * @return the modelVersion value.
  174.      */
  175.     public String getModelVersion() {
  176.         return this.modelVersion;
  177.     }

  178.     /**
  179.      * Set the modelVersion property: The version of the model to use when calling the Text Analytics service. It will
  180.      * default to the latest available when not specified. We recommend you do not specify this value unless absolutely
  181.      * necessary.
  182.      *
  183.      * @param modelVersion the modelVersion value to set.
  184.      * @return the PiiDetectionSkill object itself.
  185.      */
  186.     public PiiDetectionSkill setModelVersion(String modelVersion) {
  187.         this.modelVersion = modelVersion;
  188.         return this;
  189.     }

  190.     /**
  191.      * Get the piiCategories property: A list of PII entity categories that should be extracted and masked.
  192.      *
  193.      * @return the piiCategories value.
  194.      */
  195.     public List<String> getPiiCategories() {
  196.         return this.piiCategories;
  197.     }

  198.     /**
  199.      * Set the piiCategories property: A list of PII entity categories that should be extracted and masked.
  200.      *
  201.      * @param piiCategories the piiCategories value to set.
  202.      * @return the PiiDetectionSkill object itself.
  203.      */
  204.     public PiiDetectionSkill setPiiCategories(List<String> piiCategories) {
  205.         this.piiCategories = piiCategories;
  206.         return this;
  207.     }

  208.     /**
  209.      * Get the domain property: If specified, will set the PII domain to include only a subset of the entity categories.
  210.      * Possible values include: 'phi', 'none'. Default is 'none'.
  211.      *
  212.      * @return the domain value.
  213.      */
  214.     public String getDomain() {
  215.         return this.domain;
  216.     }

  217.     /**
  218.      * Set the domain property: If specified, will set the PII domain to include only a subset of the entity categories.
  219.      * Possible values include: 'phi', 'none'. Default is 'none'.
  220.      *
  221.      * @param domain the domain value to set.
  222.      * @return the PiiDetectionSkill object itself.
  223.      */
  224.     public PiiDetectionSkill setDomain(String domain) {
  225.         this.domain = domain;
  226.         return this;
  227.     }
  228. }