1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Defines the encryption configuration for S3 Table integrations, including the encryption algorithm and KMS key settings.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Encryption {
/// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
pub sse_algorithm: crate::types::SseAlgorithm,
/// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
pub kms_key_arn: ::std::option::Option<::std::string::String>,
}
impl Encryption {
/// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
pub fn sse_algorithm(&self) -> &crate::types::SseAlgorithm {
&self.sse_algorithm
}
/// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
self.kms_key_arn.as_deref()
}
}
impl Encryption {
/// Creates a new builder-style object to manufacture [`Encryption`](crate::types::Encryption).
pub fn builder() -> crate::types::builders::EncryptionBuilder {
crate::types::builders::EncryptionBuilder::default()
}
}
/// A builder for [`Encryption`](crate::types::Encryption).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EncryptionBuilder {
pub(crate) sse_algorithm: ::std::option::Option<crate::types::SseAlgorithm>,
pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
}
impl EncryptionBuilder {
/// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
/// This field is required.
pub fn sse_algorithm(mut self, input: crate::types::SseAlgorithm) -> Self {
self.sse_algorithm = ::std::option::Option::Some(input);
self
}
/// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
pub fn set_sse_algorithm(mut self, input: ::std::option::Option<crate::types::SseAlgorithm>) -> Self {
self.sse_algorithm = input;
self
}
/// <p>The server-side encryption algorithm used for encrypting data in the S3 Table integration.</p>
pub fn get_sse_algorithm(&self) -> &::std::option::Option<crate::types::SseAlgorithm> {
&self.sse_algorithm
}
/// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the KMS key used for encryption when using customer-managed keys.</p>
pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_arn
}
/// Consumes the builder and constructs a [`Encryption`](crate::types::Encryption).
/// This method will fail if any of the following fields are not set:
/// - [`sse_algorithm`](crate::types::builders::EncryptionBuilder::sse_algorithm)
pub fn build(self) -> ::std::result::Result<crate::types::Encryption, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Encryption {
sse_algorithm: self.sse_algorithm.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"sse_algorithm",
"sse_algorithm was not specified but it is required when building Encryption",
)
})?,
kms_key_arn: self.kms_key_arn,
})
}
}