aws_sdk_sts/operation/get_session_token/
_get_session_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>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>
10    pub 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>
17    pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
18        self.credentials.as_ref()
19    }
20}
21impl ::std::fmt::Debug for GetSessionTokenOutput {
22    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23        let 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 {
30    fn request_id(&self) -> Option<&str> {
31        self._request_id.as_deref()
32    }
33}
34impl GetSessionTokenOutput {
35    /// Creates a new builder-style object to manufacture [`GetSessionTokenOutput`](crate::operation::get_session_token::GetSessionTokenOutput).
36    pub fn builder() -> crate::operation::get_session_token::builders::GetSessionTokenOutputBuilder {
37        crate::operation::get_session_token::builders::GetSessionTokenOutputBuilder::default()
38    }
39}
40
41/// 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 {
45    pub(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>
52    pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
53        self.credentials = ::std::option::Option::Some(input);
54        self
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>
59    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
60        self.credentials = input;
61        self
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>
66    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
67        &self.credentials
68    }
69    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
70        self._request_id = Some(request_id.into());
71        self
72    }
73
74    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
75        self._request_id = request_id;
76        self
77    }
78    /// Consumes the builder and constructs a [`GetSessionTokenOutput`](crate::operation::get_session_token::GetSessionTokenOutput).
79    pub fn build(self) -> crate::operation::get_session_token::GetSessionTokenOutput {
80        crate::operation::get_session_token::GetSessionTokenOutput {
81            credentials: self.credentials,
82            _request_id: self._request_id,
83        }
84    }
85}
86impl ::std::fmt::Debug for GetSessionTokenOutputBuilder {
87    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
88        let 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}