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 repository Commits 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

  • Create a commit

    Declaration

    Swift

    public func createCommit(projectID: Int, newCommit: NewCommit) -> Observable<Commit>

    Parameters

    projectID

    The ID or URL-encoded path of the project owned by the

    newCommit

    newCommit

    Return Value

    An Observable of accepted Commit

  • 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 of Commit

  • 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 is all

    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 of Reference

  • 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 is all

    Declaration

    Swift

    public func getReferences(projectID: Int, sha: String) -> Paginator<Reference>

    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

    Return Value

    A Paginator of Reference

  • Cherry picks a commit to a given branch.

    Declaration

    Swift

    public func cherryPick(projectID: Int, sha: String, branch: String) -> Observable<Commit>

    Parameters

    projectID

    The ID or URL-encoded path of the project

    sha

    The commit has

    branch

    The name of the branch

    Return Value

    An Observable of Commit

  • Reverts a commit in a given branch.

    Declaration

    Swift

    public func revert(projectID: Int, sha: String, branch: String) -> Observable<Commit>

    Parameters

    projectID

    The ID or URL-encoded path of the project

    sha

    The commit has

    branch

    The name of the branch

    Return Value

    An Observable of Commit

  • Get the diff of a commit in a project.

    Declaration

    Swift

    public func getDiff(projectID: Int, sha: String) -> Observable<Diff>

    Parameters

    projectID

    The ID or URL-encoded path of the project

    sha

    The commit has

    Return Value

    An Observable of Diff

  • Get the comments of a commit in a project.

    Declaration

    Swift

    public func getComments(projectID: Int, sha: String) -> Observable<[Comment]>

    Parameters

    projectID

    The ID or URL-encoded path of the project owned by the

    sha

    The commit has

    Return Value

    An Observable of Comment

  • 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 and line_type should be new. 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 the line or path 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 and path is set to null.

    Declaration

    Swift

    public func postComment(comment: Comment, projectID: Int, sha: String) -> Observable<Comment>

    Parameters

    comment

    Comment

    projectID

    The ID or URL-encoded path of the project owned by the

    sha

    The commit has

    Return Value

    An Observable of Comment

  • 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 of Comment

  • 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 of Status

  • 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 of MergeRequests