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

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

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

  @JsonProperty("roleId")
  private String roleId;

  @JsonProperty("allSite")
  private Boolean allSite;

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

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

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

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

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

  public ExternalUserGroupOpenApiVo roleId(String roleId) {
    this.roleId = roleId;
    return this;
  }

  /**
   * Role ID which can be obtained from 'Get role list' interface.
   * @return roleId
  */
  @ApiModelProperty(required = true, value = "Role ID which can be obtained from 'Get role list' interface.")
  @NotNull


  public String getRoleId() {
    return roleId;
  }

  public void setRoleId(String roleId) {
    this.roleId = roleId;
  }

  public ExternalUserGroupOpenApiVo allSite(Boolean allSite) {
    this.allSite = allSite;
    return this;
  }

  /**
   * Whether having all site permissions.
   * @return allSite
  */
  @ApiModelProperty(required = true, value = "Whether having all site permissions.")
  @NotNull


  public Boolean getAllSite() {
    return allSite;
  }

  public void setAllSite(Boolean allSite) {
    this.allSite = allSite;
  }

  public ExternalUserGroupOpenApiVo sites(List<String> sites) {
    this.sites = sites;
    return this;
  }

  public ExternalUserGroupOpenApiVo addSitesItem(String sitesItem) {
    if (this.sites == null) {
      this.sites = new ArrayList<>();
    }
    this.sites.add(sitesItem);
    return this;
  }

  /**
   * The site IDs that can be accessed. Effective when allSite is false.
   * @return sites
  */
  @ApiModelProperty(value = "The site IDs that can be accessed. Effective when allSite is false.")


  public List<String> getSites() {
    return sites;
  }

  public void setSites(List<String> sites) {
    this.sites = sites;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ExternalUserGroupOpenApiVo externalUserGroupOpenApiVo = (ExternalUserGroupOpenApiVo) o;
    return Objects.equals(this.name, externalUserGroupOpenApiVo.name) &&
        Objects.equals(this.roleId, externalUserGroupOpenApiVo.roleId) &&
        Objects.equals(this.allSite, externalUserGroupOpenApiVo.allSite) &&
        Objects.equals(this.sites, externalUserGroupOpenApiVo.sites);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, roleId, allSite, sites);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ExternalUserGroupOpenApiVo {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    roleId: ").append(toIndentedString(roleId)).append("\n");
    sb.append("    allSite: ").append(toIndentedString(allSite)).append("\n");
    sb.append("    sites: ").append(toIndentedString(sites)).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    ");
  }
}

