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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutEncryptionConfigurationOutput {
/// <p>The ID of the KMS key that is used for encryption.</p>
pub kms_key_id: ::std::option::Option<::std::string::String>,
/// <p>The encryption status.</p>
pub encryption_status: crate::types::EncryptionStatus,
/// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use an KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
pub encryption_type: crate::types::EncryptionType,
_request_id: Option<String>,
}
impl PutEncryptionConfigurationOutput {
/// <p>The ID of the KMS key that is used for encryption.</p>
pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
self.kms_key_id.as_deref()
}
/// <p>The encryption status.</p>
pub fn encryption_status(&self) -> &crate::types::EncryptionStatus {
&self.encryption_status
}
/// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use an KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
pub fn encryption_type(&self) -> &crate::types::EncryptionType {
&self.encryption_type
}
}
impl ::aws_types::request_id::RequestId for PutEncryptionConfigurationOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl PutEncryptionConfigurationOutput {
/// Creates a new builder-style object to manufacture [`PutEncryptionConfigurationOutput`](crate::operation::put_encryption_configuration::PutEncryptionConfigurationOutput).
pub fn builder() -> crate::operation::put_encryption_configuration::builders::PutEncryptionConfigurationOutputBuilder {
crate::operation::put_encryption_configuration::builders::PutEncryptionConfigurationOutputBuilder::default()
}
}
/// A builder for [`PutEncryptionConfigurationOutput`](crate::operation::put_encryption_configuration::PutEncryptionConfigurationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutEncryptionConfigurationOutputBuilder {
pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
pub(crate) encryption_status: ::std::option::Option<crate::types::EncryptionStatus>,
pub(crate) encryption_type: ::std::option::Option<crate::types::EncryptionType>,
_request_id: Option<String>,
}
impl PutEncryptionConfigurationOutputBuilder {
/// <p>The ID of the KMS key that is used for encryption.</p>
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.kms_key_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the KMS key that is used for encryption.</p>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.kms_key_id = input;
self
}
/// <p>The ID of the KMS key that is used for encryption.</p>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.kms_key_id
}
/// <p>The encryption status.</p>
/// This field is required.
pub fn encryption_status(mut self, input: crate::types::EncryptionStatus) -> Self {
self.encryption_status = ::std::option::Option::Some(input);
self
}
/// <p>The encryption status.</p>
pub fn set_encryption_status(mut self, input: ::std::option::Option<crate::types::EncryptionStatus>) -> Self {
self.encryption_status = input;
self
}
/// <p>The encryption status.</p>
pub fn get_encryption_status(&self) -> &::std::option::Option<crate::types::EncryptionStatus> {
&self.encryption_status
}
/// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use an KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
/// This field is required.
pub fn encryption_type(mut self, input: crate::types::EncryptionType) -> Self {
self.encryption_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use an KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
pub fn set_encryption_type(mut self, input: ::std::option::Option<crate::types::EncryptionType>) -> Self {
self.encryption_type = input;
self
}
/// <p>The type of encryption. Set to <code>KMS_BASED_ENCRYPTION</code> to use an KMS key that you own and manage. Set to <code>FLEETWISE_DEFAULT_ENCRYPTION</code> to use an Amazon Web Services managed key that is owned by the Amazon Web Services IoT FleetWise service account.</p>
pub fn get_encryption_type(&self) -> &::std::option::Option<crate::types::EncryptionType> {
&self.encryption_type
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`PutEncryptionConfigurationOutput`](crate::operation::put_encryption_configuration::PutEncryptionConfigurationOutput).
/// This method will fail if any of the following fields are not set:
/// - [`encryption_status`](crate::operation::put_encryption_configuration::builders::PutEncryptionConfigurationOutputBuilder::encryption_status)
/// - [`encryption_type`](crate::operation::put_encryption_configuration::builders::PutEncryptionConfigurationOutputBuilder::encryption_type)
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::put_encryption_configuration::PutEncryptionConfigurationOutput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::put_encryption_configuration::PutEncryptionConfigurationOutput {
kms_key_id: self.kms_key_id,
encryption_status: self.encryption_status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"encryption_status",
"encryption_status was not specified but it is required when building PutEncryptionConfigurationOutput",
)
})?,
encryption_type: self.encryption_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"encryption_type",
"encryption_type was not specified but it is required when building PutEncryptionConfigurationOutput",
)
})?,
_request_id: self._request_id,
})
}
}