1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
23/// <p>Contains the response to a successful <code>GetSessionToken</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 GetSessionTokenOutput {
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>
10pub credentials: ::std::option::Option<crate::types::Credentials>,
11 _request_id: Option<String>,
12}
13impl GetSessionTokenOutput {
14/// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
15 /// <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>
16 /// </note>
17pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
18self.credentials.as_ref()
19 }
20}
21impl ::std::fmt::Debug for GetSessionTokenOutput {
22fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23let mut formatter = f.debug_struct("GetSessionTokenOutput");
24 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
25 formatter.field("_request_id", &self._request_id);
26 formatter.finish()
27 }
28}
29impl ::aws_types::request_id::RequestId for GetSessionTokenOutput {
30fn request_id(&self) -> Option<&str> {
31self._request_id.as_deref()
32 }
33}
34impl GetSessionTokenOutput {
35/// Creates a new builder-style object to manufacture [`GetSessionTokenOutput`](crate::operation::get_session_token::GetSessionTokenOutput).
36pub fn builder() -> crate::operation::get_session_token::builders::GetSessionTokenOutputBuilder {
37crate::operation::get_session_token::builders::GetSessionTokenOutputBuilder::default()
38 }
39}
4041/// A builder for [`GetSessionTokenOutput`](crate::operation::get_session_token::GetSessionTokenOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
43#[non_exhaustive]
44pub struct GetSessionTokenOutputBuilder {
45pub(crate) credentials: ::std::option::Option<crate::types::Credentials>,
46 _request_id: Option<String>,
47}
48impl GetSessionTokenOutputBuilder {
49/// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
50 /// <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>
51 /// </note>
52pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
53self.credentials = ::std::option::Option::Some(input);
54self
55}
56/// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
57 /// <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>
58 /// </note>
59pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
60self.credentials = input;
61self
62}
63/// <p>The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.</p><note>
64 /// <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>
65 /// </note>
66pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
67&self.credentials
68 }
69pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
70self._request_id = Some(request_id.into());
71self
72}
7374pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
75self._request_id = request_id;
76self
77}
78/// Consumes the builder and constructs a [`GetSessionTokenOutput`](crate::operation::get_session_token::GetSessionTokenOutput).
79pub fn build(self) -> crate::operation::get_session_token::GetSessionTokenOutput {
80crate::operation::get_session_token::GetSessionTokenOutput {
81 credentials: self.credentials,
82 _request_id: self._request_id,
83 }
84 }
85}
86impl ::std::fmt::Debug for GetSessionTokenOutputBuilder {
87fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
88let mut formatter = f.debug_struct("GetSessionTokenOutputBuilder");
89 formatter.field("credentials", &"*** Sensitive Data Redacted ***");
90 formatter.field("_request_id", &self._request_id);
91 formatter.finish()
92 }
93}