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.Objects;

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

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

  @JsonProperty("privilege")
  private RoleVo privilege;

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

  /**
   * Role name should contain 1 to 128 ASCII characters.
   * @return name
  */
  @ApiModelProperty(required = true, value = "Role name should contain 1 to 128 ASCII 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 ModifyRoleVo privilege(RoleVo privilege) {
    this.privilege = privilege;
    return this;
  }

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

  @Valid

  public RoleVo getPrivilege() {
    return privilege;
  }

  public void setPrivilege(RoleVo privilege) {
    this.privilege = privilege;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ModifyRoleVo modifyRoleVo = (ModifyRoleVo) o;
    return Objects.equals(this.name, modifyRoleVo.name) &&
        Objects.equals(this.privilege, modifyRoleVo.privilege);
  }

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

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

