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

com.azure.ai.metricsadvisor.implementation.models.DataFeedIngestionStatus Maven / Gradle / Ivy

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.ai.metricsadvisor.implementation.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;

/**
 * The DataFeedIngestionStatus model.
 */
@Immutable
public final class DataFeedIngestionStatus implements JsonSerializable {
    /*
     * data slice timestamp.
     */
    private OffsetDateTime timestamp;

    /*
     * latest ingestion task status for this data slice.
     */
    private IngestionStatusType status;

    /*
     * the trimmed message of last ingestion job.
     */
    private String message;

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

    /**
     * Get the timestamp property: data slice timestamp.
     * 
     * @return the timestamp value.
     */
    public OffsetDateTime getTimestamp() {
        return this.timestamp;
    }

    /**
     * Get the status property: latest ingestion task status for this data slice.
     * 
     * @return the status value.
     */
    public IngestionStatusType getStatus() {
        return this.status;
    }

    /**
     * Get the message property: the trimmed message of last ingestion job.
     * 
     * @return the message value.
     */
    public String getMessage() {
        return this.message;
    }

    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

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

                if ("timestamp".equals(fieldName)) {
                    deserializedDataFeedIngestionStatus.timestamp
                        = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
                } else if ("status".equals(fieldName)) {
                    deserializedDataFeedIngestionStatus.status = IngestionStatusType.fromString(reader.getString());
                } else if ("message".equals(fieldName)) {
                    deserializedDataFeedIngestionStatus.message = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDataFeedIngestionStatus;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy