Rust SDK for OP REST API
To be published to crates.io
See apis crate for all available clients. Example of getting account data:
use op_api_sdk::apis::accounts::Accounts;
use op_api_sdk::options::Options;
use tokio;
#[tokio::main]
async fn main() {
let mut options = Options::new_dev(String::from("X_API_KEY"));
options.set_version("v3".to_string());
let accounts = Accounts::new(options).accounts().await.unwrap();
println!("{:?}", accounts);
}See requests for required headers.
For further reading, please see our API documentation
Few guidelines for developing this library:
- Follow Rust API Guidelines
- Keep formatting consistent by using
cargo fmtfor all changes - Use
cargo clippyto find possible lint errors and warnings - Always add tests to your functionality, prefer TDD. Use /tests/ folder.
- Always run tests before pushing to remote
Tests depend to real sandbox data.
- Register at https://op-developer.fi/developers/register
- Create an app that has access to all sandbox products (Mobility, Banking, etc)
- Run tests with
X_API_KEY=<your api key> cargo test
To enable debug logging from the library set up the RUST_LOG environment variable
export RUST_LOG=op_api_sdk=debug