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 java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

public class CallForwardingRule   {
  @JsonProperty("omadacId")
  private String omadacId;

  @JsonProperty("siteId")
  private String siteId;

  @JsonProperty("ruleId")
  private String ruleId;

  @JsonProperty("enable")
  private Boolean enable;

  @JsonProperty("condition")
  private Integer condition;

  @JsonProperty("type")
  private Integer type;

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

  @JsonProperty("toDevices")
  @Valid
  private List<Integer> toDevices = null;

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

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

  @JsonProperty("destNumber")
  private String destNumber;

  public CallForwardingRule omadacId(String omadacId) {
    this.omadacId = omadacId;
    return this;
  }

  /**
   * Omadac ID
   * @return omadacId
  */
  @ApiModelProperty(value = "Omadac ID")


  public String getOmadacId() {
    return omadacId;
  }

  public void setOmadacId(String omadacId) {
    this.omadacId = omadacId;
  }

  public CallForwardingRule siteId(String siteId) {
    this.siteId = siteId;
    return this;
  }

  /**
   * Site ID
   * @return siteId
  */
  @ApiModelProperty(value = "Site ID")


  public String getSiteId() {
    return siteId;
  }

  public void setSiteId(String siteId) {
    this.siteId = siteId;
  }

  public CallForwardingRule ruleId(String ruleId) {
    this.ruleId = ruleId;
    return this;
  }

  /**
   * Call forwarding rule id
   * @return ruleId
  */
  @ApiModelProperty(value = "Call forwarding rule id")


  public String getRuleId() {
    return ruleId;
  }

  public void setRuleId(String ruleId) {
    this.ruleId = ruleId;
  }

  public CallForwardingRule enable(Boolean enable) {
    this.enable = enable;
    return this;
  }

  /**
   * Enable this rule or not
   * @return enable
  */
  @ApiModelProperty(required = true, value = "Enable this rule or not")
  @NotNull


  public Boolean getEnable() {
    return enable;
  }

  public void setEnable(Boolean enable) {
    this.enable = enable;
  }

  public CallForwardingRule condition(Integer condition) {
    this.condition = condition;
    return this;
  }

  /**
   * Forwarding condition. 0- no answer, 1- unconditional
   * @return condition
  */
  @ApiModelProperty(required = true, value = "Forwarding condition. 0- no answer, 1- unconditional")
  @NotNull


  public Integer getCondition() {
    return condition;
  }

  public void setCondition(Integer condition) {
    this.condition = condition;
  }

  public CallForwardingRule type(Integer type) {
    this.type = type;
    return this;
  }

  /**
   * The call type to be forwarded. 0: All Incoming Calls - If this option is selected, all incoming calls will be forwarded. 1: Calls to the Telephone Number - If this option is selected, select a telephone number from the list. Any incoming calls to this number will be forwarded. 2: Calls to the Phone - If this option is selected, select a telephony device from the list. Any incoming calls to this device will be forwarded. 3: Calls from a Person in the Telephone Book - If this option is selected, select a contact from the list. Any incoming calls from this contact will be forwarded. 4: Calls from the Telephone Number - If this option is selected, enter a specific telephone number. Any incoming calls from this number will be forwarded.
   * @return type
  */
  @ApiModelProperty(required = true, value = "The call type to be forwarded. 0: All Incoming Calls - If this option is selected, all incoming calls will be forwarded. 1: Calls to the Telephone Number - If this option is selected, select a telephone number from the list. Any incoming calls to this number will be forwarded. 2: Calls to the Phone - If this option is selected, select a telephony device from the list. Any incoming calls to this device will be forwarded. 3: Calls from a Person in the Telephone Book - If this option is selected, select a contact from the list. Any incoming calls from this contact will be forwarded. 4: Calls from the Telephone Number - If this option is selected, enter a specific telephone number. Any incoming calls from this number will be forwarded.")
  @NotNull


  public Integer getType() {
    return type;
  }

  public void setType(Integer type) {
    this.type = type;
  }

  public CallForwardingRule toNumbers(List<String> toNumbers) {
    this.toNumbers = toNumbers;
    return this;
  }

  public CallForwardingRule addToNumbersItem(String toNumbersItem) {
    if (this.toNumbers == null) {
      this.toNumbers = new ArrayList<>();
    }
    this.toNumbers.add(toNumbersItem);
    return this;
  }

  /**
   * Any incoming calls to these numbers will be forwarded.
   * @return toNumbers
  */
  @ApiModelProperty(value = "Any incoming calls to these numbers will be forwarded.")


  public List<String> getToNumbers() {
    return toNumbers;
  }

  public void setToNumbers(List<String> toNumbers) {
    this.toNumbers = toNumbers;
  }

