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

package com.azure.resourcemanager.devtestlabs.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Parameters for generating an ARM template for deploying artifacts. */
@Fluent
public final class GenerateArmTemplateRequest {
    /*
     * The resource name of the virtual machine.
     */
    @JsonProperty(value = "virtualMachineName")
    private String virtualMachineName;

    /*
     * The parameters of the ARM template.
     */
    @JsonProperty(value = "parameters")
    private List<ParameterInfo> parameters;

    /*
     * The location of the virtual machine.
     */
    @JsonProperty(value = "location")
    private String location;

    /*
     * Options for uploading the files for the artifact. UploadFilesAndGenerateSasTokens is the default value.
     */
    @JsonProperty(value = "fileUploadOptions")
    private FileUploadOptions fileUploadOptions;

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

    /**
     * Get the virtualMachineName property: The resource name of the virtual machine.
     *
     * @return the virtualMachineName value.
     */
    public String virtualMachineName() {
        return this.virtualMachineName;
    }

    /**
     * Set the virtualMachineName property: The resource name of the virtual machine.
     *
     * @param virtualMachineName the virtualMachineName value to set.
     * @return the GenerateArmTemplateRequest object itself.
     */
    public GenerateArmTemplateRequest withVirtualMachineName(String virtualMachineName) {
        this.virtualMachineName = virtualMachineName;
        return this;
    }

    /**
     * Get the parameters property: The parameters of the ARM template.
     *
     * @return the parameters value.
     */
    public List<ParameterInfo> parameters() {
        return this.parameters;
    }

    /**
     * Set the parameters property: The parameters of the ARM template.
     *
     * @param parameters the parameters value to set.
     * @return the GenerateArmTemplateRequest object itself.
     */
    public GenerateArmTemplateRequest withParameters(List<ParameterInfo> parameters) {
        this.parameters = parameters;
        return this;
    }

    /**
     * Get the location property: The location of the virtual machine.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The location of the virtual machine.
     *
     * @param location the location value to set.
     * @return the GenerateArmTemplateRequest object itself.
     */
    public GenerateArmTemplateRequest withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the fileUploadOptions property: Options for uploading the files for the artifact.
     * UploadFilesAndGenerateSasTokens is the default value.
     *
     * @return the fileUploadOptions value.
     */
    public FileUploadOptions fileUploadOptions() {
        return this.fileUploadOptions;
    }

    /**
     * Set the fileUploadOptions property: Options for uploading the files for the artifact.
     * UploadFilesAndGenerateSasTokens is the default value.
     *
     * @param fileUploadOptions the fileUploadOptions value to set.
     * @return the GenerateArmTemplateRequest object itself.
     */
    public GenerateArmTemplateRequest withFileUploadOptions(FileUploadOptions fileUploadOptions) {
        this.fileUploadOptions = fileUploadOptions;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (parameters() != null) {
            parameters().forEach(e -> e.validate());
        }
    }
}
