![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.compute.models.ResourceSkuCapacity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-compute Show documentation
Show all versions of azure-resourcemanager-compute Show documentation
This package contains Microsoft Azure Compute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.compute.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Describes scaling information of a SKU.
*/
@Immutable
public final class ResourceSkuCapacity implements JsonSerializable {
/*
* The minimum capacity.
*/
private Long minimum;
/*
* The maximum capacity that can be set.
*/
private Long maximum;
/*
* The default capacity.
*/
private Long defaultProperty;
/*
* The scale type applicable to the sku.
*/
private ResourceSkuCapacityScaleType scaleType;
/**
* Creates an instance of ResourceSkuCapacity class.
*/
public ResourceSkuCapacity() {
}
/**
* Get the minimum property: The minimum capacity.
*
* @return the minimum value.
*/
public Long minimum() {
return this.minimum;
}
/**
* Get the maximum property: The maximum capacity that can be set.
*
* @return the maximum value.
*/
public Long maximum() {
return this.maximum;
}
/**
* Get the defaultProperty property: The default capacity.
*
* @return the defaultProperty value.
*/
public Long defaultProperty() {
return this.defaultProperty;
}
/**
* Get the scaleType property: The scale type applicable to the sku.
*
* @return the scaleType value.
*/
public ResourceSkuCapacityScaleType scaleType() {
return this.scaleType;
}
/**
* 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();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ResourceSkuCapacity from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ResourceSkuCapacity 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 ResourceSkuCapacity.
*/
public static ResourceSkuCapacity fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ResourceSkuCapacity deserializedResourceSkuCapacity = new ResourceSkuCapacity();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("minimum".equals(fieldName)) {
deserializedResourceSkuCapacity.minimum = reader.getNullable(JsonReader::getLong);
} else if ("maximum".equals(fieldName)) {
deserializedResourceSkuCapacity.maximum = reader.getNullable(JsonReader::getLong);
} else if ("default".equals(fieldName)) {
deserializedResourceSkuCapacity.defaultProperty = reader.getNullable(JsonReader::getLong);
} else if ("scaleType".equals(fieldName)) {
deserializedResourceSkuCapacity.scaleType
= ResourceSkuCapacityScaleType.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedResourceSkuCapacity;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy