Class KeyVaultSecret

java.lang.Object
com.azure.security.keyvault.secrets.models.KeyVaultSecret
All Implemented Interfaces:
com.azure.json.JsonSerializable<KeyVaultSecret>
Direct Known Subclasses:
DeletedSecret

public class KeyVaultSecret extends Object implements com.azure.json.JsonSerializable<KeyVaultSecret>
Secret is the resource consisting of name, value and its attributes specified in SecretProperties. It is managed by Secret Service.
See Also:
  • Constructor Details

    • KeyVaultSecret

      public KeyVaultSecret(String name, String value)
      Creates a Secret with name and value.
      Parameters:
      name - The name of the secret.
      value - the value of the secret.
  • Method Details

    • getValue

      public String getValue()
      Get the value of the secret.
      Returns:
      the secret value
    • getId

      public String getId()
      Get the secret identifier.
      Returns:
      the secret identifier.
    • getName

      public String getName()
      Get the secret name.
      Returns:
      the secret name.
    • getProperties

      public SecretProperties getProperties()
      Get the secret properties
      Returns:
      the Secret properties
    • setProperties

      public KeyVaultSecret setProperties(SecretProperties properties)
      Set the secret properties
      Parameters:
      properties - The Secret properties
      Returns:
      the updated secret object
      Throws:
      NullPointerException - if properties is null.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<KeyVaultSecret>
      Throws:
      IOException
    • fromJson

      public static KeyVaultSecret fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of KeyVaultSecret from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of KeyVaultSecret if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the KeyVaultSecret.