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

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

public class ApIpSetting   {
  @JsonProperty("mode")
  private String mode;

  @JsonProperty("dhcpIpSetting")
  private DhcpIpSettingEntity dhcpIpSetting;

  @JsonProperty("staticIpSetting")
  private StaticIpSettingEntity staticIpSetting;

  public ApIpSetting mode(String mode) {
    this.mode = mode;
    return this;
  }

  /**
   * Mode should be a value as follows: Static; DHCP
   * @return mode
  */
  @ApiModelProperty(required = true, value = "Mode should be a value as follows: Static; DHCP")
  @NotNull

@Pattern(regexp="static|dhcp") 
  public String getMode() {
    return mode;
  }

  public void setMode(String mode) {
    this.mode = mode;
  }

  public ApIpSetting dhcpIpSetting(DhcpIpSettingEntity dhcpIpSetting) {
    this.dhcpIpSetting = dhcpIpSetting;
    return this;
  }

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

  @Valid

  public DhcpIpSettingEntity getDhcpIpSetting() {
    return dhcpIpSetting;
  }

  public void setDhcpIpSetting(DhcpIpSettingEntity dhcpIpSetting) {
    this.dhcpIpSetting = dhcpIpSetting;
  }

  public ApIpSetting staticIpSetting(StaticIpSettingEntity staticIpSetting) {
    this.staticIpSetting = staticIpSetting;
    return this;
  }

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

  @Valid

  public StaticIpSettingEntity getStaticIpSetting() {
    return staticIpSetting;
  }

  public void setStaticIpSetting(StaticIpSettingEntity staticIpSetting) {
    this.staticIpSetting = staticIpSetting;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApIpSetting apIpSetting = (ApIpSetting) o;
    return Objects.equals(this.mode, apIpSetting.mode) &&
        Objects.equals(this.dhcpIpSetting, apIpSetting.dhcpIpSetting) &&
        Objects.equals(this.staticIpSetting, apIpSetting.staticIpSetting);
  }

  @Override
  public int hashCode() {
    return Objects.hash(mode, dhcpIpSetting, staticIpSetting);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApIpSetting {\n");
    
    sb.append("    mode: ").append(toIndentedString(mode)).append("\n");
    sb.append("    dhcpIpSetting: ").append(toIndentedString(dhcpIpSetting)).append("\n");
    sb.append("    staticIpSetting: ").append(toIndentedString(staticIpSetting)).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    ");
  }
}

