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