All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.automation.fluent.models.SourceControlSyncJobStreamByIdProperties Maven / Gradle / Ivy

// 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.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.models.StreamType;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Map;

/**
 * Definition of source control sync job stream by id properties.
 */
@Fluent
public final class SourceControlSyncJobStreamByIdProperties
    implements JsonSerializable {
    /*
     * The sync job stream id.
     */
    private String sourceControlSyncJobStreamId;

    /*
     * The summary of the sync job stream.
     */
    private String summary;

    /*
     * The time of the sync job stream.
     */
    private OffsetDateTime time;

    /*
     * The type of the sync job stream.
     */
    private StreamType streamType;

    /*
     * The text of the sync job stream.
     */
    private String streamText;

    /*
     * The values of the job stream.
     */
    private Map value;

    /**
     * Creates an instance of SourceControlSyncJobStreamByIdProperties class.
     */
    public SourceControlSyncJobStreamByIdProperties() {
    }

    /**
     * Get the sourceControlSyncJobStreamId property: The sync job stream id.
     * 
     * @return the sourceControlSyncJobStreamId value.
     */
    public String sourceControlSyncJobStreamId() {
        return this.sourceControlSyncJobStreamId;
    }

    /**
     * Set the sourceControlSyncJobStreamId property: The sync job stream id.
     * 
     * @param sourceControlSyncJobStreamId the sourceControlSyncJobStreamId value to set.
     * @return the SourceControlSyncJobStreamByIdProperties object itself.
     */
    public SourceControlSyncJobStreamByIdProperties
        withSourceControlSyncJobStreamId(String sourceControlSyncJobStreamId) {
        this.sourceControlSyncJobStreamId = sourceControlSyncJobStreamId;
        return this;
    }

    /**
     * Get the summary property: The summary of the sync job stream.
     * 
     * @return the summary value.
     */
    public String summary() {
        return this.summary;
    }

    /**
     * Set the summary property: The summary of the sync job stream.
     * 
     * @param summary the summary value to set.
     * @return the SourceControlSyncJobStreamByIdProperties object itself.
     */
    public SourceControlSyncJobStreamByIdProperties withSummary(String summary) {
        this.summary = summary;
        return this;
    }

    /**
     * Get the time property: The time of the sync job stream.
     * 
     * @return the time value.
     */
    public OffsetDateTime time() {
        return this.time;
    }

    /**
     * Get the streamType property: The type of the sync job stream.
     * 
     * @return the streamType value.
     */
    public StreamType streamType() {
        return this.streamType;
    }

    /**
     * Set the streamType property: The type of the sync job stream.
     * 
     * @param streamType the streamType value to set.
     * @return the SourceControlSyncJobStreamByIdProperties object itself.
     */
    public SourceControlSyncJobStreamByIdProperties withStreamType(StreamType streamType) {
        this.streamType = streamType;
        return this;
    }

    /**
     * Get the streamText property: The text of the sync job stream.
     * 
     * @return the streamText value.
     */
    public String streamText() {
        return this.streamText;
    }

    /**
     * Set the streamText property: The text of the sync job stream.
     * 
     * @param streamText the streamText value to set.
     * @return the SourceControlSyncJobStreamByIdProperties object itself.
     */
    public SourceControlSyncJobStreamByIdProperties withStreamText(String streamText) {
        this.streamText = streamText;
        return this;
    }

    /**
     * Get the value property: The values of the job stream.
     * 
     * @return the value value.
     */
    public Map value() {
        return this.value;
    }

    /**
     * Set the value property: The values of the job stream.
     * 
     * @param value the value value to set.
     * @return the SourceControlSyncJobStreamByIdProperties object itself.
     */
    public SourceControlSyncJobStreamByIdProperties withValue(Map value) {
        this.value = value;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("sourceControlSyncJobStreamId", this.sourceControlSyncJobStreamId);
        jsonWriter.writeStringField("summary", this.summary);
        jsonWriter.writeStringField("streamType", this.streamType == null ? null : this.streamType.toString());
        jsonWriter.writeStringField("streamText", this.streamText);
        jsonWriter.writeMapField("value", this.value, (writer, element) -> writer.writeUntyped(element));
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of SourceControlSyncJobStreamByIdProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of SourceControlSyncJobStreamByIdProperties if the JsonReader was pointing to an instance of
     * it, or null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the SourceControlSyncJobStreamByIdProperties.
     */
    public static SourceControlSyncJobStreamByIdProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            SourceControlSyncJobStreamByIdProperties deserializedSourceControlSyncJobStreamByIdProperties
                = new SourceControlSyncJobStreamByIdProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("sourceControlSyncJobStreamId".equals(fieldName)) {
                    deserializedSourceControlSyncJobStreamByIdProperties.sourceControlSyncJobStreamId
                        = reader.getString();
                } else if ("summary".equals(fieldName)) {
                    deserializedSourceControlSyncJobStreamByIdProperties.summary = reader.getString();
                } else if ("time".equals(fieldName)) {
                    deserializedSourceControlSyncJobStreamByIdProperties.time = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("streamType".equals(fieldName)) {
                    deserializedSourceControlSyncJobStreamByIdProperties.streamType
                        = StreamType.fromString(reader.getString());
                } else if ("streamText".equals(fieldName)) {
                    deserializedSourceControlSyncJobStreamByIdProperties.streamText = reader.getString();
                } else if ("value".equals(fieldName)) {
                    Map value = reader.readMap(reader1 -> reader1.readUntyped());
                    deserializedSourceControlSyncJobStreamByIdProperties.value = value;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSourceControlSyncJobStreamByIdProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy