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

com.azure.resourcemanager.datafactory.fluent.models.PipelineRunInner 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.datafactory.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.datafactory.models.PipelineRunInvokedBy;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Information about a pipeline run.
 */
@Fluent
public final class PipelineRunInner implements JsonSerializable {
    /*
     * Identifier of a run.
     */
    private String runId;

    /*
     * Identifier that correlates all the recovery runs of a pipeline run.
     */
    private String runGroupId;

    /*
     * Indicates if the recovered pipeline run is the latest in its group.
     */
    private Boolean isLatest;

    /*
     * The pipeline name.
     */
    private String pipelineName;

    /*
     * The full or partial list of parameter name, value pair used in the pipeline run.
     */
    private Map parameters;

    /*
     * Run dimensions emitted by Pipeline run.
     */
    private Map runDimensions;

    /*
     * Entity that started the pipeline run.
     */
    private PipelineRunInvokedBy invokedBy;

    /*
     * The last updated timestamp for the pipeline run event in ISO8601 format.
     */
    private OffsetDateTime lastUpdated;

    /*
     * The start time of a pipeline run in ISO8601 format.
     */
    private OffsetDateTime runStart;

    /*
     * The end time of a pipeline run in ISO8601 format.
     */
    private OffsetDateTime runEnd;

    /*
     * The duration of a pipeline run.
     */
    private Integer durationInMs;

    /*
     * The status of a pipeline run. Possible values: Queued, InProgress, Succeeded, Failed, Canceling, Cancelled
     */
    private String status;

    /*
     * The message from a pipeline run.
     */
    private String message;

    /*
     * Information about a pipeline run.
     */
    private Map additionalProperties;

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

    /**
     * Get the runId property: Identifier of a run.
     * 
     * @return the runId value.
     */
    public String runId() {
        return this.runId;
    }

    /**
     * Get the runGroupId property: Identifier that correlates all the recovery runs of a pipeline run.
     * 
     * @return the runGroupId value.
     */
    public String runGroupId() {
        return this.runGroupId;
    }

    /**
     * Get the isLatest property: Indicates if the recovered pipeline run is the latest in its group.
     * 
     * @return the isLatest value.
     */
    public Boolean isLatest() {
        return this.isLatest;
    }

    /**
     * Get the pipelineName property: The pipeline name.
     * 
     * @return the pipelineName value.
     */
    public String pipelineName() {
        return this.pipelineName;
    }

    /**
     * Get the parameters property: The full or partial list of parameter name, value pair used in the pipeline run.
     * 
     * @return the parameters value.
     */
    public Map parameters() {
        return this.parameters;
    }

    /**
     * Get the runDimensions property: Run dimensions emitted by Pipeline run.
     * 
     * @return the runDimensions value.
     */
    public Map runDimensions() {
        return this.runDimensions;
    }

    /**
     * Get the invokedBy property: Entity that started the pipeline run.
     * 
     * @return the invokedBy value.
     */
    public PipelineRunInvokedBy invokedBy() {
        return this.invokedBy;
    }

    /**
     * Get the lastUpdated property: The last updated timestamp for the pipeline run event in ISO8601 format.
     * 
     * @return the lastUpdated value.
     */
    public OffsetDateTime lastUpdated() {
        return this.lastUpdated;
    }

    /**
     * Get the runStart property: The start time of a pipeline run in ISO8601 format.
     * 
     * @return the runStart value.
     */
    public OffsetDateTime runStart() {
        return this.runStart;
    }

    /**
     * Get the runEnd property: The end time of a pipeline run in ISO8601 format.
     * 
     * @return the runEnd value.
     */
    public OffsetDateTime runEnd() {
        return this.runEnd;
    }

    /**
     * Get the durationInMs property: The duration of a pipeline run.
     * 
     * @return the durationInMs value.
     */
    public Integer durationInMs() {
        return this.durationInMs;
    }

    /**
     * Get the status property: The status of a pipeline run. Possible values: Queued, InProgress, Succeeded, Failed,
     * Canceling, Cancelled.
     * 
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Get the message property: The message from a pipeline run.
     * 
     * @return the message value.
     */
    public String message() {
        return this.message;
    }

    /**
     * Get the additionalProperties property: Information about a pipeline run.
     * 
     * @return the additionalProperties value.
     */
    public Map additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: Information about a pipeline run.
     * 
     * @param additionalProperties the additionalProperties value to set.
     * @return the PipelineRunInner object itself.
     */
    public PipelineRunInner withAdditionalProperties(Map additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        if (additionalProperties != null) {
            for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of PipelineRunInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of PipelineRunInner 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 PipelineRunInner.
     */
    public static PipelineRunInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            PipelineRunInner deserializedPipelineRunInner = new PipelineRunInner();
            Map additionalProperties = null;
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("runId".equals(fieldName)) {
                    deserializedPipelineRunInner.runId = reader.getString();
                } else if ("runGroupId".equals(fieldName)) {
                    deserializedPipelineRunInner.runGroupId = reader.getString();
                } else if ("isLatest".equals(fieldName)) {
                    deserializedPipelineRunInner.isLatest = reader.getNullable(JsonReader::getBoolean);
                } else if ("pipelineName".equals(fieldName)) {
                    deserializedPipelineRunInner.pipelineName = reader.getString();
                } else if ("parameters".equals(fieldName)) {
                    Map parameters = reader.readMap(reader1 -> reader1.getString());
                    deserializedPipelineRunInner.parameters = parameters;
                } else if ("runDimensions".equals(fieldName)) {
                    Map runDimensions = reader.readMap(reader1 -> reader1.getString());
                    deserializedPipelineRunInner.runDimensions = runDimensions;
                } else if ("invokedBy".equals(fieldName)) {
                    deserializedPipelineRunInner.invokedBy = PipelineRunInvokedBy.fromJson(reader);
                } else if ("lastUpdated".equals(fieldName)) {
                    deserializedPipelineRunInner.lastUpdated = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("runStart".equals(fieldName)) {
                    deserializedPipelineRunInner.runStart = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("runEnd".equals(fieldName)) {
                    deserializedPipelineRunInner.runEnd = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("durationInMs".equals(fieldName)) {
                    deserializedPipelineRunInner.durationInMs = reader.getNullable(JsonReader::getInt);
                } else if ("status".equals(fieldName)) {
                    deserializedPipelineRunInner.status = reader.getString();
                } else if ("message".equals(fieldName)) {
                    deserializedPipelineRunInner.message = reader.getString();
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

                    additionalProperties.put(fieldName, reader.readUntyped());
                }
            }
            deserializedPipelineRunInner.additionalProperties = additionalProperties;

            return deserializedPipelineRunInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy