-
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.
Signed-off-by: Vaibhav Rabber <[email protected]>
- Loading branch information
Showing
2 changed files
with
33 additions
and
15 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,33 @@ | ||
use streamstore::{ | ||
client::{Client, ClientConfig}, | ||
types::ListBasinsRequest, | ||
}; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let token = std::env::var("S2_AUTH_TOKEN")?; | ||
let config = ClientConfig::new(token); | ||
let client = Client::new(config); | ||
|
||
let mut all_basins = Vec::new(); | ||
|
||
let mut has_more = true; | ||
let mut start_after: Option<String> = None; | ||
|
||
while has_more { | ||
let mut list_basins_request = ListBasinsRequest::new(); | ||
if let Some(start_after) = start_after.take() { | ||
list_basins_request = list_basins_request.with_start_after(start_after); | ||
} | ||
|
||
let list_basins_response = client.list_basins(list_basins_request).await?; | ||
|
||
all_basins.extend(list_basins_response.basins); | ||
|
||
has_more = list_basins_response.has_more; | ||
} | ||
|
||
println!("{all_basins:#?}"); | ||
|
||
Ok(()) | ||
} |
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