// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.redisenterprise.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Encryption-at-rest configuration for the cluster. */
@Fluent
public final class ClusterPropertiesEncryption {
    /*
     * All Customer-managed key encryption properties for the resource. Set this to an empty object to use
     * Microsoft-managed key encryption.
     */
    @JsonProperty(value = "customerManagedKeyEncryption")
    private ClusterPropertiesEncryptionCustomerManagedKeyEncryption customerManagedKeyEncryption;

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

    /**
     * Get the customerManagedKeyEncryption property: All Customer-managed key encryption properties for the resource.
     * Set this to an empty object to use Microsoft-managed key encryption.
     *
     * @return the customerManagedKeyEncryption value.
     */
    public ClusterPropertiesEncryptionCustomerManagedKeyEncryption customerManagedKeyEncryption() {
        return this.customerManagedKeyEncryption;
    }

    /**
     * Set the customerManagedKeyEncryption property: All Customer-managed key encryption properties for the resource.
     * Set this to an empty object to use Microsoft-managed key encryption.
     *
     * @param customerManagedKeyEncryption the customerManagedKeyEncryption value to set.
     * @return the ClusterPropertiesEncryption object itself.
     */
    public ClusterPropertiesEncryption withCustomerManagedKeyEncryption(
        ClusterPropertiesEncryptionCustomerManagedKeyEncryption customerManagedKeyEncryption) {
        this.customerManagedKeyEncryption = customerManagedKeyEncryption;
        return this;
    }

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