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

package com.azure.resourcemanager.netapp.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of key vault. */
@Fluent
public final class KeyVaultProperties {
    /*
     * UUID v4 used to identify the Azure Key Vault configuration
     */
    @JsonProperty(value = "keyVaultId", access = JsonProperty.Access.WRITE_ONLY)
    private String keyVaultId;

    /*
     * The Uri of KeyVault.
     */
    @JsonProperty(value = "keyVaultUri", required = true)
    private String keyVaultUri;

    /*
     * The name of KeyVault key.
     */
    @JsonProperty(value = "keyName", required = true)
    private String keyName;

    /*
     * The resource ID of KeyVault.
     */
    @JsonProperty(value = "keyVaultResourceId", required = true)
    private String keyVaultResourceId;

    /*
     * Status of the KeyVault connection.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private KeyVaultStatus status;

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

    /**
     * Get the keyVaultId property: UUID v4 used to identify the Azure Key Vault configuration.
     *
     * @return the keyVaultId value.
     */
    public String keyVaultId() {
        return this.keyVaultId;
    }

    /**
     * Get the keyVaultUri property: The Uri of KeyVault.
     *
     * @return the keyVaultUri value.
     */
    public String keyVaultUri() {
        return this.keyVaultUri;
    }

    /**
     * Set the keyVaultUri property: The Uri of KeyVault.
     *
     * @param keyVaultUri the keyVaultUri value to set.
     * @return the KeyVaultProperties object itself.
     */
    public KeyVaultProperties withKeyVaultUri(String keyVaultUri) {
        this.keyVaultUri = keyVaultUri;
        return this;
    }

    /**
     * Get the keyName property: The name of KeyVault key.
     *
     * @return the keyName value.
     */
    public String keyName() {
        return this.keyName;
    }

    /**
     * Set the keyName property: The name of KeyVault key.
     *
     * @param keyName the keyName value to set.
     * @return the KeyVaultProperties object itself.
     */
    public KeyVaultProperties withKeyName(String keyName) {
        this.keyName = keyName;
        return this;
    }

    /**
     * Get the keyVaultResourceId property: The resource ID of KeyVault.
     *
     * @return the keyVaultResourceId value.
     */
    public String keyVaultResourceId() {
        return this.keyVaultResourceId;
    }

    /**
     * Set the keyVaultResourceId property: The resource ID of KeyVault.
     *
     * @param keyVaultResourceId the keyVaultResourceId value to set.
     * @return the KeyVaultProperties object itself.
     */
    public KeyVaultProperties withKeyVaultResourceId(String keyVaultResourceId) {
        this.keyVaultResourceId = keyVaultResourceId;
        return this;
    }

    /**
     * Get the status property: Status of the KeyVault connection.
     *
     * @return the status value.
     */
    public KeyVaultStatus status() {
        return this.status;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (keyVaultUri() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property keyVaultUri in model KeyVaultProperties"));
        }
        if (keyName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property keyName in model KeyVaultProperties"));
        }
        if (keyVaultResourceId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property keyVaultResourceId in model KeyVaultProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(KeyVaultProperties.class);
}
