Struct gitlab_api::gitlab::GitLab [] [src]

pub struct GitLab { /* fields omitted */ }

Methods

impl GitLab
[src]

Build a URL used to access GitLab instance, including some parameters.

Examples

Example from GitLab: https://docs.gitlab.com/ce/api/#basic-usage

use gitlab_api::GitLab;

let expected_url = "https://gitlab.example.com\
                    /api/v3/groups?order_by=path&private_token=XXXXXXXXXXXXXXXXXXXX";

let gl = GitLab::new("gitlab.example.com", "XXXXXXXXXXXXXXXXXXXX").unwrap();

assert_eq!(gl.build_url("groups?order_by=path").unwrap(), expected_url);

Perform an HTTP GET to the GitLab server from a specific query.

The query is simply the string part appearing in the GET URL. For example, for a GET https://www.example.com/projects/:id/merge_requests?iid=42, the query is projects/:id/merge_requests?iid=42.

The method can be paginated if page and per_page is provided.

Notes:

  • This method is meant to be used internally;
  • Until all BuildQuery::build_query()s use serde_urlencoded, the query paramter will have to remain a string.

Returns a specific GitLab type, wrapped in a Result.

Get a specific "namespace/name" project. NOTE: We can't search for "namespace/name", so we search for "name", and refine the match on the namespace. This means the operation could be slow as multiple query to the GitLab server might be required to find the right item.

Get a project issue from a its project's namespace and name and the issue's iid.

Since GitLab uses unique ids in its API and not iids, we will need to list issues (grouped by pages of 20) until we find the proper issue matching the id requested.

Note: A iid is the issue number as seen by normal user, for example appearing on a GitLab URL. This iid can be used to reference an issue (in other issues, in commit messages, etc.) by prepending a pound sign to it, for example #3. An id, instead, is GitLab's internal and unique id associated with the issue.

Because we need to search (and thus query the GitLab server possibly multiple times), this can be a slow operation if there is many issues in the project.

Get a project merge request from a its project's namespace and name and the issue's iid.

Since GitLab uses unique ids in its API and not iids, we will need to list issues (grouped by pages of 20) until we find the proper issue matching the id requested.

Note: A iid is the issue number as seen by normal user, for example appearing on a GitLab URL. This iid can be used to reference an issue (in other issues, in commit messages, etc.) by prepending a pound sign to it, for example #3. An id, instead, is GitLab's internal and unique id associated with the issue.

Because we need to search (and thus query the GitLab server possibly multiple times), this can be a slow operation if there is many issues in the project.

Trait Implementations

impl Debug for GitLab
[src]

Formats the value using the given formatter.