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;

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

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

  @JsonProperty("type")
  private Integer type;

  @JsonProperty("ipList")
  @Valid
  private List<IpSubnetsOpenApiVo> ipList = null;

  @JsonProperty("ipv6List")
  @Valid
  private List<IPv6SubnetsOpenApiVo> ipv6List = null;

  @JsonProperty("portType")
  private Integer portType;

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

  @JsonProperty("portMaskList")
  @Valid
  private List<PortMaskOpenApiVo> portMaskList = null;

  @JsonProperty("macAddressList")
  @Valid
  private List<CreateMacAddressOpenApiVo> macAddressList = null;

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

  @JsonProperty("description")
  private String description;

  @JsonProperty("domainNamePort")
  @Valid
  private List<DomainOpenApiVo> domainNamePort = null;

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

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

@Pattern(regexp="^[^ ]$|^[^ ].{0,62}[^ ]$") 
  public String getName() {
    return name;
  }

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

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

  /**
   * Type of group profile, type should be a value as follows: 0: IP Group; 1: IP Port Group; 2: MAC Group; 3: IPv6 Group; 4: IPv6 Port Group; 5: Country Group; 7: Domain Group
   * @return type
  */
  @ApiModelProperty(required = true, value = "Type of group profile, type should be a value as follows: 0: IP Group; 1: IP Port Group; 2: MAC Group; 3: IPv6 Group; 4: IPv6 Port Group; 5: Country Group; 7: Domain Group")
  @NotNull


  public Integer getType() {
    return type;
  }

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

  public CreateGroupOpenApiVo ipList(List<IpSubnetsOpenApiVo> ipList) {
    this.ipList = ipList;
    return this;
  }

  public CreateGroupOpenApiVo addIpListItem(IpSubnetsOpenApiVo ipListItem) {
    if (this.ipList == null) {
      this.ipList = new ArrayList<>();
    }
    this.ipList.add(ipListItem);
    return this;
  }

  /**
   * IP subnet info list. [type] value of 0 or 1 is required
   * @return ipList
  */
  @ApiModelProperty(value = "IP subnet info list. [type] value of 0 or 1 is required")

  @Valid

  public List<IpSubnetsOpenApiVo> getIpList() {
    return ipList;
  }

  public void setIpList(List<IpSubnetsOpenApiVo> ipList) {
    this.ipList = ipList;
  }

  public CreateGroupOpenApiVo ipv6List(List<IPv6SubnetsOpenApiVo> ipv6List) {
    this.ipv6List = ipv6List;
    return this;
  }

  public CreateGroupOpenApiVo addIpv6ListItem(IPv6SubnetsOpenApiVo ipv6ListItem) {
    if (this.ipv6List == null) {
      this.ipv6List = new ArrayList<>();
    }
    this.ipv6List.add(ipv6ListItem);
    return this;
  }

  /**
   * IPv6 subnet info list. [type] value of 3 or 4 is required
   * @return ipv6List
  */
  @ApiModelProperty(value = "IPv6 subnet info list. [type] value of 3 or 4 is required")

  @Valid

  public List<IPv6SubnetsOpenApiVo> getIpv6List() {
    return ipv6List;
  }

  public void setIpv6List(List<IPv6SubnetsOpenApiVo> ipv6List) {
    this.ipv6List = ipv6List;
  }

  public CreateGroupOpenApiVo portType(Integer portType) {
    this.portType = portType;
    return this;
  }

  /**
   * Port type, portType should be a value as follows: 0: port range 1: port mask. [type] value of 1 or 4 is required
   * @return portType
  */
  @ApiModelProperty(value = "Port type, portType should be a value as follows: 0: port range 1: port mask. [type] value of 1 or 4 is required")


  public Integer getPortType() {
    return portType;
  }

  public void setPortType(Integer portType) {
    this.portType = portType;
  }

  public CreateGroupOpenApiVo portList(List<String> portList) {
    this.portList = portList;
    return this;
  }

  public CreateGroupOpenApiVo addPortListItem(String portListItem) {
    if (this.portList == null) {
      this.portList = new ArrayList<>();
    }
    this.portList.add(portListItem);
    return this;
  }

  /**
   * Port list. [portType] value of 0 is required. PortList should be within the range of 0-65535, e.g. 80 or 80-100
   * @return portList
  */
  @ApiModelProperty(value = "Port list. [portType] value of 0 is required. PortList should be within the range of 0-65535, e.g. 80 or 80-100")


  public List<String> getPortList() {
    return portList;
  }

  public void setPortList(List<String> portList) {
    this.portList = portList;
  }

  public CreateGroupOpenApiVo portMaskList(List<PortMaskOpenApiVo> portMaskList) {
    this.portMaskList = portMaskList;
    return this;
  }

  public CreateGroupOpenApiVo addPortMaskListItem(PortMaskOpenApiVo portMaskListItem) {
    if (this.portMaskList == null) {
      this.portMaskList = new ArrayList<>();
    }
    this.portMaskList.add(portMaskListItem);
    return this;
  }

  /**
   * Port mask list. [portType] value of 1 is required
   * @return portMaskList
  */
  @ApiModelProperty(value = "Port mask list. [portType] value of 1 is required")

  @Valid

  public List<PortMaskOpenApiVo> getPortMaskList() {
    return portMaskList;
  }

  public void setPortMaskList(List<PortMaskOpenApiVo> portMaskList) {
    this.portMaskList = portMaskList;
  }

  public CreateGroupOpenApiVo macAddressList(List<CreateMacAddressOpenApiVo> macAddressList) {
    this.macAddressList = macAddressList;
    return this;
  }

  public CreateGroupOpenApiVo addMacAddressListItem(CreateMacAddressOpenApiVo macAddressListItem) {
    if (this.macAddressList == null) {
      this.macAddressList = new ArrayList<>();
    }
    this.macAddressList.add(macAddressListItem);
    return this;
  }

  /**
   * MAC address list. [type] value of 2 is required
   * @return macAddressList
  */
  @ApiModelProperty(value = "MAC address list. [type] value of 2 is required")

  @Valid

  public List<CreateMacAddressOpenApiVo> getMacAddressList() {
    return macAddressList;
  }

  public void setMacAddressList(List<CreateMacAddressOpenApiVo> macAddressList) {
    this.macAddressList = macAddressList;
  }

  public CreateGroupOpenApiVo countryList(List<String> countryList) {
    this.countryList = countryList;
    return this;
  }

  public CreateGroupOpenApiVo addCountryListItem(String countryListItem) {
    if (this.countryList == null) {
      this.countryList = new ArrayList<>();
    }
    this.countryList.add(countryListItem);
    return this;
  }

  /**
   * Country list. [type] value of 5 is required. For the values of countryList, refer to 'Country Name' section 5.4.1 of the Open API Access Guide
   * @return countryList
  */
  @ApiModelProperty(value = "Country list. [type] value of 5 is required. For the values of countryList, refer to 'Country Name' section 5.4.1 of the Open API Access Guide")


  public List<String> getCountryList() {
    return countryList;
  }

  public void setCountryList(List<String> countryList) {
    this.countryList = countryList;
  }

  public CreateGroupOpenApiVo description(String description) {
    this.description = description;
    return this;
  }

  /**
   * Description should contain 1 to 256 characters. [type] value of 5 is required
   * @return description
  */
  @ApiModelProperty(value = "Description should contain 1 to 256 characters. [type] value of 5 is required")

