dtz-objectstore 2.1.7

a generated client for the DTZ Objectstore API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[tokio::main]
async fn main() {
    let api_key = std::env::var("DTZ_API_KEY").expect("DTZ_API_KEY must be set");
    let config = dtz::Configuration {
        api_key: Some(api_key),
        ..Default::default()
    };
    let result = dtz::objectstore::apis::get_object(&config, "file.txt", None).await;
    match result {
        Ok(response) => {
            let bytes = response.bytes().await.unwrap();
            let string = String::from_utf8(bytes.to_vec()).unwrap();
            println!("response content: {}", string);
        }
        Err(e) => println!("Error uploading file.txt: {}", e),
    }
}