-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathblacklist_get.rs
28 lines (23 loc) · 921 Bytes
/
blacklist_get.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Dependencies
use dotenv::dotenv;
use sellix_rs::Client;
use std::env;
// Entrypoint
#[tokio::test]
async fn blacklist_get() {
dotenv().ok();
// Grab our environment variables
let api_key = env::var("API_KEY").expect("API_KEY not provided");
let merchant = env::var("MERCHANT").ok();
let blacklist_uniqid = env::var("BLACKLIST_UNIQID").expect("BLACKLIST_UNIQID not provided");
// Warn if we do not have a merchant
if merchant.is_none() {
println!("warning: MERCHANT environment variable is not present. Defaulting to first merchant.");
}
// Build the client that would send out requests to the blacklist API
let client = Client::new( &api_key, merchant.as_deref() );
let blacklist_client = client.blacklist;
// Grab the blacklst
let blacklists = blacklist_client.get(&blacklist_uniqid).await;
assert!(blacklists.is_ok(), "unable to get blacklist");
}