com.azure.resourcemanager.mongocluster.models.StorageProperties 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 storage properties of the cluster. This includes the data storage size and scaling applied to servers in the
* cluster.
*/
@Fluent
public final class StorageProperties implements JsonSerializable {
/*
* The size of the data disk assigned to each server.
*/
private Long sizeGb;
/**
* Creates an instance of StorageProperties class.
*/
public StorageProperties() {
}
/**
* Get the sizeGb property: The size of the data disk assigned to each server.
*
* @return the sizeGb value.
*/
public Long sizeGb() {
return this.sizeGb;
}
/**
* Set the sizeGb property: The size of the data disk assigned to each server.
*
* @param sizeGb the sizeGb value to set.
* @return the StorageProperties object itself.
*/
public StorageProperties withSizeGb(Long sizeGb) {
this.sizeGb = sizeGb;
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.writeNumberField("sizeGb", this.sizeGb);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of StorageProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of StorageProperties 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 StorageProperties.
*/
public static StorageProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
StorageProperties deserializedStorageProperties = new StorageProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("sizeGb".equals(fieldName)) {
deserializedStorageProperties.sizeGb = reader.getNullable(JsonReader::getLong);
} else {
reader.skipChildren();
}
}
return deserializedStorageProperties;
});
}
}