将 ListIdentityPoolUsage 和 AWS SDK 搭配使用 - Amazon Cognito

ListIdentityPoolUsage 和 AWS SDK 搭配使用

以下代码示例演示了如何使用 ListIdentityPoolUsage

Rust
适用于 Rust 的 SDK
注意

查看 GitHub,了解更多信息。在 AWS 代码示例存储库中查找完整示例,了解如何进行设置和运行。

async fn show_pools(client: &Client) -> Result<(), Error> { let response = client .list_identity_pool_usage() .max_results(10) .send() .await?; let pools = response.identity_pool_usages(); println!("Identity pools:"); for pool in pools { println!( " Identity pool ID: {}", pool.identity_pool_id().unwrap_or_default() ); println!( " Data storage: {}", pool.data_storage().unwrap_or_default() ); println!( " Sync sessions count: {}", pool.sync_sessions_count().unwrap_or_default() ); println!( " Last modified: {}", pool.last_modified_date().unwrap().to_chrono_utc()? ); println!(); } println!("Next token: {}", response.next_token().unwrap_or_default()); Ok(()) }

有关 AWS SDK 开发人员指南和代码示例的完整列表,请参阅 将此服务与 AWS 开发工具包结合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。