// 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;

/**
 * All Customer-managed key encryption properties for the resource. Set this to an empty object to use Microsoft-managed
 * key encryption.
 */
@Fluent
public final class ClusterPropertiesEncryptionCustomerManagedKeyEncryption {
    /*
     * All identity configuration for Customer-managed key settings defining which identity should be used to auth to
     * Key Vault.
     */
    @JsonProperty(value = "keyEncryptionKeyIdentity")
    private ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity;

    /*
     * Key encryption key Url, versioned only. Ex:
     * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78
     */
    @JsonProperty(value = "keyEncryptionKeyUrl")
    private String keyEncryptionKeyUrl;

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

    /**
     * Get the keyEncryptionKeyIdentity property: All identity configuration for Customer-managed key settings defining
     * which identity should be used to auth to Key Vault.
     *
     * @return the keyEncryptionKeyIdentity value.
     */
    public ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity() {
        return this.keyEncryptionKeyIdentity;
    }

    /**
     * Set the keyEncryptionKeyIdentity property: All identity configuration for Customer-managed key settings defining
     * which identity should be used to auth to Key Vault.
     *
     * @param keyEncryptionKeyIdentity the keyEncryptionKeyIdentity value to set.
     * @return the ClusterPropertiesEncryptionCustomerManagedKeyEncryption object itself.
     */
    public ClusterPropertiesEncryptionCustomerManagedKeyEncryption withKeyEncryptionKeyIdentity(
        ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity) {
        this.keyEncryptionKeyIdentity = keyEncryptionKeyIdentity;
        return this;
    }

    /**
     * Get the keyEncryptionKeyUrl property: Key encryption key Url, versioned only. Ex:
     * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78.
     *
     * @return the keyEncryptionKeyUrl value.
     */
    public String keyEncryptionKeyUrl() {
        return this.keyEncryptionKeyUrl;
    }

    /**
     * Set the keyEncryptionKeyUrl property: Key encryption key Url, versioned only. Ex:
     * https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78.
     *
     * @param keyEncryptionKeyUrl the keyEncryptionKeyUrl value to set.
     * @return the ClusterPropertiesEncryptionCustomerManagedKeyEncryption object itself.
     */
    public ClusterPropertiesEncryptionCustomerManagedKeyEncryption withKeyEncryptionKeyUrl(String keyEncryptionKeyUrl) {
        this.keyEncryptionKeyUrl = keyEncryptionKeyUrl;
        return this;
    }

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