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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.automation.models.DscConfigurationAssociationProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The parameters supplied to the create compilation job operation. */
@Fluent
public final class DscCompilationJobCreateProperties {
    /*
     * Gets or sets the configuration.
     */
    @JsonProperty(value = "configuration", required = true)
    private DscConfigurationAssociationProperty configuration;

    /*
     * Gets or sets the parameters of the job.
     */
    @JsonProperty(value = "parameters")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> parameters;

    /*
     * If a new build version of NodeConfiguration is required.
     */
    @JsonProperty(value = "incrementNodeConfigurationBuild")
    private Boolean incrementNodeConfigurationBuild;

    /**
     * Get the configuration property: Gets or sets the configuration.
     *
     * @return the configuration value.
     */
    public DscConfigurationAssociationProperty configuration() {
        return this.configuration;
    }

    /**
     * Set the configuration property: Gets or sets the configuration.
     *
     * @param configuration the configuration value to set.
     * @return the DscCompilationJobCreateProperties object itself.
     */
    public DscCompilationJobCreateProperties withConfiguration(DscConfigurationAssociationProperty configuration) {
        this.configuration = configuration;
        return this;
    }

    /**
     * Get the parameters property: Gets or sets the parameters of the job.
     *
     * @return the parameters value.
     */
    public Map<String, String> parameters() {
        return this.parameters;
    }

    /**
     * Set the parameters property: Gets or sets the parameters of the job.
     *
     * @param parameters the parameters value to set.
     * @return the DscCompilationJobCreateProperties object itself.
     */
    public DscCompilationJobCreateProperties withParameters(Map<String, String> parameters) {
        this.parameters = parameters;
        return this;
    }

    /**
     * Get the incrementNodeConfigurationBuild property: If a new build version of NodeConfiguration is required.
     *
     * @return the incrementNodeConfigurationBuild value.
     */
    public Boolean incrementNodeConfigurationBuild() {
        return this.incrementNodeConfigurationBuild;
    }

    /**
     * Set the incrementNodeConfigurationBuild property: If a new build version of NodeConfiguration is required.
     *
     * @param incrementNodeConfigurationBuild the incrementNodeConfigurationBuild value to set.
     * @return the DscCompilationJobCreateProperties object itself.
     */
    public DscCompilationJobCreateProperties withIncrementNodeConfigurationBuild(
        Boolean incrementNodeConfigurationBuild) {
        this.incrementNodeConfigurationBuild = incrementNodeConfigurationBuild;
        return this;
    }

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

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