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

com.azure.ai.metricsadvisor.models.EnrichmentStatus 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.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 EnrichmentStatus model.
 */
@Immutable
public final class EnrichmentStatus implements JsonSerializable {
    /*
     * data slice timestamp.
     */
    private OffsetDateTime timestamp;

    /*
     * latest enrichment status for this data slice.
     */
    private String status;

    /*
     * the trimmed message describes details of the enrichment status.
     */
    private String message;

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

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

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

    /**
     * Get the message property: the trimmed message describes details of the enrichment status.
     * 
     * @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 EnrichmentStatus from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of EnrichmentStatus 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 EnrichmentStatus.
     */
    public static EnrichmentStatus fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            EnrichmentStatus deserializedEnrichmentStatus = new EnrichmentStatus();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

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

            return deserializedEnrichmentStatus;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy