#client-token #spec #open-api #generated #primer #model #primer-client

primer-api

primer client, generated from the OpenAPI spec

2 stable releases

2.0.0 Oct 21, 2022
1.0.0 Oct 21, 2022

#14 in #client-token

Download history 7/week @ 2024-02-17 99/week @ 2024-02-24 5/week @ 2024-03-02

111 downloads per month

MIT license

115KB
2K SLoC

GitHub Contributors Stars Build Status Downloads Crates.io

primer client, generated from the OpenAPI spec.

Usage

use primer_api::PrimerClient;
use primer_api::model::*;
#[tokio::main]
async fn main() {
    let client = PrimerClient::from_env();
    let response = client
        .retrieve_client_side_token_client_session_get()
        .client_token("your client token")
        .send()
        .await
        .unwrap();
    println!("{:#?}", response);
}

This example loads configuration from environment variables, specifically:

  • PRIMER_BASE_URL

  • PRIMER_API_KEY_AUTH

Installation

Add this to your Cargo.toml:

[dependencies]
primer-api = "0.1.0"

Documentation

You can see working examples of every API call in the examples/ directory.

Contributing

Contributions are welcome!

Library created with Libninja.

Dependencies

~15–28MB
~551K SLoC