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
3697df3d
Commit
3697df3d
authored
May 04, 2019
by
Greg Messner
Browse files
Added Applications API support (#338).
parent
eac251a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/Constants.java
View file @
3697df3d
...
@@ -526,4 +526,48 @@ public interface Constants {
...
@@ -526,4 +526,48 @@ public interface Constants {
return
(
enumHelper
.
toString
(
this
));
return
(
enumHelper
.
toString
(
this
));
}
}
}
}
/**
* Enum for the various Application scope values.
*/
public
enum
ApplicationScope
{
/** Access the authenticated user's API */
API
,
/** Read the authenticated user's personal information */
READ_USER
,
/** Perform API actions as any user in the system */
SUDO
,
/** Allows read-access to the repository */
READ_REPOSITORY
,
/** Authenticate using OpenID Connect */
OPENID
,
/** Allows read-only access to the user's personal information using OpenID Connect */
PROFILE
,
/** Allows read-only access to the user's primary email address using OpenID Connect */
EMAIL
;
private
static
JacksonJsonEnumHelper
<
ApplicationScope
>
enumHelper
=
new
JacksonJsonEnumHelper
<>(
ApplicationScope
.
class
);
@JsonCreator
public
static
ApplicationScope
forValue
(
String
value
)
{
return
enumHelper
.
forValue
(
value
);
}
@JsonValue
public
String
toValue
()
{
return
(
enumHelper
.
toString
(
this
));
}
@Override
public
String
toString
()
{
return
(
enumHelper
.
toString
(
this
));
}
}
}
}
src/main/java/org/gitlab4j/api/GitLabApi.java
View file @
3697df3d
...
@@ -51,6 +51,7 @@ public class GitLabApi {
...
@@ -51,6 +51,7 @@ public class GitLabApi {
private
int
defaultPerPage
=
DEFAULT_PER_PAGE
;
private
int
defaultPerPage
=
DEFAULT_PER_PAGE
;
private
Session
session
;
private
Session
session
;
private
ApplicationsApi
applicationsApi
;
private
AwardEmojiApi
awardEmojiApi
;
private
AwardEmojiApi
awardEmojiApi
;
private
BoardsApi
boardsApi
;
private
BoardsApi
boardsApi
;
private
CommitsApi
commitsApi
;
private
CommitsApi
commitsApi
;
...
@@ -892,6 +893,25 @@ public class GitLabApi {
...
@@ -892,6 +893,25 @@ public class GitLabApi {
return
(
response
.
readEntity
(
Version
.
class
));
return
(
response
.
readEntity
(
Version
.
class
));
}
}
/**
* Gets the ApplicationsApi instance owned by this GitLabApi instance. The ApplicationsApi is used
* to perform all OAUTH application related API calls.
*
* @return the ApplicationsApi instance owned by this GitLabApi instance
*/
public
ApplicationsApi
getApplicationsApi
()
{
if
(
applicationsApi
==
null
)
{
synchronized
(
this
)
{
if
(
applicationsApi
==
null
)
{
applicationsApi
=
new
ApplicationsApi
(
this
);
}
}
}
return
(
applicationsApi
);
}
/**
/**
* Gets the AwardEmojiApi instance owned by this GitLabApi instance. The AwardEmojiApi is used
* Gets the AwardEmojiApi instance owned by this GitLabApi instance. The AwardEmojiApi is used
* to perform all award emoji related API calls.
* to perform all award emoji related API calls.
...
...
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