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

com.azure.resourcemanager.billing.models.SavingsPlanSummaryCount 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.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The roll up count summary of savings plans in each state.
 */
@Immutable
public final class SavingsPlanSummaryCount implements JsonSerializable {
    /*
     * The number of savings plans in Succeeded state
     */
    private Float succeededCount;

    /*
     * The number of savings plans in Failed state
     */
    private Float failedCount;

    /*
     * The number of savings plans in Expiring state
     */
    private Float expiringCount;

    /*
     * The number of savings plans in Expired state
     */
    private Float expiredCount;

    /*
     * The number of savings plans in Pending state
     */
    private Float pendingCount;

    /*
     * The number of savings plans in Cancelled state
     */
    private Float cancelledCount;

    /*
     * The number of savings plans in Processing state
     */
    private Float processingCount;

    /*
     * The number of savings plans in No Benefit state
     */
    private Float noBenefitCount;

    /*
     * The number of savings plans in Warning state
     */
    private Float warningCount;

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

    /**
     * Get the succeededCount property: The number of savings plans in Succeeded state.
     * 
     * @return the succeededCount value.
     */
    public Float succeededCount() {
        return this.succeededCount;
    }

    /**
     * Get the failedCount property: The number of savings plans in Failed state.
     * 
     * @return the failedCount value.
     */
    public Float failedCount() {
        return this.failedCount;
    }

    /**
     * Get the expiringCount property: The number of savings plans in Expiring state.
     * 
     * @return the expiringCount value.
     */
    public Float expiringCount() {
        return this.expiringCount;
    }

    /**
     * Get the expiredCount property: The number of savings plans in Expired state.
     * 
     * @return the expiredCount value.
     */
    public Float expiredCount() {
        return this.expiredCount;
    }

    /**
     * Get the pendingCount property: The number of savings plans in Pending state.
     * 
     * @return the pendingCount value.
     */
    public Float pendingCount() {
        return this.pendingCount;
    }

    /**
     * Get the cancelledCount property: The number of savings plans in Cancelled state.
     * 
     * @return the cancelledCount value.
     */
    public Float cancelledCount() {
        return this.cancelledCount;
    }

    /**
     * Get the processingCount property: The number of savings plans in Processing state.
     * 
     * @return the processingCount value.
     */
    public Float processingCount() {
        return this.processingCount;
    }

    /**
     * Get the noBenefitCount property: The number of savings plans in No Benefit state.
     * 
     * @return the noBenefitCount value.
     */
    public Float noBenefitCount() {
        return this.noBenefitCount;
    }

    /**
     * Get the warningCount property: The number of savings plans in Warning state.
     * 
     * @return the warningCount value.
     */
    public Float warningCount() {
        return this.warningCount;
    }

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

                if ("succeededCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.succeededCount = reader.getNullable(JsonReader::getFloat);
                } else if ("failedCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.failedCount = reader.getNullable(JsonReader::getFloat);
                } else if ("expiringCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.expiringCount = reader.getNullable(JsonReader::getFloat);
                } else if ("expiredCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.expiredCount = reader.getNullable(JsonReader::getFloat);
                } else if ("pendingCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.pendingCount = reader.getNullable(JsonReader::getFloat);
                } else if ("cancelledCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.cancelledCount = reader.getNullable(JsonReader::getFloat);
                } else if ("processingCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.processingCount = reader.getNullable(JsonReader::getFloat);
                } else if ("noBenefitCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.noBenefitCount = reader.getNullable(JsonReader::getFloat);
                } else if ("warningCount".equals(fieldName)) {
                    deserializedSavingsPlanSummaryCount.warningCount = reader.getNullable(JsonReader::getFloat);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSavingsPlanSummaryCount;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy