com.azure.resourcemanager.machinelearning.models.SynapseSparkProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-machinelearning Show documentation
Show all versions of azure-resourcemanager-machinelearning Show documentation
This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2024-04.
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.machinelearning.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 SynapseSparkProperties model.
*/
@Fluent
public final class SynapseSparkProperties implements JsonSerializable {
/*
* Auto scale properties.
*/
private AutoScaleProperties autoScaleProperties;
/*
* Auto pause properties.
*/
private AutoPauseProperties autoPauseProperties;
/*
* Spark version.
*/
private String sparkVersion;
/*
* The number of compute nodes currently assigned to the compute.
*/
private Integer nodeCount;
/*
* Node size.
*/
private String nodeSize;
/*
* Node size family.
*/
private String nodeSizeFamily;
/*
* Azure subscription identifier.
*/
private String subscriptionId;
/*
* Name of the resource group in which workspace is located.
*/
private String resourceGroup;
/*
* Name of Azure Machine Learning workspace.
*/
private String workspaceName;
/*
* Pool name.
*/
private String poolName;
/**
* Creates an instance of SynapseSparkProperties class.
*/
public SynapseSparkProperties() {
}
/**
* Get the autoScaleProperties property: Auto scale properties.
*
* @return the autoScaleProperties value.
*/
public AutoScaleProperties autoScaleProperties() {
return this.autoScaleProperties;
}
/**
* Set the autoScaleProperties property: Auto scale properties.
*
* @param autoScaleProperties the autoScaleProperties value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withAutoScaleProperties(AutoScaleProperties autoScaleProperties) {
this.autoScaleProperties = autoScaleProperties;
return this;
}
/**
* Get the autoPauseProperties property: Auto pause properties.
*
* @return the autoPauseProperties value.
*/
public AutoPauseProperties autoPauseProperties() {
return this.autoPauseProperties;
}
/**
* Set the autoPauseProperties property: Auto pause properties.
*
* @param autoPauseProperties the autoPauseProperties value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withAutoPauseProperties(AutoPauseProperties autoPauseProperties) {
this.autoPauseProperties = autoPauseProperties;
return this;
}
/**
* Get the sparkVersion property: Spark version.
*
* @return the sparkVersion value.
*/
public String sparkVersion() {
return this.sparkVersion;
}
/**
* Set the sparkVersion property: Spark version.
*
* @param sparkVersion the sparkVersion value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withSparkVersion(String sparkVersion) {
this.sparkVersion = sparkVersion;
return this;
}
/**
* Get the nodeCount property: The number of compute nodes currently assigned to the compute.
*
* @return the nodeCount value.
*/
public Integer nodeCount() {
return this.nodeCount;
}
/**
* Set the nodeCount property: The number of compute nodes currently assigned to the compute.
*
* @param nodeCount the nodeCount value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withNodeCount(Integer nodeCount) {
this.nodeCount = nodeCount;
return this;
}
/**
* Get the nodeSize property: Node size.
*
* @return the nodeSize value.
*/
public String nodeSize() {
return this.nodeSize;
}
/**
* Set the nodeSize property: Node size.
*
* @param nodeSize the nodeSize value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withNodeSize(String nodeSize) {
this.nodeSize = nodeSize;
return this;
}
/**
* Get the nodeSizeFamily property: Node size family.
*
* @return the nodeSizeFamily value.
*/
public String nodeSizeFamily() {
return this.nodeSizeFamily;
}
/**
* Set the nodeSizeFamily property: Node size family.
*
* @param nodeSizeFamily the nodeSizeFamily value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withNodeSizeFamily(String nodeSizeFamily) {
this.nodeSizeFamily = nodeSizeFamily;
return this;
}
/**
* Get the subscriptionId property: Azure subscription identifier.
*
* @return the subscriptionId value.
*/
public String subscriptionId() {
return this.subscriptionId;
}
/**
* Set the subscriptionId property: Azure subscription identifier.
*
* @param subscriptionId the subscriptionId value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withSubscriptionId(String subscriptionId) {
this.subscriptionId = subscriptionId;
return this;
}
/**
* Get the resourceGroup property: Name of the resource group in which workspace is located.
*
* @return the resourceGroup value.
*/
public String resourceGroup() {
return this.resourceGroup;
}
/**
* Set the resourceGroup property: Name of the resource group in which workspace is located.
*
* @param resourceGroup the resourceGroup value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withResourceGroup(String resourceGroup) {
this.resourceGroup = resourceGroup;
return this;
}
/**
* Get the workspaceName property: Name of Azure Machine Learning workspace.
*
* @return the workspaceName value.
*/
public String workspaceName() {
return this.workspaceName;
}
/**
* Set the workspaceName property: Name of Azure Machine Learning workspace.
*
* @param workspaceName the workspaceName value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withWorkspaceName(String workspaceName) {
this.workspaceName = workspaceName;
return this;
}
/**
* Get the poolName property: Pool name.
*
* @return the poolName value.
*/
public String poolName() {
return this.poolName;
}
/**
* Set the poolName property: Pool name.
*
* @param poolName the poolName value to set.
* @return the SynapseSparkProperties object itself.
*/
public SynapseSparkProperties withPoolName(String poolName) {
this.poolName = poolName;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (autoScaleProperties() != null) {
autoScaleProperties().validate();
}
if (autoPauseProperties() != null) {
autoPauseProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("autoScaleProperties", this.autoScaleProperties);
jsonWriter.writeJsonField("autoPauseProperties", this.autoPauseProperties);
jsonWriter.writeStringField("sparkVersion", this.sparkVersion);
jsonWriter.writeNumberField("nodeCount", this.nodeCount);
jsonWriter.writeStringField("nodeSize", this.nodeSize);
jsonWriter.writeStringField("nodeSizeFamily", this.nodeSizeFamily);
jsonWriter.writeStringField("subscriptionId", this.subscriptionId);
jsonWriter.writeStringField("resourceGroup", this.resourceGroup);
jsonWriter.writeStringField("workspaceName", this.workspaceName);
jsonWriter.writeStringField("poolName", this.poolName);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SynapseSparkProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SynapseSparkProperties 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 SynapseSparkProperties.
*/
public static SynapseSparkProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SynapseSparkProperties deserializedSynapseSparkProperties = new SynapseSparkProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("autoScaleProperties".equals(fieldName)) {
deserializedSynapseSparkProperties.autoScaleProperties = AutoScaleProperties.fromJson(reader);
} else if ("autoPauseProperties".equals(fieldName)) {
deserializedSynapseSparkProperties.autoPauseProperties = AutoPauseProperties.fromJson(reader);
} else if ("sparkVersion".equals(fieldName)) {
deserializedSynapseSparkProperties.sparkVersion = reader.getString();
} else if ("nodeCount".equals(fieldName)) {
deserializedSynapseSparkProperties.nodeCount = reader.getNullable(JsonReader::getInt);
} else if ("nodeSize".equals(fieldName)) {
deserializedSynapseSparkProperties.nodeSize = reader.getString();
} else if ("nodeSizeFamily".equals(fieldName)) {
deserializedSynapseSparkProperties.nodeSizeFamily = reader.getString();
} else if ("subscriptionId".equals(fieldName)) {
deserializedSynapseSparkProperties.subscriptionId = reader.getString();
} else if ("resourceGroup".equals(fieldName)) {
deserializedSynapseSparkProperties.resourceGroup = reader.getString();
} else if ("workspaceName".equals(fieldName)) {
deserializedSynapseSparkProperties.workspaceName = reader.getString();
} else if ("poolName".equals(fieldName)) {
deserializedSynapseSparkProperties.poolName = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedSynapseSparkProperties;
});
}
}