// 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.fasterxml.jackson.annotation.JsonProperty;

/** Encryption entities for databricks workspace resource. */
@Fluent
public final class EncryptionEntitiesDefinition {
    /*
     * Encryption properties for the databricks managed services.
     */
    @JsonProperty(value = "managedServices")
    private EncryptionV2 managedServices;

    /*
     * Encryption properties for the databricks managed disks.
     */
    @JsonProperty(value = "managedDisk")
    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();
        }
    }
}
