aws_sdk_sso/operation/get_role_credentials/
_get_role_credentials_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetRoleCredentialsInput {
6    /// <p>The friendly name of the role that is assigned to the user.</p>
7    pub role_name: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier for the AWS account that is assigned to the user.</p>
9    pub account_id: ::std::option::Option<::std::string::String>,
10    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
11    pub access_token: ::std::option::Option<::std::string::String>,
12}
13impl GetRoleCredentialsInput {
14    /// <p>The friendly name of the role that is assigned to the user.</p>
15    pub fn role_name(&self) -> ::std::option::Option<&str> {
16        self.role_name.as_deref()
17    }
18    /// <p>The identifier for the AWS account that is assigned to the user.</p>
19    pub fn account_id(&self) -> ::std::option::Option<&str> {
20        self.account_id.as_deref()
21    }
22    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
23    pub fn access_token(&self) -> ::std::option::Option<&str> {
24        self.access_token.as_deref()
25    }
26}
27impl ::std::fmt::Debug for GetRoleCredentialsInput {
28    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
29        let mut formatter = f.debug_struct("GetRoleCredentialsInput");
30        formatter.field("role_name", &self.role_name);
31        formatter.field("account_id", &self.account_id);
32        formatter.field("access_token", &"*** Sensitive Data Redacted ***");
33        formatter.finish()
34    }
35}
36impl GetRoleCredentialsInput {
37    /// Creates a new builder-style object to manufacture [`GetRoleCredentialsInput`](crate::operation::get_role_credentials::GetRoleCredentialsInput).
38    pub fn builder() -> crate::operation::get_role_credentials::builders::GetRoleCredentialsInputBuilder {
39        crate::operation::get_role_credentials::builders::GetRoleCredentialsInputBuilder::default()
40    }
41}
42
43/// A builder for [`GetRoleCredentialsInput`](crate::operation::get_role_credentials::GetRoleCredentialsInput).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
45#[non_exhaustive]
46pub struct GetRoleCredentialsInputBuilder {
47    pub(crate) role_name: ::std::option::Option<::std::string::String>,
48    pub(crate) account_id: ::std::option::Option<::std::string::String>,
49    pub(crate) access_token: ::std::option::Option<::std::string::String>,
50}
51impl GetRoleCredentialsInputBuilder {
52    /// <p>The friendly name of the role that is assigned to the user.</p>
53    /// This field is required.
54    pub fn role_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.role_name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The friendly name of the role that is assigned to the user.</p>
59    pub fn set_role_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.role_name = input;
61        self
62    }
63    /// <p>The friendly name of the role that is assigned to the user.</p>
64    pub fn get_role_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.role_name
66    }
67    /// <p>The identifier for the AWS account that is assigned to the user.</p>
68    /// This field is required.
69    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.account_id = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The identifier for the AWS account that is assigned to the user.</p>
74    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.account_id = input;
76        self
77    }
78    /// <p>The identifier for the AWS account that is assigned to the user.</p>
79    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
80        &self.account_id
81    }
82    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
83    /// This field is required.
84    pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.access_token = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
89    pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.access_token = input;
91        self
92    }
93    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
94    pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
95        &self.access_token
96    }
97    /// Consumes the builder and constructs a [`GetRoleCredentialsInput`](crate::operation::get_role_credentials::GetRoleCredentialsInput).
98    pub fn build(
99        self,
100    ) -> ::std::result::Result<crate::operation::get_role_credentials::GetRoleCredentialsInput, ::aws_smithy_types::error::operation::BuildError>
101    {
102        ::std::result::Result::Ok(crate::operation::get_role_credentials::GetRoleCredentialsInput {
103            role_name: self.role_name,
104            account_id: self.account_id,
105            access_token: self.access_token,
106        })
107    }
108}
109impl ::std::fmt::Debug for GetRoleCredentialsInputBuilder {
110    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
111        let mut formatter = f.debug_struct("GetRoleCredentialsInputBuilder");
112        formatter.field("role_name", &self.role_name);
113        formatter.field("account_id", &self.account_id);
114        formatter.field("access_token", &"*** Sensitive Data Redacted ***");
115        formatter.finish()
116    }
117}