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

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

public class WebhookSetting   {
  @JsonProperty("name")
  private String name;

  @JsonProperty("urlNum")
  private Integer urlNum;

  @JsonProperty("urlList")
  @Valid
  private List<String> urlList = null;

  @JsonProperty("webhookId")
  private String webhookId;

  @JsonProperty("shardedSecret")
  private String shardedSecret;

  @JsonProperty("lastTime")
  private Long lastTime;

  @JsonProperty("retryPolicy")
  private Integer retryPolicy;

  @JsonProperty("template")
  private Integer template;

  public WebhookSetting name(String name) {
    this.name = name;
    return this;
  }

  /**
   * Webhook Name
   * @return name
  */
  @ApiModelProperty(value = "Webhook Name")


  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public WebhookSetting urlNum(Integer urlNum) {
    this.urlNum = urlNum;
    return this;
  }

  /**
   * Webhook URL Number
   * @return urlNum
  */
  @ApiModelProperty(value = "Webhook URL Number")


  public Integer getUrlNum() {
    return urlNum;
  }

  public void setUrlNum(Integer urlNum) {
    this.urlNum = urlNum;
  }

  public WebhookSetting urlList(List<String> urlList) {
    this.urlList = urlList;
    return this;
  }

  public WebhookSetting addUrlListItem(String urlListItem) {
    if (this.urlList == null) {
      this.urlList = new ArrayList<>();
    }
    this.urlList.add(urlListItem);
    return this;
  }

  /**
   * Webhook URL List
   * @return urlList
  */
  @ApiModelProperty(value = "Webhook URL List")


  public List<String> getUrlList() {
    return urlList;
  }

  public void setUrlList(List<String> urlList) {
    this.urlList = urlList;
  }

  public WebhookSetting webhookId(String webhookId) {
    this.webhookId = webhookId;
    return this;
  }

  /**
   * Webhook ID
   * @return webhookId
  */
  @ApiModelProperty(value = "Webhook ID")


  public String getWebhookId() {
    return webhookId;
  }

  public void setWebhookId(String webhookId) {
    this.webhookId = webhookId;
  }

  public WebhookSetting shardedSecret(String shardedSecret) {
    this.shardedSecret = shardedSecret;
    return this;
  }

  /**
   * Webhook Sharded Secret (old token)
   * @return shardedSecret
  */
  @ApiModelProperty(value = "Webhook Sharded Secret (old token)")


  public String getShardedSecret() {
    return shardedSecret;
  }

  public void setShardedSecret(String shardedSecret) {
    this.shardedSecret = shardedSecret;
  }

  public WebhookSetting lastTime(Long lastTime) {
    this.lastTime = lastTime;
    return this;
  }

  /**
   * Webhook setting last update time (ms)
   * @return lastTime
  */
  @ApiModelProperty(value = "Webhook setting last update time (ms)")


  public Long getLastTime() {
    return lastTime;
  }

  public void setLastTime(Long lastTime) {
    this.lastTime = lastTime;
  }

  public WebhookSetting retryPolicy(Integer retryPolicy) {
    this.retryPolicy = retryPolicy;
    return this;
  }

  /**
   * Webhook retry policy. It should be a value as follows: 0:None, 1:Important (Up to 5 retries over 60 minutes), 2:Critical (Up to 5 retries over 24 hours)
   * @return retryPolicy
  */
  @ApiModelProperty(value = "Webhook retry policy. It should be a value as follows: 0:None, 1:Important (Up to 5 retries over 60 minutes), 2:Critical (Up to 5 retries over 24 hours)")


  public Integer getRetryPolicy() {
    return retryPolicy;
  }

  public void setRetryPolicy(Integer retryPolicy) {
    this.retryPolicy = retryPolicy;
  }

  public WebhookSetting template(Integer template) {
    this.template = template;
    return this;
  }

  /**
   * Webhook template, it should be a value as follow: 0:Omada template, 1:Google chat template. Example: 0. 
   * @return template
  */
  @ApiModelProperty(value = "Webhook template, it should be a value as follow: 0:Omada template, 1:Google chat template. Example: 0. ")


  public Integer getTemplate() {
    return template;
  }

  public void setTemplate(Integer template) {
    this.template = template;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    WebhookSetting webhookSetting = (WebhookSetting) o;
    return Objects.equals(this.name, webhookSetting.name) &&
        Objects.equals(this.urlNum, webhookSetting.urlNum) &&
        Objects.equals(this.urlList, webhookSetting.urlList) &&
        Objects.equals(this.webhookId, webhookSetting.webhookId) &&
        Objects.equals(this.shardedSecret, webhookSetting.shardedSecret) &&
        Objects.equals(this.lastTime, webhookSetting.lastTime) &&
        Objects.equals(this.retryPolicy, webhookSetting.retryPolicy) &&
        Objects.equals(this.template, webhookSetting.template);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, urlNum, urlList, webhookId, shardedSecret, lastTime, retryPolicy, template);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class WebhookSetting {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    urlNum: ").append(toIndentedString(urlNum)).append("\n");
    sb.append("    urlList: ").append(toIndentedString(urlList)).append("\n");
    sb.append("    webhookId: ").append(toIndentedString(webhookId)).append("\n");
    sb.append("    shardedSecret: ").append(toIndentedString(shardedSecret)).append("\n");
    sb.append("    lastTime: ").append(toIndentedString(lastTime)).append("\n");
    sb.append("    retryPolicy: ").append(toIndentedString(retryPolicy)).append("\n");
    sb.append("    template: ").append(toIndentedString(template)).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    ");
  }
}

