spira

Crates.iospira
lib.rsspira
version0.0.6
sourcesrc
created_at2022-03-17 09:52:14.564443
updated_at2022-11-15 15:59:10.748102
descriptionRust client implementation for Inflectra Spira API
homepage
repositoryhttps://github.com/alxolr/spira
max_upload_size
id551698
size28,122
Alexandru Olaru (alxolr)

documentation

README

spira@0.0.6

Inflectra Spira Rust Client

Usage

use spira::{resources::project::ProjectDto, SpiraClient};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let api_key = env::var("SPIRA_API_KEY")?;
    let username = env::var("SPIRA_USERNAME")?;
    let base_url = env::var("SPIRA_API_URL")?;

    let spira_client = SpiraClient::new(&base_url, &api_key, &username)?;
    let projects = spira_client.project.list().await?;

    println!("{:#?}", projects);
    Ok(())
}

Documentation

Crate spira@0.0.6 docs

Task

Getting a task by id

/// ...
let task: TaskDto = spira_client.task.get(100 /* project_id */, task_id /* task_id */).await?;

Requirement

Getting a requirement by id

/// ...
let requirement: RequirementDto = spira_client.requirement.get(100 /* project_id */, 1500 /* requirement_id */).await?;
Commit count: 13

cargo fmt