aws_sdk_s3/operation/create_session/
_create_session_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, ::std::fmt::Debug)]
5pub struct CreateSessionOutput {
6    /// <p>The established temporary security credentials for the created session.</p>
7    pub credentials: ::std::option::Option<crate::types::SessionCredentials>,
8    _extended_request_id: Option<String>,
9    _request_id: Option<String>,
10}
11impl CreateSessionOutput {
12    /// <p>The established temporary security credentials for the created session.</p>
13    pub fn credentials(&self) -> ::std::option::Option<&crate::types::SessionCredentials> {
14        self.credentials.as_ref()
15    }
16}
17impl crate::s3_request_id::RequestIdExt for CreateSessionOutput {
18    fn extended_request_id(&self) -> Option<&str> {
19        self._extended_request_id.as_deref()
20    }
21}
22impl ::aws_types::request_id::RequestId for CreateSessionOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl CreateSessionOutput {
28    /// Creates a new builder-style object to manufacture [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput).
29    pub fn builder() -> crate::operation::create_session::builders::CreateSessionOutputBuilder {
30        crate::operation::create_session::builders::CreateSessionOutputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateSessionOutputBuilder {
38    pub(crate) credentials: ::std::option::Option<crate::types::SessionCredentials>,
39    _extended_request_id: Option<String>,
40    _request_id: Option<String>,
41}
42impl CreateSessionOutputBuilder {
43    /// <p>The established temporary security credentials for the created session.</p>
44    /// This field is required.
45    pub fn credentials(mut self, input: crate::types::SessionCredentials) -> Self {
46        self.credentials = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The established temporary security credentials for the created session.</p>
50    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::SessionCredentials>) -> Self {
51        self.credentials = input;
52        self
53    }
54    /// <p>The established temporary security credentials for the created session.</p>
55    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::SessionCredentials> {
56        &self.credentials
57    }
58    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
59        self._extended_request_id = Some(extended_request_id.into());
60        self
61    }
62
63    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
64        self._extended_request_id = extended_request_id;
65        self
66    }
67    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
68        self._request_id = Some(request_id.into());
69        self
70    }
71
72    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
73        self._request_id = request_id;
74        self
75    }
76    /// Consumes the builder and constructs a [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput).
77    pub fn build(self) -> crate::operation::create_session::CreateSessionOutput {
78        crate::operation::create_session::CreateSessionOutput {
79            credentials: self.credentials,
80            _extended_request_id: self._extended_request_id,
81            _request_id: self._request_id,
82        }
83    }
84}