package org.wfc.omada.api.batch.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * BatchRequestEntity
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:47:33.899+08:00[Asia/Shanghai]")

public class BatchRequestEntity   {
  @JsonProperty("interrupt")
  private Boolean interrupt;

  @JsonProperty("actions")
  @Valid
  private List<RequestActionEntity> actions = null;

  public BatchRequestEntity interrupt(Boolean interrupt) {
    this.interrupt = interrupt;
    return this;
  }

  /**
   * Indicates whether to interrupt execution when encountering an error while executing openAPI, defaults to true
   * @return interrupt
  */
  @ApiModelProperty(value = "Indicates whether to interrupt execution when encountering an error while executing openAPI, defaults to true")


  public Boolean getInterrupt() {
    return interrupt;
  }

  public void setInterrupt(Boolean interrupt) {
    this.interrupt = interrupt;
  }

  public BatchRequestEntity actions(List<RequestActionEntity> actions) {
    this.actions = actions;
    return this;
  }

  public BatchRequestEntity addActionsItem(RequestActionEntity actionsItem) {
    if (this.actions == null) {
      this.actions = new ArrayList<>();
    }
    this.actions.add(actionsItem);
    return this;
  }

  /**
   * List of OpenAPIs that require batch execution. Up to 20 entries are allowed for the action list
   * @return actions
  */
  @ApiModelProperty(value = "List of OpenAPIs that require batch execution. Up to 20 entries are allowed for the action list")

  @Valid

  public List<RequestActionEntity> getActions() {
    return actions;
  }

  public void setActions(List<RequestActionEntity> actions) {
    this.actions = actions;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BatchRequestEntity batchRequestEntity = (BatchRequestEntity) o;
    return Objects.equals(this.interrupt, batchRequestEntity.interrupt) &&
        Objects.equals(this.actions, batchRequestEntity.actions);
  }

  @Override
  public int hashCode() {
    return Objects.hash(interrupt, actions);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class BatchRequestEntity {\n");
    
    sb.append("    interrupt: ").append(toIndentedString(interrupt)).append("\n");
    sb.append("    actions: ").append(toIndentedString(actions)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

