com.azure.resourcemanager.hdinsight.models.ClusterCreateRequestValidationParameters 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.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* The cluster create request specification.
*/
@Fluent
public final class ClusterCreateRequestValidationParameters extends ClusterCreateParametersExtended {
/*
* The cluster name.
*/
private String name;
/*
* The resource type.
*/
private String type;
/*
* The tenant id.
*/
private String tenantId;
/*
* This indicates whether fetch Aadds resource or not.
*/
private Boolean fetchAaddsResource;
/**
* Creates an instance of ClusterCreateRequestValidationParameters class.
*/
public ClusterCreateRequestValidationParameters() {
}
/**
* Get the name property: The cluster name.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: The cluster name.
*
* @param name the name value to set.
* @return the ClusterCreateRequestValidationParameters object itself.
*/
public ClusterCreateRequestValidationParameters withName(String name) {
this.name = name;
return this;
}
/**
* Get the type property: The resource type.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Set the type property: The resource type.
*
* @param type the type value to set.
* @return the ClusterCreateRequestValidationParameters object itself.
*/
public ClusterCreateRequestValidationParameters withType(String type) {
this.type = type;
return this;
}
/**
* Get the tenantId property: The tenant id.
*
* @return the tenantId value.
*/
public String tenantId() {
return this.tenantId;
}
/**
* Set the tenantId property: The tenant id.
*
* @param tenantId the tenantId value to set.
* @return the ClusterCreateRequestValidationParameters object itself.
*/
public ClusterCreateRequestValidationParameters withTenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
/**
* Get the fetchAaddsResource property: This indicates whether fetch Aadds resource or not.
*
* @return the fetchAaddsResource value.
*/
public Boolean fetchAaddsResource() {
return this.fetchAaddsResource;
}
/**
* Set the fetchAaddsResource property: This indicates whether fetch Aadds resource or not.
*
* @param fetchAaddsResource the fetchAaddsResource value to set.
* @return the ClusterCreateRequestValidationParameters object itself.
*/
public ClusterCreateRequestValidationParameters withFetchAaddsResource(Boolean fetchAaddsResource) {
this.fetchAaddsResource = fetchAaddsResource;
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ClusterCreateRequestValidationParameters withLocation(String location) {
super.withLocation(location);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ClusterCreateRequestValidationParameters withTags(Map tags) {
super.withTags(tags);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ClusterCreateRequestValidationParameters withZones(List zones) {
super.withZones(zones);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ClusterCreateRequestValidationParameters withProperties(ClusterCreateProperties properties) {
super.withProperties(properties);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ClusterCreateRequestValidationParameters withIdentity(ClusterIdentity identity) {
super.withIdentity(identity);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("location", location());
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
jsonWriter.writeArrayField("zones", zones(), (writer, element) -> writer.writeString(element));
jsonWriter.writeJsonField("properties", properties());
jsonWriter.writeJsonField("identity", identity());
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeStringField("type", this.type);
jsonWriter.writeStringField("tenantId", this.tenantId);
jsonWriter.writeBooleanField("fetchAaddsResource", this.fetchAaddsResource);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ClusterCreateRequestValidationParameters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ClusterCreateRequestValidationParameters 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 ClusterCreateRequestValidationParameters.
*/
public static ClusterCreateRequestValidationParameters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ClusterCreateRequestValidationParameters deserializedClusterCreateRequestValidationParameters
= new ClusterCreateRequestValidationParameters();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("location".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters.withLocation(reader.getString());
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedClusterCreateRequestValidationParameters.withTags(tags);
} else if ("zones".equals(fieldName)) {
List zones = reader.readArray(reader1 -> reader1.getString());
deserializedClusterCreateRequestValidationParameters.withZones(zones);
} else if ("properties".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters
.withProperties(ClusterCreateProperties.fromJson(reader));
} else if ("identity".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters.withIdentity(ClusterIdentity.fromJson(reader));
} else if ("name".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters.type = reader.getString();
} else if ("tenantId".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters.tenantId = reader.getString();
} else if ("fetchAaddsResource".equals(fieldName)) {
deserializedClusterCreateRequestValidationParameters.fetchAaddsResource
= reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedClusterCreateRequestValidationParameters;
});
}
}