-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bdd768
commit 53d141f
Showing
3 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use centerdevice::client::{self, CenterDeviceConfig}; | ||
use centerdevice::client::search::NamedSearches; | ||
use std::env; | ||
|
||
fn main() { | ||
let client_id = env::var_os("CENTERDEVICE_CLIENT_ID").expect("Environment variable 'CENTERDEVICE_CLIENT_ID' is not set."); | ||
let client_secret = env::var_os("CENTERDEVICE_CLIENT_SECRET").expect("Environment variable 'CENTERDEVICE_CLIENT_SECRET' is not set."); | ||
let access_token = env::var_os("CENTERDEVICE_ACCESS_TOKEN").expect("Environment variable 'CENTERDEVICE_ACCESS_TOKEN' is not set."); | ||
|
||
let config = CenterDeviceConfig { | ||
client_id: client_id.to_string_lossy().to_string(), | ||
client_secret: client_secret.to_string_lossy().to_string(), | ||
refresh_token: None, | ||
access_token: access_token.to_string_lossy().to_string(), | ||
api_base_url: "centerdevice.de".to_string() | ||
}; | ||
|
||
let search_results= client::search::search_documents( | ||
&config.api_base_url, | ||
&config.access_token, | ||
None, | ||
None, | ||
Some("centerdevice"), | ||
NamedSearches::None | ||
).expect("Search failed."); | ||
|
||
println!("{}", search_results); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters