
com.azure.resourcemanager.recoveryservices.models.MonitoringSummary 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.recoveryservices.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Summary of the replication monitoring data for this vault.
*/
@Fluent
public final class MonitoringSummary implements JsonSerializable {
/*
* Count of unhealthy VMs.
*/
private Integer unHealthyVmCount;
/*
* Count of unhealthy replication providers.
*/
private Integer unHealthyProviderCount;
/*
* Count of all critical warnings.
*/
private Integer eventsCount;
/*
* Count of all deprecated recovery service providers.
*/
private Integer deprecatedProviderCount;
/*
* Count of all the supported recovery service providers.
*/
private Integer supportedProviderCount;
/*
* Count of all the unsupported recovery service providers.
*/
private Integer unsupportedProviderCount;
/**
* Creates an instance of MonitoringSummary class.
*/
public MonitoringSummary() {
}
/**
* Get the unHealthyVmCount property: Count of unhealthy VMs.
*
* @return the unHealthyVmCount value.
*/
public Integer unHealthyVmCount() {
return this.unHealthyVmCount;
}
/**
* Set the unHealthyVmCount property: Count of unhealthy VMs.
*
* @param unHealthyVmCount the unHealthyVmCount value to set.
* @return the MonitoringSummary object itself.
*/
public MonitoringSummary withUnHealthyVmCount(Integer unHealthyVmCount) {
this.unHealthyVmCount = unHealthyVmCount;
return this;
}
/**
* Get the unHealthyProviderCount property: Count of unhealthy replication providers.
*
* @return the unHealthyProviderCount value.
*/
public Integer unHealthyProviderCount() {
return this.unHealthyProviderCount;
}
/**
* Set the unHealthyProviderCount property: Count of unhealthy replication providers.
*
* @param unHealthyProviderCount the unHealthyProviderCount value to set.
* @return the MonitoringSummary object itself.
*/
public MonitoringSummary withUnHealthyProviderCount(Integer unHealthyProviderCount) {
this.unHealthyProviderCount = unHealthyProviderCount;
return this;
}
/**
* Get the eventsCount property: Count of all critical warnings.
*
* @return the eventsCount value.
*/
public Integer eventsCount() {
return this.eventsCount;
}
/**
* Set the eventsCount property: Count of all critical warnings.
*
* @param eventsCount the eventsCount value to set.
* @return the MonitoringSummary object itself.
*/
public MonitoringSummary withEventsCount(Integer eventsCount) {
this.eventsCount = eventsCount;
return this;
}
/**
* Get the deprecatedProviderCount property: Count of all deprecated recovery service providers.
*
* @return the deprecatedProviderCount value.
*/
public Integer deprecatedProviderCount() {
return this.deprecatedProviderCount;
}
/**
* Set the deprecatedProviderCount property: Count of all deprecated recovery service providers.
*
* @param deprecatedProviderCount the deprecatedProviderCount value to set.
* @return the MonitoringSummary object itself.
*/
public MonitoringSummary withDeprecatedProviderCount(Integer deprecatedProviderCount) {
this.deprecatedProviderCount = deprecatedProviderCount;
return this;
}
/**
* Get the supportedProviderCount property: Count of all the supported recovery service providers.
*
* @return the supportedProviderCount value.
*/
public Integer supportedProviderCount() {
return this.supportedProviderCount;
}
/**
* Set the supportedProviderCount property: Count of all the supported recovery service providers.
*
* @param supportedProviderCount the supportedProviderCount value to set.
* @return the MonitoringSummary object itself.
*/
public MonitoringSummary withSupportedProviderCount(Integer supportedProviderCount) {
this.supportedProviderCount = supportedProviderCount;
return this;
}
/**
* Get the unsupportedProviderCount property: Count of all the unsupported recovery service providers.
*
* @return the unsupportedProviderCount value.
*/
public Integer unsupportedProviderCount() {
return this.unsupportedProviderCount;
}
/**
* Set the unsupportedProviderCount property: Count of all the unsupported recovery service providers.
*
* @param unsupportedProviderCount the unsupportedProviderCount value to set.
* @return the MonitoringSummary object itself.
*/
public MonitoringSummary withUnsupportedProviderCount(Integer unsupportedProviderCount) {
this.unsupportedProviderCount = unsupportedProviderCount;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeNumberField("unHealthyVmCount", this.unHealthyVmCount);
jsonWriter.writeNumberField("unHealthyProviderCount", this.unHealthyProviderCount);
jsonWriter.writeNumberField("eventsCount", this.eventsCount);
jsonWriter.writeNumberField("deprecatedProviderCount", this.deprecatedProviderCount);
jsonWriter.writeNumberField("supportedProviderCount", this.supportedProviderCount);
jsonWriter.writeNumberField("unsupportedProviderCount", this.unsupportedProviderCount);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MonitoringSummary from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MonitoringSummary 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 MonitoringSummary.
*/
public static MonitoringSummary fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MonitoringSummary deserializedMonitoringSummary = new MonitoringSummary();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("unHealthyVmCount".equals(fieldName)) {
deserializedMonitoringSummary.unHealthyVmCount = reader.getNullable(JsonReader::getInt);
} else if ("unHealthyProviderCount".equals(fieldName)) {
deserializedMonitoringSummary.unHealthyProviderCount = reader.getNullable(JsonReader::getInt);
} else if ("eventsCount".equals(fieldName)) {
deserializedMonitoringSummary.eventsCount = reader.getNullable(JsonReader::getInt);
} else if ("deprecatedProviderCount".equals(fieldName)) {
deserializedMonitoringSummary.deprecatedProviderCount = reader.getNullable(JsonReader::getInt);
} else if ("supportedProviderCount".equals(fieldName)) {
deserializedMonitoringSummary.supportedProviderCount = reader.getNullable(JsonReader::getInt);
} else if ("unsupportedProviderCount".equals(fieldName)) {
deserializedMonitoringSummary.unsupportedProviderCount = reader.getNullable(JsonReader::getInt);
} else {
reader.skipChildren();
}
}
return deserializedMonitoringSummary;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy