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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.datalakeanalytics.fluent.models.AddStorageAccountProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The parameters used to add a new Azure Storage account. */
@Fluent
public final class AddStorageAccountParameters {
    /*
     * The Azure Storage account properties to use when adding a new Azure Storage account.
     */
    @JsonProperty(value = "properties", required = true)
    private AddStorageAccountProperties innerProperties = new AddStorageAccountProperties();

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

    /**
     * Get the innerProperties property: The Azure Storage account properties to use when adding a new Azure Storage
     * account.
     *
     * @return the innerProperties value.
     */
    private AddStorageAccountProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * 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.innerProperties() == null ? null : this.innerProperties().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 AddStorageAccountParameters object itself.
     */
    public AddStorageAccountParameters withAccessKey(String accessKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AddStorageAccountProperties();
        }
        this.innerProperties().withAccessKey(accessKey);
        return this;
    }

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

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

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

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