op-api-sdk

Crates.ioop-api-sdk
lib.rsop-api-sdk
version0.1.0
sourcesrc
created_at2020-10-09 09:50:19.831466
updated_at2020-10-09 09:50:19.831466
descriptionRust SDK for OP REST API
homepagehttps://op-developer.fi/
repositoryhttps://github.com/drodil/op-api-rust-sdk/
max_upload_size
id297567
size60,160
drodil (drodil)

documentation

README

op-api-rust-sdk

MIT License Contributors Issues PRs

Rust SDK for OP REST API

Installation

To be published to crates.io

Usage

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;

#[tokio::main]
async fn main() {
    let options = Options::new_dev(String::from("X_API_KEY"))
                      .with_version("v3".to_string());
    let accounts = Accounts::new(options).accounts().await.unwrap();
    println!("{:?}", accounts);
}

Additional examples available in the Examples directory.

See requests for required headers.

For further reading, please see our API documentation

Developing

Few guidelines for developing this library:

  • Follow Rust API Guidelines
  • Keep formatting consistent by using cargo fmt for all changes
  • Use cargo clippy --workspace --all-targets --verbose --all-features to find possible lint errors and warnings
  • Always add tests to your functionality, prefer TDD. Use /tests/ folder.
  • Always run tests with cargo test before pushing to remote
  • Check that you have documented all public functionality with cargo doc --open

Running tests

Tests depend to real sandbox data.

To enable debug logging from the library set up the RUST_LOG environment variable

export RUST_LOG=op_api_sdk=debug
Commit count: 36

cargo fmt