com.azure.resourcemanager.azurestackhci.models.RemoteSupportProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-azurestackhci Show documentation
Show all versions of azure-resourcemanager-azurestackhci Show documentation
This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.
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.azurestackhci.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;
import java.util.List;
/**
* Remote Support properties of the cluster.
*/
@Immutable
public final class RemoteSupportProperties implements JsonSerializable {
/*
* Remote Support Access Level
*/
private AccessLevel accessLevel;
/*
* Expiration DateTimeStamp when Remote Support Access will be expired
*/
private OffsetDateTime expirationTimestamp;
/*
* Remote Support Type for cluster
*/
private RemoteSupportType remoteSupportType;
/*
* The remoteSupportNodeSettings property.
*/
private List remoteSupportNodeSettings;
/*
* The remoteSupportSessionDetails property.
*/
private List remoteSupportSessionDetails;
/**
* Creates an instance of RemoteSupportProperties class.
*/
public RemoteSupportProperties() {
}
/**
* Get the accessLevel property: Remote Support Access Level.
*
* @return the accessLevel value.
*/
public AccessLevel accessLevel() {
return this.accessLevel;
}
/**
* Get the expirationTimestamp property: Expiration DateTimeStamp when Remote Support Access will be expired.
*
* @return the expirationTimestamp value.
*/
public OffsetDateTime expirationTimestamp() {
return this.expirationTimestamp;
}
/**
* Get the remoteSupportType property: Remote Support Type for cluster.
*
* @return the remoteSupportType value.
*/
public RemoteSupportType remoteSupportType() {
return this.remoteSupportType;
}
/**
* Get the remoteSupportNodeSettings property: The remoteSupportNodeSettings property.
*
* @return the remoteSupportNodeSettings value.
*/
public List remoteSupportNodeSettings() {
return this.remoteSupportNodeSettings;
}
/**
* Get the remoteSupportSessionDetails property: The remoteSupportSessionDetails property.
*
* @return the remoteSupportSessionDetails value.
*/
public List remoteSupportSessionDetails() {
return this.remoteSupportSessionDetails;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (remoteSupportNodeSettings() != null) {
remoteSupportNodeSettings().forEach(e -> e.validate());
}
if (remoteSupportSessionDetails() != null) {
remoteSupportSessionDetails().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of RemoteSupportProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of RemoteSupportProperties 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 RemoteSupportProperties.
*/
public static RemoteSupportProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
RemoteSupportProperties deserializedRemoteSupportProperties = new RemoteSupportProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("accessLevel".equals(fieldName)) {
deserializedRemoteSupportProperties.accessLevel = AccessLevel.fromString(reader.getString());
} else if ("expirationTimeStamp".equals(fieldName)) {
deserializedRemoteSupportProperties.expirationTimestamp = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("remoteSupportType".equals(fieldName)) {
deserializedRemoteSupportProperties.remoteSupportType
= RemoteSupportType.fromString(reader.getString());
} else if ("remoteSupportNodeSettings".equals(fieldName)) {
List remoteSupportNodeSettings
= reader.readArray(reader1 -> RemoteSupportNodeSettings.fromJson(reader1));
deserializedRemoteSupportProperties.remoteSupportNodeSettings = remoteSupportNodeSettings;
} else if ("remoteSupportSessionDetails".equals(fieldName)) {
List remoteSupportSessionDetails
= reader.readArray(reader1 -> PerNodeRemoteSupportSession.fromJson(reader1));
deserializedRemoteSupportProperties.remoteSupportSessionDetails = remoteSupportSessionDetails;
} else {
reader.skipChildren();
}
}
return deserializedRemoteSupportProperties;
});
}
}