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.
Add the following to your Cargo.toml
and run cargo build
. Voila.
toml
[dependencies]
heroku_rs = "0.4.1"
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 herokurs::framework::{apiclient::HerokuApiClient, HttpApiClient}; use herokurs::endpoints::apps;
fn main() -> Result<(), Box
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 herokurs::framework::{apiclient::HerokuApiClient, HttpApiClient}; use herokurs::framework::endpoint::Method; use heroku_rs::endpoints::custom;
fn main() -> Result<(), Box
let api_client = HttpApiClient::create("API_KEY")?;
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.
Licensed under either of
at your option.
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.