pub fn new(
        sts_client: StsClient,
        role_arn: String,
        session_name: String,
        external_id: Option<String>,
        session_duration: Option<Duration>,
        scope_down_policy: Option<String>,
        mfa_serial: Option<String>,
    ) -> StsAssumeRoleSessionCredentialsProvider {
        StsAssumeRoleSessionCredentialsProvider {
            sts_client: Box::new(sts_client),
            role_arn,
            session_name,
            external_id,
            session_duration: session_duration
                .unwrap_or(Duration::seconds(DEFAULT_ROLE_DURATION_SECONDS as i64)),
            scope_down_policy,
            mfa_serial,
            mfa_code: None,
        }
    }
Creates a new `StsAssumeRoleSessionCredentialsProvider` with the given
[StsClient](struct.StsClient.html) and session parameters.

* `sts_client` - [StsClient](struct.StsClient.html) to use to acquire session tokens.
* `role_arn` - The ARN of the role to assume.
* `session_name` - An identifier for the assumed role session. Minimum length of 2. Maximum length of 64. Pattern: `[\w+=,.@-]*`
* `external_id` -
* `session_duration` - Duration of session tokens. Default 1 hour.
* `scope_down_policy` - Optional inline IAM policy in JSON format to further restrict the access granted to the negotiated session.
* `mfa_serial` - Optional MFA hardware device serial number or virtual device ARN. Use `set_mfa_code` to set the MFA code.
rusoto/services/sts/src/custom/credential.rs