/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.batch.protocol.models;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Specifies a file upload destination within an Azure blob storage container.
 */
public class OutputFileBlobContainerDestination {
    /**
     * The destination blob or virtual directory within the Azure Storage
     * container.
     * If filePattern refers to a specific file (i.e. contains no wildcards),
     * then path is the name of the blob to which to upload that file. If
     * filePattern contains one or more wildcards (and therefore may match
     * multiple files), then path is the name of the blob virtual directory
     * (which is prepended to each blob name) to which to upload the file(s).
     * If omitted, file(s) are uploaded to the root of the container with a
     * blob name matching their file name.
     */
    @JsonProperty(value = "path")
    private String path;

    /**
     * The URL of the container within Azure Blob Storage to which to upload
     * the file(s).
     * If not using a managed identity, the URL must include a Shared Access
     * Signature (SAS) granting write permissions to the container.
     */
    @JsonProperty(value = "containerUrl", required = true)
    private String containerUrl;

    /**
     * The reference to the user assigned identity to use to access Azure Blob
     * Storage specified by containerUrl.
     * The identity must have write access to the Azure Blob Storage container.
     */
    @JsonProperty(value = "identityReference")
    private ComputeNodeIdentityReference identityReference;

    /**
     * A list of name-value pairs for headers to be used in uploading output
     * files.
     * These headers will be specified when uploading files to Azure Storage.
     * Official document on allowed headers when uploading blobs:
     * https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types.
     */
    @JsonProperty(value = "uploadHeaders")
    private List<HttpHeader> uploadHeaders;

    /**
     * Get if filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name.
     *
     * @return the path value
     */
    public String path() {
        return this.path;
    }

    /**
     * Set if filePattern refers to a specific file (i.e. contains no wildcards), then path is the name of the blob to which to upload that file. If filePattern contains one or more wildcards (and therefore may match multiple files), then path is the name of the blob virtual directory (which is prepended to each blob name) to which to upload the file(s). If omitted, file(s) are uploaded to the root of the container with a blob name matching their file name.
     *
     * @param path the path value to set
     * @return the OutputFileBlobContainerDestination object itself.
     */
    public OutputFileBlobContainerDestination withPath(String path) {
        this.path = path;
        return this;
    }

    /**
     * Get if not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container.
     *
     * @return the containerUrl value
     */
    public String containerUrl() {
        return this.containerUrl;
    }

    /**
     * Set if not using a managed identity, the URL must include a Shared Access Signature (SAS) granting write permissions to the container.
     *
     * @param containerUrl the containerUrl value to set
     * @return the OutputFileBlobContainerDestination object itself.
     */
    public OutputFileBlobContainerDestination withContainerUrl(String containerUrl) {
        this.containerUrl = containerUrl;
        return this;
    }

    /**
     * Get the identity must have write access to the Azure Blob Storage container.
     *
     * @return the identityReference value
     */
    public ComputeNodeIdentityReference identityReference() {
        return this.identityReference;
    }

    /**
     * Set the identity must have write access to the Azure Blob Storage container.
     *
     * @param identityReference the identityReference value to set
     * @return the OutputFileBlobContainerDestination object itself.
     */
    public OutputFileBlobContainerDestination withIdentityReference(ComputeNodeIdentityReference identityReference) {
        this.identityReference = identityReference;
        return this;
    }

    /**
     * Get these headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types.
     *
     * @return the uploadHeaders value
     */
    public List<HttpHeader> uploadHeaders() {
        return this.uploadHeaders;
    }

    /**
     * Set these headers will be specified when uploading files to Azure Storage. Official document on allowed headers when uploading blobs: https://docs.microsoft.com/en-us/rest/api/storageservices/put-blob#request-headers-all-blob-types.
     *
     * @param uploadHeaders the uploadHeaders value to set
     * @return the OutputFileBlobContainerDestination object itself.
     */
    public OutputFileBlobContainerDestination withUploadHeaders(List<HttpHeader> uploadHeaders) {
        this.uploadHeaders = uploadHeaders;
        return this;
    }

}
