public class CommitsApi extends AbstractApi
Constants.ActionType, Constants.ArchiveFormat, Constants.CommitBuildState, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.ImpersonationState, Constants.IssueOrderBy, 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 and Description |
|---|
CommitsApi(GitLabApi gitLabApi) |
| Modifier and Type | Method and Description |
|---|---|
Comment |
addComment(Object projectIdOrPath,
String sha,
String note)
Add a comment to a commit.
|
Comment |
addComment(Object projectIdOrPath,
String sha,
String note,
String path,
Integer line,
Constants.LineType lineType)
Add a comment to a commit.
|
CommitStatus |
addCommitStatus(Object projectIdOrPath,
String sha,
Constants.CommitBuildState state,
CommitStatus status)
Add or update the build status of a commit.
|
Commit |
createCommit(Object projectIdOrPath,
String branch,
String commitMessage,
String startBranch,
String authorEmail,
String authorName,
List<CommitAction> actions)
Create a commit with multiple files and actions.
|
List<Comment> |
getComments(Object projectIdOrPath,
String sha)
Get the comments of a commit in a project.
|
Pager<Comment> |
getComments(Object projectIdOrPath,
String sha,
int itemsPerPage)
Get a Pager of the comments of a commit in a project.
|
Commit |
getCommit(Object projectIdOrPath,
String sha)
Get a specific commit identified by the commit hash or name of a branch or tag.
|
List<CommitRef> |
getCommitRefs(Object projectIdOrPath,
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(Object projectIdOrPath,
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(Object projectIdOrPath)
Get a list of repository commits in a project.
|
Pager<Commit> |
getCommits(Object projectIdOrPath,
int itemsPerPage)
Get a Pager of repository commits in a project.
|
List<Commit> |
getCommits(Object projectIdOrPath,
int page,
int perPage)
Get a list of repository commits in a project.
|
List<Commit> |
getCommits(Object projectIdOrPath,
String ref,
Date since,
Date until)
Get a list of repository commits in a project.
|
Pager<Commit> |
getCommits(Object projectIdOrPath,
String ref,
Date since,
Date until,
int itemsPerPage)
Get a Pager of repository commits in a project.
|
List<Commit> |
getCommits(Object projectIdOrPath,
String ref,
Date since,
Date until,
int page,
int perPage)
Get a list of repository commits in a project.
|
List<Commit> |
getCommits(Object projectIdOrPath,
String ref,
Date since,
Date until,
String path)
Get a list of repository commits in a project.
|
Pager<Commit> |
getCommits(Object projectIdOrPath,
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(Object projectIdOrPath,
String ref,
Date since,
Date until,
String path,
int page,
int perPage)
Get a list of repository commits in a project.
|
List<Commit> |
getCommits(Object projectIdOrPath,
String ref,
String path)
Get a list of file commits in a project
GET /projects/:id/repository/commits?path=:file_path
|
List<CommitStatus> |
getCommitStatuses(Object projectIdOrPath,
String sha,
CommitStatusFilter filter)
Get a list of repository commit statuses that meet the provided filter.
|
Pager<CommitStatus> |
getCommitStatuses(Object projectIdOrPath,
String sha,
CommitStatusFilter filter,
int itemsPerPage)
Get a Pager of repository commit statuses that meet the provided filter.
|
List<CommitStatus> |
getCommitStatuses(Object projectIdOrPath,
String sha,
CommitStatusFilter filter,
int page,
int perPage)
Get a list of repository commit statuses that meet the provided filter.
|
List<Diff> |
getDiff(Object projectIdOrPath,
String sha)
Get the list of diffs of a commit in a project.
|
Optional<Commit> |
getOptionalCommit(Object projectIdOrPath,
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, getDefaultPerPageParam, getGroupIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, putUpload, putUpload, putWithFormData, upload, upload, urlEncode, validatepublic CommitsApi(GitLabApi gitLabApi)
public List<Commit> getCommits(Object projectIdOrPath) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancepage - the page to getperPage - the number of commits per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<Commit> getCommits(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceitemsPerPage - the number of Commit instances that will be fetched per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Commit> getCommits(Object projectIdOrPath, String ref, Date since, Date until) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String ref, Date since, Date until, String path) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String ref, String path) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String ref, Date since, Date until, int page, int perPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String ref, Date since, Date until, String path, int page, int perPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String ref, Date since, Date until, int itemsPerPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String ref, Date since, Date until, String path, int itemsPerPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instanceref - 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(Object projectIdOrPath, String sha) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic Optional<Commit> getOptionalCommit(Object projectIdOrPath, String sha)
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - a commit hash or name of a branch or tagpublic List<CommitRef> getCommitRefs(Object projectIdOrPath, String sha) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<CommitRef> getCommitRefs(Object projectIdOrPath, String sha, CommitRef.RefType refType) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - 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<CommitStatus> getCommitStatuses(Object projectIdOrPath, String sha, CommitStatusFilter filter) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - the commit SHAfilter - the commit statuses file, contains ref, stage, name, allGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<CommitStatus> getCommitStatuses(Object projectIdOrPath, String sha, CommitStatusFilter filter, int page, int perPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - the commit SHAfilter - the commit statuses file, contains ref, stage, name, allpage - the page to getperPage - the number of commits statuses per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<CommitStatus> getCommitStatuses(Object projectIdOrPath, String sha, CommitStatusFilter filter, int itemsPerPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - the commit SHAfilter - the commit statuses file, contains ref, stage, name, allitemsPerPage - the number of CommitStatus instances that will be fetched per pageGitLabApiException - GitLabApiException if any exception occurs during executionpublic CommitStatus addCommitStatus(Object projectIdOrPath, String sha, Constants.CommitBuildState state, CommitStatus status) throws GitLabApiException
Add or update the build status of a commit. The following fluent methods are available on the CommitStatus instance for setting up the status:
withCoverage(Float)
withDescription(String)
withName(String)
withRef(String)
withTargetUrl(String)
POST /projects/:id/statuses/:sha
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance (required)sha - a commit SHA (required)state - the state of the status. Can be one of the following: PENDING, RUNNING, SUCCESS, FAILED, CANCELED (required)status - the CommitSatus instance hoilding the optional parms: ref, name, target_url, description, and coverageGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Diff> getDiff(Object projectIdOrPath, String sha) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic List<Comment> getComments(Object projectIdOrPath, String sha) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - a commit hash or name of a branch or tagGitLabApiException - GitLabApiException if any exception occurs during executionpublic Pager<Comment> getComments(Object projectIdOrPath, String sha, int itemsPerPage) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - 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(Object projectIdOrPath, String sha, String note, String path, Integer line, Constants.LineType lineType) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - 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(Object projectIdOrPath, String sha, String note) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancesha - 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(Object projectIdOrPath, String branch, String commitMessage, String startBranch, String authorEmail, String authorName, List<CommitAction> actions) throws GitLabApiException
projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instancebranch - 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.