// 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 actions and action statuses. */
@Immutable
public final class BranchStatus {
    /*
     * The name of the branch status.
     */
    @JsonProperty(value = "branchName", access = JsonProperty.Access.WRITE_ONLY)
    private String branchName;

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

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

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

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

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

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

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

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

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