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

package com.azure.resourcemanager.storagemover.models;

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

/** The AzureStorageBlobContainerEndpointProperties model. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "endpointType")
@JsonTypeName("AzureStorageBlobContainer")
@Fluent
public final class AzureStorageBlobContainerEndpointProperties extends EndpointBaseProperties {
    /*
     * The Azure Resource ID of the storage account that is the target destination.
     */
    @JsonProperty(value = "storageAccountResourceId", required = true)
    private String storageAccountResourceId;

    /*
     * The name of the Storage blob container that is the target destination.
     */
    @JsonProperty(value = "blobContainerName", required = true)
    private String blobContainerName;

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

    /**
     * Get the storageAccountResourceId property: The Azure Resource ID of the storage account that is the target
     * destination.
     *
     * @return the storageAccountResourceId value.
     */
    public String storageAccountResourceId() {
        return this.storageAccountResourceId;
    }

    /**
     * Set the storageAccountResourceId property: The Azure Resource ID of the storage account that is the target
     * destination.
     *
     * @param storageAccountResourceId the storageAccountResourceId value to set.
     * @return the AzureStorageBlobContainerEndpointProperties object itself.
     */
    public AzureStorageBlobContainerEndpointProperties withStorageAccountResourceId(String storageAccountResourceId) {
        this.storageAccountResourceId = storageAccountResourceId;
        return this;
    }

    /**
     * Get the blobContainerName property: The name of the Storage blob container that is the target destination.
     *
     * @return the blobContainerName value.
     */
    public String blobContainerName() {
        return this.blobContainerName;
    }

    /**
     * Set the blobContainerName property: The name of the Storage blob container that is the target destination.
     *
     * @param blobContainerName the blobContainerName value to set.
     * @return the AzureStorageBlobContainerEndpointProperties object itself.
     */
    public AzureStorageBlobContainerEndpointProperties withBlobContainerName(String blobContainerName) {
        this.blobContainerName = blobContainerName;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public AzureStorageBlobContainerEndpointProperties withDescription(String description) {
        super.withDescription(description);
        return this;
    }

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

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