Module api

Module api 

Source
Expand description

High-level API operations for GitLab resources.

This module provides builder-pattern APIs for interacting with GitLab resources in a fluent, ergonomic way.

§API Patterns

This library uses different patterns for different types of operations:

§1. Resource-specific operations (via client methods)

For operations on specific resources, use the client methods:

// Single resource operations
let pipeline = client.pipeline("project", 123).get().await?;
let job = client.job("project", 456).get().await?;

// List operations with filters
let pipelines = client.pipelines("project")
    .status(lmrc_gitlab::models::PipelineStatus::Failed)
    .list()
    .await?;

§2. Project-level operations

For operations at the project scope (creating resources, etc.):

// Create/trigger new pipeline
let pipeline = client.project("myproject")
    .create_pipeline()
    .ref_name("main")
    .variable("ENV", "prod")
    .trigger()
    .await?;

§3. Direct API access

For operations not yet wrapped, use the underlying client:

// Access the raw gitlab crate client
let raw_client = client.client();

// Use any gitlab API endpoint
// let endpoint = ...;
// let result = endpoint.query(raw_client)?;

Re-exports§

pub use jobs::JobBuilder;
pub use jobs::JobListBuilder;
pub use pipelines::PipelineBuilder;
pub use pipelines::PipelineListBuilder;
pub use projects::CreatePipelineBuilder;
pub use projects::ProjectBuilder;
pub use variables::VariableBuilder;

Modules§

jobs
Job API operations with builder pattern.
pipelines
Pipeline API operations with builder pattern.
projects
Project API operations.
variables
Project CI/CD variables API operations.