Commit 24d2f1fe authored by Greg Messner's avatar Greg Messner
Browse files

Initial check-in (#91).

parent beeb339a
package org.gitlab4j.api.models;
import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
@XmlAccessorType(XmlAccessType.FIELD)
public class ImpersonationToken {
/** Enum to specify the scope of an ImpersonationToken. */
public enum Scope {
API, READ_USER;
private static JacksonJsonEnumHelper<Scope> enumHelper = new JacksonJsonEnumHelper<>(Scope.class);
@JsonCreator
public static Scope forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
@Override
public String toString() {
return (enumHelper.toString(this));
}
}
private Boolean active;
private String token;
private List<Scope> scopes;
private Boolean revoked;
private String name;
private Integer id;
private Date createdAt;
private Boolean impersonation;
private Date expiresAt;
public Boolean getActive() {
return active;
}
public void setActive(Boolean active) {
this.active = active;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public List<Scope> getScopes() {
return scopes;
}
public void setScopes(List<Scope> scopes) {
this.scopes = scopes;
}
public Boolean getRevoked() {
return revoked;
}
public void setRevoked(Boolean revoked) {
this.revoked = revoked;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Boolean getImpersonation() {
return impersonation;
}
public void setImpersonation(Boolean impersonation) {
this.impersonation = impersonation;
}
public Date getExpiresAt() {
return expiresAt;
}
public void setExpiresAt(Date expiresAt) {
this.expiresAt = expiresAt;
}
}
{
"active" : false,
"scopes" : [
"read_user", "api"
],
"revoked" : true,
"token" : "ZcZRpLeEuQRprkRjYydY",
"name" : "mytoken2",
"created_at" : "2017-03-17T17:19:28.697Z",
"id" : 3,
"impersonation" : true,
"expires_at" : "2017-04-14T00:00:00Z"
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment