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

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

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

  @JsonProperty("roleId")
  private String roleId;

  @JsonProperty("customerRoleId")
  private String customerRoleId;

  @JsonProperty("allCustomer")
  private Boolean allCustomer;

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

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

  /**
   * Msp external user group name should contain 1 to 128 characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Msp 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 MspExternalUserGroupOpenApiVo roleId(String roleId) {
    this.roleId = roleId;
    return this;
  }

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


  public String getRoleId() {
    return roleId;
  }

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

  public MspExternalUserGroupOpenApiVo customerRoleId(String customerRoleId) {
    this.customerRoleId = customerRoleId;
    return this;
  }

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


  public String getCustomerRoleId() {
    return customerRoleId;
  }

  public void setCustomerRoleId(String customerRoleId) {
    this.customerRoleId = customerRoleId;
  }

  public MspExternalUserGroupOpenApiVo allCustomer(Boolean allCustomer) {
    this.allCustomer = allCustomer;
    return this;
  }

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


  public Boolean getAllCustomer() {
    return allCustomer;
  }

  public void setAllCustomer(Boolean allCustomer) {
    this.allCustomer = allCustomer;
  }

  public MspExternalUserGroupOpenApiVo customers(List<String> customers) {
    this.customers = customers;
    return this;
  }

  public MspExternalUserGroupOpenApiVo addCustomersItem(String customersItem) {
    if (this.customers == null) {
      this.customers = new ArrayList<>();
    }
    this.customers.add(customersItem);
    return this;
  }

  /**
   * The customer IDs that can be accessed. Effective when allCustomer is false.
   * @return customers
  */
  @ApiModelProperty(value = "The customer IDs that can be accessed. Effective when allCustomer is false.")


  public List<String> getCustomers() {
    return customers;
  }

  public void setCustomers(List<String> customers) {
    this.customers = customers;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    MspExternalUserGroupOpenApiVo mspExternalUserGroupOpenApiVo = (MspExternalUserGroupOpenApiVo) o;
    return Objects.equals(this.name, mspExternalUserGroupOpenApiVo.name) &&
        Objects.equals(this.roleId, mspExternalUserGroupOpenApiVo.roleId) &&
        Objects.equals(this.customerRoleId, mspExternalUserGroupOpenApiVo.customerRoleId) &&
        Objects.equals(this.allCustomer, mspExternalUserGroupOpenApiVo.allCustomer) &&
        Objects.equals(this.customers, mspExternalUserGroupOpenApiVo.customers);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, roleId, customerRoleId, allCustomer, customers);
  }

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

