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 Summary
ConstructorsConstructorDescriptionKeyVaultSecret
(String name, String value) Creates a Secret withname
andvalue
. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyVaultSecret
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance ofKeyVaultSecret
from the JsonReader.getId()
Get the secret identifier.getName()
Get the secret name.Get the secret propertiesgetValue()
Get the value of the secret.setProperties
(SecretProperties properties) Set the secret propertiescom.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter)
-
Constructor Details
-
KeyVaultSecret
Creates a Secret withname
andvalue
.- Parameters:
name
- The name of the secret.value
- the value of the secret.
-
-
Method Details
-
getValue
Get the value of the secret.- Returns:
- the secret value
-
getId
Get the secret identifier.- Returns:
- the secret identifier.
-
getName
Get the secret name.- Returns:
- the secret name.
-
getProperties
Get the secret properties- Returns:
- the Secret properties
-
setProperties
Set the secret properties- Parameters:
properties
- The Secret properties- Returns:
- the updated secret object
- Throws:
NullPointerException
- ifproperties
is null.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<KeyVaultSecret>
- Throws:
IOException
-
fromJson
Reads an instance ofKeyVaultSecret
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 theKeyVaultSecret
.
-