// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.edgeorder.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Holds billing meter details for each type of billing. */
@Immutable
public final class BillingMeterDetails {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(BillingMeterDetails.class);

    /*
     * Represents Billing type name
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Represents MeterDetails
     */
    @JsonProperty(value = "meterDetails", access = JsonProperty.Access.WRITE_ONLY)
    private MeterDetails meterDetails;

    /*
     * Represents Metering type (eg one-time or recurrent)
     */
    @JsonProperty(value = "meteringType", access = JsonProperty.Access.WRITE_ONLY)
    private MeteringType meteringType;

    /*
     * Frequency of recurrence
     */
    @JsonProperty(value = "frequency", access = JsonProperty.Access.WRITE_ONLY)
    private String frequency;

    /**
     * Get the name property: Represents Billing type name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the meterDetails property: Represents MeterDetails.
     *
     * @return the meterDetails value.
     */
    public MeterDetails meterDetails() {
        return this.meterDetails;
    }

    /**
     * Get the meteringType property: Represents Metering type (eg one-time or recurrent).
     *
     * @return the meteringType value.
     */
    public MeteringType meteringType() {
        return this.meteringType;
    }

    /**
     * Get the frequency property: Frequency of recurrence.
     *
     * @return the frequency value.
     */
    public String frequency() {
        return this.frequency;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (meterDetails() != null) {
            meterDetails().validate();
        }
    }
}
