aws_sdk_sts/operation/assume_root/
_assume_root_output.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 AssumeRootOutput {
6    /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
7    /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
8    /// </note>
9    pub credentials: ::std::option::Option<crate::types::Credentials>,
10    /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
11    /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
12    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
13    pub source_identity: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl AssumeRootOutput {
17    /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
18    /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
19    /// </note>
20    pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
21        self.credentials.as_ref()
22    }
23    /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
24    /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
25    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
26    pub fn source_identity(&self) -> ::std::option::Option<&str> {
27        self.source_identity.as_deref()
28    }
29}
30impl ::std::fmt::Debug for AssumeRootOutput {
31    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
32        let mut formatter = f.debug_struct("AssumeRootOutput");
33        formatter.field("credentials", &"*** Sensitive Data Redacted ***");
34        formatter.field("source_identity", &self.source_identity);
35        formatter.field("_request_id", &self._request_id);
36        formatter.finish()
37    }
38}
39impl ::aws_types::request_id::RequestId for AssumeRootOutput {
40    fn request_id(&self) -> Option<&str> {
41        self._request_id.as_deref()
42    }
43}
44impl AssumeRootOutput {
45    /// Creates a new builder-style object to manufacture [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
46    pub fn builder() -> crate::operation::assume_root::builders::AssumeRootOutputBuilder {
47        crate::operation::assume_root::builders::AssumeRootOutputBuilder::default()
48    }
49}
50
51/// A builder for [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
53#[non_exhaustive]
54pub struct AssumeRootOutputBuilder {
55    pub(crate) credentials: ::std::option::Option<crate::types::Credentials>,
56    pub(crate) source_identity: ::std::option::Option<::std::string::String>,
57    _request_id: Option<String>,
58}
59impl AssumeRootOutputBuilder {
60    /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
61    /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
62    /// </note>
63    pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
64        self.credentials = ::std::option::Option::Some(input);
65        self
66    }
67    /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
68    /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
69    /// </note>
70    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
71        self.credentials = input;
72        self
73    }
74    /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security token.</p><note>
75    /// <p>The size of the security token that STS API operations return is not fixed. We strongly recommend that you make no assumptions about the maximum size.</p>
76    /// </note>
77    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
78        &self.credentials
79    }
80    /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
81    /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
82    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
83    pub fn source_identity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.source_identity = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
88    /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
89    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
90    pub fn set_source_identity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.source_identity = input;
92        self
93    }
94    /// <p>The source identity specified by the principal that is calling the <code>AssumeRoot</code> operation.</p>
95    /// <p>You can use the <code>aws:SourceIdentity</code> condition key to control access based on the value of source identity. For more information about using source identity, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html">Monitor and control actions taken with assumed roles</a> in the <i>IAM User Guide</i>.</p>
96    /// <p>The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-</p>
97    pub fn get_source_identity(&self) -> &::std::option::Option<::std::string::String> {
98        &self.source_identity
99    }
100    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101        self._request_id = Some(request_id.into());
102        self
103    }
104
105    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106        self._request_id = request_id;
107        self
108    }
109    /// Consumes the builder and constructs a [`AssumeRootOutput`](crate::operation::assume_root::AssumeRootOutput).
110    pub fn build(self) -> crate::operation::assume_root::AssumeRootOutput {
111        crate::operation::assume_root::AssumeRootOutput {
112            credentials: self.credentials,
113            source_identity: self.source_identity,
114            _request_id: self._request_id,
115        }
116    }
117}
118impl ::std::fmt::Debug for AssumeRootOutputBuilder {
119    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
120        let mut formatter = f.debug_struct("AssumeRootOutputBuilder");
121        formatter.field("credentials", &"*** Sensitive Data Redacted ***");
122        formatter.field("source_identity", &self.source_identity);
123        formatter.field("_request_id", &self._request_id);
124        formatter.finish()
125    }
126}