// 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.resourcemanager.automation.models.JobStreamType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** Definition of the job stream. */
@Fluent
public final class JobStreamInner {
    /*
     * Gets or sets the id of the resource.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Gets or sets the id of the job stream.
     */
    @JsonProperty(value = "properties")
    private JobStreamProperties innerProperties;

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

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

    /**
     * Get the innerProperties property: Gets or sets the id of the job stream.
     *
     * @return the innerProperties value.
     */
    private JobStreamProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Set the jobStreamId property: Gets or sets the id of the job stream.
     *
     * @param jobStreamId the jobStreamId value to set.
     * @return the JobStreamInner object itself.
     */
    public JobStreamInner withJobStreamId(String jobStreamId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JobStreamProperties();
        }
        this.innerProperties().withJobStreamId(jobStreamId);
        return this;
    }

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

    /**
     * Set the time property: Gets or sets the creation time of the job.
     *
     * @param time the time value to set.
     * @return the JobStreamInner object itself.
     */
    public JobStreamInner withTime(OffsetDateTime time) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JobStreamProperties();
        }
        this.innerProperties().withTime(time);
        return this;
    }

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

    /**
     * Set the streamType property: Gets or sets the stream type.
     *
     * @param streamType the streamType value to set.
     * @return the JobStreamInner object itself.
     */
    public JobStreamInner withStreamType(JobStreamType streamType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JobStreamProperties();
        }
        this.innerProperties().withStreamType(streamType);
        return this;
    }

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

    /**
     * Set the streamText property: Gets or sets the stream text.
     *
     * @param streamText the streamText value to set.
     * @return the JobStreamInner object itself.
     */
    public JobStreamInner withStreamText(String streamText) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JobStreamProperties();
        }
        this.innerProperties().withStreamText(streamText);
        return this;
    }

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

    /**
     * Set the summary property: Gets or sets the summary.
     *
     * @param summary the summary value to set.
     * @return the JobStreamInner object itself.
     */
    public JobStreamInner withSummary(String summary) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JobStreamProperties();
        }
        this.innerProperties().withSummary(summary);
        return this;
    }

    /**
     * Get the value property: Gets or sets the values of the job stream.
     *
     * @return the value value.
     */
    public Map<String, Object> value() {
        return this.innerProperties() == null ? null : this.innerProperties().value();
    }

    /**
     * Set the value property: Gets or sets the values of the job stream.
     *
     * @param value the value value to set.
     * @return the JobStreamInner object itself.
     */
    public JobStreamInner withValue(Map<String, Object> value) {
        if (this.innerProperties() == null) {
            this.innerProperties = new JobStreamProperties();
        }
        this.innerProperties().withValue(value);
        return this;
    }

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