
com.azure.resourcemanager.deviceupdate.models.Encryption Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.deviceupdate.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;
/**
* The CMK encryption settings on the Device Update account.
*/
@Fluent
public final class Encryption implements JsonSerializable {
/*
* The URI of the key vault
*/
private String keyVaultKeyUri;
/*
* The full resourceId of the user assigned identity to be used for key vault access. Identity has to be also
* assigned to the Account
*/
private String userAssignedIdentity;
/**
* Creates an instance of Encryption class.
*/
public Encryption() {
}
/**
* Get the keyVaultKeyUri property: The URI of the key vault.
*
* @return the keyVaultKeyUri value.
*/
public String keyVaultKeyUri() {
return this.keyVaultKeyUri;
}
/**
* Set the keyVaultKeyUri property: The URI of the key vault.
*
* @param keyVaultKeyUri the keyVaultKeyUri value to set.
* @return the Encryption object itself.
*/
public Encryption withKeyVaultKeyUri(String keyVaultKeyUri) {
this.keyVaultKeyUri = keyVaultKeyUri;
return this;
}
/**
* Get the userAssignedIdentity property: The full resourceId of the user assigned identity to be used for key vault
* access. Identity has to be also assigned to the Account.
*
* @return the userAssignedIdentity value.
*/
public String userAssignedIdentity() {
return this.userAssignedIdentity;
}
/**
* Set the userAssignedIdentity property: The full resourceId of the user assigned identity to be used for key vault
* access. Identity has to be also assigned to the Account.
*
* @param userAssignedIdentity the userAssignedIdentity value to set.
* @return the Encryption object itself.
*/
public Encryption withUserAssignedIdentity(String userAssignedIdentity) {
this.userAssignedIdentity = userAssignedIdentity;
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("keyVaultKeyUri", this.keyVaultKeyUri);
jsonWriter.writeStringField("userAssignedIdentity", this.userAssignedIdentity);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of Encryption from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of Encryption 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 Encryption.
*/
public static Encryption fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
Encryption deserializedEncryption = new Encryption();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("keyVaultKeyUri".equals(fieldName)) {
deserializedEncryption.keyVaultKeyUri = reader.getString();
} else if ("userAssignedIdentity".equals(fieldName)) {
deserializedEncryption.userAssignedIdentity = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedEncryption;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy