|
| 1 | +package org.gitlab4j.api.models; |
| 2 | + |
| 3 | +import java.util.Date; |
| 4 | +import java.util.List; |
| 5 | + |
| 6 | +import javax.xml.bind.annotation.XmlAccessType; |
| 7 | +import javax.xml.bind.annotation.XmlAccessorType; |
| 8 | + |
| 9 | +import org.gitlab4j.api.utils.JacksonJsonEnumHelper; |
| 10 | + |
| 11 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 12 | +import com.fasterxml.jackson.annotation.JsonValue; |
| 13 | + |
| 14 | +@XmlAccessorType(XmlAccessType.FIELD) |
| 15 | +public class ImpersonationToken { |
| 16 | + |
| 17 | + /** Enum to specify the scope of an ImpersonationToken. */ |
| 18 | + public enum Scope { |
| 19 | + |
| 20 | + API, READ_USER; |
| 21 | + |
| 22 | + private static JacksonJsonEnumHelper<Scope> enumHelper = new JacksonJsonEnumHelper<>(Scope.class); |
| 23 | + |
| 24 | + @JsonCreator |
| 25 | + public static Scope forValue(String value) { |
| 26 | + return enumHelper.forValue(value); |
| 27 | + } |
| 28 | + |
| 29 | + @JsonValue |
| 30 | + public String toValue() { |
| 31 | + return (enumHelper.toString(this)); |
| 32 | + } |
| 33 | + |
| 34 | + @Override |
| 35 | + public String toString() { |
| 36 | + return (enumHelper.toString(this)); |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | + private Boolean active; |
| 41 | + private String token; |
| 42 | + private List<Scope> scopes; |
| 43 | + private Boolean revoked; |
| 44 | + private String name; |
| 45 | + private Integer id; |
| 46 | + private Date createdAt; |
| 47 | + private Boolean impersonation; |
| 48 | + private Date expiresAt; |
| 49 | + |
| 50 | + public Boolean getActive() { |
| 51 | + return active; |
| 52 | + } |
| 53 | + |
| 54 | + public void setActive(Boolean active) { |
| 55 | + this.active = active; |
| 56 | + } |
| 57 | + |
| 58 | + public String getToken() { |
| 59 | + return token; |
| 60 | + } |
| 61 | + |
| 62 | + public void setToken(String token) { |
| 63 | + this.token = token; |
| 64 | + } |
| 65 | + |
| 66 | + public List<Scope> getScopes() { |
| 67 | + return scopes; |
| 68 | + } |
| 69 | + |
| 70 | + public void setScopes(List<Scope> scopes) { |
| 71 | + this.scopes = scopes; |
| 72 | + } |
| 73 | + |
| 74 | + public Boolean getRevoked() { |
| 75 | + return revoked; |
| 76 | + } |
| 77 | + |
| 78 | + public void setRevoked(Boolean revoked) { |
| 79 | + this.revoked = revoked; |
| 80 | + } |
| 81 | + |
| 82 | + public String getName() { |
| 83 | + return name; |
| 84 | + } |
| 85 | + |
| 86 | + public void setName(String name) { |
| 87 | + this.name = name; |
| 88 | + } |
| 89 | + |
| 90 | + public Integer getId() { |
| 91 | + return id; |
| 92 | + } |
| 93 | + |
| 94 | + public void setId(Integer id) { |
| 95 | + this.id = id; |
| 96 | + } |
| 97 | + |
| 98 | + public Date getCreatedAt() { |
| 99 | + return createdAt; |
| 100 | + } |
| 101 | + |
| 102 | + public void setCreatedAt(Date createdAt) { |
| 103 | + this.createdAt = createdAt; |
| 104 | + } |
| 105 | + |
| 106 | + public Boolean getImpersonation() { |
| 107 | + return impersonation; |
| 108 | + } |
| 109 | + |
| 110 | + public void setImpersonation(Boolean impersonation) { |
| 111 | + this.impersonation = impersonation; |
| 112 | + } |
| 113 | + |
| 114 | + public Date getExpiresAt() { |
| 115 | + return expiresAt; |
| 116 | + } |
| 117 | + |
| 118 | + public void setExpiresAt(Date expiresAt) { |
| 119 | + this.expiresAt = expiresAt; |
| 120 | + } |
| 121 | +} |
0 commit comments