  public CallForwardingRule toDevices(List<Integer> toDevices) {
    this.toDevices = toDevices;
    return this;
  }

  public CallForwardingRule addToDevicesItem(Integer toDevicesItem) {
    if (this.toDevices == null) {
      this.toDevices = new ArrayList<>();
    }
    this.toDevices.add(toDevicesItem);
    return this;
  }

  /**
   * Any incoming calls to these devices will be forwarded.
   * @return toDevices
  */
  @ApiModelProperty(value = "Any incoming calls to these devices will be forwarded.")


  public List<Integer> getToDevices() {
    return toDevices;
  }

  public void setToDevices(List<Integer> toDevices) {
    this.toDevices = toDevices;
  }

  public CallForwardingRule fromPersons(List<String> fromPersons) {
    this.fromPersons = fromPersons;
    return this;
  }

  public CallForwardingRule addFromPersonsItem(String fromPersonsItem) {
    if (this.fromPersons == null) {
      this.fromPersons = new ArrayList<>();
    }
    this.fromPersons.add(fromPersonsItem);
    return this;
  }

  /**
   * Any incoming calls from these contacts will be forwarded.
   * @return fromPersons
  */
  @ApiModelProperty(value = "Any incoming calls from these contacts will be forwarded.")


  public List<String> getFromPersons() {
    return fromPersons;
  }

  public void setFromPersons(List<String> fromPersons) {
    this.fromPersons = fromPersons;
  }

  public CallForwardingRule fromNumbers(List<String> fromNumbers) {
    this.fromNumbers = fromNumbers;
    return this;
  }

  public CallForwardingRule addFromNumbersItem(String fromNumbersItem) {
    if (this.fromNumbers == null) {
      this.fromNumbers = new ArrayList<>();
    }
    this.fromNumbers.add(fromNumbersItem);
    return this;
  }

  /**
   * Any incoming calls from these numbers will be forwarded.
   * @return fromNumbers
  */
  @ApiModelProperty(value = "Any incoming calls from these numbers will be forwarded.")


  public List<String> getFromNumbers() {
    return fromNumbers;
  }

  public void setFromNumbers(List<String> fromNumbers) {
    this.fromNumbers = fromNumbers;
  }

  public CallForwardingRule destNumber(String destNumber) {
    this.destNumber = destNumber;
    return this;
  }

  /**
   * The Destination Telephone Number that incoming calls will be redirected to.
   * @return destNumber
  */
  @ApiModelProperty(required = true, value = "The Destination Telephone Number that incoming calls will be redirected to.")
  @NotNull


  public String getDestNumber() {
    return destNumber;
  }

  public void setDestNumber(String destNumber) {
    this.destNumber = destNumber;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CallForwardingRule callForwardingRule = (CallForwardingRule) o;
    return Objects.equals(this.omadacId, callForwardingRule.omadacId) &&
        Objects.equals(this.siteId, callForwardingRule.siteId) &&
        Objects.equals(this.ruleId, callForwardingRule.ruleId) &&
        Objects.equals(this.enable, callForwardingRule.enable) &&
        Objects.equals(this.condition, callForwardingRule.condition) &&
        Objects.equals(this.type, callForwardingRule.type) &&
        Objects.equals(this.toNumbers, callForwardingRule.toNumbers) &&
        Objects.equals(this.toDevices, callForwardingRule.toDevices) &&
        Objects.equals(this.fromPersons, callForwardingRule.fromPersons) &&
        Objects.equals(this.fromNumbers, callForwardingRule.fromNumbers) &&
        Objects.equals(this.destNumber, callForwardingRule.destNumber);
  }

  @Override
  public int hashCode() {
    return Objects.hash(omadacId, siteId, ruleId, enable, condition, type, toNumbers, toDevices, fromPersons, fromNumbers, destNumber);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CallForwardingRule {\n");
    
    sb.append("    omadacId: ").append(toIndentedString(omadacId)).append("\n");
    sb.append("    siteId: ").append(toIndentedString(siteId)).append("\n");
    sb.append("    ruleId: ").append(toIndentedString(ruleId)).append("\n");
    sb.append("    enable: ").append(toIndentedString(enable)).append("\n");
    sb.append("    condition: ").append(toIndentedString(condition)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    toNumbers: ").append(toIndentedString(toNumbers)).append("\n");
    sb.append("    toDevices: ").append(toIndentedString(toDevices)).append("\n");
    sb.append("    fromPersons: ").append(toIndentedString(fromPersons)).append("\n");
    sb.append("    fromNumbers: ").append(toIndentedString(fromNumbers)).append("\n");
    sb.append("    destNumber: ").append(toIndentedString(destNumber)).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    ");
  }
}

