All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.billing.fluent.models.TransactionSummaryInner 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.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * A transaction summary.
 */
@Immutable
public final class TransactionSummaryInner implements JsonSerializable {
    /*
     * The total amount of any Azure credits applied.
     */
    private Float azureCreditApplied;

    /*
     * The ISO 4217 code for the currency in which the transactions are billed.
     */
    private String billingCurrency;

    /*
     * The total Microsoft Azure Consumption Commitment (MACC) decrement through the invoice.
     */
    private Float consumptionCommitmentDecremented;

    /*
     * The total pre-tax charged amount.
     */
    private Float subTotal;

    /*
     * The total tax amount applied.
     */
    private Float tax;

    /*
     * The total charges.
     */
    private Float total;

    /**
     * Creates an instance of TransactionSummaryInner class.
     */
    public TransactionSummaryInner() {
    }

    /**
     * Get the azureCreditApplied property: The total amount of any Azure credits applied.
     * 
     * @return the azureCreditApplied value.
     */
    public Float azureCreditApplied() {
        return this.azureCreditApplied;
    }

    /**
     * Get the billingCurrency property: The ISO 4217 code for the currency in which the transactions are billed.
     * 
     * @return the billingCurrency value.
     */
    public String billingCurrency() {
        return this.billingCurrency;
    }

    /**
     * Get the consumptionCommitmentDecremented property: The total Microsoft Azure Consumption Commitment (MACC)
     * decrement through the invoice.
     * 
     * @return the consumptionCommitmentDecremented value.
     */
    public Float consumptionCommitmentDecremented() {
        return this.consumptionCommitmentDecremented;
    }

    /**
     * Get the subTotal property: The total pre-tax charged amount.
     * 
     * @return the subTotal value.
     */
    public Float subTotal() {
        return this.subTotal;
    }

    /**
     * Get the tax property: The total tax amount applied.
     * 
     * @return the tax value.
     */
    public Float tax() {
        return this.tax;
    }

    /**
     * Get the total property: The total charges.
     * 
     * @return the total value.
     */
    public Float total() {
        return this.total;
    }

    /**
     * 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();
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of TransactionSummaryInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of TransactionSummaryInner 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 TransactionSummaryInner.
     */
    public static TransactionSummaryInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            TransactionSummaryInner deserializedTransactionSummaryInner = new TransactionSummaryInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("azureCreditApplied".equals(fieldName)) {
                    deserializedTransactionSummaryInner.azureCreditApplied = reader.getNullable(JsonReader::getFloat);
                } else if ("billingCurrency".equals(fieldName)) {
                    deserializedTransactionSummaryInner.billingCurrency = reader.getString();
                } else if ("consumptionCommitmentDecremented".equals(fieldName)) {
                    deserializedTransactionSummaryInner.consumptionCommitmentDecremented
                        = reader.getNullable(JsonReader::getFloat);
                } else if ("subTotal".equals(fieldName)) {
                    deserializedTransactionSummaryInner.subTotal = reader.getNullable(JsonReader::getFloat);
                } else if ("tax".equals(fieldName)) {
                    deserializedTransactionSummaryInner.tax = reader.getNullable(JsonReader::getFloat);
                } else if ("total".equals(fieldName)) {
                    deserializedTransactionSummaryInner.total = reader.getNullable(JsonReader::getFloat);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedTransactionSummaryInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy