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)]
5pub struct CreateSessionOutput {
6    /// <p>The server-side encryption algorithm used when you store objects in the directory bucket.</p>
7    pub server_side_encryption: ::std::option::Option<crate::types::ServerSideEncryption>,
8    /// <p>If you specify <code>x-amz-server-side-encryption</code> with <code>aws:kms</code>, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.</p>
9    pub ssekms_key_id: ::std::option::Option<::std::string::String>,
10    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future <code>GetObject</code> operations on this object.</p>
11    pub ssekms_encryption_context: ::std::option::Option<::std::string::String>,
12    /// <p>Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).</p>
13    pub bucket_key_enabled: ::std::option::Option<bool>,
14    /// <p>The established temporary security credentials for the created session.</p>
15    pub credentials: ::std::option::Option<crate::types::SessionCredentials>,
16    _extended_request_id: Option<String>,
17    _request_id: Option<String>,
18}
19impl CreateSessionOutput {
20    /// <p>The server-side encryption algorithm used when you store objects in the directory bucket.</p>
21    pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> {
22        self.server_side_encryption.as_ref()
23    }
24    /// <p>If you specify <code>x-amz-server-side-encryption</code> with <code>aws:kms</code>, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.</p>
25    pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> {
26        self.ssekms_key_id.as_deref()
27    }
28    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future <code>GetObject</code> operations on this object.</p>
29    pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> {
30        self.ssekms_encryption_context.as_deref()
31    }
32    /// <p>Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).</p>
33    pub fn bucket_key_enabled(&self) -> ::std::option::Option<bool> {
34        self.bucket_key_enabled
35    }
36    /// <p>The established temporary security credentials for the created session.</p>
37    pub fn credentials(&self) -> ::std::option::Option<&crate::types::SessionCredentials> {
38        self.credentials.as_ref()
39    }
40}
41impl ::std::fmt::Debug for CreateSessionOutput {
42    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
43        let mut formatter = f.debug_struct("CreateSessionOutput");
44        formatter.field("server_side_encryption", &self.server_side_encryption);
45        formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***");
46        formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***");
47        formatter.field("bucket_key_enabled", &self.bucket_key_enabled);
48        formatter.field("credentials", &self.credentials);
49        formatter.field("_extended_request_id", &self._extended_request_id);
50        formatter.field("_request_id", &self._request_id);
51        formatter.finish()
52    }
53}
54impl crate::s3_request_id::RequestIdExt for CreateSessionOutput {
55    fn extended_request_id(&self) -> Option<&str> {
56        self._extended_request_id.as_deref()
57    }
58}
59impl ::aws_types::request_id::RequestId for CreateSessionOutput {
60    fn request_id(&self) -> Option<&str> {
61        self._request_id.as_deref()
62    }
63}
64impl CreateSessionOutput {
65    /// Creates a new builder-style object to manufacture [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput).
66    pub fn builder() -> crate::operation::create_session::builders::CreateSessionOutputBuilder {
67        crate::operation::create_session::builders::CreateSessionOutputBuilder::default()
68    }
69}
70
71/// A builder for [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
73#[non_exhaustive]
74pub struct CreateSessionOutputBuilder {
75    pub(crate) server_side_encryption: ::std::option::Option<crate::types::ServerSideEncryption>,
76    pub(crate) ssekms_key_id: ::std::option::Option<::std::string::String>,
77    pub(crate) ssekms_encryption_context: ::std::option::Option<::std::string::String>,
78    pub(crate) bucket_key_enabled: ::std::option::Option<bool>,
79    pub(crate) credentials: ::std::option::Option<crate::types::SessionCredentials>,
80    _extended_request_id: Option<String>,
81    _request_id: Option<String>,
82}
83impl CreateSessionOutputBuilder {
84    /// <p>The server-side encryption algorithm used when you store objects in the directory bucket.</p>
85    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self {
86        self.server_side_encryption = ::std::option::Option::Some(input);
87        self
88    }
89    /// <p>The server-side encryption algorithm used when you store objects in the directory bucket.</p>
90    pub fn set_server_side_encryption(mut self, input: ::std::option::Option<crate::types::ServerSideEncryption>) -> Self {
91        self.server_side_encryption = input;
92        self
93    }
94    /// <p>The server-side encryption algorithm used when you store objects in the directory bucket.</p>
95    pub fn get_server_side_encryption(&self) -> &::std::option::Option<crate::types::ServerSideEncryption> {
96        &self.server_side_encryption
97    }
98    /// <p>If you specify <code>x-amz-server-side-encryption</code> with <code>aws:kms</code>, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.</p>
99    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.ssekms_key_id = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>If you specify <code>x-amz-server-side-encryption</code> with <code>aws:kms</code>, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.</p>
104    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.ssekms_key_id = input;
106        self
107    }
108    /// <p>If you specify <code>x-amz-server-side-encryption</code> with <code>aws:kms</code>, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.</p>
109    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> {
110        &self.ssekms_key_id
111    }
112    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future <code>GetObject</code> operations on this object.</p>
113    pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.ssekms_encryption_context = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future <code>GetObject</code> operations on this object.</p>
118    pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.ssekms_encryption_context = input;
120        self
121    }
122    /// <p>If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future <code>GetObject</code> operations on this object.</p>
123    pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> {
124        &self.ssekms_encryption_context
125    }
126    /// <p>Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).</p>
127    pub fn bucket_key_enabled(mut self, input: bool) -> Self {
128        self.bucket_key_enabled = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).</p>
132    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
133        self.bucket_key_enabled = input;
134        self
135    }
136    /// <p>Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).</p>
137    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option<bool> {
138        &self.bucket_key_enabled
139    }
140    /// <p>The established temporary security credentials for the created session.</p>
141    /// This field is required.
142    pub fn credentials(mut self, input: crate::types::SessionCredentials) -> Self {
143        self.credentials = ::std::option::Option::Some(input);
144        self
145    }
146    /// <p>The established temporary security credentials for the created session.</p>
147    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::SessionCredentials>) -> Self {
148        self.credentials = input;
149        self
150    }
151    /// <p>The established temporary security credentials for the created session.</p>
152    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::SessionCredentials> {
153        &self.credentials
154    }
155    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
156        self._extended_request_id = Some(extended_request_id.into());
157        self
158    }
159
160    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
161        self._extended_request_id = extended_request_id;
162        self
163    }
164    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
165        self._request_id = Some(request_id.into());
166        self
167    }
168
169    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
170        self._request_id = request_id;
171        self
172    }
173    /// Consumes the builder and constructs a [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput).
174    pub fn build(self) -> crate::operation::create_session::CreateSessionOutput {
175        crate::operation::create_session::CreateSessionOutput {
176            server_side_encryption: self.server_side_encryption,
177            ssekms_key_id: self.ssekms_key_id,
178            ssekms_encryption_context: self.ssekms_encryption_context,
179            bucket_key_enabled: self.bucket_key_enabled,
180            credentials: self.credentials,
181            _extended_request_id: self._extended_request_id,
182            _request_id: self._request_id,
183        }
184    }
185}
186impl ::std::fmt::Debug for CreateSessionOutputBuilder {
187    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
188        let mut formatter = f.debug_struct("CreateSessionOutputBuilder");
189        formatter.field("server_side_encryption", &self.server_side_encryption);
190        formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***");
191        formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***");
192        formatter.field("bucket_key_enabled", &self.bucket_key_enabled);
193        formatter.field("credentials", &self.credentials);
194        formatter.field("_extended_request_id", &self._extended_request_id);
195        formatter.field("_request_id", &self._request_id);
196        formatter.finish()
197    }
198}