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

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

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

/** The properties that define SAS authentication. */
@Fluent
public final class SasProperties {
    /*
     * The SAS URI to the Azure Storage blob container. Any offset from the root of the container to where the
     * artifacts are located can be defined in the artifactRoot.
     */
    @JsonProperty(value = "sasUri", required = true)
    private String sasUri;

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

    /**
     * Get the sasUri property: The SAS URI to the Azure Storage blob container. Any offset from the root of the
     * container to where the artifacts are located can be defined in the artifactRoot.
     *
     * @return the sasUri value.
     */
    public String sasUri() {
        return this.sasUri;
    }

    /**
     * Set the sasUri property: The SAS URI to the Azure Storage blob container. Any offset from the root of the
     * container to where the artifacts are located can be defined in the artifactRoot.
     *
     * @param sasUri the sasUri value to set.
     * @return the SasProperties object itself.
     */
    public SasProperties withSasUri(String sasUri) {
        this.sasUri = sasUri;
        return this;
    }

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

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