repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/MilestonesApi.java | MilestonesApi.updateMilestone | public Milestone updateMilestone(Object projectIdOrPath, Integer milestoneId, String title, String description,
Date dueDate, Date startDate, MilestoneState milestoneState) throws GitLabApiException {
if (milestoneId == null) {
throw new RuntimeException("milestoneId cannot be null");
}
GitLabApiForm formData = new GitLabApiForm()
.withParam("title", title, true)
.withParam("description", description)
.withParam("due_date", dueDate)
.withParam("start_date", startDate)
.withParam("state_event", milestoneState);
Response response = put(Response.Status.OK, formData.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "milestones", milestoneId);
return (response.readEntity(Milestone.class));
} | java | public Milestone updateMilestone(Object projectIdOrPath, Integer milestoneId, String title, String description,
Date dueDate, Date startDate, MilestoneState milestoneState) throws GitLabApiException {
if (milestoneId == null) {
throw new RuntimeException("milestoneId cannot be null");
}
GitLabApiForm formData = new GitLabApiForm()
.withParam("title", title, true)
.withParam("description", description)
.withParam("due_date", dueDate)
.withParam("start_date", startDate)
.withParam("state_event", milestoneState);
Response response = put(Response.Status.OK, formData.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "milestones", milestoneId);
return (response.readEntity(Milestone.class));
} | [
"public",
"Milestone",
"updateMilestone",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"milestoneId",
",",
"String",
"title",
",",
"String",
"description",
",",
"Date",
"dueDate",
",",
"Date",
"startDate",
",",
"MilestoneState",
"milestoneState",
")",
"throws",... | Update the specified milestone.
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param milestoneId the milestone ID to update
@param title the updated title for the milestone
@param description the updated description for the milestone
@param dueDate the updated due date for the milestone
@param startDate the updated start date for the milestone
@param milestoneState the updated milestone state
@return the updated Milestone instance
@throws GitLabApiException if any exception occurs | [
"Update",
"the",
"specified",
"milestone",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/MilestonesApi.java#L474-L490 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getIssues | public List<Issue> getIssues(int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "issues");
return (response.readEntity(new GenericType<List<Issue>>() {}));
} | java | public List<Issue> getIssues(int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "issues");
return (response.readEntity(new GenericType<List<Issue>>() {}));
} | [
"public",
"List",
"<",
"Issue",
">",
"getIssues",
"(",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getPageQueryParams",
"(",
"page",
",... | Get all issues the authenticated user has access to using the specified page and per page setting. Only returns issues created by the current user.
<pre><code>GitLab Endpoint: GET /issues</code></pre>
@param page the page to get
@param perPage the number of issues per page
@return the list of issues in the specified range
@throws GitLabApiException if any exception occurs | [
"Get",
"all",
"issues",
"the",
"authenticated",
"user",
"has",
"access",
"to",
"using",
"the",
"specified",
"page",
"and",
"per",
"page",
"setting",
".",
"Only",
"returns",
"issues",
"created",
"by",
"the",
"current",
"user",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L73-L76 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getIssues | public Pager<Issue> getIssues(int itemsPerPage) throws GitLabApiException {
return (new Pager<Issue>(this, Issue.class, itemsPerPage, null, "issues"));
} | java | public Pager<Issue> getIssues(int itemsPerPage) throws GitLabApiException {
return (new Pager<Issue>(this, Issue.class, itemsPerPage, null, "issues"));
} | [
"public",
"Pager",
"<",
"Issue",
">",
"getIssues",
"(",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"new",
"Pager",
"<",
"Issue",
">",
"(",
"this",
",",
"Issue",
".",
"class",
",",
"itemsPerPage",
",",
"null",
",",
"\"... | Get a Pager of all issues the authenticated user has access to. Only returns issues created by the current user.
<pre><code>GitLab Endpoint: GET /issues</code></pre>
r
@param itemsPerPage the number of issues per page
@return the list of issues in the specified range
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Pager",
"of",
"all",
"issues",
"the",
"authenticated",
"user",
"has",
"access",
"to",
".",
"Only",
"returns",
"issues",
"created",
"by",
"the",
"current",
"user",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L87-L89 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getIssues | public Pager<Issue> getIssues(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return (new Pager<Issue>(this, Issue.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "issues"));
} | java | public Pager<Issue> getIssues(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return (new Pager<Issue>(this, Issue.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "issues"));
} | [
"public",
"Pager",
"<",
"Issue",
">",
"getIssues",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"new",
"Pager",
"<",
"Issue",
">",
"(",
"this",
",",
"Issue",
".",
"class",
",",
"item... | Get a Pager of project's issues.
<pre><code>GitLab Endpoint: GET /projects/:id/issues</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param itemsPerPage the number of issues per page
@return the list of issues in the specified range
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Pager",
"of",
"project",
"s",
"issues",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L142-L144 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getIssues | public Pager<Issue> getIssues(IssueFilter filter, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
return (new Pager<Issue>(this, Issue.class, itemsPerPage, formData.asMap(), "issues"));
} | java | public Pager<Issue> getIssues(IssueFilter filter, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
return (new Pager<Issue>(this, Issue.class, itemsPerPage, formData.asMap(), "issues"));
} | [
"public",
"Pager",
"<",
"Issue",
">",
"getIssues",
"(",
"IssueFilter",
"filter",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"filter",
".",
"getQueryParams",
"(",
")",
";",
"return",
"(",
"new",
"Page... | Get all issues the authenticated user has access to.
By default it returns only issues created by the current user.
<pre><code>GitLab Endpoint: GET /issues</code></pre>
@param filter {@link IssueFilter} a IssueFilter instance with the filter settings.
@param itemsPerPage the number of Project instances that will be fetched per page.
@return the list of issues in the specified range.
@throws GitLabApiException if any exception occurs | [
"Get",
"all",
"issues",
"the",
"authenticated",
"user",
"has",
"access",
"to",
".",
"By",
"default",
"it",
"returns",
"only",
"issues",
"created",
"by",
"the",
"current",
"user",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L264-L267 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getIssue | public Issue getIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
} | java | public Issue getIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
} | [
"public",
"Issue",
"getIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getDefaultPerPageParam",
"(",
")",
",",
... | Get a single project issue.
<pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param issueIid the internal ID of a project's issue
@return the specified Issue instance
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"single",
"project",
"issue",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L293-L297 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getOptionalIssue | public Optional<Issue> getOptionalIssue(Object projectIdOrPath, Integer issueIid) {
try {
return (Optional.ofNullable(getIssue(projectIdOrPath, issueIid)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | java | public Optional<Issue> getOptionalIssue(Object projectIdOrPath, Integer issueIid) {
try {
return (Optional.ofNullable(getIssue(projectIdOrPath, issueIid)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | [
"public",
"Optional",
"<",
"Issue",
">",
"getOptionalIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"{",
"try",
"{",
"return",
"(",
"Optional",
".",
"ofNullable",
"(",
"getIssue",
"(",
"projectIdOrPath",
",",
"issueIid",
")",
")",
... | Get a single project issue as an Optional instance.
<pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param issueIid the internal ID of a project's issue
@return the specified Issue as an Optional instance | [
"Get",
"a",
"single",
"project",
"issue",
"as",
"an",
"Optional",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L308-L314 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.closeIssue | public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
GitLabApiForm formData = new GitLabApiForm().withParam("state_event", StateEvent.CLOSE);
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
} | java | public Issue closeIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
GitLabApiForm formData = new GitLabApiForm().withParam("state_event", StateEvent.CLOSE);
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
} | [
"public",
"Issue",
"closeIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"issueIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"issue IID cannot be null\"",
")",
";... | Closes an existing project issue.
<pre><code>GitLab Endpoint: PUT /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param issueIid the issue IID to update, required
@return an instance of the updated Issue
@throws GitLabApiException if any exception occurs | [
"Closes",
"an",
"existing",
"project",
"issue",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L380-L389 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.updateIssue | public Issue updateIssue(Object projectIdOrPath, Integer issueIid, String title, String description, Boolean confidential, List<Integer> assigneeIds,
Integer milestoneId, String labels, StateEvent stateEvent, Date updatedAt, Date dueDate) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
GitLabApiForm formData = new GitLabApiForm()
.withParam("title", title)
.withParam("description", description)
.withParam("confidential", confidential)
.withParam("assignee_ids", assigneeIds)
.withParam("milestone_id", milestoneId)
.withParam("labels", labels)
.withParam("state_event", stateEvent)
.withParam("updated_at", updatedAt)
.withParam("due_date", dueDate);
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
} | java | public Issue updateIssue(Object projectIdOrPath, Integer issueIid, String title, String description, Boolean confidential, List<Integer> assigneeIds,
Integer milestoneId, String labels, StateEvent stateEvent, Date updatedAt, Date dueDate) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
GitLabApiForm formData = new GitLabApiForm()
.withParam("title", title)
.withParam("description", description)
.withParam("confidential", confidential)
.withParam("assignee_ids", assigneeIds)
.withParam("milestone_id", milestoneId)
.withParam("labels", labels)
.withParam("state_event", stateEvent)
.withParam("updated_at", updatedAt)
.withParam("due_date", dueDate);
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
return (response.readEntity(Issue.class));
} | [
"public",
"Issue",
"updateIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"String",
"title",
",",
"String",
"description",
",",
"Boolean",
"confidential",
",",
"List",
"<",
"Integer",
">",
"assigneeIds",
",",
"Integer",
"milestoneId",
... | Updates an existing project issue. This call can also be used to mark an issue as closed.
<pre><code>GitLab Endpoint: PUT /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param issueIid the issue IID to update, required
@param title the title of an issue, optional
@param description the description of an issue, optional
@param confidential set the issue to be confidential, default is false, optional
@param assigneeIds the IDs of the users to assign issue, optional
@param milestoneId the ID of a milestone to assign issue, optional
@param labels comma-separated label names for an issue, optional
@param stateEvent the state event of an issue. Set close to close the issue and reopen to reopen it, optional
@param updatedAt sets the updated date, requires admin or project owner rights, optional
@param dueDate the due date, optional
@return an instance of the updated Issue
@throws GitLabApiException if any exception occurs | [
"Updates",
"an",
"existing",
"project",
"issue",
".",
"This",
"call",
"can",
"also",
"be",
"used",
"to",
"mark",
"an",
"issue",
"as",
"closed",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L410-L429 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.deleteIssue | public void deleteIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
} | java | public void deleteIssue(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, getDefaultPerPageParam(), "projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid);
} | [
"public",
"void",
"deleteIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"issueIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"issue IID cannot be null\"",
")",
";... | Delete an issue.
<pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param issueIid the internal ID of a project's issue
@throws GitLabApiException if any exception occurs | [
"Delete",
"an",
"issue",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L440-L448 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.resetSpentTime | public TimeStats resetSpentTime(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response response = post(Response.Status.OK, new GitLabApiForm().asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "reset_spent_time");
return (response.readEntity(TimeStats.class));
} | java | public TimeStats resetSpentTime(Object projectIdOrPath, Integer issueIid) throws GitLabApiException {
if (issueIid == null) {
throw new RuntimeException("issue IID cannot be null");
}
Response response = post(Response.Status.OK, new GitLabApiForm().asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "reset_spent_time");
return (response.readEntity(TimeStats.class));
} | [
"public",
"TimeStats",
"resetSpentTime",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"issueIid",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"issue IID cannot be null\"",
"... | Resets the total spent time for this issue to 0 seconds.
<pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/reset_spent_time</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param issueIid the internal ID of a project's issue
@return a TimeSTats instance
@throws GitLabApiException if any exception occurs | [
"Resets",
"the",
"total",
"spent",
"time",
"for",
"this",
"issue",
"to",
"0",
"seconds",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L591-L600 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getOptionalTimeTrackingStats | public Optional<TimeStats> getOptionalTimeTrackingStats(Object projectIdOrPath, Integer issueIid) {
try {
return (Optional.ofNullable(getTimeTrackingStats(projectIdOrPath, issueIid)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | java | public Optional<TimeStats> getOptionalTimeTrackingStats(Object projectIdOrPath, Integer issueIid) {
try {
return (Optional.ofNullable(getTimeTrackingStats(projectIdOrPath, issueIid)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | [
"public",
"Optional",
"<",
"TimeStats",
">",
"getOptionalTimeTrackingStats",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
")",
"{",
"try",
"{",
"return",
"(",
"Optional",
".",
"ofNullable",
"(",
"getTimeTrackingStats",
"(",
"projectIdOrPath",
",",
... | Get time tracking stats as an Optional instance
<pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/time_stats</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param issueIid the internal ID of a project's issue
@return a TimeStats as an Optional instance | [
"Get",
"time",
"tracking",
"stats",
"as",
"an",
"Optional",
"instance"
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L632-L638 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getClosedByMergeRequests | public Pager<MergeRequest> getClosedByMergeRequests(Object projectIdOrPath, Integer issueIid, int itemsPerPage) throws GitLabApiException {
return new Pager<MergeRequest>(this, MergeRequest.class, itemsPerPage, null,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "closed_by");
} | java | public Pager<MergeRequest> getClosedByMergeRequests(Object projectIdOrPath, Integer issueIid, int itemsPerPage) throws GitLabApiException {
return new Pager<MergeRequest>(this, MergeRequest.class, itemsPerPage, null,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "closed_by");
} | [
"public",
"Pager",
"<",
"MergeRequest",
">",
"getClosedByMergeRequests",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"new",
"Pager",
"<",
"MergeRequest",
">",
"(",
"t... | Get a Pager containing all the merge requests that will close issue when merged.
<pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/closed_by</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param issueIid the internal ID of a project's issue
@param itemsPerPage the number of Issue instances that will be fetched per page
@return a Pager containing all the issues that would be closed by merging the provided merge request
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Pager",
"containing",
"all",
"the",
"merge",
"requests",
"that",
"will",
"close",
"issue",
"when",
"merged",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L683-L686 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.duplicate | public final GitLabApi duplicate() {
Integer sudoUserId = this.getSudoAsId();
GitLabApi gitLabApi = new GitLabApi(apiVersion, gitLabServerUrl,
getTokenType(), getAuthToken(), getSecretToken(), clientConfigProperties);
if (sudoUserId != null) {
gitLabApi.apiClient.setSudoAsId(sudoUserId);
}
if (getIgnoreCertificateErrors()) {
gitLabApi.setIgnoreCertificateErrors(true);
}
gitLabApi.defaultPerPage = this.defaultPerPage;
return (gitLabApi);
} | java | public final GitLabApi duplicate() {
Integer sudoUserId = this.getSudoAsId();
GitLabApi gitLabApi = new GitLabApi(apiVersion, gitLabServerUrl,
getTokenType(), getAuthToken(), getSecretToken(), clientConfigProperties);
if (sudoUserId != null) {
gitLabApi.apiClient.setSudoAsId(sudoUserId);
}
if (getIgnoreCertificateErrors()) {
gitLabApi.setIgnoreCertificateErrors(true);
}
gitLabApi.defaultPerPage = this.defaultPerPage;
return (gitLabApi);
} | [
"public",
"final",
"GitLabApi",
"duplicate",
"(",
")",
"{",
"Integer",
"sudoUserId",
"=",
"this",
".",
"getSudoAsId",
"(",
")",
";",
"GitLabApi",
"gitLabApi",
"=",
"new",
"GitLabApi",
"(",
"apiVersion",
",",
"gitLabServerUrl",
",",
"getTokenType",
"(",
")",
... | Create a new GitLabApi instance that is logically a duplicate of this instance, with the exception off sudo state.
@return a new GitLabApi instance that is logically a duplicate of this instance, with the exception off sudo state. | [
"Create",
"a",
"new",
"GitLabApi",
"instance",
"that",
"is",
"logically",
"a",
"duplicate",
"of",
"this",
"instance",
"with",
"the",
"exception",
"off",
"sudo",
"state",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L102-L117 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.enableRequestResponseLogging | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize) {
enableRequestResponseLogging(logger, level, maxEntitySize, MaskingLoggingFilter.DEFAULT_MASKED_HEADER_NAMES);
} | java | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize) {
enableRequestResponseLogging(logger, level, maxEntitySize, MaskingLoggingFilter.DEFAULT_MASKED_HEADER_NAMES);
} | [
"public",
"void",
"enableRequestResponseLogging",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"int",
"maxEntitySize",
")",
"{",
"enableRequestResponseLogging",
"(",
"logger",
",",
"level",
",",
"maxEntitySize",
",",
"MaskingLoggingFilter",
".",
"DEFAULT_MASKE... | Enable the logging of the requests to and the responses from the GitLab server API using the
specified logger. Logging will mask PRIVATE-TOKEN and Authorization headers.
@param logger the Logger instance to log to
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize maximum number of entity bytes to be logged. When logging if the maxEntitySize
is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at
the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"using",
"the",
"specified",
"logger",
".",
"Logging",
"will",
"mask",
"PRIVATE",
"-",
"TOKEN",
"and",
"Authorization",
"headers",
... | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L667-L669 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.enableRequestResponseLogging | public void enableRequestResponseLogging(Level level, int maxEntitySize, List<String> maskedHeaderNames) {
apiClient.enableRequestResponseLogging(LOGGER, level, maxEntitySize, maskedHeaderNames);
} | java | public void enableRequestResponseLogging(Level level, int maxEntitySize, List<String> maskedHeaderNames) {
apiClient.enableRequestResponseLogging(LOGGER, level, maxEntitySize, maskedHeaderNames);
} | [
"public",
"void",
"enableRequestResponseLogging",
"(",
"Level",
"level",
",",
"int",
"maxEntitySize",
",",
"List",
"<",
"String",
">",
"maskedHeaderNames",
")",
"{",
"apiClient",
".",
"enableRequestResponseLogging",
"(",
"LOGGER",
",",
"level",
",",
"maxEntitySize",... | Enable the logging of the requests to and the responses from the GitLab server API using the
GitLab4J shared Logger instance.
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize maximum number of entity bytes to be logged. When logging if the maxEntitySize
is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at
the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
@param maskedHeaderNames a list of header names that should have the values masked | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"using",
"the",
"GitLab4J",
"shared",
"Logger",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L704-L706 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.enableRequestResponseLogging | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize, List<String> maskedHeaderNames) {
apiClient.enableRequestResponseLogging(logger, level, maxEntitySize, maskedHeaderNames);
} | java | public void enableRequestResponseLogging(Logger logger, Level level, int maxEntitySize, List<String> maskedHeaderNames) {
apiClient.enableRequestResponseLogging(logger, level, maxEntitySize, maskedHeaderNames);
} | [
"public",
"void",
"enableRequestResponseLogging",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"int",
"maxEntitySize",
",",
"List",
"<",
"String",
">",
"maskedHeaderNames",
")",
"{",
"apiClient",
".",
"enableRequestResponseLogging",
"(",
"logger",
",",
"le... | Enable the logging of the requests to and the responses from the GitLab server API using the
specified logger.
@param logger the Logger instance to log to
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize maximum number of entity bytes to be logged. When logging if the maxEntitySize
is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at
the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
@param maskedHeaderNames a list of header names that should have the values masked | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"using",
"the",
"specified",
"logger",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L719-L721 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.getVersion | public Version getVersion() throws GitLabApiException {
class VersionApi extends AbstractApi {
VersionApi(GitLabApi gitlabApi) {
super(gitlabApi);
}
}
Response response = new VersionApi(this).get(Response.Status.OK, null, "version");
return (response.readEntity(Version.class));
} | java | public Version getVersion() throws GitLabApiException {
class VersionApi extends AbstractApi {
VersionApi(GitLabApi gitlabApi) {
super(gitlabApi);
}
}
Response response = new VersionApi(this).get(Response.Status.OK, null, "version");
return (response.readEntity(Version.class));
} | [
"public",
"Version",
"getVersion",
"(",
")",
"throws",
"GitLabApiException",
"{",
"class",
"VersionApi",
"extends",
"AbstractApi",
"{",
"VersionApi",
"(",
"GitLabApi",
"gitlabApi",
")",
"{",
"super",
"(",
"gitlabApi",
")",
";",
"}",
"}",
"Response",
"response",
... | Get the version info for the GitLab server using the GitLab Version API.
@return the version info for the GitLab server
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"version",
"info",
"for",
"the",
"GitLab",
"server",
"using",
"the",
"GitLab",
"Version",
"API",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L883-L893 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.createOptionalFromException | protected static final <T> Optional<T> createOptionalFromException(GitLabApiException glae) {
Optional<T> optional = Optional.empty();
optionalExceptionMap.put(System.identityHashCode(optional), glae);
return (optional);
} | java | protected static final <T> Optional<T> createOptionalFromException(GitLabApiException glae) {
Optional<T> optional = Optional.empty();
optionalExceptionMap.put(System.identityHashCode(optional), glae);
return (optional);
} | [
"protected",
"static",
"final",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"createOptionalFromException",
"(",
"GitLabApiException",
"glae",
")",
"{",
"Optional",
"<",
"T",
">",
"optional",
"=",
"Optional",
".",
"empty",
"(",
")",
";",
"optionalExceptionMap",
... | Create and return an Optional instance associated with a GitLabApiException.
@param <T> the type of the Optional instance
@param glae the GitLabApiException that was the result of a call to the GitLab API
@return the created Optional instance | [
"Create",
"and",
"return",
"an",
"Optional",
"instance",
"associated",
"with",
"a",
"GitLabApiException",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L1484-L1488 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApi.java | GitLabApi.orElseThrow | public static final <T> T orElseThrow(Optional<T> optional) throws GitLabApiException {
GitLabApiException glea = getOptionalException(optional);
if (glea != null) {
throw (glea);
}
return (optional.get());
} | java | public static final <T> T orElseThrow(Optional<T> optional) throws GitLabApiException {
GitLabApiException glea = getOptionalException(optional);
if (glea != null) {
throw (glea);
}
return (optional.get());
} | [
"public",
"static",
"final",
"<",
"T",
">",
"T",
"orElseThrow",
"(",
"Optional",
"<",
"T",
">",
"optional",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiException",
"glea",
"=",
"getOptionalException",
"(",
"optional",
")",
";",
"if",
"(",
"glea",
"!=... | Return the Optional instances contained value, if present, otherwise throw the exception that is
associated with the Optional instance.
@param <T> the type for the Optional parameter
@param optional the Optional instance to get the value for
@return the value of the Optional instance if no exception is associated with it
@throws GitLabApiException if there was an exception associated with the Optional instance | [
"Return",
"the",
"Optional",
"instances",
"contained",
"value",
"if",
"present",
"otherwise",
"throw",
"the",
"exception",
"that",
"is",
"associated",
"with",
"the",
"Optional",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApi.java#L1511-L1519 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.getNoteAwardEmojis | public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Integer issueIid, Integer noteId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji");
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
} | java | public List<AwardEmoji> getNoteAwardEmojis(Object projectIdOrPath, Integer issueIid, Integer noteId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji");
return response.readEntity(new GenericType<List<AwardEmoji>>() {});
} | [
"public",
"List",
"<",
"AwardEmoji",
">",
"getNoteAwardEmojis",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"Integer",
"noteId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
... | Get a list of award emoji for the specified note.
<pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/notes/:note_id/award_emoji</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param issueIid the issue IID of the issue that owns the note
@param noteId the note ID to get the award emojis for
@return a list of AwardEmoji for the specified note
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"list",
"of",
"award",
"emoji",
"for",
"the",
"specified",
"note",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L81-L85 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.getIssueAwardEmoji | public AwardEmoji getIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer awardId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji", awardId);
return (response.readEntity(AwardEmoji.class));
} | java | public AwardEmoji getIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer awardId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji", awardId);
return (response.readEntity(AwardEmoji.class));
} | [
"public",
"AwardEmoji",
"getIssueAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"... | Get the specified award emoji for the specified issue.
<pre><code>GitLab Endpoint: GET /projects/:id/issues/:issue_iid/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param issueIid the issue IID to get the award emoji for
@param awardId the ID of the award emoji to get
@return an AwardEmoji instance for the specified award emoji
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"specified",
"award",
"emoji",
"for",
"the",
"specified",
"issue",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L98-L102 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.getMergeRequestAwardEmoji | public AwardEmoji getMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId);
return (response.readEntity(AwardEmoji.class));
} | java | public AwardEmoji getMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId);
return (response.readEntity(AwardEmoji.class));
} | [
"public",
"AwardEmoji",
"getMergeRequestAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"mergeRequestIid",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"O... | Get the specified award emoji for the specified merge request.
<pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param mergeRequestIid the merge request IID to get the award emoji for
@param awardId the ID of the award emoji to get
@return an AwardEmoji instance for the specified award emoji
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"specified",
"award",
"emoji",
"for",
"the",
"specified",
"merge",
"request",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L115-L119 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.getSnippetAwardEmoji | public AwardEmoji getSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
return (response.readEntity(AwardEmoji.class));
} | java | public AwardEmoji getSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(1, getDefaultPerPage()),
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
return (response.readEntity(AwardEmoji.class));
} | [
"public",
"AwardEmoji",
"getSnippetAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"snippetId",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
... | Get the specified award emoji for the specified snippet.
<pre><code>GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param snippetId the snippet ID to get the award emoji for
@param awardId the ID of the award emoji to get
@return an AwardEmoji instance for the specified award emoji
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"specified",
"award",
"emoji",
"for",
"the",
"specified",
"snippet",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L132-L136 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.addNoteAwardEmoji | public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
Response response = post(Response.Status.CREATED, form.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji");
return (response.readEntity(AwardEmoji.class));
} | java | public AwardEmoji addNoteAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer noteId, String name) throws GitLabApiException {
GitLabApiForm form = new GitLabApiForm().withParam("name", name, true);
Response response = post(Response.Status.CREATED, form.asMap(),
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes", noteId, "award_emoji");
return (response.readEntity(AwardEmoji.class));
} | [
"public",
"AwardEmoji",
"addNoteAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"Integer",
"noteId",
",",
"String",
"name",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"form",
"=",
"new",
"GitLabApiForm",
"(",
")",
".... | Add an award emoji for the specified note.
<pre><code>GitLab Endpoint: POST /projects/:id/issues/:issue_iid/notes/:noteId/award_emoji</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param issueIid the issue IID of the issue that owns the note
@param noteId the note ID to add the award emoji to
@param name the name of the award emoji to add
@return an AwardEmoji instance for the added award emoji
@throws GitLabApiException if any exception occurs | [
"Add",
"an",
"award",
"emoji",
"for",
"the",
"specified",
"note",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L222-L227 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.deleteIssueAwardEmoji | public void deleteIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji", awardId);
} | java | public void deleteIssueAwardEmoji(Object projectIdOrPath, Integer issueIid, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "award_emoji", awardId);
} | [
"public",
"void",
"deleteIssueAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueIid",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"projects... | Delete an award emoji from the specified issue.
<pre><code>GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param issueIid the issue IID to delete the award emoji from
@param awardId the ID of the award emoji to delete
@throws GitLabApiException if any exception occurs | [
"Delete",
"an",
"award",
"emoji",
"from",
"the",
"specified",
"issue",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L239-L242 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.deleteMergeRequestAwardEmoji | public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId);
} | java | public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId);
} | [
"public",
"void",
"deleteMergeRequestAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"mergeRequestIid",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",... | Delete an award emoji from the specified merge request.
<pre><code>GitLab Endpoint: DELETE /projects/:id/merge_requests/:merge_request_iid/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param mergeRequestIid the merge request IID to delete the award emoji from
@param awardId the ID of the award emoji to delete
@throws GitLabApiException if any exception occurs | [
"Delete",
"an",
"award",
"emoji",
"from",
"the",
"specified",
"merge",
"request",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L254-L257 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AwardEmojiApi.java | AwardEmojiApi.deleteSnippetAwardEmoji | public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
} | java | public void deleteSnippetAwardEmoji(Object projectIdOrPath, Integer snippetId, Integer awardId) throws GitLabApiException {
delete(Response.Status.NO_CONTENT, null,
"projects", getProjectIdOrPath(projectIdOrPath), "snippets", snippetId, "award_emoji", awardId);
} | [
"public",
"void",
"deleteSnippetAwardEmoji",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"snippetId",
",",
"Integer",
"awardId",
")",
"throws",
"GitLabApiException",
"{",
"delete",
"(",
"Response",
".",
"Status",
".",
"NO_CONTENT",
",",
"null",
",",
"\"proje... | Delete an award emoji from the specified snippet.
<pre><code>GitLab Endpoint: DELETE /projects/:id/snippets/:snippet_id/award_emoji/:award_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param snippetId the snippet ID to delete the award emoji from
@param awardId the ID of the award emoji to delete
@throws GitLabApiException if any exception occurs | [
"Delete",
"an",
"award",
"emoji",
"from",
"the",
"specified",
"snippet",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AwardEmojiApi.java#L269-L272 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getBranches | public Pager<Branch> getBranches(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return (new Pager<Branch>(this, Branch.class, itemsPerPage, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches"));
} | java | public Pager<Branch> getBranches(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return (new Pager<Branch>(this, Branch.class, itemsPerPage, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches"));
} | [
"public",
"Pager",
"<",
"Branch",
">",
"getBranches",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"new",
"Pager",
"<",
"Branch",
">",
"(",
"this",
",",
"Branch",
".",
"class",
",",
... | Get a Pager of repository branches from a project, sorted by name alphabetically.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/branches</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param itemsPerPage the number of Project instances that will be fetched per page
@return the list of repository branches for the specified project ID
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Pager",
"of",
"repository",
"branches",
"from",
"a",
"project",
"sorted",
"by",
"name",
"alphabetically",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L76-L79 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getBranchesStream | public Stream<Branch> getBranchesStream(Object projectIdOrPath) throws GitLabApiException {
return (getBranches(projectIdOrPath, getDefaultPerPage()).stream());
} | java | public Stream<Branch> getBranchesStream(Object projectIdOrPath) throws GitLabApiException {
return (getBranches(projectIdOrPath, getDefaultPerPage()).stream());
} | [
"public",
"Stream",
"<",
"Branch",
">",
"getBranchesStream",
"(",
"Object",
"projectIdOrPath",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"getBranches",
"(",
"projectIdOrPath",
",",
"getDefaultPerPage",
"(",
")",
")",
".",
"stream",
"(",
")",
")",
... | Get a Stream of repository branches from a project, sorted by name alphabetically.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/branches</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@return a Stream of repository branches for the specified project
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Stream",
"of",
"repository",
"branches",
"from",
"a",
"project",
"sorted",
"by",
"name",
"alphabetically",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L90-L92 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getBranch | public Branch getBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName));
return (response.readEntity(Branch.class));
} | java | public Branch getBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName));
return (response.readEntity(Branch.class));
} | [
"public",
"Branch",
"getBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"get... | Get a single project repository branch.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/branches/:branch</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to get
@return the branch info for the specified project ID/branch name pair
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"single",
"project",
"repository",
"branch",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L104-L108 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getOptionalBranch | public Optional<Branch> getOptionalBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
try {
return (Optional.ofNullable(getBranch(projectIdOrPath, branchName)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | java | public Optional<Branch> getOptionalBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
try {
return (Optional.ofNullable(getBranch(projectIdOrPath, branchName)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | [
"public",
"Optional",
"<",
"Branch",
">",
"getOptionalBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"return",
"(",
"Optional",
".",
"ofNullable",
"(",
"getBranch",
"(",
"projectIdOrPat... | Get an Optional instance with the value for the specific repository branch.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/branches/:branch</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to get
@return an Optional instance with the info for the specified project ID/branch name pair as the value
@throws GitLabApiException if any exception occurs | [
"Get",
"an",
"Optional",
"instance",
"with",
"the",
"value",
"for",
"the",
"specific",
"repository",
"branch",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L120-L126 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.createBranch | public Branch createBranch(Object projectIdOrPath, String branchName, String ref) throws GitLabApiException {
Form formData = new GitLabApiForm()
.withParam(isApiVersion(ApiVersion.V3) ? "branch_name" : "branch", branchName, true)
.withParam("ref", ref, true);
Response response = post(Response.Status.CREATED, formData.asMap(), "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches");
return (response.readEntity(Branch.class));
} | java | public Branch createBranch(Object projectIdOrPath, String branchName, String ref) throws GitLabApiException {
Form formData = new GitLabApiForm()
.withParam(isApiVersion(ApiVersion.V3) ? "branch_name" : "branch", branchName, true)
.withParam("ref", ref, true);
Response response = post(Response.Status.CREATED, formData.asMap(), "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches");
return (response.readEntity(Branch.class));
} | [
"public",
"Branch",
"createBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"isApiVersion",
"... | Creates a branch for the project. Support as of version 6.8.x
<pre><code>GitLab Endpoint: POST /projects/:id/repository/branches</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to create
@param ref Source to create the branch from, can be an existing branch, tag or commit SHA
@return the branch info for the created branch
@throws GitLabApiException if any exception occurs | [
"Creates",
"a",
"branch",
"for",
"the",
"project",
".",
"Support",
"as",
"of",
"version",
"6",
".",
"8",
".",
"x"
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L139-L147 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.deleteBranch | public void deleteBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName));
} | java | public void deleteBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName));
} | [
"public",
"void",
"deleteBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
... | Delete a single project repository branch.
<pre><code>GitLab Endpoint: DELETE /projects/:id/repository/branches/:branch</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to delete
@throws GitLabApiException if any exception occurs | [
"Delete",
"a",
"single",
"project",
"repository",
"branch",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L158-L162 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.protectBranch | public Branch protectBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = put(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName), "protect");
return (response.readEntity(Branch.class));
} | java | public Branch protectBranch(Object projectIdOrPath, String branchName) throws GitLabApiException {
Response response = put(Response.Status.OK, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "branches", urlEncode(branchName), "protect");
return (response.readEntity(Branch.class));
} | [
"public",
"Branch",
"protectBranch",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"branchName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"put",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
... | Protects a single project repository branch. This is an idempotent function,
protecting an already protected repository branch will not produce an error.
<pre><code>GitLab Endpoint: PUT /projects/:id/repository/branches/:branch/protect</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param branchName the name of the branch to protect
@return the branch info for the protected branch
@throws GitLabApiException if any exception occurs | [
"Protects",
"a",
"single",
"project",
"repository",
"branch",
".",
"This",
"is",
"an",
"idempotent",
"function",
"protecting",
"an",
"already",
"protected",
"repository",
"branch",
"will",
"not",
"produce",
"an",
"error",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L175-L179 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.createTag | public Tag createTag(Object projectIdOrPath, String tagName, String ref, String message, String releaseNotes) throws GitLabApiException {
Form formData = new GitLabApiForm()
.withParam("tag_name", tagName, true)
.withParam("ref", ref, true)
.withParam("message", message, false)
.withParam("release_description", releaseNotes, false);
Response response = post(Response.Status.CREATED, formData.asMap(), "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "tags");
return (response.readEntity(Tag.class));
} | java | public Tag createTag(Object projectIdOrPath, String tagName, String ref, String message, String releaseNotes) throws GitLabApiException {
Form formData = new GitLabApiForm()
.withParam("tag_name", tagName, true)
.withParam("ref", ref, true)
.withParam("message", message, false)
.withParam("release_description", releaseNotes, false);
Response response = post(Response.Status.CREATED, formData.asMap(), "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "tags");
return (response.readEntity(Tag.class));
} | [
"public",
"Tag",
"createTag",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"tagName",
",",
"String",
"ref",
",",
"String",
"message",
",",
"String",
"releaseNotes",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"new",
"GitLabApiForm",
"(... | Creates a tag on a particular ref of the given project. A message and release notes are optional.
<pre><code>GitLab Endpoint: POST /projects/:id/repository/tags</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param tagName The name of the tag Must be unique for the project
@param ref the git ref to place the tag on
@param message the message to included with the tag (optional)
@param releaseNotes the release notes for the tag (optional)
@return a Tag instance containing info on the newly created tag
@throws GitLabApiException if any exception occurs
@deprecated Replaced by TagsApi.createTag(Object, String, String, String, String) | [
"Creates",
"a",
"tag",
"on",
"a",
"particular",
"ref",
"of",
"the",
"given",
"project",
".",
"A",
"message",
"and",
"release",
"notes",
"are",
"optional",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L265-L275 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.deleteTag | public void deleteTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "repository", "tags", tagName);
} | java | public void deleteTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "repository", "tags", tagName);
} | [
"public",
"void",
"deleteTag",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"tagName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
".",
... | Deletes the tag from a project with the specified tag name.
<pre><code>GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param tagName The name of the tag to delete
@throws GitLabApiException if any exception occurs
@deprecated Replaced by TagsApi.deleteTag(Object, String) | [
"Deletes",
"the",
"tag",
"from",
"a",
"project",
"with",
"the",
"specified",
"tag",
"name",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L319-L322 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getContributors | public List<Contributor> getContributors(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage),
"projects", getProjectIdOrPath(projectIdOrPath), "repository", "contributors");
return (response.readEntity(new GenericType<List<Contributor>>() { }));
} | java | public List<Contributor> getContributors(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage),
"projects", getProjectIdOrPath(projectIdOrPath), "repository", "contributors");
return (response.readEntity(new GenericType<List<Contributor>>() { }));
} | [
"public",
"List",
"<",
"Contributor",
">",
"getContributors",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
... | Get a list of contributors from a project and in the specified page range.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/contributors</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param page the page to get
@param perPage the number of projects per page
@return a List containing the contributors for the specified project ID
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"list",
"of",
"contributors",
"from",
"a",
"project",
"and",
"in",
"the",
"specified",
"page",
"range",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L732-L736 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.getContributors | public Pager<Contributor> getContributors(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return new Pager<Contributor>(this, Contributor.class, itemsPerPage, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "contributors");
} | java | public Pager<Contributor> getContributors(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return new Pager<Contributor>(this, Contributor.class, itemsPerPage, null, "projects",
getProjectIdOrPath(projectIdOrPath), "repository", "contributors");
} | [
"public",
"Pager",
"<",
"Contributor",
">",
"getContributors",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"new",
"Pager",
"<",
"Contributor",
">",
"(",
"this",
",",
"Contributor",
".",
"class... | Get a Pager of contributors from a project.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/contributors</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param itemsPerPage the number of Project instances that will be fetched per page
@return a Pager containing the contributors for the specified project ID
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Pager",
"of",
"contributors",
"from",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L748-L751 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.getProjectIdOrPath | public Object getProjectIdOrPath(Object obj) throws GitLabApiException {
if (obj == null) {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Integer) {
return (obj);
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Project) {
Integer id = ((Project) obj).getId();
if (id != null && id.intValue() > 0) {
return (id);
}
String path = ((Project) obj).getPathWithNamespace();
if (path != null && path.trim().length() > 0) {
return (urlEncode(path.trim()));
}
throw (new RuntimeException("Cannot determine ID or path from provided Project instance"));
} else {
throw (new RuntimeException("Cannot determine ID or path from provided " + obj.getClass().getSimpleName() +
" instance, must be Integer, String, or a Project instance"));
}
} | java | public Object getProjectIdOrPath(Object obj) throws GitLabApiException {
if (obj == null) {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Integer) {
return (obj);
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Project) {
Integer id = ((Project) obj).getId();
if (id != null && id.intValue() > 0) {
return (id);
}
String path = ((Project) obj).getPathWithNamespace();
if (path != null && path.trim().length() > 0) {
return (urlEncode(path.trim()));
}
throw (new RuntimeException("Cannot determine ID or path from provided Project instance"));
} else {
throw (new RuntimeException("Cannot determine ID or path from provided " + obj.getClass().getSimpleName() +
" instance, must be Integer, String, or a Project instance"));
}
} | [
"public",
"Object",
"getProjectIdOrPath",
"(",
"Object",
"obj",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"throw",
"(",
"new",
"RuntimeException",
"(",
"\"Cannot determine ID or path from null object\"",
")",
")",
";",
"}"... | Returns the project ID or path from the provided Integer, String, or Project instance.
@param obj the object to determine the ID or path from
@return the project ID or path from the provided Integer, String, or Project instance
@throws GitLabApiException if any exception occurs during execution | [
"Returns",
"the",
"project",
"ID",
"or",
"path",
"from",
"the",
"provided",
"Integer",
"String",
"or",
"Project",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L37-L64 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.getGroupIdOrPath | public Object getGroupIdOrPath(Object obj) throws GitLabApiException {
if (obj == null) {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Integer) {
return (obj);
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Group) {
Integer id = ((Group) obj).getId();
if (id != null && id.intValue() > 0) {
return (id);
}
String path = ((Group) obj).getFullPath();
if (path != null && path.trim().length() > 0) {
return (urlEncode(path.trim()));
}
throw (new RuntimeException("Cannot determine ID or path from provided Group instance"));
} else {
throw (new RuntimeException("Cannot determine ID or path from provided " + obj.getClass().getSimpleName() +
" instance, must be Integer, String, or a Group instance"));
}
} | java | public Object getGroupIdOrPath(Object obj) throws GitLabApiException {
if (obj == null) {
throw (new RuntimeException("Cannot determine ID or path from null object"));
} else if (obj instanceof Integer) {
return (obj);
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof Group) {
Integer id = ((Group) obj).getId();
if (id != null && id.intValue() > 0) {
return (id);
}
String path = ((Group) obj).getFullPath();
if (path != null && path.trim().length() > 0) {
return (urlEncode(path.trim()));
}
throw (new RuntimeException("Cannot determine ID or path from provided Group instance"));
} else {
throw (new RuntimeException("Cannot determine ID or path from provided " + obj.getClass().getSimpleName() +
" instance, must be Integer, String, or a Group instance"));
}
} | [
"public",
"Object",
"getGroupIdOrPath",
"(",
"Object",
"obj",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"throw",
"(",
"new",
"RuntimeException",
"(",
"\"Cannot determine ID or path from null object\"",
")",
")",
";",
"}",
... | Returns the group ID or path from the provided Integer, String, or Group instance.
@param obj the object to determine the ID or path from
@return the group ID or path from the provided Integer, String, or Group instance
@throws GitLabApiException if any exception occurs during execution | [
"Returns",
"the",
"group",
"ID",
"or",
"path",
"from",
"the",
"provided",
"Integer",
"String",
"or",
"Group",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L73-L100 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.getUserIdOrUsername | public Object getUserIdOrUsername(Object obj) throws GitLabApiException {
if (obj == null) {
throw (new RuntimeException("Cannot determine ID or username from null object"));
} else if (obj instanceof Integer) {
return (obj);
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof User) {
Integer id = ((User) obj).getId();
if (id != null && id.intValue() > 0) {
return (id);
}
String username = ((User) obj).getUsername();
if (username != null && username.trim().length() > 0) {
return (urlEncode(username.trim()));
}
throw (new RuntimeException("Cannot determine ID or username from provided User instance"));
} else {
throw (new RuntimeException("Cannot determine ID or username from provided " + obj.getClass().getSimpleName() +
" instance, must be Integer, String, or a User instance"));
}
} | java | public Object getUserIdOrUsername(Object obj) throws GitLabApiException {
if (obj == null) {
throw (new RuntimeException("Cannot determine ID or username from null object"));
} else if (obj instanceof Integer) {
return (obj);
} else if (obj instanceof String) {
return (urlEncode(((String) obj).trim()));
} else if (obj instanceof User) {
Integer id = ((User) obj).getId();
if (id != null && id.intValue() > 0) {
return (id);
}
String username = ((User) obj).getUsername();
if (username != null && username.trim().length() > 0) {
return (urlEncode(username.trim()));
}
throw (new RuntimeException("Cannot determine ID or username from provided User instance"));
} else {
throw (new RuntimeException("Cannot determine ID or username from provided " + obj.getClass().getSimpleName() +
" instance, must be Integer, String, or a User instance"));
}
} | [
"public",
"Object",
"getUserIdOrUsername",
"(",
"Object",
"obj",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"throw",
"(",
"new",
"RuntimeException",
"(",
"\"Cannot determine ID or username from null object\"",
")",
")",
";",
... | Returns the user ID or path from the provided Integer, String, or User instance.
@param obj the object to determine the ID or username from
@return the user ID or username from the provided Integer, String, or User instance
@throws GitLabApiException if any exception occurs during execution | [
"Returns",
"the",
"user",
"ID",
"or",
"path",
"from",
"the",
"provided",
"Integer",
"String",
"or",
"User",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L109-L136 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.urlEncode | protected String urlEncode(String s) throws GitLabApiException {
try {
String encoded = URLEncoder.encode(s, "UTF-8");
// Since the encode method encodes plus signs as %2B,
// we can simply replace the encoded spaces with the correct encoding here
encoded = encoded.replace("+", "%20");
encoded = encoded.replace(".", "%2E");
encoded = encoded.replace("-", "%2D");
encoded = encoded.replace("_", "%5F");
return (encoded);
} catch (Exception e) {
throw new GitLabApiException(e);
}
} | java | protected String urlEncode(String s) throws GitLabApiException {
try {
String encoded = URLEncoder.encode(s, "UTF-8");
// Since the encode method encodes plus signs as %2B,
// we can simply replace the encoded spaces with the correct encoding here
encoded = encoded.replace("+", "%20");
encoded = encoded.replace(".", "%2E");
encoded = encoded.replace("-", "%2D");
encoded = encoded.replace("_", "%5F");
return (encoded);
} catch (Exception e) {
throw new GitLabApiException(e);
}
} | [
"protected",
"String",
"urlEncode",
"(",
"String",
"s",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"String",
"encoded",
"=",
"URLEncoder",
".",
"encode",
"(",
"s",
",",
"\"UTF-8\"",
")",
";",
"// Since the encode method encodes plus signs as %2B,",
"// we... | Encode a string to be used as in-path argument for a gitlab api request.
Standard URL encoding changes spaces to plus signs, but for arguments that are part of the path,
like the :file_path in a "Get raw file" request, gitlab expects spaces to be encoded with %20.
@param s the string to encode
@return encoded version of s with spaces encoded as %2F
@throws GitLabApiException if encoding throws an exception | [
"Encode",
"a",
"string",
"to",
"be",
"used",
"as",
"in",
"-",
"path",
"argument",
"for",
"a",
"gitlab",
"api",
"request",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L164-L177 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.post | protected Response post(Response.Status expectedStatus, StreamingOutput stream, String mediaType, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().post(stream, mediaType, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | java | protected Response post(Response.Status expectedStatus, StreamingOutput stream, String mediaType, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().post(stream, mediaType, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | [
"protected",
"Response",
"post",
"(",
"Response",
".",
"Status",
"expectedStatus",
",",
"StreamingOutput",
"stream",
",",
"String",
"mediaType",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"return",
"validate",
"(",
"g... | Perform an HTTP POST call with the specified payload object and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
@param expectedStatus the HTTP status that should be returned from the server
@param stream the StreamingOutput that will be used for the POST data
@param mediaType the content-type for the streamed data
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws GitLabApiException if any exception occurs during execution | [
"Perform",
"an",
"HTTP",
"POST",
"call",
"with",
"the",
"specified",
"payload",
"object",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L299-L305 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.upload | protected Response upload(Response.Status expectedStatus, String name, File fileToUpload, String mediaType, URL url) throws GitLabApiException {
try {
return validate(getApiClient().upload(name, fileToUpload, mediaType, url), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | java | protected Response upload(Response.Status expectedStatus, String name, File fileToUpload, String mediaType, URL url) throws GitLabApiException {
try {
return validate(getApiClient().upload(name, fileToUpload, mediaType, url), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | [
"protected",
"Response",
"upload",
"(",
"Response",
".",
"Status",
"expectedStatus",
",",
"String",
"name",
",",
"File",
"fileToUpload",
",",
"String",
"mediaType",
",",
"URL",
"url",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"return",
"validate",
... | Perform a file upload with the specified File instance and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
@param expectedStatus the HTTP status that should be returned from the server
@param name the name for the form field that contains the file name
@param fileToUpload a File instance pointing to the file to upload
@param mediaType the content-type of the uploaded file, if null will be determined from fileToUpload
@param url the fully formed path to the GitLab API endpoint
@return a ClientResponse instance with the data returned from the endpoint
@throws GitLabApiException if any exception occurs during execution | [
"Perform",
"a",
"file",
"upload",
"with",
"the",
"specified",
"File",
"instance",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L375-L381 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.put | protected Response put(Response.Status expectedStatus, MultivaluedMap<String, String> queryParams, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().put(queryParams, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | java | protected Response put(Response.Status expectedStatus, MultivaluedMap<String, String> queryParams, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().put(queryParams, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | [
"protected",
"Response",
"put",
"(",
"Response",
".",
"Status",
"expectedStatus",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"return",
"validate... | Perform an HTTP PUT call with the specified form data and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
@param expectedStatus the HTTP status that should be returned from the server
@param queryParams multivalue map of request parameters
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws GitLabApiException if any exception occurs during execution | [
"Perform",
"an",
"HTTP",
"PUT",
"call",
"with",
"the",
"specified",
"form",
"data",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L415-L421 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.putUpload | protected Response putUpload(Response.Status expectedStatus, String name, File fileToUpload, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().putUpload(name, fileToUpload, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | java | protected Response putUpload(Response.Status expectedStatus, String name, File fileToUpload, Object... pathArgs) throws GitLabApiException {
try {
return validate(getApiClient().putUpload(name, fileToUpload, pathArgs), expectedStatus);
} catch (Exception e) {
throw handle(e);
}
} | [
"protected",
"Response",
"putUpload",
"(",
"Response",
".",
"Status",
"expectedStatus",
",",
"String",
"name",
",",
"File",
"fileToUpload",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"return",
"validate",
"(",
"getApi... | Perform a file upload using the HTTP PUT method with the specified File instance and path objects,
returning a ClientResponse instance with the data returned from the endpoint.
@param expectedStatus the HTTP status that should be returned from the server
@param name the name for the form field that contains the file name
@param fileToUpload a File instance pointing to the file to upload
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws GitLabApiException if any exception occurs during execution | [
"Perform",
"a",
"file",
"upload",
"using",
"the",
"HTTP",
"PUT",
"method",
"with",
"the",
"specified",
"File",
"instance",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"... | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L471-L477 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.validate | protected Response validate(Response response, Response.Status expected) throws GitLabApiException {
int responseCode = response.getStatus();
int expectedResponseCode = expected.getStatusCode();
if (responseCode != expectedResponseCode) {
// If the expected code is 200-204 and the response code is 200-204 it is OK. We do this because
// GitLab is constantly changing the expected code in the 200 to 204 range
if (expectedResponseCode > 204 || responseCode > 204 || expectedResponseCode < 200 || responseCode < 200)
throw new GitLabApiException(response);
}
if (!getApiClient().validateSecretToken(response)) {
throw new GitLabApiException(new NotAuthorizedException("Invalid secret token in response."));
}
return (response);
} | java | protected Response validate(Response response, Response.Status expected) throws GitLabApiException {
int responseCode = response.getStatus();
int expectedResponseCode = expected.getStatusCode();
if (responseCode != expectedResponseCode) {
// If the expected code is 200-204 and the response code is 200-204 it is OK. We do this because
// GitLab is constantly changing the expected code in the 200 to 204 range
if (expectedResponseCode > 204 || responseCode > 204 || expectedResponseCode < 200 || responseCode < 200)
throw new GitLabApiException(response);
}
if (!getApiClient().validateSecretToken(response)) {
throw new GitLabApiException(new NotAuthorizedException("Invalid secret token in response."));
}
return (response);
} | [
"protected",
"Response",
"validate",
"(",
"Response",
"response",
",",
"Response",
".",
"Status",
"expected",
")",
"throws",
"GitLabApiException",
"{",
"int",
"responseCode",
"=",
"response",
".",
"getStatus",
"(",
")",
";",
"int",
"expectedResponseCode",
"=",
"... | Validates response the response from the server against the expected HTTP status and
the returned secret token, if either is not correct will throw a GitLabApiException.
@param response response
@param expected expected response status
@return original response if the response status is expected
@throws GitLabApiException if HTTP status is not as expected, or the secret token doesn't match | [
"Validates",
"response",
"the",
"response",
"from",
"the",
"server",
"against",
"the",
"expected",
"HTTP",
"status",
"and",
"the",
"returned",
"secret",
"token",
"if",
"either",
"is",
"not",
"correct",
"will",
"throw",
"a",
"GitLabApiException",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L583-L601 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.handle | protected GitLabApiException handle(Exception thrown) {
if (thrown instanceof GitLabApiException) {
return ((GitLabApiException) thrown);
}
return (new GitLabApiException(thrown));
} | java | protected GitLabApiException handle(Exception thrown) {
if (thrown instanceof GitLabApiException) {
return ((GitLabApiException) thrown);
}
return (new GitLabApiException(thrown));
} | [
"protected",
"GitLabApiException",
"handle",
"(",
"Exception",
"thrown",
")",
"{",
"if",
"(",
"thrown",
"instanceof",
"GitLabApiException",
")",
"{",
"return",
"(",
"(",
"GitLabApiException",
")",
"thrown",
")",
";",
"}",
"return",
"(",
"new",
"GitLabApiExceptio... | Wraps an exception in a GitLabApiException if needed.
@param thrown the exception that should be wrapped
@return either the untouched GitLabApiException or a new GitLabApiExceptin wrapping a non-GitLabApiException | [
"Wraps",
"an",
"exception",
"in",
"a",
"GitLabApiException",
"if",
"needed",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L609-L616 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.getPerPageQueryParam | protected MultivaluedMap<String, String> getPerPageQueryParam(int perPage) {
return (new GitLabApiForm().withParam(PER_PAGE_PARAM, perPage).asMap());
} | java | protected MultivaluedMap<String, String> getPerPageQueryParam(int perPage) {
return (new GitLabApiForm().withParam(PER_PAGE_PARAM, perPage).asMap());
} | [
"protected",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"getPerPageQueryParam",
"(",
"int",
"perPage",
")",
"{",
"return",
"(",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"PER_PAGE_PARAM",
",",
"perPage",
")",
".",
"asMap",
"(",
")",
... | Creates a MultivaluedMap instance containing the "per_page" param.
@param perPage the number of projects per page
@return a MultivaluedMap instance containing the "per_page" param | [
"Creates",
"a",
"MultivaluedMap",
"instance",
"containing",
"the",
"per_page",
"param",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L624-L626 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/AbstractApi.java | AbstractApi.getDefaultPerPageParam | protected MultivaluedMap<String, String> getDefaultPerPageParam(boolean customAttributesEnabled) {
GitLabApiForm form = new GitLabApiForm().withParam(PER_PAGE_PARAM, getDefaultPerPage());
if (customAttributesEnabled)
return (form.withParam("with_custom_attributes", true).asMap());
return (form.asMap());
} | java | protected MultivaluedMap<String, String> getDefaultPerPageParam(boolean customAttributesEnabled) {
GitLabApiForm form = new GitLabApiForm().withParam(PER_PAGE_PARAM, getDefaultPerPage());
if (customAttributesEnabled)
return (form.withParam("with_custom_attributes", true).asMap());
return (form.asMap());
} | [
"protected",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"getDefaultPerPageParam",
"(",
"boolean",
"customAttributesEnabled",
")",
"{",
"GitLabApiForm",
"form",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"PER_PAGE_PARAM",
",",
"getDefault... | Creates a MultivaluedMap instance containing the "per_page" param with the default value.
@param customAttributesEnabled enables customAttributes for this query
@return a MultivaluedMap instance containing the "per_page" param with the default value | [
"Creates",
"a",
"MultivaluedMap",
"instance",
"containing",
"the",
"per_page",
"param",
"with",
"the",
"default",
"value",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/AbstractApi.java#L671-L678 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.enableRequestResponseLogging | void enableRequestResponseLogging(Logger logger, Level level, int maxEntityLength, List<String> maskedHeaderNames) {
MaskingLoggingFilter loggingFilter = new MaskingLoggingFilter(logger, level, maxEntityLength, maskedHeaderNames);
clientConfig.register(loggingFilter);
// Recreate the Client instance if already created.
if (apiClient != null) {
createApiClient();
}
} | java | void enableRequestResponseLogging(Logger logger, Level level, int maxEntityLength, List<String> maskedHeaderNames) {
MaskingLoggingFilter loggingFilter = new MaskingLoggingFilter(logger, level, maxEntityLength, maskedHeaderNames);
clientConfig.register(loggingFilter);
// Recreate the Client instance if already created.
if (apiClient != null) {
createApiClient();
}
} | [
"void",
"enableRequestResponseLogging",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"int",
"maxEntityLength",
",",
"List",
"<",
"String",
">",
"maskedHeaderNames",
")",
"{",
"MaskingLoggingFilter",
"loggingFilter",
"=",
"new",
"MaskingLoggingFilter",
"(",
"... | Enable the logging of the requests to and the responses from the GitLab server API.
@param logger the Logger instance to log to
@param level the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
@param maxEntitySize maximum number of entity bytes to be logged. When logging if the maxEntitySize
is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at
the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
@param maskedHeaderNames a list of header names that should have the values masked | [
"Enable",
"the",
"logging",
"of",
"the",
"requests",
"to",
"and",
"the",
"responses",
"from",
"the",
"GitLab",
"server",
"API",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L253-L262 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.getApiUrl | protected URL getApiUrl(Object... pathArgs) throws IOException {
String url = appendPathArgs(this.hostUrl, pathArgs);
return (new URL(url));
} | java | protected URL getApiUrl(Object... pathArgs) throws IOException {
String url = appendPathArgs(this.hostUrl, pathArgs);
return (new URL(url));
} | [
"protected",
"URL",
"getApiUrl",
"(",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"String",
"url",
"=",
"appendPathArgs",
"(",
"this",
".",
"hostUrl",
",",
"pathArgs",
")",
";",
"return",
"(",
"new",
"URL",
"(",
"url",
")",
")",
";",
... | Construct a REST URL with the specified path arguments.
@param pathArgs variable list of arguments used to build the URI
@return a REST URL with the specified path arguments
@throws IOException if an error occurs while constructing the URL | [
"Construct",
"a",
"REST",
"URL",
"with",
"the",
"specified",
"path",
"arguments",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L315-L318 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.getUrlWithBase | protected URL getUrlWithBase(Object... pathArgs) throws IOException {
String url = appendPathArgs(this.baseUrl, pathArgs);
return (new URL(url));
} | java | protected URL getUrlWithBase(Object... pathArgs) throws IOException {
String url = appendPathArgs(this.baseUrl, pathArgs);
return (new URL(url));
} | [
"protected",
"URL",
"getUrlWithBase",
"(",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"String",
"url",
"=",
"appendPathArgs",
"(",
"this",
".",
"baseUrl",
",",
"pathArgs",
")",
";",
"return",
"(",
"new",
"URL",
"(",
"url",
")",
")",
... | Construct a REST URL with the specified path arguments using
Gitlab base url.
@param pathArgs variable list of arguments used to build the URI
@return a REST URL with the specified path arguments
@throws IOException if an error occurs while constructing the URL | [
"Construct",
"a",
"REST",
"URL",
"with",
"the",
"specified",
"path",
"arguments",
"using",
"Gitlab",
"base",
"url",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L328-L331 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.getWithAccepts | protected Response getWithAccepts(MultivaluedMap<String, String> queryParams, String accepts, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (getWithAccepts(queryParams, url, accepts));
} | java | protected Response getWithAccepts(MultivaluedMap<String, String> queryParams, String accepts, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (getWithAccepts(queryParams, url, accepts));
} | [
"protected",
"Response",
"getWithAccepts",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"String",
"accepts",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getApiUrl",
"(",
"pathArgs",
... | Perform an HTTP GET call with the specified query parameters and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
@param queryParams multivalue map of request parameters
@param accepts if non-empty will set the Accepts header to this value
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws IOException if an error occurs while constructing the URL | [
"Perform",
"an",
"HTTP",
"GET",
"call",
"with",
"the",
"specified",
"query",
"parameters",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L399-L402 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.head | protected Response head(MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (head(queryParams, url));
} | java | protected Response head(MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (head(queryParams, url));
} | [
"protected",
"Response",
"head",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getApiUrl",
"(",
"pathArgs",
")",
";",
"return",
"(",
"head",
... | Perform an HTTP HEAD call with the specified query parameters and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
@param queryParams multivalue map of request parameters
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws IOException if an error occurs while constructing the URL | [
"Perform",
"an",
"HTTP",
"HEAD",
"call",
"with",
"the",
"specified",
"query",
"parameters",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L426-L429 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.head | protected Response head(MultivaluedMap<String, String> queryParams, URL url) {
return (invocation(url, queryParams).head());
} | java | protected Response head(MultivaluedMap<String, String> queryParams, URL url) {
return (invocation(url, queryParams).head());
} | [
"protected",
"Response",
"head",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"URL",
"url",
")",
"{",
"return",
"(",
"invocation",
"(",
"url",
",",
"queryParams",
")",
".",
"head",
"(",
")",
")",
";",
"}"
] | Perform an HTTP HEAD call with the specified query parameters and URL, returning
a ClientResponse instance with the data returned from the endpoint.
@param queryParams multivalue map of request parameters
@param url the fully formed path to the GitLab API endpoint
@return a ClientResponse instance with the data returned from the endpoint | [
"Perform",
"an",
"HTTP",
"HEAD",
"call",
"with",
"the",
"specified",
"query",
"parameters",
"and",
"URL",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L439-L441 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.post | protected Response post(Object payload, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
Entity<?> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
return (invocation(url, null).post(entity));
} | java | protected Response post(Object payload, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
Entity<?> entity = Entity.entity(payload, MediaType.APPLICATION_JSON);
return (invocation(url, null).post(entity));
} | [
"protected",
"Response",
"post",
"(",
"Object",
"payload",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getApiUrl",
"(",
"pathArgs",
")",
";",
"Entity",
"<",
"?",
">",
"entity",
"=",
"Entity",
".",
"entity",
"(... | Perform an HTTP POST call with the specified payload object and URL, returning
a ClientResponse instance with the data returned from the endpoint.
@param payload the object instance that will be serialized to JSON and used as the POST data
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws IOException if an error occurs while constructing the URL | [
"Perform",
"an",
"HTTP",
"POST",
"call",
"with",
"the",
"specified",
"payload",
"object",
"and",
"URL",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L507-L511 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.post | protected Response post(StreamingOutput stream, String mediaType, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (invocation(url, null).post(Entity.entity(stream, mediaType)));
} | java | protected Response post(StreamingOutput stream, String mediaType, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (invocation(url, null).post(Entity.entity(stream, mediaType)));
} | [
"protected",
"Response",
"post",
"(",
"StreamingOutput",
"stream",
",",
"String",
"mediaType",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getApiUrl",
"(",
"pathArgs",
")",
";",
"return",
"(",
"invocation",
"(",
"... | Perform an HTTP POST call with the specified StreamingOutput, MediaType, and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
@param stream the StreamingOutput instance that contains the POST data
@param mediaType the content-type of the POST data
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws IOException if an error occurs while constructing the URL | [
"Perform",
"an",
"HTTP",
"POST",
"call",
"with",
"the",
"specified",
"StreamingOutput",
"MediaType",
"and",
"path",
"objects",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L523-L526 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.upload | protected Response upload(String name, File fileToUpload, String mediaTypeString, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (upload(name, fileToUpload, mediaTypeString, null, url));
} | java | protected Response upload(String name, File fileToUpload, String mediaTypeString, Object... pathArgs) throws IOException {
URL url = getApiUrl(pathArgs);
return (upload(name, fileToUpload, mediaTypeString, null, url));
} | [
"protected",
"Response",
"upload",
"(",
"String",
"name",
",",
"File",
"fileToUpload",
",",
"String",
"mediaTypeString",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getApiUrl",
"(",
"pathArgs",
")",
";",
"return",
... | Perform a file upload using the specified media type, returning
a ClientResponse instance with the data returned from the endpoint.
@param name the name for the form field that contains the file name
@param fileToUpload a File instance pointing to the file to upload
@param mediaTypeString the content-type of the uploaded file, if null will be determined from fileToUpload
@param pathArgs variable list of arguments used to build the URI
@return a ClientResponse instance with the data returned from the endpoint
@throws IOException if an error occurs while constructing the URL | [
"Perform",
"a",
"file",
"upload",
"using",
"the",
"specified",
"media",
"type",
"returning",
"a",
"ClientResponse",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L539-L542 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.delete | protected Response delete(MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOException {
return (delete(queryParams, getApiUrl(pathArgs)));
} | java | protected Response delete(MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOException {
return (delete(queryParams, getApiUrl(pathArgs)));
} | [
"protected",
"Response",
"delete",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"Object",
"...",
"pathArgs",
")",
"throws",
"IOException",
"{",
"return",
"(",
"delete",
"(",
"queryParams",
",",
"getApiUrl",
"(",
"pathArgs",
")"... | Perform an HTTP DELETE call with the specified form data and path objects, returning
a Response instance with the data returned from the endpoint.
@param queryParams multivalue map of request parameters
@param pathArgs variable list of arguments used to build the URI
@return a Response instance with the data returned from the endpoint
@throws IOException if an error occurs while constructing the URL | [
"Perform",
"an",
"HTTP",
"DELETE",
"call",
"with",
"the",
"specified",
"form",
"data",
"and",
"path",
"objects",
"returning",
"a",
"Response",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L700-L702 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.delete | protected Response delete(MultivaluedMap<String, String> queryParams, URL url) {
return (invocation(url, queryParams).delete());
} | java | protected Response delete(MultivaluedMap<String, String> queryParams, URL url) {
return (invocation(url, queryParams).delete());
} | [
"protected",
"Response",
"delete",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"URL",
"url",
")",
"{",
"return",
"(",
"invocation",
"(",
"url",
",",
"queryParams",
")",
".",
"delete",
"(",
")",
")",
";",
"}"
] | Perform an HTTP DELETE call with the specified form data and URL, returning
a Response instance with the data returned from the endpoint.
@param queryParams multivalue map of request parameters
@param url the fully formed path to the GitLab API endpoint
@return a Response instance with the data returned from the endpoint | [
"Perform",
"an",
"HTTP",
"DELETE",
"call",
"with",
"the",
"specified",
"form",
"data",
"and",
"URL",
"returning",
"a",
"Response",
"instance",
"with",
"the",
"data",
"returned",
"from",
"the",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L712-L714 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.setIgnoreCertificateErrors | public void setIgnoreCertificateErrors(boolean ignoreCertificateErrors) {
if (this.ignoreCertificateErrors == ignoreCertificateErrors) {
return;
}
if (!ignoreCertificateErrors) {
this.ignoreCertificateErrors = false;
openSslContext = null;
openHostnameVerifier = null;
apiClient = null;
} else {
if (setupIgnoreCertificateErrors()) {
this.ignoreCertificateErrors = true;
apiClient = null;
} else {
this.ignoreCertificateErrors = false;
apiClient = null;
throw new RuntimeException("Unable to ignore certificate errors.");
}
}
} | java | public void setIgnoreCertificateErrors(boolean ignoreCertificateErrors) {
if (this.ignoreCertificateErrors == ignoreCertificateErrors) {
return;
}
if (!ignoreCertificateErrors) {
this.ignoreCertificateErrors = false;
openSslContext = null;
openHostnameVerifier = null;
apiClient = null;
} else {
if (setupIgnoreCertificateErrors()) {
this.ignoreCertificateErrors = true;
apiClient = null;
} else {
this.ignoreCertificateErrors = false;
apiClient = null;
throw new RuntimeException("Unable to ignore certificate errors.");
}
}
} | [
"public",
"void",
"setIgnoreCertificateErrors",
"(",
"boolean",
"ignoreCertificateErrors",
")",
"{",
"if",
"(",
"this",
".",
"ignoreCertificateErrors",
"==",
"ignoreCertificateErrors",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"ignoreCertificateErrors",
")",
"{"... | Sets up the Jersey system ignore SSL certificate errors or not.
@param ignoreCertificateErrors if true will set up the Jersey system ignore SSL certificate errors | [
"Sets",
"up",
"the",
"Jersey",
"system",
"ignore",
"SSL",
"certificate",
"errors",
"or",
"not",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L777-L801 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiClient.java | GitLabApiClient.setupIgnoreCertificateErrors | private boolean setupIgnoreCertificateErrors() {
// Create a TrustManager that trusts all certificates
TrustManager[] trustAllCerts = new TrustManager[] { new X509ExtendedTrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {
}
}};
// Ignore differences between given hostname and certificate hostname
HostnameVerifier hostnameVerifier = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustAllCerts, new SecureRandom());
openSslContext = sslContext;
openHostnameVerifier = hostnameVerifier;
} catch (GeneralSecurityException ex) {
openSslContext = null;
openHostnameVerifier = null;
return (false);
}
return (true);
} | java | private boolean setupIgnoreCertificateErrors() {
// Create a TrustManager that trusts all certificates
TrustManager[] trustAllCerts = new TrustManager[] { new X509ExtendedTrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {
}
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {
}
}};
// Ignore differences between given hostname and certificate hostname
HostnameVerifier hostnameVerifier = new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustAllCerts, new SecureRandom());
openSslContext = sslContext;
openHostnameVerifier = hostnameVerifier;
} catch (GeneralSecurityException ex) {
openSslContext = null;
openHostnameVerifier = null;
return (false);
}
return (true);
} | [
"private",
"boolean",
"setupIgnoreCertificateErrors",
"(",
")",
"{",
"// Create a TrustManager that trusts all certificates",
"TrustManager",
"[",
"]",
"trustAllCerts",
"=",
"new",
"TrustManager",
"[",
"]",
"{",
"new",
"X509ExtendedTrustManager",
"(",
")",
"{",
"@",
"Ov... | Sets up Jersey client to ignore certificate errors.
@return true if successful at setting up to ignore certificate errors, otherwise returns false. | [
"Sets",
"up",
"Jersey",
"client",
"to",
"ignore",
"certificate",
"errors",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiClient.java#L808-L861 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getJobs | public List<Job> getJobs(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", getProjectIdOrPath(projectIdOrPath), "jobs");
return (response.readEntity(new GenericType<List<Job>>() {}));
} | java | public List<Job> getJobs(Object projectIdOrPath, int page, int perPage) throws GitLabApiException {
Response response = get(Response.Status.OK, getPageQueryParams(page, perPage), "projects", getProjectIdOrPath(projectIdOrPath), "jobs");
return (response.readEntity(new GenericType<List<Job>>() {}));
} | [
"public",
"List",
"<",
"Job",
">",
"getJobs",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"page",
",",
"int",
"perPage",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getPag... | Get a list of jobs in a project in the specified page range.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the jobs for
@param page the page to get
@param perPage the number of Job instances per page
@return a list containing the jobs for the specified project ID in the specified page range
@throws GitLabApiException if any exception occurs during execution | [
"Get",
"a",
"list",
"of",
"jobs",
"in",
"a",
"project",
"in",
"the",
"specified",
"page",
"range",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L55-L58 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getJobs | public Pager<Job> getJobs(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return (new Pager<Job>(this, Job.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "jobs"));
} | java | public Pager<Job> getJobs(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException {
return (new Pager<Job>(this, Job.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "jobs"));
} | [
"public",
"Pager",
"<",
"Job",
">",
"getJobs",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"new",
"Pager",
"<",
"Job",
">",
"(",
"this",
",",
"Job",
".",
"class",
",",
"itemsPerPage... | Get a Pager of jobs in a project.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the jobs for
@param itemsPerPage the number of Job instances that will be fetched per page
@return a Pager containing the jobs for the specified project ID
@throws GitLabApiException if any exception occurs during execution | [
"Get",
"a",
"Pager",
"of",
"jobs",
"in",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L70-L72 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getJobsStream | public Stream<Job> getJobsStream(Object projectIdOrPath) throws GitLabApiException {
return (getJobs(projectIdOrPath, getDefaultPerPage()).stream());
} | java | public Stream<Job> getJobsStream(Object projectIdOrPath) throws GitLabApiException {
return (getJobs(projectIdOrPath, getDefaultPerPage()).stream());
} | [
"public",
"Stream",
"<",
"Job",
">",
"getJobsStream",
"(",
"Object",
"projectIdOrPath",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"getJobs",
"(",
"projectIdOrPath",
",",
"getDefaultPerPage",
"(",
")",
")",
".",
"stream",
"(",
")",
")",
";",
"}... | Get a Stream of jobs in a project.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@return a Stream containing the jobs for the specified project ID
@throws GitLabApiException if any exception occurs during execution | [
"Get",
"a",
"Stream",
"of",
"jobs",
"in",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L83-L85 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getJob | public Job getJob(Object projectIdOrPath, int jobId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId);
return (response.readEntity(Job.class));
} | java | public Job getJob(Object projectIdOrPath, int jobId) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId);
return (response.readEntity(Job.class));
} | [
"public",
"Job",
"getJob",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"jobId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"getProjectIdOrPat... | Get single job in a project.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:job_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the job for
@param jobId the job ID to get
@return a single job for the specified project ID
@throws GitLabApiException if any exception occurs during execution | [
"Get",
"single",
"job",
"in",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L175-L178 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getOptionalJob | public Optional<Job> getOptionalJob(Object projectIdOrPath, int jobId) {
try {
return (Optional.ofNullable(getJob(projectIdOrPath, jobId)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | java | public Optional<Job> getOptionalJob(Object projectIdOrPath, int jobId) {
try {
return (Optional.ofNullable(getJob(projectIdOrPath, jobId)));
} catch (GitLabApiException glae) {
return (GitLabApi.createOptionalFromException(glae));
}
} | [
"public",
"Optional",
"<",
"Job",
">",
"getOptionalJob",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"jobId",
")",
"{",
"try",
"{",
"return",
"(",
"Optional",
".",
"ofNullable",
"(",
"getJob",
"(",
"projectIdOrPath",
",",
"jobId",
")",
")",
")",
";",
"... | Get single job in a project as an Optional instance.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:job_id</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path to get the job for
@param jobId the job ID to get
@return a single job for the specified project ID as an Optional intance | [
"Get",
"single",
"job",
"in",
"a",
"project",
"as",
"an",
"Optional",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L189-L195 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.downloadArtifactsFile | public InputStream downloadArtifactsFile(Object projectIdOrPath, String ref, String jobName) throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("job", jobName, true);
Response response = getWithAccepts(Response.Status.OK, formData.asMap(), MediaType.MEDIA_TYPE_WILDCARD,
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", "artifacts", ref, "download");
return (response.readEntity(InputStream.class));
} | java | public InputStream downloadArtifactsFile(Object projectIdOrPath, String ref, String jobName) throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("job", jobName, true);
Response response = getWithAccepts(Response.Status.OK, formData.asMap(), MediaType.MEDIA_TYPE_WILDCARD,
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", "artifacts", ref, "download");
return (response.readEntity(InputStream.class));
} | [
"public",
"InputStream",
"downloadArtifactsFile",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"ref",
",",
"String",
"jobName",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"job\"... | Get an InputStream pointing to the artifacts file from the given reference name and job
provided the job finished successfully. The file will be saved to the specified directory.
If the file already exists in the directory it will be overwritten.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/artifacts/:ref_name/download?job=name</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param ref the ref from a repository
@param jobName the name of the job to download the artifacts for
@return an InputStream to read the specified artifacts file from
@throws GitLabApiException if any exception occurs | [
"Get",
"an",
"InputStream",
"pointing",
"to",
"the",
"artifacts",
"file",
"from",
"the",
"given",
"reference",
"name",
"and",
"job",
"provided",
"the",
"job",
"finished",
"successfully",
".",
"The",
"file",
"will",
"be",
"saved",
"to",
"the",
"specified",
"d... | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L247-L252 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.downloadArtifactsFile | public InputStream downloadArtifactsFile(Object projectIdOrPath, Integer jobId) throws GitLabApiException {
Response response = getWithAccepts(Response.Status.OK, null, MediaType.MEDIA_TYPE_WILDCARD,
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "artifacts");
return (response.readEntity(InputStream.class));
} | java | public InputStream downloadArtifactsFile(Object projectIdOrPath, Integer jobId) throws GitLabApiException {
Response response = getWithAccepts(Response.Status.OK, null, MediaType.MEDIA_TYPE_WILDCARD,
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "artifacts");
return (response.readEntity(InputStream.class));
} | [
"public",
"InputStream",
"downloadArtifactsFile",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"jobId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"getWithAccepts",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"Medi... | Get an InputStream pointing to the job artifacts file for the specified job ID.
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:job_id/artifacts</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param jobId the job ID to get the artifacts for
@return an InputStream to read the specified job artifacts file
@throws GitLabApiException if any exception occurs | [
"Get",
"an",
"InputStream",
"pointing",
"to",
"the",
"job",
"artifacts",
"file",
"for",
"the",
"specified",
"job",
"ID",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L298-L302 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.getTrace | public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "trace");
return (response.readEntity(String.class));
} | java | public String getTrace(Object projectIdOrPath, int jobId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "trace");
return (response.readEntity(String.class));
} | [
"public",
"String",
"getTrace",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"jobId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"getDefaultPerPageParam",
"(",
")",
",",
"\"pro... | Get a trace of a specific job of a project
<pre><code>GitLab Endpoint: GET /projects/:id/jobs/:id/trace</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
to get the specified job's trace for
@param jobId the job ID to get the trace for
@return a String containing the specified job's trace
@throws GitLabApiException if any exception occurs during execution | [
"Get",
"a",
"trace",
"of",
"a",
"specific",
"job",
"of",
"a",
"project"
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L425-L429 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/JobApi.java | JobApi.playJob | public Job playJob(Object projectIdOrPath, int jobId) throws GitLabApiException {
GitLabApiForm formData = null;
Response response = post(Status.CREATED, formData, "projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "play");
return (response.readEntity(Job.class));
} | java | public Job playJob(Object projectIdOrPath, int jobId) throws GitLabApiException {
GitLabApiForm formData = null;
Response response = post(Status.CREATED, formData, "projects", getProjectIdOrPath(projectIdOrPath), "jobs", jobId, "play");
return (response.readEntity(Job.class));
} | [
"public",
"Job",
"playJob",
"(",
"Object",
"projectIdOrPath",
",",
"int",
"jobId",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"null",
";",
"Response",
"response",
"=",
"post",
"(",
"Status",
".",
"CREATED",
",",
"formData",
","... | Play specified job in a project.
<pre><code>GitLab Endpoint: POST /projects/:id/jobs/:job_id/play</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param jobId the ID to play job
@return job instance which just played
@throws GitLabApiException if any exception occurs during execution | [
"Play",
"specified",
"job",
"in",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/JobApi.java#L489-L493 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.readTree | public JsonNode readTree(String postData) throws JsonParseException, JsonMappingException, IOException {
return (objectMapper.readTree(postData));
} | java | public JsonNode readTree(String postData) throws JsonParseException, JsonMappingException, IOException {
return (objectMapper.readTree(postData));
} | [
"public",
"JsonNode",
"readTree",
"(",
"String",
"postData",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"return",
"(",
"objectMapper",
".",
"readTree",
"(",
"postData",
")",
")",
";",
"}"
] | Reads and parses the String containing JSON data and returns a JsonNode tree representation.
@param postData a String holding the POST data
@return a JsonNode instance containing the parsed JSON
@throws JsonParseException when an error occurs parsing the provided JSON
@throws JsonMappingException if a JSON error occurs
@throws IOException if an error occurs reading the JSON data | [
"Reads",
"and",
"parses",
"the",
"String",
"containing",
"JSON",
"data",
"and",
"returns",
"a",
"JsonNode",
"tree",
"representation",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L100-L102 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.readTree | public JsonNode readTree(Reader reader) throws JsonParseException, JsonMappingException, IOException {
return (objectMapper.readTree(reader));
} | java | public JsonNode readTree(Reader reader) throws JsonParseException, JsonMappingException, IOException {
return (objectMapper.readTree(reader));
} | [
"public",
"JsonNode",
"readTree",
"(",
"Reader",
"reader",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"return",
"(",
"objectMapper",
".",
"readTree",
"(",
"reader",
")",
")",
";",
"}"
] | Reads and parses the JSON data on the specified Reader instance to a JsonNode tree representation.
@param reader the Reader instance that contains the JSON data
@return a JsonNode instance containing the parsed JSON
@throws JsonParseException when an error occurs parsing the provided JSON
@throws JsonMappingException if a JSON error occurs
@throws IOException if an error occurs reading the JSON data | [
"Reads",
"and",
"parses",
"the",
"JSON",
"data",
"on",
"the",
"specified",
"Reader",
"instance",
"to",
"a",
"JsonNode",
"tree",
"representation",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L113-L115 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.unmarshal | public <T> T unmarshal(Class<T> returnType, Reader reader) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(returnType);
return (objectMapper.readValue(reader, returnType));
} | java | public <T> T unmarshal(Class<T> returnType, Reader reader) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(returnType);
return (objectMapper.readValue(reader, returnType));
} | [
"public",
"<",
"T",
">",
"T",
"unmarshal",
"(",
"Class",
"<",
"T",
">",
"returnType",
",",
"Reader",
"reader",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"ObjectMapper",
"objectMapper",
"=",
"getContext",
"(",
"r... | Unmarshal the JSON data on the specified Reader instance to an instance of the provided class.
@param <T> the generics type for the return value
@param returnType an instance of this type class will be returned
@param reader the Reader instance that contains the JSON data
@return an instance of the provided class containing the parsed data from the Reader
@throws JsonParseException when an error occurs parsing the provided JSON
@throws JsonMappingException if a JSON error occurs
@throws IOException if an error occurs reading the JSON data | [
"Unmarshal",
"the",
"JSON",
"data",
"on",
"the",
"specified",
"Reader",
"instance",
"to",
"an",
"instance",
"of",
"the",
"provided",
"class",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L144-L147 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.unmarshal | public <T> T unmarshal(Class<T> returnType, String postData) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(returnType);
return (objectMapper.readValue(postData, returnType));
} | java | public <T> T unmarshal(Class<T> returnType, String postData) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(returnType);
return (objectMapper.readValue(postData, returnType));
} | [
"public",
"<",
"T",
">",
"T",
"unmarshal",
"(",
"Class",
"<",
"T",
">",
"returnType",
",",
"String",
"postData",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"ObjectMapper",
"objectMapper",
"=",
"getContext",
"(",
... | Unmarshal the JSON data contained by the string and populate an instance of the provided returnType class.
@param <T> the generics type for the return value
@param returnType an instance of this type class will be returned
@param postData a String holding the POST data
@return an instance of the provided class containing the parsed data from the string
@throws JsonParseException when an error occurs parsing the provided JSON
@throws JsonMappingException if a JSON error occurs
@throws IOException if an error occurs reading the JSON data | [
"Unmarshal",
"the",
"JSON",
"data",
"contained",
"by",
"the",
"string",
"and",
"populate",
"an",
"instance",
"of",
"the",
"provided",
"returnType",
"class",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L160-L163 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.unmarshalList | public <T> List<T> unmarshalList(Class<T> returnType, Reader reader) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(null);
CollectionType javaType = objectMapper.getTypeFactory().constructCollectionType(List.class, returnType);
return (objectMapper.readValue(reader, javaType));
} | java | public <T> List<T> unmarshalList(Class<T> returnType, Reader reader) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(null);
CollectionType javaType = objectMapper.getTypeFactory().constructCollectionType(List.class, returnType);
return (objectMapper.readValue(reader, javaType));
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"unmarshalList",
"(",
"Class",
"<",
"T",
">",
"returnType",
",",
"Reader",
"reader",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"ObjectMapper",
"objectMapper",
"=",... | Unmarshal the JSON data on the specified Reader instance and populate a List of instances of the provided returnType class.
@param <T> the generics type for the List
@param returnType an instance of this type class will be contained in the returned List
@param reader the Reader instance that contains the JSON data
@return a List of the provided class containing the parsed data from the Reader
@throws JsonParseException when an error occurs parsing the provided JSON
@throws JsonMappingException if a JSON error occurs
@throws IOException if an error occurs reading the JSON data | [
"Unmarshal",
"the",
"JSON",
"data",
"on",
"the",
"specified",
"Reader",
"instance",
"and",
"populate",
"a",
"List",
"of",
"instances",
"of",
"the",
"provided",
"returnType",
"class",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L176-L180 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.unmarshalMap | public <T> Map<String, T> unmarshalMap(Class<T> returnType, Reader reader) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(null);
return (objectMapper.readValue(reader, new TypeReference<Map<String, T>>() {}));
} | java | public <T> Map<String, T> unmarshalMap(Class<T> returnType, Reader reader) throws JsonParseException, JsonMappingException, IOException {
ObjectMapper objectMapper = getContext(null);
return (objectMapper.readValue(reader, new TypeReference<Map<String, T>>() {}));
} | [
"public",
"<",
"T",
">",
"Map",
"<",
"String",
",",
"T",
">",
"unmarshalMap",
"(",
"Class",
"<",
"T",
">",
"returnType",
",",
"Reader",
"reader",
")",
"throws",
"JsonParseException",
",",
"JsonMappingException",
",",
"IOException",
"{",
"ObjectMapper",
"obje... | Unmarshal the JSON data on the specified Reader instance and populate a Map of String keys and values of the provided returnType class.
@param <T> the generics type for the Map value
@param returnType an instance of this type class will be contained the values of the Map
@param reader the Reader instance that contains the JSON data
@return a Map containing the parsed data from the Reader
@throws JsonParseException when an error occurs parsing the provided JSON
@throws JsonMappingException if a JSON error occurs
@throws IOException if an error occurs reading the JSON data | [
"Unmarshal",
"the",
"JSON",
"data",
"on",
"the",
"specified",
"Reader",
"instance",
"and",
"populate",
"a",
"Map",
"of",
"String",
"keys",
"and",
"values",
"of",
"the",
"provided",
"returnType",
"class",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L210-L213 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.marshal | public <T> String marshal(final T object) {
if (object == null) {
throw new IllegalArgumentException("object parameter is null");
}
ObjectWriter writer = objectMapper.writer().withDefaultPrettyPrinter();
String results = null;
try {
results = writer.writeValueAsString(object);
} catch (JsonGenerationException e) {
System.err.println("JsonGenerationException, message=" + e.getMessage());
} catch (JsonMappingException e) {
e.printStackTrace();
System.err.println("JsonMappingException, message=" + e.getMessage());
} catch (IOException e) {
System.err.println("IOException, message=" + e.getMessage());
}
return (results);
} | java | public <T> String marshal(final T object) {
if (object == null) {
throw new IllegalArgumentException("object parameter is null");
}
ObjectWriter writer = objectMapper.writer().withDefaultPrettyPrinter();
String results = null;
try {
results = writer.writeValueAsString(object);
} catch (JsonGenerationException e) {
System.err.println("JsonGenerationException, message=" + e.getMessage());
} catch (JsonMappingException e) {
e.printStackTrace();
System.err.println("JsonMappingException, message=" + e.getMessage());
} catch (IOException e) {
System.err.println("IOException, message=" + e.getMessage());
}
return (results);
} | [
"public",
"<",
"T",
">",
"String",
"marshal",
"(",
"final",
"T",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"object parameter is null\"",
")",
";",
"}",
"ObjectWriter",
"writer",
"=",
... | Marshals the supplied object out as a formatted JSON string.
@param <T> the generics type for the provided object
@param object the object to output as a JSON string
@return a String containing the JSON for the specified object | [
"Marshals",
"the",
"supplied",
"object",
"out",
"as",
"a",
"formatted",
"JSON",
"string",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L238-L258 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/utils/JacksonJson.java | JacksonJson.toJsonNode | public static JsonNode toJsonNode(String jsonString) throws IOException {
return (JacksonJsonSingletonHelper.JACKSON_JSON.objectMapper.readTree(jsonString));
} | java | public static JsonNode toJsonNode(String jsonString) throws IOException {
return (JacksonJsonSingletonHelper.JACKSON_JSON.objectMapper.readTree(jsonString));
} | [
"public",
"static",
"JsonNode",
"toJsonNode",
"(",
"String",
"jsonString",
")",
"throws",
"IOException",
"{",
"return",
"(",
"JacksonJsonSingletonHelper",
".",
"JACKSON_JSON",
".",
"objectMapper",
".",
"readTree",
"(",
"jsonString",
")",
")",
";",
"}"
] | Parse the provided String into a JsonNode instance.
@param jsonString a String containing JSON to parse
@return a JsonNode with the String parsed into a JSON tree
@throws IOException if any IO error occurs | [
"Parse",
"the",
"provided",
"String",
"into",
"a",
"JsonNode",
"instance",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/utils/JacksonJson.java#L365-L367 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/LicensesApi.java | LicensesApi.getAllLicenseTemplates | public List<LicenseTemplate> getAllLicenseTemplates() throws GitLabApiException {
Response response = get(Response.Status.OK, null, "licenses");
return (response.readEntity(new GenericType<List<LicenseTemplate>>() {}));
} | java | public List<LicenseTemplate> getAllLicenseTemplates() throws GitLabApiException {
Response response = get(Response.Status.OK, null, "licenses");
return (response.readEntity(new GenericType<List<LicenseTemplate>>() {}));
} | [
"public",
"List",
"<",
"LicenseTemplate",
">",
"getAllLicenseTemplates",
"(",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"licenses\"",
")",
";",
"return",
"(",
... | Get all license templates.
GET /licenses
@return a list of LicenseTemplate instances
@throws GitLabApiException if any exception occurs | [
"Get",
"all",
"license",
"templates",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/LicensesApi.java#L28-L31 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/LicensesApi.java | LicensesApi.getPopularLicenseTemplates | public List<LicenseTemplate> getPopularLicenseTemplates() throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("popular", true, true);
Response response = get(Response.Status.OK, formData.asMap(), "licenses");
return (response.readEntity(new GenericType<List<LicenseTemplate>>() {}));
} | java | public List<LicenseTemplate> getPopularLicenseTemplates() throws GitLabApiException {
Form formData = new GitLabApiForm().withParam("popular", true, true);
Response response = get(Response.Status.OK, formData.asMap(), "licenses");
return (response.readEntity(new GenericType<List<LicenseTemplate>>() {}));
} | [
"public",
"List",
"<",
"LicenseTemplate",
">",
"getPopularLicenseTemplates",
"(",
")",
"throws",
"GitLabApiException",
"{",
"Form",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"popular\"",
",",
"true",
",",
"true",
")",
";",
"Re... | Get popular license templates.
GET /licenses
@return a list of LicenseTemplate instances
@throws GitLabApiException if any exception occurs | [
"Get",
"popular",
"license",
"templates",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/LicensesApi.java#L41-L45 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/LicensesApi.java | LicensesApi.getSingleLicenseTemplate | public LicenseTemplate getSingleLicenseTemplate(String key) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "licenses", key);
return (response.readEntity(LicenseTemplate.class));
} | java | public LicenseTemplate getSingleLicenseTemplate(String key) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "licenses", key);
return (response.readEntity(LicenseTemplate.class));
} | [
"public",
"LicenseTemplate",
"getSingleLicenseTemplate",
"(",
"String",
"key",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"licenses\"",
",",
"key",
")",
";",
"ret... | Get a single license template.
GET /licenses
@param key The key of the license template
@return a LicenseTemplate instance
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"single",
"license",
"template",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/LicensesApi.java#L56-L59 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/HealthCheckApi.java | HealthCheckApi.getLiveness | public HealthCheckInfo getLiveness(String token) throws GitLabApiException {
try {
URL livenessUrl = getApiClient().getUrlWithBase("-", "liveness");
GitLabApiForm formData = new GitLabApiForm().withParam("token", token, false);
Response response = get(Response.Status.OK, formData.asMap(), livenessUrl);
return (response.readEntity(HealthCheckInfo.class));
} catch (IOException ioe) {
throw (new GitLabApiException(ioe));
}
} | java | public HealthCheckInfo getLiveness(String token) throws GitLabApiException {
try {
URL livenessUrl = getApiClient().getUrlWithBase("-", "liveness");
GitLabApiForm formData = new GitLabApiForm().withParam("token", token, false);
Response response = get(Response.Status.OK, formData.asMap(), livenessUrl);
return (response.readEntity(HealthCheckInfo.class));
} catch (IOException ioe) {
throw (new GitLabApiException(ioe));
}
} | [
"public",
"HealthCheckInfo",
"getLiveness",
"(",
"String",
"token",
")",
"throws",
"GitLabApiException",
"{",
"try",
"{",
"URL",
"livenessUrl",
"=",
"getApiClient",
"(",
")",
".",
"getUrlWithBase",
"(",
"\"-\"",
",",
"\"liveness\"",
")",
";",
"GitLabApiForm",
"f... | Get Health Checks from the liveness endpoint.
<pre><code>GitLab Endpoint: GET /-/liveness</code></pre>
@param token Health Status token
@return HealthCheckInfo instance
@throws GitLabApiException if any exception occurs
@deprecated | [
"Get",
"Health",
"Checks",
"from",
"the",
"liveness",
"endpoint",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/HealthCheckApi.java#L40-L49 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.setGitLabCI | public void setGitLabCI(Object projectIdOrPath, String token, String projectCIUrl) throws GitLabApiException {
final Form formData = new Form();
formData.param("token", token);
formData.param("project_url", projectCIUrl);
put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "gitlab-ci");
} | java | public void setGitLabCI(Object projectIdOrPath, String token, String projectCIUrl) throws GitLabApiException {
final Form formData = new Form();
formData.param("token", token);
formData.param("project_url", projectCIUrl);
put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "gitlab-ci");
} | [
"public",
"void",
"setGitLabCI",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"token",
",",
"String",
"projectCIUrl",
")",
"throws",
"GitLabApiException",
"{",
"final",
"Form",
"formData",
"=",
"new",
"Form",
"(",
")",
";",
"formData",
".",
"param",
"(",
... | Activates the gitlab-ci service for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/gitlab-ci</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param token for authentication
@param projectCIUrl URL of the GitLab-CI project
@throws GitLabApiException if any exception occurs
@deprecated No longer supported | [
"Activates",
"the",
"gitlab",
"-",
"ci",
"service",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L33-L38 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.deleteGitLabCI | public void deleteGitLabCI(Object projectIdOrPath) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "services", "gitlab-ci");
} | java | public void deleteGitLabCI(Object projectIdOrPath) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "services", "gitlab-ci");
} | [
"public",
"void",
"deleteGitLabCI",
"(",
"Object",
"projectIdOrPath",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
".",
"Status",
".",
"OK",
... | Deletes the gitlab-ci service for a project.
<pre><code>GitLab Endpoint: DELETE /projects/:id/services/gitlab-ci</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@throws GitLabApiException if any exception occurs
@deprecated No longer supported | [
"Deletes",
"the",
"gitlab",
"-",
"ci",
"service",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L49-L52 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.getHipChatService | public HipChatService getHipChatService(Object projectIdOrPath) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "services", "hipchat");
return (response.readEntity(HipChatService.class));
} | java | public HipChatService getHipChatService(Object projectIdOrPath) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "services", "hipchat");
return (response.readEntity(HipChatService.class));
} | [
"public",
"HipChatService",
"getHipChatService",
"(",
"Object",
"projectIdOrPath",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"getProjectIdOrPath",
... | Get the HipChatService notification configuration for a project.
<pre><code>GitLab Endpoint: GET /projects/:id/services/hipchat</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@return a HipChatService instance holding the HipChatService notification settings
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"HipChatService",
"notification",
"configuration",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L63-L66 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.updateHipChatService | public HipChatService updateHipChatService(Object projectIdOrPath, HipChatService hipChat) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("push_events", hipChat.getPushEvents())
.withParam("issues_events", hipChat.getIssuesEvents())
.withParam("confidential_issues_events", hipChat.getConfidentialIssuesEvents())
.withParam("merge_requests_events", hipChat.getMergeRequestsEvents())
.withParam("tag_push_events", hipChat.getTagPushEvents())
.withParam("note_events", hipChat.getNoteEvents())
.withParam("confidential_note_events", hipChat.getConfidentialNoteEvents())
.withParam("pipeline_events", hipChat.getPipelineEvents())
.withParam("token", hipChat.getToken(), true)
.withParam("color", hipChat.getColor())
.withParam("notify", hipChat.getNotify())
.withParam("room", hipChat.getRoom())
.withParam("api_version", hipChat.getApiVersion())
.withParam("server", hipChat.getServer())
.withParam("notify_only_broken_pipelines", hipChat.getNotifyOnlyBrokenPipelines());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "hipchat");
return (response.readEntity(HipChatService.class));
} | java | public HipChatService updateHipChatService(Object projectIdOrPath, HipChatService hipChat) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("push_events", hipChat.getPushEvents())
.withParam("issues_events", hipChat.getIssuesEvents())
.withParam("confidential_issues_events", hipChat.getConfidentialIssuesEvents())
.withParam("merge_requests_events", hipChat.getMergeRequestsEvents())
.withParam("tag_push_events", hipChat.getTagPushEvents())
.withParam("note_events", hipChat.getNoteEvents())
.withParam("confidential_note_events", hipChat.getConfidentialNoteEvents())
.withParam("pipeline_events", hipChat.getPipelineEvents())
.withParam("token", hipChat.getToken(), true)
.withParam("color", hipChat.getColor())
.withParam("notify", hipChat.getNotify())
.withParam("room", hipChat.getRoom())
.withParam("api_version", hipChat.getApiVersion())
.withParam("server", hipChat.getServer())
.withParam("notify_only_broken_pipelines", hipChat.getNotifyOnlyBrokenPipelines());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "hipchat");
return (response.readEntity(HipChatService.class));
} | [
"public",
"HipChatService",
"updateHipChatService",
"(",
"Object",
"projectIdOrPath",
",",
"HipChatService",
"hipChat",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"push_events\""... | Updates the HipChatService notification settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/hipchat</code></pre>
The following properties on the HipChatService instance are utilized in the update of the settings:
<p>
pushEvents (optional) - Enable notifications for push events
issuesEvents (optional) - Enable notifications for issue events
confidentialIssuesEvents (optional) - Enable notifications for confidential issue events
MergeRequestsEvents (optional) - Enable notifications for merge request events
tagPushEvents (optional) - Enable notifications for tag push events
noteEvents (optional) - Enable notifications for note events
confidentialNoteEvents (optional) - Enable notifications for confidential note events
pipelineEvents (optional) - Enable notifications for pipeline events
token (required) - The room token
color (optional) - The room color
notify (optional) - Enable notifications
room (optional) - Room name or ID
apiVersion (optional) - Leave blank for default (v2)
server (false) - Leave blank for default. https://hipchat.example.com
notifyOnlyBrokenPipelines (optional) - Send notifications for broken pipelines
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param hipChat the HipChatService instance holding the settings
@return a HipChatService instance holding the newly updated settings
@throws GitLabApiException if any exception occurs | [
"Updates",
"the",
"HipChatService",
"notification",
"settings",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L96-L115 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.setHipChat | public void setHipChat(Object projectIdOrPath, String token, String room, String server) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("token", token)
.withParam("room", room)
.withParam("server", server);
put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "hipchat");
} | java | public void setHipChat(Object projectIdOrPath, String token, String room, String server) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("token", token)
.withParam("room", room)
.withParam("server", server);
put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "hipchat");
} | [
"public",
"void",
"setHipChat",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"token",
",",
"String",
"room",
",",
"String",
"server",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withPara... | Activates HipChatService notifications.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/hipchat</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param token for authentication
@param room HipChatService Room
@param server HipChatService Server URL
@throws GitLabApiException if any exception occurs
@deprecated replaced with {@link #updateHipChatService(Object, HipChatService) updateHipChat} method | [
"Activates",
"HipChatService",
"notifications",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L129-L135 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.getSlackService | public SlackService getSlackService(Object projectIdOrPath) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "services", "slack");
return (response.readEntity(SlackService.class));
} | java | public SlackService getSlackService(Object projectIdOrPath) throws GitLabApiException {
Response response = get(Response.Status.OK, null, "projects", getProjectIdOrPath(projectIdOrPath), "services", "slack");
return (response.readEntity(SlackService.class));
} | [
"public",
"SlackService",
"getSlackService",
"(",
"Object",
"projectIdOrPath",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
"null",
",",
"\"projects\"",
",",
"getProjectIdOrPath",
"("... | Get the Slack notification settings for a project.
<pre><code>GitLab Endpoint: GET /projects/:id/services/slack</code></pre>
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@return a SlackService instance holding the Slack notification settings
@throws GitLabApiException if any exception occurs | [
"Get",
"the",
"Slack",
"notification",
"settings",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L172-L175 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.updateSlackService | public SlackService updateSlackService(Object projectIdOrPath, SlackService slackNotifications) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("webhook", slackNotifications.getWebhook(), true)
.withParam("username", slackNotifications.getUsername())
.withParam("channel", slackNotifications.getDefaultChannel())
.withParam("notify_only_broken_pipelines", slackNotifications.getNotifyOnlyBrokenPipelines())
.withParam("notify_only_default_branch", slackNotifications.getNotifyOnlyDefaultBranch())
.withParam("push_events", slackNotifications.getPushEvents())
.withParam("issues_events", slackNotifications.getIssuesEvents())
.withParam("confidential_issues_events", slackNotifications.getConfidentialIssuesEvents())
.withParam("merge_requests_events", slackNotifications.getMergeRequestsEvents())
.withParam("tag_push_events", slackNotifications.getTagPushEvents())
.withParam("note_events", slackNotifications.getNoteEvents())
.withParam("confidential_note_events", slackNotifications.getConfidentialNoteEvents())
.withParam("pipeline_events", slackNotifications.getPipelineEvents())
.withParam("wiki_page_events", slackNotifications.getWikiPageEvents())
.withParam("push_channel", slackNotifications.getPushChannel())
.withParam("issue_channel", slackNotifications.getIssueChannel())
.withParam("confidential_issue_channel", slackNotifications.getConfidentialIssueChannel())
.withParam("merge_request_channel", slackNotifications.getMergeRequestChannel())
.withParam("note_channel", slackNotifications.getNoteChannel())
.withParam("confidential_note_channel", slackNotifications.getConfidentialNoteChannel())
.withParam("tag_push_channel", slackNotifications.getTagPushChannel())
.withParam("pipeline_channel", slackNotifications.getPipelineChannel())
.withParam("wiki_page_channel", slackNotifications.getWikiPageChannel());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "slack");
return (response.readEntity(SlackService.class));
} | java | public SlackService updateSlackService(Object projectIdOrPath, SlackService slackNotifications) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("webhook", slackNotifications.getWebhook(), true)
.withParam("username", slackNotifications.getUsername())
.withParam("channel", slackNotifications.getDefaultChannel())
.withParam("notify_only_broken_pipelines", slackNotifications.getNotifyOnlyBrokenPipelines())
.withParam("notify_only_default_branch", slackNotifications.getNotifyOnlyDefaultBranch())
.withParam("push_events", slackNotifications.getPushEvents())
.withParam("issues_events", slackNotifications.getIssuesEvents())
.withParam("confidential_issues_events", slackNotifications.getConfidentialIssuesEvents())
.withParam("merge_requests_events", slackNotifications.getMergeRequestsEvents())
.withParam("tag_push_events", slackNotifications.getTagPushEvents())
.withParam("note_events", slackNotifications.getNoteEvents())
.withParam("confidential_note_events", slackNotifications.getConfidentialNoteEvents())
.withParam("pipeline_events", slackNotifications.getPipelineEvents())
.withParam("wiki_page_events", slackNotifications.getWikiPageEvents())
.withParam("push_channel", slackNotifications.getPushChannel())
.withParam("issue_channel", slackNotifications.getIssueChannel())
.withParam("confidential_issue_channel", slackNotifications.getConfidentialIssueChannel())
.withParam("merge_request_channel", slackNotifications.getMergeRequestChannel())
.withParam("note_channel", slackNotifications.getNoteChannel())
.withParam("confidential_note_channel", slackNotifications.getConfidentialNoteChannel())
.withParam("tag_push_channel", slackNotifications.getTagPushChannel())
.withParam("pipeline_channel", slackNotifications.getPipelineChannel())
.withParam("wiki_page_channel", slackNotifications.getWikiPageChannel());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "slack");
return (response.readEntity(SlackService.class));
} | [
"public",
"SlackService",
"updateSlackService",
"(",
"Object",
"projectIdOrPath",
",",
"SlackService",
"slackNotifications",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"webhook\"... | Updates the Slack notification settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/slack</code></pre>
The following properties on the SlackService instance are utilized in the update of the settings:
<p>
webhook (required) - https://hooks.slack.com/services/...
username (optional) - username
defaultChannel (optional) - Default channel to use if others are not configured
notifyOnlyBrokenPipelines (optional) - Send notifications for broken pipelines
notifyOnlyDefault_branch (optional) - Send notifications only for the default branch
pushEvents (optional) - Enable notifications for push events
issuesEvents (optional) - Enable notifications for issue events
confidentialIssuesEvents (optional) - Enable notifications for confidential issue events
mergeRequestsEvents (optional) - Enable notifications for merge request events
tagPushEvents (optional) - Enable notifications for tag push events
noteEvents (optional) - Enable notifications for note events
confidentialNoteEvents (optional) - Enable notifications for confidential note events
pipelineEvents (optional) - Enable notifications for pipeline events
wikiPageEvents (optional) - Enable notifications for wiki page events
pushChannel (optional) - The name of the channel to receive push events notifications
issueChannel (optional) - The name of the channel to receive issues events notifications
confidentialIssueChannel (optional) - The name of the channel to receive confidential issues events notifications
mergeRequestChannel (optional) - The name of the channel to receive merge request events notifications
noteChannel (optional) - The name of the channel to receive note events notifications
confidentialNoteChannel (optional) - The name of the channel to receive confidential note events notifications
tagPushChannel (optional) - The name of the channel to receive tag push events notifications
pipelineChannel (optional) - The name of the channel to receive pipeline events notifications
wikiPageChannel (optional) - The name of the channel to receive wiki page events notifications
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param slackNotifications the SlackService instance holding the settings
@return a SlackService instance holding the newly updated settings
@throws GitLabApiException if any exception occurs | [
"Updates",
"the",
"Slack",
"notification",
"settings",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L213-L240 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.updateJiraService | public JiraService updateJiraService(Object projectIdOrPath, JiraService jira) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("merge_requests_events", jira.getMergeRequestsEvents())
.withParam("commit_events", jira.getCommitEvents())
.withParam("url", jira.getUrl(), true)
.withParam("api_url", jira.getApiUrl())
.withParam("project_key", jira.getProjectKey())
.withParam("username", jira.getUsername(), true)
.withParam("password", jira.getPassword(), true)
.withParam("jira_issue_transition_id", jira.getJiraIssueTransitionId());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "jira");
return (response.readEntity(JiraService.class));
} | java | public JiraService updateJiraService(Object projectIdOrPath, JiraService jira) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("merge_requests_events", jira.getMergeRequestsEvents())
.withParam("commit_events", jira.getCommitEvents())
.withParam("url", jira.getUrl(), true)
.withParam("api_url", jira.getApiUrl())
.withParam("project_key", jira.getProjectKey())
.withParam("username", jira.getUsername(), true)
.withParam("password", jira.getPassword(), true)
.withParam("jira_issue_transition_id", jira.getJiraIssueTransitionId());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "jira");
return (response.readEntity(JiraService.class));
} | [
"public",
"JiraService",
"updateJiraService",
"(",
"Object",
"projectIdOrPath",
",",
"JiraService",
"jira",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"\"merge_requests_events\"",
... | Updates the JIRA service settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/jira</code></pre>
The following properties on the JiraService instance are utilized in the update of the settings:
<p>
mergeRequestsEvents (optional) - Enable notifications for merge request events
commitEvents (optional) - Enable notifications for commit events
url (required) - The URL to the JIRA project which is being linked to this GitLab project, e.g., https://jira.example.com.
apiUrl (optional) - The JIRA API url if different than url
projectKey (optional) - The short identifier for your JIRA project, all uppercase, e.g., PROJ.
username (required) - The username of the user created to be used with GitLab/JIRA.
password (required) - The password of the user created to be used with GitLab/JIRA.
jiraIssueTransitionId (optional) - The ID of a transition that moves issues to a closed state.
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param jira the JiraService instance holding the settings
@return a JiraService instance holding the newly updated settings
@throws GitLabApiException if any exception occurs | [
"Updates",
"the",
"JIRA",
"service",
"settings",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L290-L302 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ServicesApi.java | ServicesApi.updateExternalWikiService | public ExternalWikiService updateExternalWikiService(Object projectIdOrPath, ExternalWikiService externalWiki) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("external_wiki_url", externalWiki.getExternalWikiUrl());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "external-wiki");
return (response.readEntity(ExternalWikiService.class));
} | java | public ExternalWikiService updateExternalWikiService(Object projectIdOrPath, ExternalWikiService externalWiki) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("external_wiki_url", externalWiki.getExternalWikiUrl());
Response response = put(Response.Status.OK, formData.asMap(), "projects", getProjectIdOrPath(projectIdOrPath), "services", "external-wiki");
return (response.readEntity(ExternalWikiService.class));
} | [
"public",
"ExternalWikiService",
"updateExternalWikiService",
"(",
"Object",
"projectIdOrPath",
",",
"ExternalWikiService",
"externalWiki",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",... | Updates the ExternalWikiService service settings for a project.
<pre><code>GitLab Endpoint: PUT /projects/:id/services/external-wiki</code></pre>
The following properties on the JiraService instance are utilized in the update of the settings:
<p>
external_wiki_url (required) - The URL to the External Wiki project which is being linked to this GitLab project, e.g., http://www.wikidot.com/
@param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
@param externalWiki the ExternalWikiService instance holding the settings
@return a ExternalWikiService instance holding the newly updated settings
@throws GitLabApiException if any exception occurs | [
"Updates",
"the",
"ExternalWikiService",
"service",
"settings",
"for",
"a",
"project",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ServicesApi.java#L345-L350 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/systemhooks/SystemHookManager.java | SystemHookManager.handleEvent | public void handleEvent(HttpServletRequest request) throws GitLabApiException {
String eventName = request.getHeader("X-Gitlab-Event");
if (eventName == null || eventName.trim().isEmpty()) {
String message = "X-Gitlab-Event header is missing!";
LOGGER.warning(message);
return;
}
if (!isValidSecretToken(request)) {
String message = "X-Gitlab-Token mismatch!";
LOGGER.warning(message);
throw new GitLabApiException(message);
}
LOGGER.info("handleEvent: X-Gitlab-Event=" + eventName);
if (!SYSTEM_HOOK_EVENT.equals(eventName)) {
String message = "Unsupported X-Gitlab-Event, event Name=" + eventName;
LOGGER.warning(message);
throw new GitLabApiException(message);
}
// Get the JSON as a JsonNode tree. We do not directly unmarshal the input as special handling must
// be done for "merge_request" events.
JsonNode tree;
try {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(HttpRequestUtils.getShortRequestDump("System Hook", true, request));
String postData = HttpRequestUtils.getPostDataAsString(request);
LOGGER.fine("Raw POST data:\n" + postData);
tree = jacksonJson.readTree(postData);
} else {
InputStreamReader reader = new InputStreamReader(request.getInputStream());
tree = jacksonJson.readTree(reader);
}
} catch (Exception e) {
LOGGER.warning("Error reading JSON data, exception=" +
e.getClass().getSimpleName() + ", error=" + e.getMessage());
throw new GitLabApiException(e);
}
// NOTE: This is a hack based on the GitLab documentation and actual content of the "merge_request" event
// showing that the "event_name" property is missing from the merge_request system hook event. The hack is
// to inject the "event_name" node so that the polymorphic deserialization of a SystemHookEvent works correctly
// when the system hook event is a "merge_request" event.
if (!tree.has("event_name") && tree.has("object_kind")) {
String objectKind = tree.get("object_kind").asText();
if (MergeRequestSystemHookEvent.MERGE_REQUEST_EVENT.equals(objectKind)) {
ObjectNode node = (ObjectNode)tree;
node.put("event_name", MergeRequestSystemHookEvent.MERGE_REQUEST_EVENT);
} else {
String message = "Unsupported object_kind for system hook event, object_kind=" + objectKind;
LOGGER.warning(message);
throw new GitLabApiException(message);
}
}
// Unmarshal the tree to a concrete instance of a SystemHookEvent and fire the event to any listeners
try {
SystemHookEvent event = jacksonJson.unmarshal(SystemHookEvent.class, tree);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(event.getEventName() + "\n" + jacksonJson.marshal(event) + "\n");
}
StringBuffer requestUrl = request.getRequestURL();
event.setRequestUrl(requestUrl != null ? requestUrl.toString() : null);
event.setRequestQueryString(request.getQueryString());
fireEvent(event);
} catch (Exception e) {
LOGGER.warning("Error processing JSON data, exception=" +
e.getClass().getSimpleName() + ", error=" + e.getMessage());
throw new GitLabApiException(e);
}
} | java | public void handleEvent(HttpServletRequest request) throws GitLabApiException {
String eventName = request.getHeader("X-Gitlab-Event");
if (eventName == null || eventName.trim().isEmpty()) {
String message = "X-Gitlab-Event header is missing!";
LOGGER.warning(message);
return;
}
if (!isValidSecretToken(request)) {
String message = "X-Gitlab-Token mismatch!";
LOGGER.warning(message);
throw new GitLabApiException(message);
}
LOGGER.info("handleEvent: X-Gitlab-Event=" + eventName);
if (!SYSTEM_HOOK_EVENT.equals(eventName)) {
String message = "Unsupported X-Gitlab-Event, event Name=" + eventName;
LOGGER.warning(message);
throw new GitLabApiException(message);
}
// Get the JSON as a JsonNode tree. We do not directly unmarshal the input as special handling must
// be done for "merge_request" events.
JsonNode tree;
try {
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(HttpRequestUtils.getShortRequestDump("System Hook", true, request));
String postData = HttpRequestUtils.getPostDataAsString(request);
LOGGER.fine("Raw POST data:\n" + postData);
tree = jacksonJson.readTree(postData);
} else {
InputStreamReader reader = new InputStreamReader(request.getInputStream());
tree = jacksonJson.readTree(reader);
}
} catch (Exception e) {
LOGGER.warning("Error reading JSON data, exception=" +
e.getClass().getSimpleName() + ", error=" + e.getMessage());
throw new GitLabApiException(e);
}
// NOTE: This is a hack based on the GitLab documentation and actual content of the "merge_request" event
// showing that the "event_name" property is missing from the merge_request system hook event. The hack is
// to inject the "event_name" node so that the polymorphic deserialization of a SystemHookEvent works correctly
// when the system hook event is a "merge_request" event.
if (!tree.has("event_name") && tree.has("object_kind")) {
String objectKind = tree.get("object_kind").asText();
if (MergeRequestSystemHookEvent.MERGE_REQUEST_EVENT.equals(objectKind)) {
ObjectNode node = (ObjectNode)tree;
node.put("event_name", MergeRequestSystemHookEvent.MERGE_REQUEST_EVENT);
} else {
String message = "Unsupported object_kind for system hook event, object_kind=" + objectKind;
LOGGER.warning(message);
throw new GitLabApiException(message);
}
}
// Unmarshal the tree to a concrete instance of a SystemHookEvent and fire the event to any listeners
try {
SystemHookEvent event = jacksonJson.unmarshal(SystemHookEvent.class, tree);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(event.getEventName() + "\n" + jacksonJson.marshal(event) + "\n");
}
StringBuffer requestUrl = request.getRequestURL();
event.setRequestUrl(requestUrl != null ? requestUrl.toString() : null);
event.setRequestQueryString(request.getQueryString());
fireEvent(event);
} catch (Exception e) {
LOGGER.warning("Error processing JSON data, exception=" +
e.getClass().getSimpleName() + ", error=" + e.getMessage());
throw new GitLabApiException(e);
}
} | [
"public",
"void",
"handleEvent",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"GitLabApiException",
"{",
"String",
"eventName",
"=",
"request",
".",
"getHeader",
"(",
"\"X-Gitlab-Event\"",
")",
";",
"if",
"(",
"eventName",
"==",
"null",
"||",
"eventName",
... | Parses and verifies an SystemHookEvent instance from the HTTP request and
fires it off to the registered listeners.
@param request the HttpServletRequest to read the Event instance from
@throws GitLabApiException if the parsed event is not supported | [
"Parses",
"and",
"verifies",
"an",
"SystemHookEvent",
"instance",
"from",
"the",
"HTTP",
"request",
"and",
"fires",
"it",
"off",
"to",
"the",
"registered",
"listeners",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/systemhooks/SystemHookManager.java#L57-L135 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RunnersApi.java | RunnersApi.getRunnersStream | public Stream<Runner> getRunnersStream(Runner.RunnerStatus scope) throws GitLabApiException {
return (getRunners(scope, getDefaultPerPage()).stream());
} | java | public Stream<Runner> getRunnersStream(Runner.RunnerStatus scope) throws GitLabApiException {
return (getRunners(scope, getDefaultPerPage()).stream());
} | [
"public",
"Stream",
"<",
"Runner",
">",
"getRunnersStream",
"(",
"Runner",
".",
"RunnerStatus",
"scope",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"getRunners",
"(",
"scope",
",",
"getDefaultPerPage",
"(",
")",
")",
".",
"stream",
"(",
")",
")... | Get a Stream of all available runners available to the user with pagination support.
<pre><code>GitLab Endpoint: GET /runners</code></pre>
@param scope The scope of specific runners to show, one of: active, paused, online; showing all runners null
@return Stream of Runners
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"Stream",
"of",
"all",
"available",
"runners",
"available",
"to",
"the",
"user",
"with",
"pagination",
"support",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L68-L70 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RunnersApi.java | RunnersApi.getRunners | public Pager<Runner> getRunners(Runner.RunnerStatus scope, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("scope", scope, false);
return (new Pager<>(this, Runner.class, itemsPerPage, formData.asMap(), "runners"));
} | java | public Pager<Runner> getRunners(Runner.RunnerStatus scope, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm().withParam("scope", scope, false);
return (new Pager<>(this, Runner.class, itemsPerPage, formData.asMap(), "runners"));
} | [
"public",
"Pager",
"<",
"Runner",
">",
"getRunners",
"(",
"Runner",
".",
"RunnerStatus",
"scope",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
"withParam",
"(",
"... | Get a list of specific runners available to the user.
<pre><code>GitLab Endpoint: GET /runners</code></pre>
@param scope the scope of specific runners to show, one of: active, paused, online; showing all runners null
@param itemsPerPage The number of Runner instances that will be fetched per page
@return a Pager containing the Runners for the user
@throws GitLabApiException if any exception occurs | [
"Get",
"a",
"list",
"of",
"specific",
"runners",
"available",
"to",
"the",
"user",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L130-L133 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RunnersApi.java | RunnersApi.getRunnerDetail | public RunnerDetail getRunnerDetail(Integer runnerId) throws GitLabApiException {
if (runnerId == null) {
throw new RuntimeException("runnerId cannot be null");
}
Response response = get(Response.Status.OK, null, "runners", runnerId);
return (response.readEntity(RunnerDetail.class));
} | java | public RunnerDetail getRunnerDetail(Integer runnerId) throws GitLabApiException {
if (runnerId == null) {
throw new RuntimeException("runnerId cannot be null");
}
Response response = get(Response.Status.OK, null, "runners", runnerId);
return (response.readEntity(RunnerDetail.class));
} | [
"public",
"RunnerDetail",
"getRunnerDetail",
"(",
"Integer",
"runnerId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"runnerId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"runnerId cannot be null\"",
")",
";",
"}",
"Response",
"re... | Get details of a runner.
<pre><code>GitLab Endpoint: GET /runners/:id</code></pre>
@param runnerId Runner id to get details for
@return RunnerDetail instance.
@throws GitLabApiException if any exception occurs | [
"Get",
"details",
"of",
"a",
"runner",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L256-L264 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RunnersApi.java | RunnersApi.updateRunner | public RunnerDetail updateRunner(Integer runnerId, String description, Boolean active, List<String> tagList,
Boolean runUntagged, Boolean locked, RunnerDetail.RunnerAccessLevel accessLevel) throws GitLabApiException {
if (runnerId == null) {
throw new RuntimeException("runnerId cannot be null");
}
GitLabApiForm formData = new GitLabApiForm()
.withParam("description", description, false)
.withParam("active", active, false)
.withParam("tag_list", tagList, false)
.withParam("run_untagged", runUntagged, false)
.withParam("locked", locked, false)
.withParam("access_level", accessLevel, false);
Response response = put(Response.Status.OK, formData.asMap(), "runners", runnerId);
return (response.readEntity(RunnerDetail.class));
} | java | public RunnerDetail updateRunner(Integer runnerId, String description, Boolean active, List<String> tagList,
Boolean runUntagged, Boolean locked, RunnerDetail.RunnerAccessLevel accessLevel) throws GitLabApiException {
if (runnerId == null) {
throw new RuntimeException("runnerId cannot be null");
}
GitLabApiForm formData = new GitLabApiForm()
.withParam("description", description, false)
.withParam("active", active, false)
.withParam("tag_list", tagList, false)
.withParam("run_untagged", runUntagged, false)
.withParam("locked", locked, false)
.withParam("access_level", accessLevel, false);
Response response = put(Response.Status.OK, formData.asMap(), "runners", runnerId);
return (response.readEntity(RunnerDetail.class));
} | [
"public",
"RunnerDetail",
"updateRunner",
"(",
"Integer",
"runnerId",
",",
"String",
"description",
",",
"Boolean",
"active",
",",
"List",
"<",
"String",
">",
"tagList",
",",
"Boolean",
"runUntagged",
",",
"Boolean",
"locked",
",",
"RunnerDetail",
".",
"RunnerAc... | Update details of a runner.
<pre><code>GitLab Endpoint: PUT /runners/:id</code></pre>
@param runnerId The ID of a runner
@param description The description of a runner
@param active The state of a runner; can be set to true or false
@param tagList The list of tags for a runner; put array of tags, that should be finally assigned to a runner
@param runUntagged Flag indicating the runner can execute untagged jobs
@param locked Flag indicating the runner is locked
@param accessLevel The access_level of the runner; not_protected or ref_protected
@return RunnerDetail instance.
@throws GitLabApiException if any exception occurs | [
"Update",
"details",
"of",
"a",
"runner",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L281-L296 | train |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RunnersApi.java | RunnersApi.removeRunner | public void removeRunner(Integer runnerId) throws GitLabApiException {
if (runnerId == null) {
throw new RuntimeException("runnerId cannot be null");
}
delete(Response.Status.NO_CONTENT, null, "runners", runnerId);
} | java | public void removeRunner(Integer runnerId) throws GitLabApiException {
if (runnerId == null) {
throw new RuntimeException("runnerId cannot be null");
}
delete(Response.Status.NO_CONTENT, null, "runners", runnerId);
} | [
"public",
"void",
"removeRunner",
"(",
"Integer",
"runnerId",
")",
"throws",
"GitLabApiException",
"{",
"if",
"(",
"runnerId",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"runnerId cannot be null\"",
")",
";",
"}",
"delete",
"(",
"Response... | Remove a runner.
<pre><code>GitLab Endpoint: DELETE /runners/:id</code></pre>
@param runnerId The ID of a runner
@throws GitLabApiException if any exception occurs | [
"Remove",
"a",
"runner",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RunnersApi.java#L306-L313 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.