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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.databoxedge.models.ArmBaseModel;
import com.azure.resourcemanager.databoxedge.models.DataPolicy;
import com.azure.resourcemanager.databoxedge.models.StorageAccountStatus;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Represents a Storage Account on the Data Box Edge/Gateway device. */
@Fluent
public final class StorageAccountInner extends ArmBaseModel {
    /*
     * The Storage Account properties.
     */
    @JsonProperty(value = "properties", required = true)
    private StorageAccountProperties innerProperties = new StorageAccountProperties();

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

    /**
     * Get the innerProperties property: The Storage Account properties.
     *
     * @return the innerProperties value.
     */
    private StorageAccountProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the description property: Description for the storage Account.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Description for the storage Account.
     *
     * @param description the description value to set.
     * @return the StorageAccountInner object itself.
     */
    public StorageAccountInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageAccountProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the storageAccountStatus property: Current status of the storage account.
     *
     * @return the storageAccountStatus value.
     */
    public StorageAccountStatus storageAccountStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().storageAccountStatus();
    }

    /**
     * Set the storageAccountStatus property: Current status of the storage account.
     *
     * @param storageAccountStatus the storageAccountStatus value to set.
     * @return the StorageAccountInner object itself.
     */
    public StorageAccountInner withStorageAccountStatus(StorageAccountStatus storageAccountStatus) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageAccountProperties();
        }
        this.innerProperties().withStorageAccountStatus(storageAccountStatus);
        return this;
    }

    /**
     * Get the dataPolicy property: Data policy of the storage Account.
     *
     * @return the dataPolicy value.
     */
    public DataPolicy dataPolicy() {
        return this.innerProperties() == null ? null : this.innerProperties().dataPolicy();
    }

    /**
     * Set the dataPolicy property: Data policy of the storage Account.
     *
     * @param dataPolicy the dataPolicy value to set.
     * @return the StorageAccountInner object itself.
     */
    public StorageAccountInner withDataPolicy(DataPolicy dataPolicy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageAccountProperties();
        }
        this.innerProperties().withDataPolicy(dataPolicy);
        return this;
    }

    /**
     * Get the storageAccountCredentialId property: Storage Account Credential Id.
     *
     * @return the storageAccountCredentialId value.
     */
    public String storageAccountCredentialId() {
        return this.innerProperties() == null ? null : this.innerProperties().storageAccountCredentialId();
    }

    /**
     * Set the storageAccountCredentialId property: Storage Account Credential Id.
     *
     * @param storageAccountCredentialId the storageAccountCredentialId value to set.
     * @return the StorageAccountInner object itself.
     */
    public StorageAccountInner withStorageAccountCredentialId(String storageAccountCredentialId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StorageAccountProperties();
        }
        this.innerProperties().withStorageAccountCredentialId(storageAccountCredentialId);
        return this;
    }

    /**
     * Get the blobEndpoint property: BlobEndpoint of Storage Account.
     *
     * @return the blobEndpoint value.
     */
    public String blobEndpoint() {
        return this.innerProperties() == null ? null : this.innerProperties().blobEndpoint();
    }

    /**
     * Get the containerCount property: The Container Count. Present only for Storage Accounts with DataPolicy set to
     * Cloud.
     *
     * @return the containerCount value.
     */
    public Integer containerCount() {
        return this.innerProperties() == null ? null : this.innerProperties().containerCount();
    }

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

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