![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.compute.models.CloudServiceRoleSku 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.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;
/**
* Describes the cloud service role sku.
*/
@Fluent
public final class CloudServiceRoleSku implements JsonSerializable {
/*
* The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need
* to delete and recreate the cloud service or move back to the old sku.
*/
private String name;
/*
* Specifies the tier of the cloud service. Possible Values are
**Standard**
**Basic**
*/
private String tier;
/*
* Specifies the number of role instances in the cloud service.
*/
private Long capacity;
/**
* Creates an instance of CloudServiceRoleSku class.
*/
public CloudServiceRoleSku() {
}
/**
* Get the name property: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is
* currently on, you need to delete and recreate the cloud service or move back to the old sku.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is
* currently on, you need to delete and recreate the cloud service or move back to the old sku.
*
* @param name the name value to set.
* @return the CloudServiceRoleSku object itself.
*/
public CloudServiceRoleSku withName(String name) {
this.name = name;
return this;
}
/**
* Get the tier property: Specifies the tier of the cloud service. Possible Values are <br /><br />
* **Standard** <br /><br /> **Basic**.
*
* @return the tier value.
*/
public String tier() {
return this.tier;
}
/**
* Set the tier property: Specifies the tier of the cloud service. Possible Values are <br /><br />
* **Standard** <br /><br /> **Basic**.
*
* @param tier the tier value to set.
* @return the CloudServiceRoleSku object itself.
*/
public CloudServiceRoleSku withTier(String tier) {
this.tier = tier;
return this;
}
/**
* Get the capacity property: Specifies the number of role instances in the cloud service.
*
* @return the capacity value.
*/
public Long capacity() {
return this.capacity;
}
/**
* Set the capacity property: Specifies the number of role instances in the cloud service.
*
* @param capacity the capacity value to set.
* @return the CloudServiceRoleSku object itself.
*/
public CloudServiceRoleSku withCapacity(Long capacity) {
this.capacity = capacity;
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("name", this.name);
jsonWriter.writeStringField("tier", this.tier);
jsonWriter.writeNumberField("capacity", this.capacity);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CloudServiceRoleSku from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CloudServiceRoleSku 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 CloudServiceRoleSku.
*/
public static CloudServiceRoleSku fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CloudServiceRoleSku deserializedCloudServiceRoleSku = new CloudServiceRoleSku();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedCloudServiceRoleSku.name = reader.getString();
} else if ("tier".equals(fieldName)) {
deserializedCloudServiceRoleSku.tier = reader.getString();
} else if ("capacity".equals(fieldName)) {
deserializedCloudServiceRoleSku.capacity = reader.getNullable(JsonReader::getLong);
} else {
reader.skipChildren();
}
}
return deserializedCloudServiceRoleSku;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy