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

package com.azure.resourcemanager.chaos.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Model that represents the a list of branches and branch statuses. */
@Immutable
public final class StepStatus {
    /*
     * The name of the step.
     */
    @JsonProperty(value = "stepName", access = JsonProperty.Access.WRITE_ONLY)
    private String stepName;

    /*
     * The id of the step.
     */
    @JsonProperty(value = "stepId", access = JsonProperty.Access.WRITE_ONLY)
    private String stepId;

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

    /*
     * The array of branches.
     */
    @JsonProperty(value = "branches", access = JsonProperty.Access.WRITE_ONLY)
    private List<BranchStatus> branches;

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

    /**
     * Get the stepName property: The name of the step.
     *
     * @return the stepName value.
     */
    public String stepName() {
        return this.stepName;
    }

    /**
     * Get the stepId property: The id of the step.
     *
     * @return the stepId value.
     */
    public String stepId() {
        return this.stepId;
    }

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

    /**
     * Get the branches property: The array of branches.
     *
     * @return the branches value.
     */
    public List<BranchStatus> branches() {
        return this.branches;
    }

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