
com.azure.resourcemanager.hdinsight.models.BillingMeters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-hdinsight Show documentation
Show all versions of azure-resourcemanager-hdinsight Show documentation
This package contains Microsoft Azure SDK for HDInsight Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Management Client. Package tag package-2021-06.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.hdinsight.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 billing meters.
*/
@Fluent
public final class BillingMeters implements JsonSerializable {
/*
* The virtual machine sizes.
*/
private String meterParameter;
/*
* The HDInsight meter guid.
*/
private String meter;
/*
* The unit of meter, VMHours or CoreHours.
*/
private String unit;
/**
* Creates an instance of BillingMeters class.
*/
public BillingMeters() {
}
/**
* Get the meterParameter property: The virtual machine sizes.
*
* @return the meterParameter value.
*/
public String meterParameter() {
return this.meterParameter;
}
/**
* Set the meterParameter property: The virtual machine sizes.
*
* @param meterParameter the meterParameter value to set.
* @return the BillingMeters object itself.
*/
public BillingMeters withMeterParameter(String meterParameter) {
this.meterParameter = meterParameter;
return this;
}
/**
* Get the meter property: The HDInsight meter guid.
*
* @return the meter value.
*/
public String meter() {
return this.meter;
}
/**
* Set the meter property: The HDInsight meter guid.
*
* @param meter the meter value to set.
* @return the BillingMeters object itself.
*/
public BillingMeters withMeter(String meter) {
this.meter = meter;
return this;
}
/**
* Get the unit property: The unit of meter, VMHours or CoreHours.
*
* @return the unit value.
*/
public String unit() {
return this.unit;
}
/**
* Set the unit property: The unit of meter, VMHours or CoreHours.
*
* @param unit the unit value to set.
* @return the BillingMeters object itself.
*/
public BillingMeters withUnit(String unit) {
this.unit = unit;
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("meterParameter", this.meterParameter);
jsonWriter.writeStringField("meter", this.meter);
jsonWriter.writeStringField("unit", this.unit);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of BillingMeters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of BillingMeters 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 BillingMeters.
*/
public static BillingMeters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
BillingMeters deserializedBillingMeters = new BillingMeters();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("meterParameter".equals(fieldName)) {
deserializedBillingMeters.meterParameter = reader.getString();
} else if ("meter".equals(fieldName)) {
deserializedBillingMeters.meter = reader.getString();
} else if ("unit".equals(fieldName)) {
deserializedBillingMeters.unit = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedBillingMeters;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy