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

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Properties of a cost target. */
@Fluent
public final class TargetCostProperties {
    /*
     * Target cost status
     */
    @JsonProperty(value = "status")
    private TargetCostStatus status;

    /*
     * Lab target cost
     */
    @JsonProperty(value = "target")
    private Integer target;

    /*
     * Cost thresholds.
     */
    @JsonProperty(value = "costThresholds")
    private List<CostThresholdProperties> costThresholds;

    /*
     * Reporting cycle start date.
     */
    @JsonProperty(value = "cycleStartDateTime")
    private OffsetDateTime cycleStartDateTime;

    /*
     * Reporting cycle end date.
     */
    @JsonProperty(value = "cycleEndDateTime")
    private OffsetDateTime cycleEndDateTime;

    /*
     * Reporting cycle type.
     */
    @JsonProperty(value = "cycleType")
    private ReportingCycleType cycleType;

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

    /**
     * Get the status property: Target cost status.
     *
     * @return the status value.
     */
    public TargetCostStatus status() {
        return this.status;
    }

    /**
     * Set the status property: Target cost status.
     *
     * @param status the status value to set.
     * @return the TargetCostProperties object itself.
     */
    public TargetCostProperties withStatus(TargetCostStatus status) {
        this.status = status;
        return this;
    }

    /**
     * Get the target property: Lab target cost.
     *
     * @return the target value.
     */
    public Integer target() {
        return this.target;
    }

    /**
     * Set the target property: Lab target cost.
     *
     * @param target the target value to set.
     * @return the TargetCostProperties object itself.
     */
    public TargetCostProperties withTarget(Integer target) {
        this.target = target;
        return this;
    }

    /**
     * Get the costThresholds property: Cost thresholds.
     *
     * @return the costThresholds value.
     */
    public List<CostThresholdProperties> costThresholds() {
        return this.costThresholds;
    }

    /**
     * Set the costThresholds property: Cost thresholds.
     *
     * @param costThresholds the costThresholds value to set.
     * @return the TargetCostProperties object itself.
     */
    public TargetCostProperties withCostThresholds(List<CostThresholdProperties> costThresholds) {
        this.costThresholds = costThresholds;
        return this;
    }

    /**
     * Get the cycleStartDateTime property: Reporting cycle start date.
     *
     * @return the cycleStartDateTime value.
     */
    public OffsetDateTime cycleStartDateTime() {
        return this.cycleStartDateTime;
    }

    /**
     * Set the cycleStartDateTime property: Reporting cycle start date.
     *
     * @param cycleStartDateTime the cycleStartDateTime value to set.
     * @return the TargetCostProperties object itself.
     */
    public TargetCostProperties withCycleStartDateTime(OffsetDateTime cycleStartDateTime) {
        this.cycleStartDateTime = cycleStartDateTime;
        return this;
    }

    /**
     * Get the cycleEndDateTime property: Reporting cycle end date.
     *
     * @return the cycleEndDateTime value.
     */
    public OffsetDateTime cycleEndDateTime() {
        return this.cycleEndDateTime;
    }

    /**
     * Set the cycleEndDateTime property: Reporting cycle end date.
     *
     * @param cycleEndDateTime the cycleEndDateTime value to set.
     * @return the TargetCostProperties object itself.
     */
    public TargetCostProperties withCycleEndDateTime(OffsetDateTime cycleEndDateTime) {
        this.cycleEndDateTime = cycleEndDateTime;
        return this;
    }

    /**
     * Get the cycleType property: Reporting cycle type.
     *
     * @return the cycleType value.
     */
    public ReportingCycleType cycleType() {
        return this.cycleType;
    }

    /**
     * Set the cycleType property: Reporting cycle type.
     *
     * @param cycleType the cycleType value to set.
     * @return the TargetCostProperties object itself.
     */
    public TargetCostProperties withCycleType(ReportingCycleType cycleType) {
        this.cycleType = cycleType;
        return this;
    }

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