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

package com.azure.resourcemanager.logic.models;

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

/** The encryption key details for the integration service environment. */
@Fluent
public final class IntegrationServiceEnvironmenEncryptionKeyReference {
    /*
     * The key vault reference.
     */
    @JsonProperty(value = "keyVault")
    private ResourceReference keyVault;

    /*
     * Gets the key name in the Key Vault.
     */
    @JsonProperty(value = "keyName")
    private String keyName;

    /*
     * Gets the version of the key specified in the keyName property.
     */
    @JsonProperty(value = "keyVersion")
    private String keyVersion;

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

    /**
     * Get the keyVault property: The key vault reference.
     *
     * @return the keyVault value.
     */
    public ResourceReference keyVault() {
        return this.keyVault;
    }

    /**
     * Set the keyVault property: The key vault reference.
     *
     * @param keyVault the keyVault value to set.
     * @return the IntegrationServiceEnvironmenEncryptionKeyReference object itself.
     */
    public IntegrationServiceEnvironmenEncryptionKeyReference withKeyVault(ResourceReference keyVault) {
        this.keyVault = keyVault;
        return this;
    }

    /**
     * Get the keyName property: Gets the key name in the Key Vault.
     *
     * @return the keyName value.
     */
    public String keyName() {
        return this.keyName;
    }

    /**
     * Set the keyName property: Gets the key name in the Key Vault.
     *
     * @param keyName the keyName value to set.
     * @return the IntegrationServiceEnvironmenEncryptionKeyReference object itself.
     */
    public IntegrationServiceEnvironmenEncryptionKeyReference withKeyName(String keyName) {
        this.keyName = keyName;
        return this;
    }

    /**
     * Get the keyVersion property: Gets the version of the key specified in the keyName property.
     *
     * @return the keyVersion value.
     */
    public String keyVersion() {
        return this.keyVersion;
    }

    /**
     * Set the keyVersion property: Gets the version of the key specified in the keyName property.
     *
     * @param keyVersion the keyVersion value to set.
     * @return the IntegrationServiceEnvironmenEncryptionKeyReference object itself.
     */
    public IntegrationServiceEnvironmenEncryptionKeyReference withKeyVersion(String keyVersion) {
        this.keyVersion = keyVersion;
        return this;
    }

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