Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
24d2f1fe
Commit
24d2f1fe
authored
Nov 05, 2017
by
Greg Messner
Browse files
Initial check-in (#91).
parent
beeb339a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/ImpersonationToken.java
0 → 100644
View file @
24d2f1fe
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
;
}
}
src/test/resources/org/gitlab4j/api/impersonation-token.json
0 → 100644
View file @
24d2f1fe
{
"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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment