package org.wfc.omada.api.globalsetting.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;

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

public class OpenApiWebhookDispatchLogVo   {
  @JsonProperty("dispatchMessage")
  private OpenApiWebhookLogMessageVo dispatchMessage;

  @JsonProperty("dispatchDetail")
  private OpenApiDispatchLogDetailVo dispatchDetail;

  @JsonProperty("attemptMessages")
  @Valid
  private List<OpenApiWebhookAttemptMessageVo> attemptMessages = null;

  public OpenApiWebhookDispatchLogVo dispatchMessage(OpenApiWebhookLogMessageVo dispatchMessage) {
    this.dispatchMessage = dispatchMessage;
    return this;
  }

  /**
   * Get dispatchMessage
   * @return dispatchMessage
  */
  @ApiModelProperty(value = "")

  @Valid

  public OpenApiWebhookLogMessageVo getDispatchMessage() {
    return dispatchMessage;
  }

  public void setDispatchMessage(OpenApiWebhookLogMessageVo dispatchMessage) {
    this.dispatchMessage = dispatchMessage;
  }

  public OpenApiWebhookDispatchLogVo dispatchDetail(OpenApiDispatchLogDetailVo dispatchDetail) {
    this.dispatchDetail = dispatchDetail;
    return this;
  }

  /**
   * Get dispatchDetail
   * @return dispatchDetail
  */
  @ApiModelProperty(value = "")

  @Valid

  public OpenApiDispatchLogDetailVo getDispatchDetail() {
    return dispatchDetail;
  }

  public void setDispatchDetail(OpenApiDispatchLogDetailVo dispatchDetail) {
    this.dispatchDetail = dispatchDetail;
  }

  public OpenApiWebhookDispatchLogVo attemptMessages(List<OpenApiWebhookAttemptMessageVo> attemptMessages) {
    this.attemptMessages = attemptMessages;
    return this;
  }

  public OpenApiWebhookDispatchLogVo addAttemptMessagesItem(OpenApiWebhookAttemptMessageVo attemptMessagesItem) {
    if (this.attemptMessages == null) {
      this.attemptMessages = new ArrayList<>();
    }
    this.attemptMessages.add(attemptMessagesItem);
    return this;
  }

  /**
   * Attempt Message of Dispatch Log Detail
   * @return attemptMessages
  */
  @ApiModelProperty(value = "Attempt Message of Dispatch Log Detail")

  @Valid

  public List<OpenApiWebhookAttemptMessageVo> getAttemptMessages() {
    return attemptMessages;
  }

  public void setAttemptMessages(List<OpenApiWebhookAttemptMessageVo> attemptMessages) {
    this.attemptMessages = attemptMessages;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    OpenApiWebhookDispatchLogVo openApiWebhookDispatchLogVo = (OpenApiWebhookDispatchLogVo) o;
    return Objects.equals(this.dispatchMessage, openApiWebhookDispatchLogVo.dispatchMessage) &&
        Objects.equals(this.dispatchDetail, openApiWebhookDispatchLogVo.dispatchDetail) &&
        Objects.equals(this.attemptMessages, openApiWebhookDispatchLogVo.attemptMessages);
  }

  @Override
  public int hashCode() {
    return Objects.hash(dispatchMessage, dispatchDetail, attemptMessages);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OpenApiWebhookDispatchLogVo {\n");
    
    sb.append("    dispatchMessage: ").append(toIndentedString(dispatchMessage)).append("\n");
    sb.append("    dispatchDetail: ").append(toIndentedString(dispatchDetail)).append("\n");
    sb.append("    attemptMessages: ").append(toIndentedString(attemptMessages)).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    ");
  }
}

