
com.azure.resourcemanager.billing.models.InvoicePropertiesFreeAzureCreditApplied 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 free Azure credits applied to the charges. This field is applicable to billing accounts with agreement
* type Microsoft Customer Agreement.
*/
@Immutable
public final class InvoicePropertiesFreeAzureCreditApplied 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 InvoicePropertiesFreeAzureCreditApplied class.
*/
public InvoicePropertiesFreeAzureCreditApplied() {
}
/**
* 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 InvoicePropertiesFreeAzureCreditApplied from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of InvoicePropertiesFreeAzureCreditApplied 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 InvoicePropertiesFreeAzureCreditApplied.
*/
public static InvoicePropertiesFreeAzureCreditApplied fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
InvoicePropertiesFreeAzureCreditApplied deserializedInvoicePropertiesFreeAzureCreditApplied
= new InvoicePropertiesFreeAzureCreditApplied();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("currency".equals(fieldName)) {
deserializedInvoicePropertiesFreeAzureCreditApplied.currency = reader.getString();
} else if ("value".equals(fieldName)) {
deserializedInvoicePropertiesFreeAzureCreditApplied.value
= reader.getNullable(JsonReader::getFloat);
} else {
reader.skipChildren();
}
}
return deserializedInvoicePropertiesFreeAzureCreditApplied;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy