Commit 3697df3d authored by Greg Messner's avatar Greg Messner
Browse files

Added Applications API support (#338).

parent eac251a8
...@@ -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));
}
}
} }
...@@ -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.
......
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