com.azure.resourcemanager.machinelearning.models.VirtualMachineSize 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;
import java.util.List;
/**
* Describes the properties of a VM size.
*/
@Fluent
public final class VirtualMachineSize implements JsonSerializable {
/*
* The name of the virtual machine size.
*/
private String name;
/*
* The family name of the virtual machine size.
*/
private String family;
/*
* The number of vCPUs supported by the virtual machine size.
*/
private Integer vCPUs;
/*
* The number of gPUs supported by the virtual machine size.
*/
private Integer gpus;
/*
* The OS VHD disk size, in MB, allowed by the virtual machine size.
*/
private Integer osVhdSizeMB;
/*
* The resource volume size, in MB, allowed by the virtual machine size.
*/
private Integer maxResourceVolumeMB;
/*
* The amount of memory, in GB, supported by the virtual machine size.
*/
private Double memoryGB;
/*
* Specifies if the virtual machine size supports low priority VMs.
*/
private Boolean lowPriorityCapable;
/*
* Specifies if the virtual machine size supports premium IO.
*/
private Boolean premiumIO;
/*
* The estimated price information for using a VM.
*/
private EstimatedVMPrices estimatedVMPrices;
/*
* Specifies the compute types supported by the virtual machine size.
*/
private List supportedComputeTypes;
/**
* Creates an instance of VirtualMachineSize class.
*/
public VirtualMachineSize() {
}
/**
* Get the name property: The name of the virtual machine size.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Get the family property: The family name of the virtual machine size.
*
* @return the family value.
*/
public String family() {
return this.family;
}
/**
* Get the vCPUs property: The number of vCPUs supported by the virtual machine size.
*
* @return the vCPUs value.
*/
public Integer vCPUs() {
return this.vCPUs;
}
/**
* Get the gpus property: The number of gPUs supported by the virtual machine size.
*
* @return the gpus value.
*/
public Integer gpus() {
return this.gpus;
}
/**
* Get the osVhdSizeMB property: The OS VHD disk size, in MB, allowed by the virtual machine size.
*
* @return the osVhdSizeMB value.
*/
public Integer osVhdSizeMB() {
return this.osVhdSizeMB;
}
/**
* Get the maxResourceVolumeMB property: The resource volume size, in MB, allowed by the virtual machine size.
*
* @return the maxResourceVolumeMB value.
*/
public Integer maxResourceVolumeMB() {
return this.maxResourceVolumeMB;
}
/**
* Get the memoryGB property: The amount of memory, in GB, supported by the virtual machine size.
*
* @return the memoryGB value.
*/
public Double memoryGB() {
return this.memoryGB;
}
/**
* Get the lowPriorityCapable property: Specifies if the virtual machine size supports low priority VMs.
*
* @return the lowPriorityCapable value.
*/
public Boolean lowPriorityCapable() {
return this.lowPriorityCapable;
}
/**
* Get the premiumIO property: Specifies if the virtual machine size supports premium IO.
*
* @return the premiumIO value.
*/
public Boolean premiumIO() {
return this.premiumIO;
}
/**
* Get the estimatedVMPrices property: The estimated price information for using a VM.
*
* @return the estimatedVMPrices value.
*/
public EstimatedVMPrices estimatedVMPrices() {
return this.estimatedVMPrices;
}
/**
* Set the estimatedVMPrices property: The estimated price information for using a VM.
*
* @param estimatedVMPrices the estimatedVMPrices value to set.
* @return the VirtualMachineSize object itself.
*/
public VirtualMachineSize withEstimatedVMPrices(EstimatedVMPrices estimatedVMPrices) {
this.estimatedVMPrices = estimatedVMPrices;
return this;
}
/**
* Get the supportedComputeTypes property: Specifies the compute types supported by the virtual machine size.
*
* @return the supportedComputeTypes value.
*/
public List supportedComputeTypes() {
return this.supportedComputeTypes;
}
/**
* Set the supportedComputeTypes property: Specifies the compute types supported by the virtual machine size.
*
* @param supportedComputeTypes the supportedComputeTypes value to set.
* @return the VirtualMachineSize object itself.
*/
public VirtualMachineSize withSupportedComputeTypes(List supportedComputeTypes) {
this.supportedComputeTypes = supportedComputeTypes;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (estimatedVMPrices() != null) {
estimatedVMPrices().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("estimatedVMPrices", this.estimatedVMPrices);
jsonWriter.writeArrayField("supportedComputeTypes", this.supportedComputeTypes,
(writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VirtualMachineSize from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VirtualMachineSize 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 VirtualMachineSize.
*/
public static VirtualMachineSize fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
VirtualMachineSize deserializedVirtualMachineSize = new VirtualMachineSize();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedVirtualMachineSize.name = reader.getString();
} else if ("family".equals(fieldName)) {
deserializedVirtualMachineSize.family = reader.getString();
} else if ("vCPUs".equals(fieldName)) {
deserializedVirtualMachineSize.vCPUs = reader.getNullable(JsonReader::getInt);
} else if ("gpus".equals(fieldName)) {
deserializedVirtualMachineSize.gpus = reader.getNullable(JsonReader::getInt);
} else if ("osVhdSizeMB".equals(fieldName)) {
deserializedVirtualMachineSize.osVhdSizeMB = reader.getNullable(JsonReader::getInt);
} else if ("maxResourceVolumeMB".equals(fieldName)) {
deserializedVirtualMachineSize.maxResourceVolumeMB = reader.getNullable(JsonReader::getInt);
} else if ("memoryGB".equals(fieldName)) {
deserializedVirtualMachineSize.memoryGB = reader.getNullable(JsonReader::getDouble);
} else if ("lowPriorityCapable".equals(fieldName)) {
deserializedVirtualMachineSize.lowPriorityCapable = reader.getNullable(JsonReader::getBoolean);
} else if ("premiumIO".equals(fieldName)) {
deserializedVirtualMachineSize.premiumIO = reader.getNullable(JsonReader::getBoolean);
} else if ("estimatedVMPrices".equals(fieldName)) {
deserializedVirtualMachineSize.estimatedVMPrices = EstimatedVMPrices.fromJson(reader);
} else if ("supportedComputeTypes".equals(fieldName)) {
List supportedComputeTypes = reader.readArray(reader1 -> reader1.getString());
deserializedVirtualMachineSize.supportedComputeTypes = supportedComputeTypes;
} else {
reader.skipChildren();
}
}
return deserializedVirtualMachineSize;
});
}
}