com.azure.resourcemanager.hdinsight.models.AzureMonitorRequest 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;
/**
* The azure monitor parameters.
*/
@Fluent
public final class AzureMonitorRequest implements JsonSerializable {
/*
* The Log Analytics workspace ID.
*/
private String workspaceId;
/*
* The Log Analytics workspace key.
*/
private String primaryKey;
/*
* The selected configurations.
*/
private AzureMonitorSelectedConfigurations selectedConfigurations;
/**
* Creates an instance of AzureMonitorRequest class.
*/
public AzureMonitorRequest() {
}
/**
* Get the workspaceId property: The Log Analytics workspace ID.
*
* @return the workspaceId value.
*/
public String workspaceId() {
return this.workspaceId;
}
/**
* Set the workspaceId property: The Log Analytics workspace ID.
*
* @param workspaceId the workspaceId value to set.
* @return the AzureMonitorRequest object itself.
*/
public AzureMonitorRequest withWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
return this;
}
/**
* Get the primaryKey property: The Log Analytics workspace key.
*
* @return the primaryKey value.
*/
public String primaryKey() {
return this.primaryKey;
}
/**
* Set the primaryKey property: The Log Analytics workspace key.
*
* @param primaryKey the primaryKey value to set.
* @return the AzureMonitorRequest object itself.
*/
public AzureMonitorRequest withPrimaryKey(String primaryKey) {
this.primaryKey = primaryKey;
return this;
}
/**
* Get the selectedConfigurations property: The selected configurations.
*
* @return the selectedConfigurations value.
*/
public AzureMonitorSelectedConfigurations selectedConfigurations() {
return this.selectedConfigurations;
}
/**
* Set the selectedConfigurations property: The selected configurations.
*
* @param selectedConfigurations the selectedConfigurations value to set.
* @return the AzureMonitorRequest object itself.
*/
public AzureMonitorRequest withSelectedConfigurations(AzureMonitorSelectedConfigurations selectedConfigurations) {
this.selectedConfigurations = selectedConfigurations;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (selectedConfigurations() != null) {
selectedConfigurations().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("workspaceId", this.workspaceId);
jsonWriter.writeStringField("primaryKey", this.primaryKey);
jsonWriter.writeJsonField("selectedConfigurations", this.selectedConfigurations);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AzureMonitorRequest from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AzureMonitorRequest 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 AzureMonitorRequest.
*/
public static AzureMonitorRequest fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AzureMonitorRequest deserializedAzureMonitorRequest = new AzureMonitorRequest();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("workspaceId".equals(fieldName)) {
deserializedAzureMonitorRequest.workspaceId = reader.getString();
} else if ("primaryKey".equals(fieldName)) {
deserializedAzureMonitorRequest.primaryKey = reader.getString();
} else if ("selectedConfigurations".equals(fieldName)) {
deserializedAzureMonitorRequest.selectedConfigurations
= AzureMonitorSelectedConfigurations.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedAzureMonitorRequest;
});
}
}