com.azure.resourcemanager.hdinsight.models.AzureMonitorSelectedConfigurations 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;
import java.util.Map;
/**
* The selected configurations for azure monitor.
*/
@Fluent
public final class AzureMonitorSelectedConfigurations implements JsonSerializable {
/*
* The configuration version.
*/
private String configurationVersion;
/*
* The global configurations of selected configurations.
*/
private Map globalConfigurations;
/*
* The table list.
*/
private List tableList;
/**
* Creates an instance of AzureMonitorSelectedConfigurations class.
*/
public AzureMonitorSelectedConfigurations() {
}
/**
* Get the configurationVersion property: The configuration version.
*
* @return the configurationVersion value.
*/
public String configurationVersion() {
return this.configurationVersion;
}
/**
* Set the configurationVersion property: The configuration version.
*
* @param configurationVersion the configurationVersion value to set.
* @return the AzureMonitorSelectedConfigurations object itself.
*/
public AzureMonitorSelectedConfigurations withConfigurationVersion(String configurationVersion) {
this.configurationVersion = configurationVersion;
return this;
}
/**
* Get the globalConfigurations property: The global configurations of selected configurations.
*
* @return the globalConfigurations value.
*/
public Map globalConfigurations() {
return this.globalConfigurations;
}
/**
* Set the globalConfigurations property: The global configurations of selected configurations.
*
* @param globalConfigurations the globalConfigurations value to set.
* @return the AzureMonitorSelectedConfigurations object itself.
*/
public AzureMonitorSelectedConfigurations withGlobalConfigurations(Map globalConfigurations) {
this.globalConfigurations = globalConfigurations;
return this;
}
/**
* Get the tableList property: The table list.
*
* @return the tableList value.
*/
public List tableList() {
return this.tableList;
}
/**
* Set the tableList property: The table list.
*
* @param tableList the tableList value to set.
* @return the AzureMonitorSelectedConfigurations object itself.
*/
public AzureMonitorSelectedConfigurations withTableList(List tableList) {
this.tableList = tableList;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (tableList() != null) {
tableList().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("configurationVersion", this.configurationVersion);
jsonWriter.writeMapField("globalConfigurations", this.globalConfigurations,
(writer, element) -> writer.writeString(element));
jsonWriter.writeArrayField("tableList", this.tableList, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AzureMonitorSelectedConfigurations from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AzureMonitorSelectedConfigurations 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 AzureMonitorSelectedConfigurations.
*/
public static AzureMonitorSelectedConfigurations fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AzureMonitorSelectedConfigurations deserializedAzureMonitorSelectedConfigurations
= new AzureMonitorSelectedConfigurations();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("configurationVersion".equals(fieldName)) {
deserializedAzureMonitorSelectedConfigurations.configurationVersion = reader.getString();
} else if ("globalConfigurations".equals(fieldName)) {
Map globalConfigurations = reader.readMap(reader1 -> reader1.getString());
deserializedAzureMonitorSelectedConfigurations.globalConfigurations = globalConfigurations;
} else if ("tableList".equals(fieldName)) {
List tableList
= reader.readArray(reader1 -> AzureMonitorTableConfiguration.fromJson(reader1));
deserializedAzureMonitorSelectedConfigurations.tableList = tableList;
} else {
reader.skipChildren();
}
}
return deserializedAzureMonitorSelectedConfigurations;
});
}
}