Skip to content

peteyb/zuora_rest_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zuora_rest_client

crates.io Documentation MIT licensed

A HTTP Client built on top of the reqwest package for accessing the Zuora Billing REST API

TODOs

This package currently only provides an interface for performing OAuth authenticated GET requests

  • Add missing HTTP methods
  • Add retry logic
  • Hook up to a CI server

Example

This example uses serde_json to prepare the data for a GET request. Your Cargo.toml could look like this:

[dependencies]
zuora_rest_client = "0.1"
serde_json = "1"

And then the code:

use std::env;
use zuora_rest_client::Zuora;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = Zuora::new(
        env::var("ZUORA_CLIENT_ID").unwrap_or_default(),
        env::var("ZUORA_CLIENT_SECRET").unwrap_or_default(),
        String::from("https://rest.sandbox.eu.zuora.com"),
        String::from("/v1"),
        3,
    );

    let result = client.generate_token();
    println!("{:?}", result);

    let get = client.get("/catalog/products", serde_json::from_str("{}").unwrap());
    println!("{:?}", get);
    Ok(())
}

License

Licensed under

About

Zuora HTTP Client written in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages