com.azure.resourcemanager.servicefabricmanagedclusters.fluent.models.ManagedMaintenanceWindowStatusInner 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.servicefabricmanagedclusters.fluent.models;
import com.azure.core.annotation.Immutable;
import com.azure.core.util.CoreUtils;
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;
/**
* Describes the maintenance window status of the Service Fabric Managed Cluster.
*/
@Immutable
public final class ManagedMaintenanceWindowStatusInner
implements JsonSerializable {
/*
* If maintenance window is enabled on this cluster.
*/
private Boolean isWindowEnabled;
/*
* Indicates if the region is ready to configure maintenance windows.
*/
private Boolean isRegionReady;
/*
* If maintenance window is active.
*/
private Boolean isWindowActive;
/*
* If updates can be applied.
*/
private Boolean canApplyUpdates;
/*
* Last window update time in UTC.
*/
private OffsetDateTime lastWindowStatusUpdateAtUtc;
/*
* Last window start time in UTC.
*/
private OffsetDateTime lastWindowStartTimeUtc;
/*
* Last window end time in UTC.
*/
private OffsetDateTime lastWindowEndTimeUtc;
/**
* Creates an instance of ManagedMaintenanceWindowStatusInner class.
*/
public ManagedMaintenanceWindowStatusInner() {
}
/**
* Get the isWindowEnabled property: If maintenance window is enabled on this cluster.
*
* @return the isWindowEnabled value.
*/
public Boolean isWindowEnabled() {
return this.isWindowEnabled;
}
/**
* Get the isRegionReady property: Indicates if the region is ready to configure maintenance windows.
*
* @return the isRegionReady value.
*/
public Boolean isRegionReady() {
return this.isRegionReady;
}
/**
* Get the isWindowActive property: If maintenance window is active.
*
* @return the isWindowActive value.
*/
public Boolean isWindowActive() {
return this.isWindowActive;
}
/**
* Get the canApplyUpdates property: If updates can be applied.
*
* @return the canApplyUpdates value.
*/
public Boolean canApplyUpdates() {
return this.canApplyUpdates;
}
/**
* Get the lastWindowStatusUpdateAtUtc property: Last window update time in UTC.
*
* @return the lastWindowStatusUpdateAtUtc value.
*/
public OffsetDateTime lastWindowStatusUpdateAtUtc() {
return this.lastWindowStatusUpdateAtUtc;
}
/**
* Get the lastWindowStartTimeUtc property: Last window start time in UTC.
*
* @return the lastWindowStartTimeUtc value.
*/
public OffsetDateTime lastWindowStartTimeUtc() {
return this.lastWindowStartTimeUtc;
}
/**
* Get the lastWindowEndTimeUtc property: Last window end time in UTC.
*
* @return the lastWindowEndTimeUtc value.
*/
public OffsetDateTime lastWindowEndTimeUtc() {
return this.lastWindowEndTimeUtc;
}
/**
* 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();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ManagedMaintenanceWindowStatusInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ManagedMaintenanceWindowStatusInner 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 ManagedMaintenanceWindowStatusInner.
*/
public static ManagedMaintenanceWindowStatusInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ManagedMaintenanceWindowStatusInner deserializedManagedMaintenanceWindowStatusInner
= new ManagedMaintenanceWindowStatusInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("isWindowEnabled".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.isWindowEnabled
= reader.getNullable(JsonReader::getBoolean);
} else if ("isRegionReady".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.isRegionReady
= reader.getNullable(JsonReader::getBoolean);
} else if ("isWindowActive".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.isWindowActive
= reader.getNullable(JsonReader::getBoolean);
} else if ("canApplyUpdates".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.canApplyUpdates
= reader.getNullable(JsonReader::getBoolean);
} else if ("lastWindowStatusUpdateAtUTC".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.lastWindowStatusUpdateAtUtc = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastWindowStartTimeUTC".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.lastWindowStartTimeUtc = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastWindowEndTimeUTC".equals(fieldName)) {
deserializedManagedMaintenanceWindowStatusInner.lastWindowEndTimeUtc = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else {
reader.skipChildren();
}
}
return deserializedManagedMaintenanceWindowStatusInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy