com.azure.resourcemanager.elasticsan.fluent.models.ElasticSanUpdateProperties Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.elasticsan.fluent.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 com.azure.resourcemanager.elasticsan.models.PublicNetworkAccess;
import java.io.IOException;
/**
* Elastic San update properties.
*/
@Fluent
public final class ElasticSanUpdateProperties implements JsonSerializable {
/*
* Base size of the Elastic San appliance in TiB.
*/
private Long baseSizeTiB;
/*
* Extended size of the Elastic San appliance in TiB.
*/
private Long extendedCapacitySizeTiB;
/*
* Allow or disallow public network access to ElasticSan Account. Value is optional but if passed in, must be
* 'Enabled' or 'Disabled'.
*/
private PublicNetworkAccess publicNetworkAccess;
/**
* Creates an instance of ElasticSanUpdateProperties class.
*/
public ElasticSanUpdateProperties() {
}
/**
* Get the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
*
* @return the baseSizeTiB value.
*/
public Long baseSizeTiB() {
return this.baseSizeTiB;
}
/**
* Set the baseSizeTiB property: Base size of the Elastic San appliance in TiB.
*
* @param baseSizeTiB the baseSizeTiB value to set.
* @return the ElasticSanUpdateProperties object itself.
*/
public ElasticSanUpdateProperties withBaseSizeTiB(Long baseSizeTiB) {
this.baseSizeTiB = baseSizeTiB;
return this;
}
/**
* Get the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
*
* @return the extendedCapacitySizeTiB value.
*/
public Long extendedCapacitySizeTiB() {
return this.extendedCapacitySizeTiB;
}
/**
* Set the extendedCapacitySizeTiB property: Extended size of the Elastic San appliance in TiB.
*
* @param extendedCapacitySizeTiB the extendedCapacitySizeTiB value to set.
* @return the ElasticSanUpdateProperties object itself.
*/
public ElasticSanUpdateProperties withExtendedCapacitySizeTiB(Long extendedCapacitySizeTiB) {
this.extendedCapacitySizeTiB = extendedCapacitySizeTiB;
return this;
}
/**
* Get the publicNetworkAccess property: Allow or disallow public network access to ElasticSan Account. Value is
* optional but if passed in, must be 'Enabled' or 'Disabled'.
*
* @return the publicNetworkAccess value.
*/
public PublicNetworkAccess publicNetworkAccess() {
return this.publicNetworkAccess;
}
/**
* Set the publicNetworkAccess property: Allow or disallow public network access to ElasticSan Account. Value is
* optional but if passed in, must be 'Enabled' or 'Disabled'.
*
* @param publicNetworkAccess the publicNetworkAccess value to set.
* @return the ElasticSanUpdateProperties object itself.
*/
public ElasticSanUpdateProperties withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
this.publicNetworkAccess = publicNetworkAccess;
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("baseSizeTiB", this.baseSizeTiB);
jsonWriter.writeNumberField("extendedCapacitySizeTiB", this.extendedCapacitySizeTiB);
jsonWriter.writeStringField("publicNetworkAccess",
this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ElasticSanUpdateProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ElasticSanUpdateProperties 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 ElasticSanUpdateProperties.
*/
public static ElasticSanUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ElasticSanUpdateProperties deserializedElasticSanUpdateProperties = new ElasticSanUpdateProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("baseSizeTiB".equals(fieldName)) {
deserializedElasticSanUpdateProperties.baseSizeTiB = reader.getNullable(JsonReader::getLong);
} else if ("extendedCapacitySizeTiB".equals(fieldName)) {
deserializedElasticSanUpdateProperties.extendedCapacitySizeTiB
= reader.getNullable(JsonReader::getLong);
} else if ("publicNetworkAccess".equals(fieldName)) {
deserializedElasticSanUpdateProperties.publicNetworkAccess
= PublicNetworkAccess.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedElasticSanUpdateProperties;
});
}
}