Skip to content

Commit

Permalink
fix IAM example compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoh authored and beqqrry-aws committed Aug 28, 2023
1 parent d0f4aa7 commit 404b163
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 4 additions & 1 deletion rust_dev_preview/examples/iam/src/bin/hello.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// snippet-start:[rust.example_code.iam.hello_bin]

use aws_sdk_iam::error::SdkError;
use aws_sdk_iam::operation::list_policies::ListPoliciesError;
use clap::Parser;

const PATH_PREFIX_HELP: &str = "The path prefix for filtering the results.";


use aws_smithy_http::body::SdkBody;
type SdkError<E> = aws_sdk_iam::error::SdkError<E, http::Response<SdkBody>>;

#[derive(Debug, clap::Parser)]
#[command(about)]
struct HelloScenarioArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ async fn run_iam_operations(
.as_ref()
.unwrap()
.session_token
.borrow()
.clone(),
);

Expand Down
8 changes: 5 additions & 3 deletions rust_dev_preview/examples/iam/src/iam-service-lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

// snippet-start:[rust.example_code.iam.scenario_getting_started.lib]

use aws_sdk_iam::error::SdkError;
use aws_sdk_iam::operation::{
attach_role_policy::*, create_access_key::*, create_role::*, create_service_linked_role::*,
delete_user::*, delete_user_policy::*, get_account_password_policy::*, get_role::*,
Expand All @@ -18,6 +17,9 @@ use aws_sdk_iam::{Client, Error as iamError};
use futures::StreamExt;
use tokio::time::{sleep, Duration};

use aws_smithy_http::body::SdkBody;
type SdkError<E> = aws_sdk_iam::error::SdkError<E, http::Response<SdkBody>>;

// snippet-start:[rust.example_code.iam.service.create_policy]
pub async fn create_policy(
client: &iamClient,
Expand Down Expand Up @@ -497,9 +499,9 @@ pub async fn list_role_policies(
pub async fn list_saml_providers(
client: &Client,
) -> Result<ListSamlProvidersOutput, SdkError<ListSAMLProvidersError>> {
let response = client.list_saml_providers().send().await?;
return client.list_saml_providers().send().await;

Ok(response)
//Ok(response)
}
// snippet-end:[rust.example_code.iam.service.list_saml_providers]

Expand Down

0 comments on commit 404b163

Please sign in to comment.