com.azure.resourcemanager.automation.models.KeyVaultProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-automation Show documentation
Show all versions of azure-resourcemanager-automation Show documentation
This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.automation.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Settings concerning key vault encryption for a configuration store.
*/
@Fluent
public final class KeyVaultProperties implements JsonSerializable {
/*
* The URI of the key vault key used to encrypt data.
*/
private String keyvaultUri;
/*
* The name of key used to encrypt data.
*/
private String keyName;
/*
* The key version of the key used to encrypt data.
*/
private String keyVersion;
/**
* Creates an instance of KeyVaultProperties class.
*/
public KeyVaultProperties() {
}
/**
* Get the keyvaultUri property: The URI of the key vault key used to encrypt data.
*
* @return the keyvaultUri value.
*/
public String keyvaultUri() {
return this.keyvaultUri;
}
/**
* Set the keyvaultUri property: The URI of the key vault key used to encrypt data.
*
* @param keyvaultUri the keyvaultUri value to set.
* @return the KeyVaultProperties object itself.
*/
public KeyVaultProperties withKeyvaultUri(String keyvaultUri) {
this.keyvaultUri = keyvaultUri;
return this;
}
/**
* Get the keyName property: The name of key used to encrypt data.
*
* @return the keyName value.
*/
public String keyName() {
return this.keyName;
}
/**
* Set the keyName property: The name of key used to encrypt data.
*
* @param keyName the keyName value to set.
* @return the KeyVaultProperties object itself.
*/
public KeyVaultProperties withKeyName(String keyName) {
this.keyName = keyName;
return this;
}
/**
* Get the keyVersion property: The key version of the key used to encrypt data.
*
* @return the keyVersion value.
*/
public String keyVersion() {
return this.keyVersion;
}
/**
* Set the keyVersion property: The key version of the key used to encrypt data.
*
* @param keyVersion the keyVersion value to set.
* @return the KeyVaultProperties object itself.
*/
public KeyVaultProperties withKeyVersion(String keyVersion) {
this.keyVersion = keyVersion;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("keyvaultUri", this.keyvaultUri);
jsonWriter.writeStringField("keyName", this.keyName);
jsonWriter.writeStringField("keyVersion", this.keyVersion);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of KeyVaultProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of KeyVaultProperties 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 KeyVaultProperties.
*/
public static KeyVaultProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
KeyVaultProperties deserializedKeyVaultProperties = new KeyVaultProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("keyvaultUri".equals(fieldName)) {
deserializedKeyVaultProperties.keyvaultUri = reader.getString();
} else if ("keyName".equals(fieldName)) {
deserializedKeyVaultProperties.keyName = reader.getString();
} else if ("keyVersion".equals(fieldName)) {
deserializedKeyVaultProperties.keyVersion = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedKeyVaultProperties;
});
}
}