com.azure.resourcemanager.hdinsight.fluent.models.ClusterMonitoringResponseInner 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.fluent.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;
/**
* The cluster monitoring status response.
*/
@Fluent
public final class ClusterMonitoringResponseInner implements JsonSerializable {
/*
* The status of the monitor on the HDInsight cluster.
*/
private Boolean clusterMonitoringEnabled;
/*
* The workspace ID of the monitor on the HDInsight cluster.
*/
private String workspaceId;
/**
* Creates an instance of ClusterMonitoringResponseInner class.
*/
public ClusterMonitoringResponseInner() {
}
/**
* Get the clusterMonitoringEnabled property: The status of the monitor on the HDInsight cluster.
*
* @return the clusterMonitoringEnabled value.
*/
public Boolean clusterMonitoringEnabled() {
return this.clusterMonitoringEnabled;
}
/**
* Set the clusterMonitoringEnabled property: The status of the monitor on the HDInsight cluster.
*
* @param clusterMonitoringEnabled the clusterMonitoringEnabled value to set.
* @return the ClusterMonitoringResponseInner object itself.
*/
public ClusterMonitoringResponseInner withClusterMonitoringEnabled(Boolean clusterMonitoringEnabled) {
this.clusterMonitoringEnabled = clusterMonitoringEnabled;
return this;
}
/**
* Get the workspaceId property: The workspace ID of the monitor on the HDInsight cluster.
*
* @return the workspaceId value.
*/
public String workspaceId() {
return this.workspaceId;
}
/**
* Set the workspaceId property: The workspace ID of the monitor on the HDInsight cluster.
*
* @param workspaceId the workspaceId value to set.
* @return the ClusterMonitoringResponseInner object itself.
*/
public ClusterMonitoringResponseInner withWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
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("clusterMonitoringEnabled", this.clusterMonitoringEnabled);
jsonWriter.writeStringField("workspaceId", this.workspaceId);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ClusterMonitoringResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ClusterMonitoringResponseInner 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 ClusterMonitoringResponseInner.
*/
public static ClusterMonitoringResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ClusterMonitoringResponseInner deserializedClusterMonitoringResponseInner
= new ClusterMonitoringResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("clusterMonitoringEnabled".equals(fieldName)) {
deserializedClusterMonitoringResponseInner.clusterMonitoringEnabled
= reader.getNullable(JsonReader::getBoolean);
} else if ("workspaceId".equals(fieldName)) {
deserializedClusterMonitoringResponseInner.workspaceId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedClusterMonitoringResponseInner;
});
}
}