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

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

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.edgeorder.models.StageDetails;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Represents order details. */
@Immutable
public final class OrderProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(OrderProperties.class);

    /*
     * List of order item ARM Ids which are part of an order.
     */
    @JsonProperty(value = "orderItemIds", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> orderItemIds;

    /*
     * Order current status.
     */
    @JsonProperty(value = "currentStage", access = JsonProperty.Access.WRITE_ONLY)
    private StageDetails currentStage;

    /*
     * Order status history.
     */
    @JsonProperty(value = "orderStageHistory", access = JsonProperty.Access.WRITE_ONLY)
    private List<StageDetails> orderStageHistory;

    /**
     * Get the orderItemIds property: List of order item ARM Ids which are part of an order.
     *
     * @return the orderItemIds value.
     */
    public List<String> orderItemIds() {
        return this.orderItemIds;
    }

    /**
     * Get the currentStage property: Order current status.
     *
     * @return the currentStage value.
     */
    public StageDetails currentStage() {
        return this.currentStage;
    }

    /**
     * Get the orderStageHistory property: Order status history.
     *
     * @return the orderStageHistory value.
     */
    public List<StageDetails> orderStageHistory() {
        return this.orderStageHistory;
    }

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