CommitsEndpointGroup
public class CommitsEndpointGroup : EndpointGroup
This EndpointGroup communicates with Commits API
-
Get an observable of list of repository commits in a project.
Optional Query Parameters:
- ref_name: String - The name of a repository branch or tag or if not given the default branch
- since: String - Only commits after or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ
- until: String - Only commits before or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ
- path: String - The file path
- all: Boolean - Retrieve every commit from the repository
with_stats: Boolean - Stats about each commit will be added to the response
Declaration
Swift
public func getCommits(projectID: Int, parameters: QueryParameters? = nil, page: Int = 1, perPage: Int = RxGitLabAPIClient.defaultPerPage) -> Observable<[Commit]>
Parameters
projectID
The ID or URL-encoded path of the project
Return Value
An
Observable
of list of repositoryCommit
s in a project -
Get a paginator of list of repository commits in a project.
Optional Query Parameters:
- ref_name: String - The name of a repository branch or tag or if not given the default branch
- since: String - Only commits after or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ
- until: String - Only commits before or on this date will be returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ
- path: String - The file path
- all: Boolean - Retrieve every commit from the repository
with_stats: Boolean - Stats about each commit will be added to the response
Declaration
Swift
public func getCommits(projectID: Int, perPage: Int = RxGitLabAPIClient.defaultPerPage, parameters: QueryParameters? = nil) -> Paginator<Commit>
Parameters
projectID
The ID or URL-encoded path of the project
Return Value
A Paginator of commits
-
Get a specific commit identified by the commit hash or name of a branch or tag.
Optional Query Parameters:
stats: Bool - Include commit stats. Default is true
Declaration
Swift
public func getCommit(projectID: Int, sha: String, parameters: QueryParameters? = nil) -> Observable<Commit>
Parameters
projectID
The ID or URL-encoded path of the project owned by the
sha
The commit hash or name of a repository branch or tag
Return Value
An
Observable
ofCommit
-
Get all references (from branches or tags) a commit is pushed to. The pagination parameters page and per_page can be used to restrict the list of references.
Optional Query Parameters:
type: String - The scope of commits. Possible values
branch
,tag
,all
. Default isall
Declaration
Swift
public func getReferences(projectID: Int, sha: String, parameters: QueryParameters? = nil, page: Int = 1, perPage: Int = RxGitLabAPIClient.defaultPerPage) -> Observable<[Reference]>
Parameters
projectID
The ID or URL-encoded path of the project
sha
The commit hash or name of a repository branch or tag
Return Value
An
Observable
of list ofReference
-
Get a paginator of references (from branches or tags) a commit is pushed to.
Query Parameters:
- Optional:
type: String - The scope of commits. Possible values
branch
,tag
,all
. Default isall
Parameters
projectID
The ID or URL-encoded path of the project owned by the user
sha
The commit hash or name of a repository branch or tag
-
Adds a comment to a commit.-
In order to post a comment in a particular line of a particular file, you must specify the full commit SHA, the path, the
line
andline_type
should benew
. The comment will be added at the end of the last commit if at least one of the cases below is valid:- the
sha
is instead a branch or a tag and theline
orpath
are invalid - the
line
number is invalid (does not exist) - the
path
is invalid (does not exist) In any of the above cases, the response of
line
,line_type
andpath
is set tonull
.
Declaration
Parameters
comment
Comment
projectID
The ID or URL-encoded path of the project owned by the
sha
The commit has
Return Value
An
Observable
ofComment
- the
-
Get the comments of a commit in a project.
Declaration
Swift
public func getStatuses(projectID: Int, sha: String) -> Observable<[CommitStatus]>
Parameters
projectID
The ID or URL-encoded path of the project owned by the
sha
The commit has
Return Value
An
Observable
ofComment
-
Adds or updates a build status of a commit.
Declaration
Swift
public func postStatus(status: BuildStatus, projectID: Int, sha: String) -> Observable<CommitStatus>
Parameters
projectID
The ID or URL-encoded path of the project owned by the
sha
The commit has
Return Value
An
Observable
ofStatus
-
Get a list of Merge Requests related to the specified commit.
Declaration
Swift
public func getMergeRequests(projectID: Int, sha: String) -> Observable<[MergeRequest]>
Parameters
projectID
The ID or URL-encoded path of the project owned by the
sha
The commit SHA
Return Value
An
Observable
of list ofMergeRequest
s