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

/** Properties of a cost item. */
@Fluent
public final class LabCostProperties {
    /*
     * The target cost properties
     */
    @JsonProperty(value = "targetCost")
    private TargetCostProperties targetCost;

    /*
     * The lab cost summary component of the cost data.
     */
    @JsonProperty(value = "labCostSummary", access = JsonProperty.Access.WRITE_ONLY)
    private LabCostSummaryProperties labCostSummary;

    /*
     * The lab cost details component of the cost data.
     */
    @JsonProperty(value = "labCostDetails", access = JsonProperty.Access.WRITE_ONLY)
    private List<LabCostDetailsProperties> labCostDetails;

    /*
     * The resource cost component of the cost data.
     */
    @JsonProperty(value = "resourceCosts", access = JsonProperty.Access.WRITE_ONLY)
    private List<LabResourceCostProperties> resourceCosts;

    /*
     * The currency code of the cost.
     */
    @JsonProperty(value = "currencyCode")
    private String currencyCode;

    /*
     * The start time of the cost data.
     */
    @JsonProperty(value = "startDateTime")
    private OffsetDateTime startDateTime;

    /*
     * The end time of the cost data.
     */
    @JsonProperty(value = "endDateTime")
    private OffsetDateTime endDateTime;

    /*
     * The creation date of the cost.
     */
    @JsonProperty(value = "createdDate")
    private OffsetDateTime createdDate;

    /*
     * The provisioning status of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * The unique immutable identifier of a resource (Guid).
     */
    @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY)
    private String uniqueIdentifier;

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

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

    /**
     * Set the targetCost property: The target cost properties.
     *
     * @param targetCost the targetCost value to set.
     * @return the LabCostProperties object itself.
     */
    public LabCostProperties withTargetCost(TargetCostProperties targetCost) {
        this.targetCost = 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.labCostSummary;
    }

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (targetCost() != null) {
            targetCost().validate();
        }
        if (labCostSummary() != null) {
            labCostSummary().validate();
        }
        if (labCostDetails() != null) {
            labCostDetails().forEach(e -> e.validate());
        }
        if (resourceCosts() != null) {
            resourceCosts().forEach(e -> e.validate());
        }
    }
}
