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

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

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

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

public class IPsecFailover   {
  @JsonProperty("id")
  private String id;

  @JsonProperty("name")
  private String name;

  @JsonProperty("primary")
  private String primary;

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

  @JsonProperty("failback")
  private Boolean failback;

  @JsonProperty("failbackTime")
  private Integer failbackTime;

  public IPsecFailover id(String id) {
    this.id = id;
    return this;
  }

  /**
   * ID of the IPSec failover.
   * @return id
  */
  @ApiModelProperty(value = "ID of the IPSec failover.")


  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

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

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

@Pattern(regexp="^[\\041-\\0176]$|^[\\041-\\0176][\\040-\\0176]{0,62}[\\041-\\0176]$") 
  public String getName() {
    return name;
  }

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

  public IPsecFailover primary(String primary) {
    this.primary = primary;
    return this;
  }

  /**
   * Primary of the IPSec failover. IPsec VPN can be created using 'Create site-to-site VPN' interface, and ID can be obtained from 'Get site-to-site VPN list' interface.
   * @return primary
  */
  @ApiModelProperty(required = true, value = "Primary of the IPSec failover. IPsec VPN can be created using 'Create site-to-site VPN' interface, and ID can be obtained from 'Get site-to-site VPN list' interface.")
  @NotNull


  public String getPrimary() {
    return primary;
  }

  public void setPrimary(String primary) {
    this.primary = primary;
  }

  public IPsecFailover candidates(List<String> candidates) {
    this.candidates = candidates;
    return this;
  }

  public IPsecFailover addCandidatesItem(String candidatesItem) {
    this.candidates.add(candidatesItem);
    return this;
  }

  /**
   * Candidates of the IPSec failover. IPsec VPN can be created using 'Create site-to-site VPN' interface, and ID can be obtained from 'Get site-to-site VPN list' interface.
   * @return candidates
  */
  @ApiModelProperty(required = true, value = "Candidates of the IPSec failover. IPsec VPN can be created using 'Create site-to-site VPN' interface, and ID can be obtained from 'Get site-to-site VPN list' interface.")
  @NotNull


  public List<String> getCandidates() {
    return candidates;
  }

  public void setCandidates(List<String> candidates) {
    this.candidates = candidates;
  }

  public IPsecFailover failback(Boolean failback) {
    this.failback = failback;
    return this;
  }

  /**
   * Failback of the IPSec failover.
   * @return failback
  */
  @ApiModelProperty(value = "Failback of the IPSec failover.")


  public Boolean getFailback() {
    return failback;
  }

  public void setFailback(Boolean failback) {
    this.failback = failback;
  }

  public IPsecFailover failbackTime(Integer failbackTime) {
    this.failbackTime = failbackTime;
    return this;
  }

  /**
   * Failback time should be within the range of 10–3600s.
   * @return failbackTime
  */
  @ApiModelProperty(value = "Failback time should be within the range of 10–3600s.")


  public Integer getFailbackTime() {
    return failbackTime;
  }

  public void setFailbackTime(Integer failbackTime) {
    this.failbackTime = failbackTime;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    IPsecFailover ipsecFailover = (IPsecFailover) o;
    return Objects.equals(this.id, ipsecFailover.id) &&
        Objects.equals(this.name, ipsecFailover.name) &&
        Objects.equals(this.primary, ipsecFailover.primary) &&
        Objects.equals(this.candidates, ipsecFailover.candidates) &&
        Objects.equals(this.failback, ipsecFailover.failback) &&
        Objects.equals(this.failbackTime, ipsecFailover.failbackTime);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, primary, candidates, failback, failbackTime);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class IPsecFailover {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    primary: ").append(toIndentedString(primary)).append("\n");
    sb.append("    candidates: ").append(toIndentedString(candidates)).append("\n");
    sb.append("    failback: ").append(toIndentedString(failback)).append("\n");
    sb.append("    failbackTime: ").append(toIndentedString(failbackTime)).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    ");
  }
}

