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

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

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

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

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

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

  @JsonProperty("retryPolicy")
  private Integer retryPolicy;

  @JsonProperty("shardedSecret")
  private String shardedSecret;

  @JsonProperty("template")
  private Integer template;

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

  /**
   * Webhook name. It should contain 1 to 128 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Webhook name. It should contain 1 to 128 characters.")
  @NotNull


  public String getName() {
    return name;
  }

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

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

  public OpenApiWebhookSettingAddVo addUrlListItem(String urlListItem) {
    this.urlList.add(urlListItem);
    return this;
  }

  /**
   * Webhook URL List. Up to 3 entries are allowed for the URL list
   * @return urlList
  */
  @ApiModelProperty(required = true, value = "Webhook URL List. Up to 3 entries are allowed for the URL list")
  @NotNull


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

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

  public OpenApiWebhookSettingAddVo 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(required = true, 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)")
  @NotNull


  public Integer getRetryPolicy() {
    return retryPolicy;
  }

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

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

  /**
   * Webhook Sharded Secret. It should contain 0 to 128 characters.
   * @return shardedSecret
  */
  @ApiModelProperty(value = "Webhook Sharded Secret. It should contain 0 to 128 characters.")


  public String getShardedSecret() {
    return shardedSecret;
  }

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

  public OpenApiWebhookSettingAddVo 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;
    }
    OpenApiWebhookSettingAddVo openApiWebhookSettingAddVo = (OpenApiWebhookSettingAddVo) o;
    return Objects.equals(this.name, openApiWebhookSettingAddVo.name) &&
        Objects.equals(this.urlList, openApiWebhookSettingAddVo.urlList) &&
        Objects.equals(this.retryPolicy, openApiWebhookSettingAddVo.retryPolicy) &&
        Objects.equals(this.shardedSecret, openApiWebhookSettingAddVo.shardedSecret) &&
        Objects.equals(this.template, openApiWebhookSettingAddVo.template);
  }

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

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

