Class SecretProperties
java.lang.Object
com.azure.security.keyvault.secrets.models.SecretProperties
- All Implemented Interfaces:
com.azure.json.JsonSerializable<SecretProperties>
public class SecretProperties
extends Object
implements com.azure.json.JsonSerializable<SecretProperties>
SecretProperties is the resource containing all the properties of the secret except its value.
It is managed by the Secret Service.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SecretProperties
fromJson
(com.azure.json.JsonReader jsonReader) Reads a JSON stream into aSecretProperties
.Get the content type.Get the the UTC time at which secret was created.Get the Secret Expiry time in UTC.getId()
Get the secret identifier.getKeyId()
Get the keyId identifier.getName()
Get the secret name.Get the notBefore UTC time.Gets the number of days a secret is retained before being deleted for a soft delete-enabled Key Vault.Get the recovery level of the secret.getTags()
Get the tags associated with the secret.Get the UTC time at which secret was last updated.Get the version of the secret.Get the enabled value.Get the managed value.setContentType
(String contentType) Set the contentType.setEnabled
(Boolean enabled) Set the enabled value.setExpiresOn
(OffsetDateTime expiresOn) Set theexpires
UTC time.setNotBefore
(OffsetDateTime notBefore) Set thenotBefore
UTC time.Set the tags to be associated with the secret.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Writes the object to the passedJsonWriter
.
-
Constructor Details
-
SecretProperties
public SecretProperties()Creates empty instance of SecretProperties.
-
-
Method Details
-
getName
Get the secret name.- Returns:
- the name of the secret.
-
getRecoveryLevel
Get the recovery level of the secret.- Returns:
- the recoveryLevel of the secret.
-
isEnabled
Get the enabled value.- Returns:
- the enabled value
-
setEnabled
Set the enabled value.- Parameters:
enabled
- The enabled value to set- Returns:
- the SecretProperties object itself.
- Throws:
NullPointerException
- ifenabled
is null.
-
getNotBefore
Get the notBefore UTC time.- Returns:
- the notBefore UTC time.
-
setNotBefore
Set thenotBefore
UTC time.- Parameters:
notBefore
- The notBefore UTC time to set- Returns:
- the SecretProperties object itself.
-
getExpiresOn
Get the Secret Expiry time in UTC.- Returns:
- the expires UTC time.
-
setExpiresOn
Set theexpires
UTC time.- Parameters:
expiresOn
- The expiry time to set for the secret.- Returns:
- the SecretProperties object itself.
-
getCreatedOn
Get the the UTC time at which secret was created.- Returns:
- the created UTC time.
-
getUpdatedOn
Get the UTC time at which secret was last updated.- Returns:
- the last updated UTC time.
-
getId
Get the secret identifier.- Returns:
- the secret identifier.
-
getContentType
Get the content type.- Returns:
- the content type.
-
setContentType
Set the contentType.- Parameters:
contentType
- The contentType to set- Returns:
- the updated SecretProperties object itself.
-
getTags
Get the tags associated with the secret.- Returns:
- the value of the tags.
-
setTags
Set the tags to be associated with the secret.- Parameters:
tags
- The tags to set- Returns:
- the updated SecretProperties object itself.
-
getKeyId
Get the keyId identifier.- Returns:
- the keyId identifier.
-
isManaged
Get the managed value.- Returns:
- the managed value
-
getVersion
Get the version of the secret.- Returns:
- the version of the secret.
-
getRecoverableDays
Gets the number of days a secret is retained before being deleted for a soft delete-enabled Key Vault.- Returns:
- the recoverable days.
-
toJson
Description copied from interface:com.azure.json.JsonSerializable
Writes the object to the passedJsonWriter
.The contract for writing JSON to
JsonWriter
is that the object being written will handle opening and closing its own JSON object. So, for objects calling out to otherJsonSerializable
objects for serialization, they'll write the field name only then pass theJsonWriter
to the otherJsonSerializable
object. This way objects writing JSON will be self-encapsulated for writing properly formatted JSON.- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<SecretProperties>
- Parameters:
jsonWriter
- Where the object's JSON will be written.- Returns:
- The
JsonWriter
where the JSON was written. - Throws:
IOException
- If the object fails to be written to thejsonWriter
.
-
fromJson
Reads a JSON stream into aSecretProperties
.- Parameters:
jsonReader
- TheJsonReader
being read.- Returns:
- An instance of
SecretProperties
that the JSON stream represented, may return null. - Throws:
IOException
- If aSecretProperties
fails to be read from thejsonReader
.
-