heroku_rs

crates.io Documentation MIT/Apache-2 licensed CI

Intro

This crate is a API wrapper for the Heroku v3 API.

See the documentation for more information on which endpoints are covered by the crate.

Getting Started

Add the following to your Cargo.toml and run cargo build. Voila.

toml [dependencies] heroku_rs = "0.5"

See FEATURES documentation for more information about the configurations of the crate.

Example

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

```rust use heroku_rs::prelude::*;

fn main() -> Result<(), Box> { let apiclient = HttpApiClient::create("APIKEY")?; let response = api_client.request(&apps::AppList {});

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

Ok(())

} ```

You can also call custom endpoints that have not been supported by the library yet. e.g. :

```rust use heroku_rs::prelude::*;

fn main() -> Result<(), Box> { let apiclient = HttpApiClient::create("APIKEY")?;

// This will do a GET request on https://api.heroku.com/apps/my_app_name_here
let query = format!("{}{}", "apps/", "my_app_name_here");
let method = Method::Get;
let response = api_client.request(&custom::CustomEndpointSimple::new(query, method));

Ok(())

}

```

See more examples on how to use these custom endpoints.

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.