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

package com.azure.resourcemanager.datalakeanalytics.fluent.models;

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

/** The Azure Storage account properties to use when adding a new Azure Storage account. */
@Fluent
public final class AddStorageAccountProperties {
    /*
     * The access key associated with this Azure Storage account that will be used to connect to it.
     */
    @JsonProperty(value = "accessKey", required = true)
    private String accessKey;

    /*
     * The optional suffix for the storage account.
     */
    @JsonProperty(value = "suffix")
    private String suffix;

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

    /**
     * Get the accessKey property: The access key associated with this Azure Storage account that will be used to
     * connect to it.
     *
     * @return the accessKey value.
     */
    public String accessKey() {
        return this.accessKey;
    }

    /**
     * Set the accessKey property: The access key associated with this Azure Storage account that will be used to
     * connect to it.
     *
     * @param accessKey the accessKey value to set.
     * @return the AddStorageAccountProperties object itself.
     */
    public AddStorageAccountProperties withAccessKey(String accessKey) {
        this.accessKey = accessKey;
        return this;
    }

    /**
     * Get the suffix property: The optional suffix for the storage account.
     *
     * @return the suffix value.
     */
    public String suffix() {
        return this.suffix;
    }

    /**
     * Set the suffix property: The optional suffix for the storage account.
     *
     * @param suffix the suffix value to set.
     * @return the AddStorageAccountProperties object itself.
     */
    public AddStorageAccountProperties withSuffix(String suffix) {
        this.suffix = suffix;
        return this;
    }

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

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