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

package com.azure.resourcemanager.consumption.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.consumption.fluent.models.ModernChargeSummaryProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Modern charge summary. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("modern")
@Fluent
public final class ModernChargeSummary extends ChargeSummary {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummary.class);

    /*
     * Properties for modern charge summary
     */
    @JsonProperty(value = "properties", required = true)
    private ModernChargeSummaryProperties innerProperties = new ModernChargeSummaryProperties();

    /**
     * Get the innerProperties property: Properties for modern charge summary.
     *
     * @return the innerProperties value.
     */
    private ModernChargeSummaryProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public ModernChargeSummary withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to.
     *
     * @return the billingPeriodId value.
     */
    public String billingPeriodId() {
        return this.innerProperties() == null ? null : this.innerProperties().billingPeriodId();
    }

    /**
     * Get the usageStart property: Usage start date.
     *
     * @return the usageStart value.
     */
    public String usageStart() {
        return this.innerProperties() == null ? null : this.innerProperties().usageStart();
    }

    /**
     * Get the usageEnd property: Usage end date.
     *
     * @return the usageEnd value.
     */
    public String usageEnd() {
        return this.innerProperties() == null ? null : this.innerProperties().usageEnd();
    }

    /**
     * Get the azureCharges property: Azure Charges.
     *
     * @return the azureCharges value.
     */
    public Amount azureCharges() {
        return this.innerProperties() == null ? null : this.innerProperties().azureCharges();
    }

    /**
     * Get the chargesBilledSeparately property: Charges Billed separately.
     *
     * @return the chargesBilledSeparately value.
     */
    public Amount chargesBilledSeparately() {
        return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately();
    }

    /**
     * Get the marketplaceCharges property: Marketplace Charges.
     *
     * @return the marketplaceCharges value.
     */
    public Amount marketplaceCharges() {
        return this.innerProperties() == null ? null : this.innerProperties().marketplaceCharges();
    }

    /**
     * Get the billingAccountId property: Billing Account Id.
     *
     * @return the billingAccountId value.
     */
    public String billingAccountId() {
        return this.innerProperties() == null ? null : this.innerProperties().billingAccountId();
    }

    /**
     * Get the billingProfileId property: Billing Profile Id.
     *
     * @return the billingProfileId value.
     */
    public String billingProfileId() {
        return this.innerProperties() == null ? null : this.innerProperties().billingProfileId();
    }

    /**
     * Get the invoiceSectionId property: Invoice Section Id.
     *
     * @return the invoiceSectionId value.
     */
    public String invoiceSectionId() {
        return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId();
    }

    /**
     * Get the customerId property: Customer Id.
     *
     * @return the customerId value.
     */
    public String customerId() {
        return this.innerProperties() == null ? null : this.innerProperties().customerId();
    }

    /**
     * Get the isInvoiced property: Is charge Invoiced.
     *
     * @return the isInvoiced value.
     */
    public Boolean isInvoiced() {
        return this.innerProperties() == null ? null : this.innerProperties().isInvoiced();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() == null) {
            throw logger
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model ModernChargeSummary"));
        } else {
            innerProperties().validate();
        }
    }
}
