diff --git a/.env.example b/.env.example index 132e464..7d6736d 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,2 @@ -CLIENT_ID= -CLIENT_SECRET= -TRIBUFU_API_URL=https://api.tribufu.com \ No newline at end of file +TRIBUFU_API_KEY="" +TRIBUFU_API_URL="https://api.tribufu.com" diff --git a/Cargo.toml b/Cargo.toml index 4bf44ec..e71c290 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,3 +43,4 @@ uuid = { version = "^1.8", features = ["serde", "v4"] } [dev-dependencies] dotenv = "0.15.0" +tokio = { version = "1.45.1", features = ["full"] } diff --git a/examples/api.rs b/examples/api.rs new file mode 100644 index 0000000..9d644f4 --- /dev/null +++ b/examples/api.rs @@ -0,0 +1,14 @@ +// Copyright (c) Tribufu. All Rights Reserved. +// SPDX-License-Identifier: MIT + +use dotenv::dotenv; +use tribufu::apis::tribufu_generated_api::TribufuGeneratedApi; +use tribufu::TribufuApi; + +#[tokio::main] +async fn main() { + dotenv().unwrap(); + let tribufu = TribufuApi::from_env_or_default(None); + let user_info = tribufu.get_user_info().await.unwrap(); + println!("{:?}", user_info); +}