com.azure.resourcemanager.storagecache.models.CacheEncryptionSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-storagecache Show documentation
Show all versions of azure-resourcemanager-storagecache Show documentation
This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.
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.storagecache.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;
/**
* Cache encryption settings.
*/
@Fluent
public final class CacheEncryptionSettings implements JsonSerializable {
/*
* Specifies the location of the key encryption key in key vault.
*/
private KeyVaultKeyReference keyEncryptionKey;
/*
* Specifies whether the service will automatically rotate to the newest version of the key in the key vault.
*/
private Boolean rotationToLatestKeyVersionEnabled;
/**
* Creates an instance of CacheEncryptionSettings class.
*/
public CacheEncryptionSettings() {
}
/**
* Get the keyEncryptionKey property: Specifies the location of the key encryption key in key vault.
*
* @return the keyEncryptionKey value.
*/
public KeyVaultKeyReference keyEncryptionKey() {
return this.keyEncryptionKey;
}
/**
* Set the keyEncryptionKey property: Specifies the location of the key encryption key in key vault.
*
* @param keyEncryptionKey the keyEncryptionKey value to set.
* @return the CacheEncryptionSettings object itself.
*/
public CacheEncryptionSettings withKeyEncryptionKey(KeyVaultKeyReference keyEncryptionKey) {
this.keyEncryptionKey = keyEncryptionKey;
return this;
}
/**
* Get the rotationToLatestKeyVersionEnabled property: Specifies whether the service will automatically rotate to
* the newest version of the key in the key vault.
*
* @return the rotationToLatestKeyVersionEnabled value.
*/
public Boolean rotationToLatestKeyVersionEnabled() {
return this.rotationToLatestKeyVersionEnabled;
}
/**
* Set the rotationToLatestKeyVersionEnabled property: Specifies whether the service will automatically rotate to
* the newest version of the key in the key vault.
*
* @param rotationToLatestKeyVersionEnabled the rotationToLatestKeyVersionEnabled value to set.
* @return the CacheEncryptionSettings object itself.
*/
public CacheEncryptionSettings withRotationToLatestKeyVersionEnabled(Boolean rotationToLatestKeyVersionEnabled) {
this.rotationToLatestKeyVersionEnabled = rotationToLatestKeyVersionEnabled;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (keyEncryptionKey() != null) {
keyEncryptionKey().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("keyEncryptionKey", this.keyEncryptionKey);
jsonWriter.writeBooleanField("rotationToLatestKeyVersionEnabled", this.rotationToLatestKeyVersionEnabled);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CacheEncryptionSettings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CacheEncryptionSettings 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 CacheEncryptionSettings.
*/
public static CacheEncryptionSettings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CacheEncryptionSettings deserializedCacheEncryptionSettings = new CacheEncryptionSettings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("keyEncryptionKey".equals(fieldName)) {
deserializedCacheEncryptionSettings.keyEncryptionKey = KeyVaultKeyReference.fromJson(reader);
} else if ("rotationToLatestKeyVersionEnabled".equals(fieldName)) {
deserializedCacheEncryptionSettings.rotationToLatestKeyVersionEnabled
= reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedCacheEncryptionSettings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy