CognitiveServicesAccountKey.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. /** A cognitive service resource provisioned with a key that is attached to a skillset. */
  15. @JsonTypeInfo(
  16.         use = JsonTypeInfo.Id.NAME,
  17.         include = JsonTypeInfo.As.EXISTING_PROPERTY,
  18.         property = "@odata.type",
  19.         visible = true)
  20. @JsonTypeName("#Microsoft.Azure.Search.CognitiveServicesByKey")
  21. @Fluent
  22. public final class CognitiveServicesAccountKey extends CognitiveServicesAccount {

  23.     /*
  24.      * Identifies the concrete type of the cognitive service resource attached
  25.      * to a skillset.
  26.      */
  27.     @JsonTypeId
  28.     @JsonProperty(value = "@odata.type", required = true)
  29.     private String odataType = "#Microsoft.Azure.Search.CognitiveServicesByKey";

  30.     /*
  31.      * The key used to provision the cognitive service resource attached to a
  32.      * skillset.
  33.      */
  34.     @JsonProperty(value = "key", required = true)
  35.     private String key;

  36.     /**
  37.      * Creates an instance of CognitiveServicesAccountKey class.
  38.      *
  39.      * @param key the key value to set.
  40.      */
  41.     @JsonCreator
  42.     public CognitiveServicesAccountKey(@JsonProperty(value = "key", required = true) String key) {
  43.         this.key = key;
  44.     }

  45.     /**
  46.      * Get the key property: The key used to provision the cognitive service resource attached to a skillset.
  47.      *
  48.      * @return the key value.
  49.      */
  50.     public String getKey() {
  51.         return this.key;
  52.     }

  53.     /**
  54.      * Set the key property: The key used to provision the cognitive service resource attached to a skillset.
  55.      *
  56.      * @param key the key value to set.
  57.      * @return the CognitiveServicesAccountKey object itself.
  58.      */
  59.     public CognitiveServicesAccountKey setKey(String key) {
  60.         this.key = key;
  61.         return this;
  62.     }
  63. }