// 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.management.Resource;
import com.azure.resourcemanager.automation.models.ContentSource;
import com.azure.resourcemanager.automation.models.DscConfigurationParameter;
import com.azure.resourcemanager.automation.models.DscConfigurationProvisioningState;
import com.azure.resourcemanager.automation.models.DscConfigurationState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** Definition of the configuration type. */
@Fluent
public final class DscConfigurationInner extends Resource {
    /*
     * Gets or sets the configuration properties.
     */
    @JsonProperty(value = "properties")
    private DscConfigurationProperties innerProperties;

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

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

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

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

    /** {@inheritDoc} */
    @Override
    public DscConfigurationInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public DscConfigurationInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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

    /**
     * Set the provisioningState property: Gets or sets the provisioning state of the configuration.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withProvisioningState(DscConfigurationProvisioningState provisioningState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withProvisioningState(provisioningState);
        return this;
    }

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

    /**
     * Set the jobCount property: Gets or sets the job count of the configuration.
     *
     * @param jobCount the jobCount value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withJobCount(Integer jobCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withJobCount(jobCount);
        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 DscConfigurationInner object itself.
     */
    public DscConfigurationInner withParameters(Map<String, DscConfigurationParameter> parameters) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withParameters(parameters);
        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 DscConfigurationInner object itself.
     */
    public DscConfigurationInner withSource(ContentSource source) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withSource(source);
        return this;
    }

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

    /**
     * Set the state property: Gets or sets the state of the configuration.
     *
     * @param state the state value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withState(DscConfigurationState state) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withState(state);
        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 DscConfigurationInner object itself.
     */
    public DscConfigurationInner withLogVerbose(Boolean logVerbose) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withLogVerbose(logVerbose);
        return this;
    }

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

    /**
     * Set the creationTime property: Gets or sets the creation time.
     *
     * @param creationTime the creationTime value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withCreationTime(OffsetDateTime creationTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withCreationTime(creationTime);
        return this;
    }

    /**
     * Get the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
    }

    /**
     * Set the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withLastModifiedTime(lastModifiedTime);
        return this;
    }

    /**
     * Get the nodeConfigurationCount property: Gets the number of compiled node configurations.
     *
     * @return the nodeConfigurationCount value.
     */
    public Integer nodeConfigurationCount() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeConfigurationCount();
    }

    /**
     * Set the nodeConfigurationCount property: Gets the number of compiled node configurations.
     *
     * @param nodeConfigurationCount the nodeConfigurationCount value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withNodeConfigurationCount(Integer nodeConfigurationCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        this.innerProperties().withNodeConfigurationCount(nodeConfigurationCount);
        return this;
    }

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

    /**
     * Set the description property: Gets or sets the description.
     *
     * @param description the description value to set.
     * @return the DscConfigurationInner object itself.
     */
    public DscConfigurationInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DscConfigurationProperties();
        }
        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();
        }
    }
}
