// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.automation.fluent.models.DscConfigurationCreateOrUpdateProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The parameters supplied to the create or update configuration operation. */
@Fluent
public final class DscConfigurationUpdateParameters {
    /*
     * Gets or sets configuration create or update properties.
     */
    @JsonProperty(value = "properties")
    private DscConfigurationCreateOrUpdateProperties innerProperties;

    /*
     * Gets or sets name of the resource.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Gets or sets the tags attached to the resource.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /**
     * Get the innerProperties property: Gets or sets configuration create or update properties.
     *
     * @return the innerProperties value.
     */
    private DscConfigurationCreateOrUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the name property: Gets or sets name of the resource.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Gets or sets name of the resource.
     *
     * @param name the name value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the tags property: Gets or sets the tags attached to the resource.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Gets or sets the tags attached to the resource.
     *
     * @param tags the tags value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the logVerbose property: Gets or sets verbose log option.
     *
     * @return the logVerbose value.
     */
    public Boolean logVerbose() {
        return this.innerProperties() == null ? null : this.innerProperties().logVerbose();
    }

    /**
     * Set the logVerbose property: Gets or sets verbose log option.
     *
     * @param logVerbose the logVerbose value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withLogVerbose(Boolean logVerbose) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationCreateOrUpdateProperties();
        }
        this.innerProperties().withLogVerbose(logVerbose);
        return this;
    }

    /**
     * Get the logProgress property: Gets or sets progress log option.
     *
     * @return the logProgress value.
     */
    public Boolean logProgress() {
        return this.innerProperties() == null ? null : this.innerProperties().logProgress();
    }

    /**
     * Set the logProgress property: Gets or sets progress log option.
     *
     * @param logProgress the logProgress value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withLogProgress(Boolean logProgress) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationCreateOrUpdateProperties();
        }
        this.innerProperties().withLogProgress(logProgress);
        return this;
    }

    /**
     * Get the source property: Gets or sets the source.
     *
     * @return the source value.
     */
    public ContentSource source() {
        return this.innerProperties() == null ? null : this.innerProperties().source();
    }

    /**
     * Set the source property: Gets or sets the source.
     *
     * @param source the source value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withSource(ContentSource source) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationCreateOrUpdateProperties();
        }
        this.innerProperties().withSource(source);
        return this;
    }

    /**
     * Get the parameters property: Gets or sets the configuration parameters.
     *
     * @return the parameters value.
     */
    public Map<String, DscConfigurationParameter> parameters() {
        return this.innerProperties() == null ? null : this.innerProperties().parameters();
    }

    /**
     * Set the parameters property: Gets or sets the configuration parameters.
     *
     * @param parameters the parameters value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withParameters(Map<String, DscConfigurationParameter> parameters) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationCreateOrUpdateProperties();
        }
        this.innerProperties().withParameters(parameters);
        return this;
    }

    /**
     * Get the description property: Gets or sets the description of the configuration.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Gets or sets the description of the configuration.
     *
     * @param description the description value to set.
     * @return the DscConfigurationUpdateParameters object itself.
     */
    public DscConfigurationUpdateParameters withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationCreateOrUpdateProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

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