com.azure.resourcemanager.storagecache.models.CacheUpgradeSettings Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-storagecache Show documentation
Show all versions of azure-resourcemanager-storagecache Show documentation
This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.
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.resourcemanager.storagecache.models;
import com.azure.core.annotation.Fluent;
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;
import java.time.format.DateTimeFormatter;
/**
* Cache Upgrade Settings.
*/
@Fluent
public final class CacheUpgradeSettings implements JsonSerializable {
/*
* True if the user chooses to select an installation time between now and firmwareUpdateDeadline. Else the firmware
* will automatically be installed after firmwareUpdateDeadline if not triggered earlier via the upgrade operation.
*/
private Boolean upgradeScheduleEnabled;
/*
* When upgradeScheduleEnabled is true, this field holds the user-chosen upgrade time. At the user-chosen time, the
* firmware update will automatically be installed on the cache.
*/
private OffsetDateTime scheduledTime;
/**
* Creates an instance of CacheUpgradeSettings class.
*/
public CacheUpgradeSettings() {
}
/**
* Get the upgradeScheduleEnabled property: True if the user chooses to select an installation time between now and
* firmwareUpdateDeadline. Else the firmware will automatically be installed after firmwareUpdateDeadline if not
* triggered earlier via the upgrade operation.
*
* @return the upgradeScheduleEnabled value.
*/
public Boolean upgradeScheduleEnabled() {
return this.upgradeScheduleEnabled;
}
/**
* Set the upgradeScheduleEnabled property: True if the user chooses to select an installation time between now and
* firmwareUpdateDeadline. Else the firmware will automatically be installed after firmwareUpdateDeadline if not
* triggered earlier via the upgrade operation.
*
* @param upgradeScheduleEnabled the upgradeScheduleEnabled value to set.
* @return the CacheUpgradeSettings object itself.
*/
public CacheUpgradeSettings withUpgradeScheduleEnabled(Boolean upgradeScheduleEnabled) {
this.upgradeScheduleEnabled = upgradeScheduleEnabled;
return this;
}
/**
* Get the scheduledTime property: When upgradeScheduleEnabled is true, this field holds the user-chosen upgrade
* time. At the user-chosen time, the firmware update will automatically be installed on the cache.
*
* @return the scheduledTime value.
*/
public OffsetDateTime scheduledTime() {
return this.scheduledTime;
}
/**
* Set the scheduledTime property: When upgradeScheduleEnabled is true, this field holds the user-chosen upgrade
* time. At the user-chosen time, the firmware update will automatically be installed on the cache.
*
* @param scheduledTime the scheduledTime value to set.
* @return the CacheUpgradeSettings object itself.
*/
public CacheUpgradeSettings withScheduledTime(OffsetDateTime scheduledTime) {
this.scheduledTime = scheduledTime;
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.writeBooleanField("upgradeScheduleEnabled", this.upgradeScheduleEnabled);
jsonWriter.writeStringField("scheduledTime",
this.scheduledTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduledTime));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CacheUpgradeSettings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CacheUpgradeSettings 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 CacheUpgradeSettings.
*/
public static CacheUpgradeSettings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CacheUpgradeSettings deserializedCacheUpgradeSettings = new CacheUpgradeSettings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("upgradeScheduleEnabled".equals(fieldName)) {
deserializedCacheUpgradeSettings.upgradeScheduleEnabled
= reader.getNullable(JsonReader::getBoolean);
} else if ("scheduledTime".equals(fieldName)) {
deserializedCacheUpgradeSettings.scheduledTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else {
reader.skipChildren();
}
}
return deserializedCacheUpgradeSettings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy