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

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

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

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

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

  @JsonProperty("name")
  private String name;

  @JsonProperty("roleId")
  private String roleId;

  @JsonProperty("roleName")
  private String roleName;

  @JsonProperty("roleType")
  private Integer roleType;

  @JsonProperty("allSite")
  private Boolean allSite;

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

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

  /**
   * External user group ID.
   * @return id
  */
  @ApiModelProperty(value = "External user group ID.")


  public String getId() {
    return id;
  }

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

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

  /**
   * External user group name.
   * @return name
  */
  @ApiModelProperty(value = "External user group name.")


  public String getName() {
    return name;
  }

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

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

  /**
   * Role ID.
   * @return roleId
  */
  @ApiModelProperty(value = "Role ID.")


  public String getRoleId() {
    return roleId;
  }

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

  public ExternalUserGroupDetailOpenApiVo roleName(String roleName) {
    this.roleName = roleName;
    return this;
  }

  /**
   * Role name.
   * @return roleName
  */
  @ApiModelProperty(value = "Role name.")


  public String getRoleName() {
    return roleName;
  }

  public void setRoleName(String roleName) {
    this.roleName = roleName;
  }

  public ExternalUserGroupDetailOpenApiVo roleType(Integer roleType) {
    this.roleType = roleType;
    return this;
  }

  /**
   * Role type. It should be a value as follows: 0: standard, 1: customer, 2: msp.
   * @return roleType
  */
  @ApiModelProperty(value = "Role type. It should be a value as follows: 0: standard, 1: customer, 2: msp.")


  public Integer getRoleType() {
    return roleType;
  }

  public void setRoleType(Integer roleType) {
    this.roleType = roleType;
  }

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

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


  public Boolean getAllSite() {
    return allSite;
  }

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

  public ExternalUserGroupDetailOpenApiVo sites(List<SiteInfoOpenApiVo> sites) {
    this.sites = sites;
    return this;
  }

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

  /**
   * The sites which can be accessed.
   * @return sites
  */
  @ApiModelProperty(value = "The sites which can be accessed.")

  @Valid

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

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


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

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

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

