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

package com.azure.resourcemanager.devtestlabs.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.devtestlabs.models.LabCostDetailsProperties;
import com.azure.resourcemanager.devtestlabs.models.LabCostSummaryProperties;
import com.azure.resourcemanager.devtestlabs.models.LabResourceCostProperties;
import com.azure.resourcemanager.devtestlabs.models.TargetCostProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** A cost item. */
@Fluent
public final class LabCostInner extends Resource {
    /*
     * The properties of the resource.
     */
    @JsonProperty(value = "properties", required = true)
    private LabCostProperties innerProperties = new LabCostProperties();

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

    /**
     * Get the innerProperties property: The properties of the resource.
     *
     * @return the innerProperties value.
     */
    private LabCostProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public LabCostInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public LabCostInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the targetCost property: The target cost properties.
     *
     * @return the targetCost value.
     */
    public TargetCostProperties targetCost() {
        return this.innerProperties() == null ? null : this.innerProperties().targetCost();
    }

    /**
     * Set the targetCost property: The target cost properties.
     *
     * @param targetCost the targetCost value to set.
     * @return the LabCostInner object itself.
     */
    public LabCostInner withTargetCost(TargetCostProperties targetCost) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LabCostProperties();
        }
        this.innerProperties().withTargetCost(targetCost);
        return this;
    }

    /**
     * Get the labCostSummary property: The lab cost summary component of the cost data.
     *
     * @return the labCostSummary value.
     */
    public LabCostSummaryProperties labCostSummary() {
        return this.innerProperties() == null ? null : this.innerProperties().labCostSummary();
    }

    /**
     * Get the labCostDetails property: The lab cost details component of the cost data.
     *
     * @return the labCostDetails value.
     */
    public List<LabCostDetailsProperties> labCostDetails() {
        return this.innerProperties() == null ? null : this.innerProperties().labCostDetails();
    }

    /**
     * Get the resourceCosts property: The resource cost component of the cost data.
     *
     * @return the resourceCosts value.
     */
    public List<LabResourceCostProperties> resourceCosts() {
        return this.innerProperties() == null ? null : this.innerProperties().resourceCosts();
    }

    /**
     * Get the currencyCode property: The currency code of the cost.
     *
     * @return the currencyCode value.
     */
    public String currencyCode() {
        return this.innerProperties() == null ? null : this.innerProperties().currencyCode();
    }

    /**
     * Set the currencyCode property: The currency code of the cost.
     *
     * @param currencyCode the currencyCode value to set.
     * @return the LabCostInner object itself.
     */
    public LabCostInner withCurrencyCode(String currencyCode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LabCostProperties();
        }
        this.innerProperties().withCurrencyCode(currencyCode);
        return this;
    }

    /**
     * Get the startDateTime property: The start time of the cost data.
     *
     * @return the startDateTime value.
     */
    public OffsetDateTime startDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().startDateTime();
    }

    /**
     * Set the startDateTime property: The start time of the cost data.
     *
     * @param startDateTime the startDateTime value to set.
     * @return the LabCostInner object itself.
     */
    public LabCostInner withStartDateTime(OffsetDateTime startDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LabCostProperties();
        }
        this.innerProperties().withStartDateTime(startDateTime);
        return this;
    }

    /**
     * Get the endDateTime property: The end time of the cost data.
     *
     * @return the endDateTime value.
     */
    public OffsetDateTime endDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().endDateTime();
    }

    /**
     * Set the endDateTime property: The end time of the cost data.
     *
     * @param endDateTime the endDateTime value to set.
     * @return the LabCostInner object itself.
     */
    public LabCostInner withEndDateTime(OffsetDateTime endDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LabCostProperties();
        }
        this.innerProperties().withEndDateTime(endDateTime);
        return this;
    }

    /**
     * Get the createdDate property: The creation date of the cost.
     *
     * @return the createdDate value.
     */
    public OffsetDateTime createdDate() {
        return this.innerProperties() == null ? null : this.innerProperties().createdDate();
    }

    /**
     * Set the createdDate property: The creation date of the cost.
     *
     * @param createdDate the createdDate value to set.
     * @return the LabCostInner object itself.
     */
    public LabCostInner withCreatedDate(OffsetDateTime createdDate) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LabCostProperties();
        }
        this.innerProperties().withCreatedDate(createdDate);
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    public String uniqueIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier();
    }

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

    private static final ClientLogger LOGGER = new ClientLogger(LabCostInner.class);
}
