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

package com.azure.resourcemanager.machinelearningservices.models;

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

/** The EncryptionProperties model. */
@Fluent
public class EncryptionProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(EncryptionProperties.class);

    /*
     * vault base Url
     */
    @JsonProperty(value = "vaultBaseUrl", required = true)
    private String vaultBaseUrl;

    /*
     * Encryption Key name
     */
    @JsonProperty(value = "keyName", required = true)
    private String keyName;

    /*
     * Encryption Key Version
     */
    @JsonProperty(value = "keyVersion", required = true)
    private String keyVersion;

    /**
     * Get the vaultBaseUrl property: vault base Url.
     *
     * @return the vaultBaseUrl value.
     */
    public String vaultBaseUrl() {
        return this.vaultBaseUrl;
    }

    /**
     * Set the vaultBaseUrl property: vault base Url.
     *
     * @param vaultBaseUrl the vaultBaseUrl value to set.
     * @return the EncryptionProperties object itself.
     */
    public EncryptionProperties withVaultBaseUrl(String vaultBaseUrl) {
        this.vaultBaseUrl = vaultBaseUrl;
        return this;
    }

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

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

    /**
     * Get the keyVersion property: Encryption Key Version.
     *
     * @return the keyVersion value.
     */
    public String keyVersion() {
        return this.keyVersion;
    }

    /**
     * Set the keyVersion property: Encryption Key Version.
     *
     * @param keyVersion the keyVersion value to set.
     * @return the EncryptionProperties object itself.
     */
    public EncryptionProperties withKeyVersion(String keyVersion) {
        this.keyVersion = keyVersion;
        return this;
    }

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