// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** A management group aggregated cost resource. */
@Fluent
public final class ManagementGroupAggregatedCostResultInner extends ProxyResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupAggregatedCostResultInner.class);

    /*
     * The properties of the Management Group Aggregated Cost.
     */
    @JsonProperty(value = "properties")
    private ManagementGroupAggregatedCostProperties innerProperties;

    /*
     * The etag for the resource.
     */
    @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /*
     * Resource tags.
     */
    @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY)
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /**
     * Get the innerProperties property: The properties of the Management Group Aggregated Cost.
     *
     * @return the innerProperties value.
     */
    private ManagementGroupAggregatedCostProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the etag property: The etag for the resource.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Get the tags property: Resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

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

    /**
     * Get the usageStart property: The start of the date time range covered by aggregated cost.
     *
     * @return the usageStart value.
     */
    public OffsetDateTime usageStart() {
        return this.innerProperties() == null ? null : this.innerProperties().usageStart();
    }

    /**
     * Get the usageEnd property: The end of the date time range covered by the aggregated cost.
     *
     * @return the usageEnd value.
     */
    public OffsetDateTime usageEnd() {
        return this.innerProperties() == null ? null : this.innerProperties().usageEnd();
    }

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

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

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

    /**
     * Get the currency property: The ISO currency in which the meter is charged, for example, USD.
     *
     * @return the currency value.
     */
    public String currency() {
        return this.innerProperties() == null ? null : this.innerProperties().currency();
    }

    /**
     * Get the children property: Children of a management group.
     *
     * @return the children value.
     */
    public List<ManagementGroupAggregatedCostResultInner> children() {
        return this.innerProperties() == null ? null : this.innerProperties().children();
    }

    /**
     * Set the children property: Children of a management group.
     *
     * @param children the children value to set.
     * @return the ManagementGroupAggregatedCostResultInner object itself.
     */
    public ManagementGroupAggregatedCostResultInner withChildren(
        List<ManagementGroupAggregatedCostResultInner> children) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ManagementGroupAggregatedCostProperties();
        }
        this.innerProperties().withChildren(children);
        return this;
    }

    /**
     * Get the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated
     * cost.
     *
     * @return the includedSubscriptions value.
     */
    public List<String> includedSubscriptions() {
        return this.innerProperties() == null ? null : this.innerProperties().includedSubscriptions();
    }

    /**
     * Set the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated
     * cost.
     *
     * @param includedSubscriptions the includedSubscriptions value to set.
     * @return the ManagementGroupAggregatedCostResultInner object itself.
     */
    public ManagementGroupAggregatedCostResultInner withIncludedSubscriptions(List<String> includedSubscriptions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ManagementGroupAggregatedCostProperties();
        }
        this.innerProperties().withIncludedSubscriptions(includedSubscriptions);
        return this;
    }

    /**
     * Get the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated
     * cost.
     *
     * @return the excludedSubscriptions value.
     */
    public List<String> excludedSubscriptions() {
        return this.innerProperties() == null ? null : this.innerProperties().excludedSubscriptions();
    }

    /**
     * Set the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated
     * cost.
     *
     * @param excludedSubscriptions the excludedSubscriptions value to set.
     * @return the ManagementGroupAggregatedCostResultInner object itself.
     */
    public ManagementGroupAggregatedCostResultInner withExcludedSubscriptions(List<String> excludedSubscriptions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ManagementGroupAggregatedCostProperties();
        }
        this.innerProperties().withExcludedSubscriptions(excludedSubscriptions);
        return this;
    }

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