
com.azure.resourcemanager.billing.models.RefundDetailsSummaryAmountRequested 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.billing.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* The amount of refund requested.
*/
@Immutable
public final class RefundDetailsSummaryAmountRequested extends Amount {
/*
* The amount value. For example, if the currency is USD, then a value of 600 would be $600.00.
*/
private Float value;
/*
* The currency for the amount value.
*/
private String currency;
/**
* Creates an instance of RefundDetailsSummaryAmountRequested class.
*/
public RefundDetailsSummaryAmountRequested() {
}
/**
* Get the value property: The amount value. For example, if the currency is USD, then a value of 600 would be
* $600.00.
*
* @return the value value.
*/
@Override
public Float value() {
return this.value;
}
/**
* Get the currency property: The currency for the amount value.
*
* @return the currency value.
*/
@Override
public String currency() {
return this.currency;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of RefundDetailsSummaryAmountRequested from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of RefundDetailsSummaryAmountRequested 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 RefundDetailsSummaryAmountRequested.
*/
public static RefundDetailsSummaryAmountRequested fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
RefundDetailsSummaryAmountRequested deserializedRefundDetailsSummaryAmountRequested
= new RefundDetailsSummaryAmountRequested();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("currency".equals(fieldName)) {
deserializedRefundDetailsSummaryAmountRequested.currency = reader.getString();
} else if ("value".equals(fieldName)) {
deserializedRefundDetailsSummaryAmountRequested.value = reader.getNullable(JsonReader::getFloat);
} else {
reader.skipChildren();
}
}
return deserializedRefundDetailsSummaryAmountRequested;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy