aws_sdk_sts/operation/get_federation_token/_get_federation_token_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the response to a successful <code>GetFederationToken</code> request, including temporary Amazon Web Services credentials that can be used to make Amazon Web Services requests.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct GetFederationTokenOutput {
7 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
8 /// <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>
9 /// </note>
10 pub credentials: ::std::option::Option<crate::types::Credentials>,
11 /// <p>Identifiers for the federated user associated with the credentials (such as <code>arn:aws:sts::123456789012:federated-user/Bob</code> or <code>123456789012:Bob</code>). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy.</p>
12 pub federated_user: ::std::option::Option<crate::types::FederatedUser>,
13 /// <p>A percentage value that indicates the packed size of the session policies and session tags combined passed in the request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded the allowed space.</p>
14 pub packed_policy_size: ::std::option::Option<i32>,
15 _request_id: Option<String>,
16}
17impl GetFederationTokenOutput {
18 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
19 /// <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>
20 /// </note>
21 pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
22 self.credentials.as_ref()
23 }
24 /// <p>Identifiers for the federated user associated with the credentials (such as <code>arn:aws:sts::123456789012:federated-user/Bob</code> or <code>123456789012:Bob</code>). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy.</p>
25 pub fn federated_user(&self) -> ::std::option::Option<&crate::types::FederatedUser> {
26 self.federated_user.as_ref()
27 }
28 /// <p>A percentage value that indicates the packed size of the session policies and session tags combined passed in the request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded the allowed space.</p>
29 pub fn packed_policy_size(&self) -> ::std::option::Option<i32> {
30 self.packed_policy_size
31 }
32}
33impl ::std::fmt::Debug for GetFederationTokenOutput {
34 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35 let mut formatter = f.debug_struct("GetFederationTokenOutput");
36 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
37 formatter.field("federated_user", &self.federated_user);
38 formatter.field("packed_policy_size", &self.packed_policy_size);
39 formatter.field("_request_id", &self._request_id);
40 formatter.finish()
41 }
42}
43impl ::aws_types::request_id::RequestId for GetFederationTokenOutput {
44 fn request_id(&self) -> Option<&str> {
45 self._request_id.as_deref()
46 }
47}
48impl GetFederationTokenOutput {
49 /// Creates a new builder-style object to manufacture [`GetFederationTokenOutput`](crate::operation::get_federation_token::GetFederationTokenOutput).
50 pub fn builder() -> crate::operation::get_federation_token::builders::GetFederationTokenOutputBuilder {
51 crate::operation::get_federation_token::builders::GetFederationTokenOutputBuilder::default()
52 }
53}
54
55/// A builder for [`GetFederationTokenOutput`](crate::operation::get_federation_token::GetFederationTokenOutput).
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
57#[non_exhaustive]
58pub struct GetFederationTokenOutputBuilder {
59 pub(crate) credentials: ::std::option::Option<crate::types::Credentials>,
60 pub(crate) federated_user: ::std::option::Option<crate::types::FederatedUser>,
61 pub(crate) packed_policy_size: ::std::option::Option<i32>,
62 _request_id: Option<String>,
63}
64impl GetFederationTokenOutputBuilder {
65 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
66 /// <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>
67 /// </note>
68 pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
69 self.credentials = ::std::option::Option::Some(input);
70 self
71 }
72 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
73 /// <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>
74 /// </note>
75 pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
76 self.credentials = input;
77 self
78 }
79 /// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
80 /// <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>
81 /// </note>
82 pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
83 &self.credentials
84 }
85 /// <p>Identifiers for the federated user associated with the credentials (such as <code>arn:aws:sts::123456789012:federated-user/Bob</code> or <code>123456789012:Bob</code>). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy.</p>
86 pub fn federated_user(mut self, input: crate::types::FederatedUser) -> Self {
87 self.federated_user = ::std::option::Option::Some(input);
88 self
89 }
90 /// <p>Identifiers for the federated user associated with the credentials (such as <code>arn:aws:sts::123456789012:federated-user/Bob</code> or <code>123456789012:Bob</code>). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy.</p>
91 pub fn set_federated_user(mut self, input: ::std::option::Option<crate::types::FederatedUser>) -> Self {
92 self.federated_user = input;
93 self
94 }
95 /// <p>Identifiers for the federated user associated with the credentials (such as <code>arn:aws:sts::123456789012:federated-user/Bob</code> or <code>123456789012:Bob</code>). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy.</p>
96 pub fn get_federated_user(&self) -> &::std::option::Option<crate::types::FederatedUser> {
97 &self.federated_user
98 }
99 /// <p>A percentage value that indicates the packed size of the session policies and session tags combined passed in the request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded the allowed space.</p>
100 pub fn packed_policy_size(mut self, input: i32) -> Self {
101 self.packed_policy_size = ::std::option::Option::Some(input);
102 self
103 }
104 /// <p>A percentage value that indicates the packed size of the session policies and session tags combined passed in the request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded the allowed space.</p>
105 pub fn set_packed_policy_size(mut self, input: ::std::option::Option<i32>) -> Self {
106 self.packed_policy_size = input;
107 self
108 }
109 /// <p>A percentage value that indicates the packed size of the session policies and session tags combined passed in the request. The request fails if the packed size is greater than 100 percent, which means the policies and tags exceeded the allowed space.</p>
110 pub fn get_packed_policy_size(&self) -> &::std::option::Option<i32> {
111 &self.packed_policy_size
112 }
113 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
114 self._request_id = Some(request_id.into());
115 self
116 }
117
118 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
119 self._request_id = request_id;
120 self
121 }
122 /// Consumes the builder and constructs a [`GetFederationTokenOutput`](crate::operation::get_federation_token::GetFederationTokenOutput).
123 pub fn build(self) -> crate::operation::get_federation_token::GetFederationTokenOutput {
124 crate::operation::get_federation_token::GetFederationTokenOutput {
125 credentials: self.credentials,
126 federated_user: self.federated_user,
127 packed_policy_size: self.packed_policy_size,
128 _request_id: self._request_id,
129 }
130 }
131}
132impl ::std::fmt::Debug for GetFederationTokenOutputBuilder {
133 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
134 let mut formatter = f.debug_struct("GetFederationTokenOutputBuilder");
135 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
136 formatter.field("federated_user", &self.federated_user);
137 formatter.field("packed_policy_size", &self.packed_policy_size);
138 formatter.field("_request_id", &self._request_id);
139 formatter.finish()
140 }
141}