com.azure.resourcemanager.mongocluster.models.ComputeProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-mongocluster Show documentation
Show all versions of azure-resourcemanager-mongocluster Show documentation
This package contains Microsoft Azure SDK for Mongo Cluster Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for MongoDB vCore resources including clusters and firewall rules.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.
package com.azure.resourcemanager.mongocluster.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 compute properties of the cluster. This includes the virtual-cores/memory and scaling options applied to servers
* in the cluster.
*/
@Fluent
public final class ComputeProperties implements JsonSerializable {
/*
* The compute tier to assign to the cluster, where each tier maps to a virtual-core and memory size. Example
* values: 'M30', 'M40'.
*/
private String tier;
/**
* Creates an instance of ComputeProperties class.
*/
public ComputeProperties() {
}
/**
* Get the tier property: The compute tier to assign to the cluster, where each tier maps to a virtual-core and
* memory size. Example values: 'M30', 'M40'.
*
* @return the tier value.
*/
public String tier() {
return this.tier;
}
/**
* Set the tier property: The compute tier to assign to the cluster, where each tier maps to a virtual-core and
* memory size. Example values: 'M30', 'M40'.
*
* @param tier the tier value to set.
* @return the ComputeProperties object itself.
*/
public ComputeProperties withTier(String tier) {
this.tier = tier;
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.writeStringField("tier", this.tier);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ComputeProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ComputeProperties 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 ComputeProperties.
*/
public static ComputeProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ComputeProperties deserializedComputeProperties = new ComputeProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("tier".equals(fieldName)) {
deserializedComputeProperties.tier = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedComputeProperties;
});
}
}