All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.databricks.models.EncryptionEntitiesDefinition Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureDatabricks Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management APIs allow end users to operate on Azure Databricks Workspace / Access Connector resources. Package tag package-2023-05-01.

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.databricks.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;

/**
 * Encryption entities for databricks workspace resource.
 */
@Fluent
public final class EncryptionEntitiesDefinition implements JsonSerializable {
    /*
     * Encryption properties for the databricks managed services.
     */
    private EncryptionV2 managedServices;

    /*
     * Encryption properties for the databricks managed disks.
     */
    private ManagedDiskEncryption managedDisk;

    /**
     * Creates an instance of EncryptionEntitiesDefinition class.
     */
    public EncryptionEntitiesDefinition() {
    }

    /**
     * Get the managedServices property: Encryption properties for the databricks managed services.
     * 
     * @return the managedServices value.
     */
    public EncryptionV2 managedServices() {
        return this.managedServices;
    }

    /**
     * Set the managedServices property: Encryption properties for the databricks managed services.
     * 
     * @param managedServices the managedServices value to set.
     * @return the EncryptionEntitiesDefinition object itself.
     */
    public EncryptionEntitiesDefinition withManagedServices(EncryptionV2 managedServices) {
        this.managedServices = managedServices;
        return this;
    }

    /**
     * Get the managedDisk property: Encryption properties for the databricks managed disks.
     * 
     * @return the managedDisk value.
     */
    public ManagedDiskEncryption managedDisk() {
        return this.managedDisk;
    }

    /**
     * Set the managedDisk property: Encryption properties for the databricks managed disks.
     * 
     * @param managedDisk the managedDisk value to set.
     * @return the EncryptionEntitiesDefinition object itself.
     */
    public EncryptionEntitiesDefinition withManagedDisk(ManagedDiskEncryption managedDisk) {
        this.managedDisk = managedDisk;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (managedServices() != null) {
            managedServices().validate();
        }
        if (managedDisk() != null) {
            managedDisk().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("managedServices", this.managedServices);
        jsonWriter.writeJsonField("managedDisk", this.managedDisk);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of EncryptionEntitiesDefinition from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of EncryptionEntitiesDefinition 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 EncryptionEntitiesDefinition.
     */
    public static EncryptionEntitiesDefinition fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            EncryptionEntitiesDefinition deserializedEncryptionEntitiesDefinition = new EncryptionEntitiesDefinition();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("managedServices".equals(fieldName)) {
                    deserializedEncryptionEntitiesDefinition.managedServices = EncryptionV2.fromJson(reader);
                } else if ("managedDisk".equals(fieldName)) {
                    deserializedEncryptionEntitiesDefinition.managedDisk = ManagedDiskEncryption.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedEncryptionEntitiesDefinition;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy