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
projectIDThe ID or URL-encoded path of the project
Return Value
An
Observableof list of repositoryCommits 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
projectIDThe 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
projectIDThe ID or URL-encoded path of the project owned by the
shaThe commit hash or name of a repository branch or tag
Return Value
An
ObservableofCommit -
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
projectIDThe ID or URL-encoded path of the project
shaThe commit hash or name of a repository branch or tag
Return Value
An
Observableof 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
projectIDThe ID or URL-encoded path of the project owned by the user
shaThe 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
lineandline_typeshould benew. The comment will be added at the end of the last commit if at least one of the cases below is valid:- the
shais instead a branch or a tag and thelineorpathare invalid - the
linenumber is invalid (does not exist) - the
pathis invalid (does not exist) In any of the above cases, the response of
line,line_typeandpathis set tonull.
Declaration
Parameters
commentComment
projectIDThe ID or URL-encoded path of the project owned by the
shaThe commit has
Return Value
An
ObservableofComment - the
-
Get the comments of a commit in a project.
Declaration
Swift
public func getStatuses(projectID: Int, sha: String) -> Observable<[CommitStatus]>Parameters
projectIDThe ID or URL-encoded path of the project owned by the
shaThe commit has
Return Value
An
ObservableofComment -
Adds or updates a build status of a commit.
Declaration
Swift
public func postStatus(status: BuildStatus, projectID: Int, sha: String) -> Observable<CommitStatus>Parameters
projectIDThe ID or URL-encoded path of the project owned by the
shaThe commit has
Return Value
An
ObservableofStatus -
Get a list of Merge Requests related to the specified commit.
Declaration
Swift
public func getMergeRequests(projectID: Int, sha: String) -> Observable<[MergeRequest]>Parameters
projectIDThe ID or URL-encoded path of the project owned by the
shaThe commit SHA
Return Value
An
Observableof list ofMergeRequests
CommitsEndpointGroup Class Reference