com.azure.resourcemanager.hdinsight.models.RegionsCapability Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-hdinsight Show documentation
Show all versions of azure-resourcemanager-hdinsight Show documentation
This package contains Microsoft Azure SDK for HDInsight Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Management Client. Package tag package-2024-08-preview.
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.hdinsight.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;
import java.util.List;
/**
* The regions capability.
*/
@Fluent
public final class RegionsCapability implements JsonSerializable {
/*
* The list of region capabilities.
*/
private List available;
/**
* Creates an instance of RegionsCapability class.
*/
public RegionsCapability() {
}
/**
* Get the available property: The list of region capabilities.
*
* @return the available value.
*/
public List available() {
return this.available;
}
/**
* Set the available property: The list of region capabilities.
*
* @param available the available value to set.
* @return the RegionsCapability object itself.
*/
public RegionsCapability withAvailable(List available) {
this.available = available;
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.writeArrayField("available", this.available, (writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of RegionsCapability from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of RegionsCapability 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 RegionsCapability.
*/
public static RegionsCapability fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
RegionsCapability deserializedRegionsCapability = new RegionsCapability();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("available".equals(fieldName)) {
List available = reader.readArray(reader1 -> reader1.getString());
deserializedRegionsCapability.available = available;
} else {
reader.skipChildren();
}
}
return deserializedRegionsCapability;
});
}
}