All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.leanix.mtm.api.models.Permission Maven / Gradle / Ivy

There is a newer version: 1.7.25
Show newest version
package net.leanix.mtm.api.models;

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

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;






public class Permission   {
  
  private String id = null;
  private User user = null;
  private Workspace workspace = null;
  private String workspaceId = null;


  public enum RoleEnum {
    ADMIN("ADMIN"),
    MEMBER("MEMBER"),
    VIEWER("VIEWER"),
    CONTACT("CONTACT");

    private String value;

    RoleEnum(String value) {
      this.value = value;
    }

    @Override
    @JsonValue
    public String toString() {
      return value;
    }
  }

  private RoleEnum role = null;


  public enum StatusEnum {
    NOTINVITED("NOTINVITED"),
    ACTIVE("ACTIVE"),
    ARCHIVED("ARCHIVED"),
    INVITED("INVITED"),
    REQUESTED("REQUESTED");

    private String value;

    StatusEnum(String value) {
      this.value = value;
    }

    @Override
    @JsonValue
    public String toString() {
      return value;
    }
  }

  private StatusEnum status = null;
  private Date lastLogin = null;
  private User invitedByUser = null;
  private User reviewedByUser = null;
  private List links = new ArrayList();

  
  /**
   **/
  public Permission id(String id) {
    this.id = id;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("id")
  public String getId() {
    return id;
  }
  public void setId(String id) {
    this.id = id;
  }

  
  /**
   **/
  public Permission user(User user) {
    this.user = user;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("user")
  public User getUser() {
    return user;
  }
  public void setUser(User user) {
    this.user = user;
  }

  
  /**
   **/
  public Permission workspace(Workspace workspace) {
    this.workspace = workspace;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("workspace")
  public Workspace getWorkspace() {
    return workspace;
  }
  public void setWorkspace(Workspace workspace) {
    this.workspace = workspace;
  }

  
  /**
   **/
  public Permission workspaceId(String workspaceId) {
    this.workspaceId = workspaceId;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("workspaceId")
  public String getWorkspaceId() {
    return workspaceId;
  }
  public void setWorkspaceId(String workspaceId) {
    this.workspaceId = workspaceId;
  }

  
  /**
   **/
  public Permission role(RoleEnum role) {
    this.role = role;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("role")
  public RoleEnum getRole() {
    return role;
  }
  public void setRole(RoleEnum role) {
    this.role = role;
  }

  
  /**
   **/
  public Permission status(StatusEnum status) {
    this.status = status;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("status")
  public StatusEnum getStatus() {
    return status;
  }
  public void setStatus(StatusEnum status) {
    this.status = status;
  }

  
  /**
   **/
  public Permission lastLogin(Date lastLogin) {
    this.lastLogin = lastLogin;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("lastLogin")
  public Date getLastLogin() {
    return lastLogin;
  }
  public void setLastLogin(Date lastLogin) {
    this.lastLogin = lastLogin;
  }

  
  /**
   **/
  public Permission invitedByUser(User invitedByUser) {
    this.invitedByUser = invitedByUser;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("invitedByUser")
  public User getInvitedByUser() {
    return invitedByUser;
  }
  public void setInvitedByUser(User invitedByUser) {
    this.invitedByUser = invitedByUser;
  }

  
  /**
   **/
  public Permission reviewedByUser(User reviewedByUser) {
    this.reviewedByUser = reviewedByUser;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("reviewedByUser")
  public User getReviewedByUser() {
    return reviewedByUser;
  }
  public void setReviewedByUser(User reviewedByUser) {
    this.reviewedByUser = reviewedByUser;
  }

  
  /**
   **/
  public Permission links(List links) {
    this.links = links;
    return this;
  }
  
  @ApiModelProperty(example = "null", value = "")
  @JsonProperty("links")
  public List getLinks() {
    return links;
  }
  public void setLinks(List links) {
    this.links = links;
  }

  

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Permission permission = (Permission) o;
    return Objects.equals(this.id, permission.id) &&
        Objects.equals(this.user, permission.user) &&
        Objects.equals(this.workspace, permission.workspace) &&
        Objects.equals(this.workspaceId, permission.workspaceId) &&
        Objects.equals(this.role, permission.role) &&
        Objects.equals(this.status, permission.status) &&
        Objects.equals(this.lastLogin, permission.lastLogin) &&
        Objects.equals(this.invitedByUser, permission.invitedByUser) &&
        Objects.equals(this.reviewedByUser, permission.reviewedByUser) &&
        Objects.equals(this.links, permission.links);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, user, workspace, workspaceId, role, status, lastLogin, invitedByUser, reviewedByUser, links);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Permission {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    user: ").append(toIndentedString(user)).append("\n");
    sb.append("    workspace: ").append(toIndentedString(workspace)).append("\n");
    sb.append("    workspaceId: ").append(toIndentedString(workspaceId)).append("\n");
    sb.append("    role: ").append(toIndentedString(role)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).append("\n");
    sb.append("    lastLogin: ").append(toIndentedString(lastLogin)).append("\n");
    sb.append("    invitedByUser: ").append(toIndentedString(invitedByUser)).append("\n");
    sb.append("    reviewedByUser: ").append(toIndentedString(reviewedByUser)).append("\n");
    sb.append("    links: ").append(toIndentedString(links)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy