heroku_rs 0.3.0

Rust bindings for the Heroku API
Documentation

heroku-rs

crates.io Documentation MIT/Apache-2 licensed CI

This project is currently under development

Intro

This is a rust api wrapper for the Heroku v3 API.

Getting Started

Add the following to your Cargo.toml

[dependencies]
heroku_rs = "0.3"

run: cargo build

Here's a simple example which fetches the apps list. At the moment, the client is blocking by default.

use heroku_rs::framework::{
    auth::Credentials,
    response::{ApiResponse, ApiResult},
    apiclient::HerokuApiClient,
    ApiEnvironment, HttpApiClient, HttpApiClientConfig,
};
use heroku_rs::endpoints::apps;

fn main() -> Result<(), Box<dyn std::error::Error>> {

    let credentials = Credentials::UserAuthToken {
        token: String::from("TOKEN_HERE"),
    };

    let api_client = HttpApiClient::new(
        credentials,
        HttpApiClientConfig::default(),
        ApiEnvironment::Production,
    )?;

    let response = api_client.request(&apps::AppList {});

    match response {
        Ok(success) => println!("Success: {:#?}", success),
        Err(e) => println!("Error: {}", e),
    }

    Ok(())
}

Useful links

Heroku quickstart

Heroku API reference

Generating a heroku API key

License

Licensed under either of

at your option.

Licensing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.