@Pattern(regexp="^$|^[^ ]$|^[^ ].{0,510}[^ ]$") 
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public CreateGroupOpenApiVo domainNamePort(List<DomainOpenApiVo> domainNamePort) {
    this.domainNamePort = domainNamePort;
    return this;
  }

  public CreateGroupOpenApiVo addDomainNamePortItem(DomainOpenApiVo domainNamePortItem) {
    if (this.domainNamePort == null) {
      this.domainNamePort = new ArrayList<>();
    }
    this.domainNamePort.add(domainNamePortItem);
    return this;
  }

  /**
   * Domain info. Handle situations where there are ports, [type] value of 7 is required
   * @return domainNamePort
  */
  @ApiModelProperty(value = "Domain info. Handle situations where there are ports, [type] value of 7 is required")

  @Valid

  public List<DomainOpenApiVo> getDomainNamePort() {
    return domainNamePort;
  }

  public void setDomainNamePort(List<DomainOpenApiVo> domainNamePort) {
    this.domainNamePort = domainNamePort;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CreateGroupOpenApiVo createGroupOpenApiVo = (CreateGroupOpenApiVo) o;
    return Objects.equals(this.name, createGroupOpenApiVo.name) &&
        Objects.equals(this.type, createGroupOpenApiVo.type) &&
        Objects.equals(this.ipList, createGroupOpenApiVo.ipList) &&
        Objects.equals(this.ipv6List, createGroupOpenApiVo.ipv6List) &&
        Objects.equals(this.portType, createGroupOpenApiVo.portType) &&
        Objects.equals(this.portList, createGroupOpenApiVo.portList) &&
        Objects.equals(this.portMaskList, createGroupOpenApiVo.portMaskList) &&
        Objects.equals(this.macAddressList, createGroupOpenApiVo.macAddressList) &&
        Objects.equals(this.countryList, createGroupOpenApiVo.countryList) &&
        Objects.equals(this.description, createGroupOpenApiVo.description) &&
        Objects.equals(this.domainNamePort, createGroupOpenApiVo.domainNamePort);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, type, ipList, ipv6List, portType, portList, portMaskList, macAddressList, countryList, description, domainNamePort);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CreateGroupOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    ipList: ").append(toIndentedString(ipList)).append("\n");
    sb.append("    ipv6List: ").append(toIndentedString(ipv6List)).append("\n");
    sb.append("    portType: ").append(toIndentedString(portType)).append("\n");
    sb.append("    portList: ").append(toIndentedString(portList)).append("\n");
    sb.append("    portMaskList: ").append(toIndentedString(portMaskList)).append("\n");
    sb.append("    macAddressList: ").append(toIndentedString(macAddressList)).append("\n");
    sb.append("    countryList: ").append(toIndentedString(countryList)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    domainNamePort: ").append(toIndentedString(domainNamePort)).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    ");
  }
}

