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

com.azure.ai.metricsadvisor.implementation.models.DataFeedIngestionProgress 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 DataFeedIngestionProgress model.
 */
@Immutable
public final class DataFeedIngestionProgress implements JsonSerializable {
    /*
     * the timestamp of latest success ingestion job.
     * null indicates not available
     */
    private OffsetDateTime latestSuccessTimestamp;

    /*
     * the timestamp of latest ingestion job with status update.
     * null indicates not available
     */
    private OffsetDateTime latestActiveTimestamp;

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

    /**
     * Get the latestSuccessTimestamp property: the timestamp of latest success ingestion job.
     * null indicates not available.
     * 
     * @return the latestSuccessTimestamp value.
     */
    public OffsetDateTime getLatestSuccessTimestamp() {
        return this.latestSuccessTimestamp;
    }

    /**
     * Get the latestActiveTimestamp property: the timestamp of latest ingestion job with status update.
     * null indicates not available.
     * 
     * @return the latestActiveTimestamp value.
     */
    public OffsetDateTime getLatestActiveTimestamp() {
        return this.latestActiveTimestamp;
    }

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

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

                if ("latestSuccessTimestamp".equals(fieldName)) {
                    deserializedDataFeedIngestionProgress.latestSuccessTimestamp
                        = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
                } else if ("latestActiveTimestamp".equals(fieldName)) {
                    deserializedDataFeedIngestionProgress.latestActiveTimestamp
                        = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDataFeedIngestionProgress;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy