com.azure.ai.metricsadvisor.implementation.models.UsageStats Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-ai-metricsadvisor Show documentation
Show all versions of azure-ai-metricsadvisor Show documentation
This package contains the Microsoft Azure Cognitive Services Metrics Advisor SDK.
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 UsageStats model.
*/
@Immutable
public final class UsageStats implements JsonSerializable {
/*
* The timestamp of the stats
*/
private OffsetDateTime timestamp;
/*
* The active series count
*/
private Integer activeSeriesCount;
/*
* All series count under non deleted data feed
*/
private Integer allSeriesCount;
/*
* The metrics count under non deleted data feed
*/
private Integer metricsCount;
/*
* The count of non deleted data feed
*/
private Integer dataFeedCount;
/**
* Creates an instance of UsageStats class.
*/
public UsageStats() {
}
/**
* Get the timestamp property: The timestamp of the stats.
*
* @return the timestamp value.
*/
public OffsetDateTime getTimestamp() {
return this.timestamp;
}
/**
* Get the activeSeriesCount property: The active series count.
*
* @return the activeSeriesCount value.
*/
public Integer getActiveSeriesCount() {
return this.activeSeriesCount;
}
/**
* Get the allSeriesCount property: All series count under non deleted data feed.
*
* @return the allSeriesCount value.
*/
public Integer getAllSeriesCount() {
return this.allSeriesCount;
}
/**
* Get the metricsCount property: The metrics count under non deleted data feed.
*
* @return the metricsCount value.
*/
public Integer getMetricsCount() {
return this.metricsCount;
}
/**
* Get the dataFeedCount property: The count of non deleted data feed.
*
* @return the dataFeedCount value.
*/
public Integer getDataFeedCount() {
return this.dataFeedCount;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of UsageStats from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of UsageStats 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 UsageStats.
*/
public static UsageStats fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
UsageStats deserializedUsageStats = new UsageStats();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("timestamp".equals(fieldName)) {
deserializedUsageStats.timestamp
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
} else if ("activeSeriesCount".equals(fieldName)) {
deserializedUsageStats.activeSeriesCount = reader.getNullable(JsonReader::getInt);
} else if ("allSeriesCount".equals(fieldName)) {
deserializedUsageStats.allSeriesCount = reader.getNullable(JsonReader::getInt);
} else if ("metricsCount".equals(fieldName)) {
deserializedUsageStats.metricsCount = reader.getNullable(JsonReader::getInt);
} else if ("dataFeedCount".equals(fieldName)) {
deserializedUsageStats.dataFeedCount = reader.getNullable(JsonReader::getInt);
} else {
reader.skipChildren();
}
}
return deserializedUsageStats;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy