// 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.ContentLink;
import com.azure.resourcemanager.automation.models.RunbookTypeEnum;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The parameters supplied to the create or update runbook operation. */
@Fluent
public final class RunbookCreateOrUpdateParametersInner {
    /*
     * Gets or sets runbook create or update properties.
     */
    @JsonProperty(value = "properties", required = true)
    private RunbookCreateOrUpdatePropertiesInner innerProperties = new RunbookCreateOrUpdatePropertiesInner();

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

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

    /*
     * 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 runbook create or update properties.
     *
     * @return the innerProperties value.
     */
    private RunbookCreateOrUpdatePropertiesInner innerProperties() {
        return this.innerProperties;
    }

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

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

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

    /**
     * Set the location property: Gets or sets the location of the resource.
     *
     * @param location the location value to set.
     * @return the RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withLocation(String location) {
        this.location = location;
        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 RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner 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 RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withLogVerbose(Boolean logVerbose) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookCreateOrUpdatePropertiesInner();
        }
        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 RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withLogProgress(Boolean logProgress) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookCreateOrUpdatePropertiesInner();
        }
        this.innerProperties().withLogProgress(logProgress);
        return this;
    }

    /**
     * Get the runbookType property: Gets or sets the type of the runbook.
     *
     * @return the runbookType value.
     */
    public RunbookTypeEnum runbookType() {
        return this.innerProperties() == null ? null : this.innerProperties().runbookType();
    }

    /**
     * Set the runbookType property: Gets or sets the type of the runbook.
     *
     * @param runbookType the runbookType value to set.
     * @return the RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withRunbookType(RunbookTypeEnum runbookType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookCreateOrUpdatePropertiesInner();
        }
        this.innerProperties().withRunbookType(runbookType);
        return this;
    }

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

    /**
     * Set the draft property: Gets or sets the draft runbook properties.
     *
     * @param draft the draft value to set.
     * @return the RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withDraft(RunbookDraftInner draft) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookCreateOrUpdatePropertiesInner();
        }
        this.innerProperties().withDraft(draft);
        return this;
    }

    /**
     * Get the publishContentLink property: Gets or sets the published runbook content link.
     *
     * @return the publishContentLink value.
     */
    public ContentLink publishContentLink() {
        return this.innerProperties() == null ? null : this.innerProperties().publishContentLink();
    }

    /**
     * Set the publishContentLink property: Gets or sets the published runbook content link.
     *
     * @param publishContentLink the publishContentLink value to set.
     * @return the RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withPublishContentLink(ContentLink publishContentLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookCreateOrUpdatePropertiesInner();
        }
        this.innerProperties().withPublishContentLink(publishContentLink);
        return this;
    }

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

    /**
     * Get the logActivityTrace property: Gets or sets the activity-level tracing options of the runbook.
     *
     * @return the logActivityTrace value.
     */
    public Integer logActivityTrace() {
        return this.innerProperties() == null ? null : this.innerProperties().logActivityTrace();
    }

    /**
     * Set the logActivityTrace property: Gets or sets the activity-level tracing options of the runbook.
     *
     * @param logActivityTrace the logActivityTrace value to set.
     * @return the RunbookCreateOrUpdateParametersInner object itself.
     */
    public RunbookCreateOrUpdateParametersInner withLogActivityTrace(Integer logActivityTrace) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RunbookCreateOrUpdatePropertiesInner();
        }
        this.innerProperties().withLogActivityTrace(logActivityTrace);
        return this;
    }

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

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