Constantspublic class CommitsApi extends AbstractApi
Constants.ActionType, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.SortOrder, Constants.StateEvent, Constants.TargetType, Constants.TokenTypeNEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER| Constructor | Description |
|---|---|
CommitsApi(GitLabApi gitLabApi) |
| Modifier and Type | Method | Description |
|---|---|---|
Comment |
addComment(int projectId,
String sha,
String note) |
Add a comment to a commit.
|
Comment |
addComment(int projectId,
String sha,
String note,
String path,
Integer line,
Constants.LineType lineType) |
Add a comment to a commit.
|
Commit |
createCommit(int projectId,
String branch,
String commitMessage,
String startBranch,
String authorEmail,
String authorName,
List<CommitAction> actions) |
Create a commit with multiple files and actions.
|
Commit |
createCommit(String project,
String branch,
String commitMessage,
String startBranch,
String authorEmail,
String authorName,
List<CommitAction> actions) |
Create a commit with multiple files and actions.
|
List<Comment> |
getComments(int projectId,
String sha) |
Get the comments of a commit in a project.
|
Pager<Comment> |
getComments(int projectId,
String sha,
int itemsPerPage) |
Get a Pager of the comments of a commit in a project.
|
Commit |
getCommit(int projectId,
String sha) |
Get a specific commit identified by the commit hash or name of a branch or tag.
|
List<CommitRef> |
getCommitRefs(int projectId,
String sha) |
Get a specific commit identified by the commit hash or name of a branch or tag as an Optional instance
GET /projects/:id/repository/commits/:sha/refs
|
List<CommitRef> |
getCommitRefs(int projectId,
String sha,
CommitRef.RefType refType) |
Get a specific commit identified by the commit hash or name of a branch or tag as an Optional instance
GET /projects/:id/repository/commits/:sha/refs?type=:refType
|
List<Commit> |
getCommits(int projectId) |
Get a list of repository commits in a project.
|
Pager<Commit> |
getCommits(int projectId,
int itemsPerPage) |
Get a Pager of repository commits in a project.
|
List<Commit> |
getCommits(int projectId,
int page,
int perPage) |
Get a list of repository commits in a project.
|
List<Commit> |
getCommits(int projectId,
String ref,
String path) |
Get a list of file commits in a project
GET /projects/:id/repository/commits?path=:file_path
|
List<Commit> |
getCommits(int projectId,
String ref,
Date since,
Date until) |
Get a list of repository commits in a project.
|
Pager<Commit> |
getCommits(int projectId,
String ref,
Date since,
Date until,
int itemsPerPage) |
Get a Pager of repository commits in a project.
|
List<Commit> |
getCommits(int projectId,
String ref,
Date since,
Date until,
int page,
int perPage) |
Get a list of repository commits in a project.
|
List<Commit> |
getCommits(int projectId,
String ref,
Date since,
Date until,
String path) |
Get a list of repository commits in a project.
|
Pager<Commit> |
getCommits(int projectId,
String ref,
Date since,
Date until,
String path,
int itemsPerPage) |
Get a Pager of repository commits in a project
GET /projects/:id/repository/commits
|
List<Commit> |
getCommits(int projectId,
String ref,
Date since,
Date until,
String path,
int page,
int perPage) |
Get a list of repository commits in a project.
|
List<Diff> |
getDiff(int projectId,
String sha) |
Get the list of diffs of a commit in a project.
|
List<Diff> |
getDiff(String projectPath,
String sha) |
Get the list of diffs of a commit in a project.
|
Optional<Commit> |
getOptionalCommit(int projectId,
String sha) |
Get a specific commit identified by the commit hash or name of a branch or tag as an Optional instance
GET /projects/:id/repository/commits/:sha
|
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getProjectIdOrPath, getWithAccepts, handle, isApiVersion, post, post, post, post, post, put, put, putWithFormData, upload, upload, urlEncode, validatepublic CommitsApi(GitLabApi gitLabApi)
public List<Commit> getCommits(int projectId) throws GitLabApiException
projectId - the project ID to get the list of commits forGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(int projectId, int page, int perPage) throws GitLabApiException
projectId - the project ID to get the list of commits forpage - the page to getperPage - the number of commits per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<Commit> getCommits(int projectId, int itemsPerPage) throws GitLabApiException
projectId - the project ID to get the list of commits foritemsPerPage - the number of Commit instances that will be fetched per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(int projectId, String ref, Date since, Date until) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchsince - only commits after or on this date will be returneduntil - only commits before or on this date will be returnedGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(int projectId, String ref, Date since, Date until, String path) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchsince - only commits after or on this date will be returneduntil - only commits before or on this date will be returnedpath - the path to file of a projectGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(int projectId, String ref, String path) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchpath - the path to file of a projectGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(int projectId, String ref, Date since, Date until, int page, int perPage) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchsince - only commits after or on this date will be returneduntil - only commits before or on this date will be returnedpage - the page to getperPage - the number of commits per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(int projectId, String ref, Date since, Date until, String path, int page, int perPage) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchsince - only commits after or on this date will be returneduntil - only commits before or on this date will be returnedpath - the path to file of a projectpage - the page to getperPage - the number of commits per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, int itemsPerPage) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchsince - only commits after or on this date will be returneduntil - only commits before or on this date will be returneditemsPerPage - the number of Commit instances that will be fetched per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<Commit> getCommits(int projectId, String ref, Date since, Date until, String path, int itemsPerPage) throws GitLabApiException
projectId - the project ID to get the list of commits forref - the name of a repository branch or tag or if not given the default branchsince - only commits after or on this date will be returneduntil - only commits before or on this date will be returneditemsPerPage - the number of Commit instances that will be fetched per pagepath - the path to file of a projectGitLabApiException - GitLabApiException if any exception occurs during executionpublic Commit getCommit(int projectId, String sha) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic Optional<Commit> getOptionalCommit(int projectId, String sha)
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagpublic List<CommitRef> getCommitRefs(int projectId, String sha) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<CommitRef> getCommitRefs(int projectId, String sha, CommitRef.RefType refType) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagrefType - the scope of commits. Possible values branch, tag, all. Default is all.GitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Diff> getDiff(int projectId, String sha) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Diff> getDiff(String projectPath, String sha) throws GitLabApiException
projectPath - the project path that the commit belongs tosha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Comment> getComments(int projectId, String sha) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<Comment> getComments(int projectId, String sha, int itemsPerPage) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagitemsPerPage - the number of Comment instances that will be fetched per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic Comment addComment(int projectId, String sha, String note, String path, Integer line, Constants.LineType lineType) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagnote - the text of the comment, requiredpath - the file path relative to the repository, optionalline - the line number where the comment should be placed, optionallineType - the line type, optionalGitLabApiException - GitLabApiException if any exception occurs during executionpublic Comment addComment(int projectId, String sha, String note) throws GitLabApiException
projectId - the project ID that the commit belongs tosha - a commit hash or name of a branch or tagnote - the text of the comment, requiredGitLabApiException - GitLabApiException if any exception occurs during executionpublic Commit createCommit(int projectId, String branch, String commitMessage, String startBranch, String authorEmail, String authorName, List<CommitAction> actions) throws GitLabApiException
projectId - the ID of the projectbranch - tame of the branch to commit into. To create a new branch, also provide startBranchcommitMessage - the commit messagestartBranch - the name of the branch to start the new commit fromauthorEmail - the commit author's email addressauthorName - the commit author's nameactions - the array of CommitAction to commit as a batchGitLabApiException - if any exception occurs during executionpublic Commit createCommit(String project, String branch, String commitMessage, String startBranch, String authorEmail, String authorName, List<CommitAction> actions) throws GitLabApiException
project - the path of the projectbranch - tame of the branch to commit into. To create a new branch, also provide startBranchcommitMessage - the commit messagestartBranch - the name of the branch to start the new commit fromauthorEmail - the commit author's email addressauthorName - the commit author's nameactions - the array of CommitAction to commit as a batchGitLabApiException - if any exception occurs during executionCopyright © 2018. All rights reserved.