aws_sdk_s3/types/
_ssekms.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the use of SSE-KMS to encrypt delivered inventory reports.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct Ssekms {
7    /// <p>Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports.</p>
8    pub key_id: ::std::string::String,
9}
10impl Ssekms {
11    /// <p>Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports.</p>
12    pub fn key_id(&self) -> &str {
13        use std::ops::Deref;
14        self.key_id.deref()
15    }
16}
17impl ::std::fmt::Debug for Ssekms {
18    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
19        let mut formatter = f.debug_struct("Ssekms");
20        formatter.field("key_id", &"*** Sensitive Data Redacted ***");
21        formatter.finish()
22    }
23}
24impl Ssekms {
25    /// Creates a new builder-style object to manufacture [`Ssekms`](crate::types::Ssekms).
26    pub fn builder() -> crate::types::builders::SsekmsBuilder {
27        crate::types::builders::SsekmsBuilder::default()
28    }
29}
30
31/// A builder for [`Ssekms`](crate::types::Ssekms).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
33#[non_exhaustive]
34pub struct SsekmsBuilder {
35    pub(crate) key_id: ::std::option::Option<::std::string::String>,
36}
37impl SsekmsBuilder {
38    /// <p>Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports.</p>
39    /// This field is required.
40    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.key_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports.</p>
45    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.key_id = input;
47        self
48    }
49    /// <p>Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports.</p>
50    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.key_id
52    }
53    /// Consumes the builder and constructs a [`Ssekms`](crate::types::Ssekms).
54    /// This method will fail if any of the following fields are not set:
55    /// - [`key_id`](crate::types::builders::SsekmsBuilder::key_id)
56    pub fn build(self) -> ::std::result::Result<crate::types::Ssekms, ::aws_smithy_types::error::operation::BuildError> {
57        ::std::result::Result::Ok(crate::types::Ssekms {
58            key_id: self.key_id.ok_or_else(|| {
59                ::aws_smithy_types::error::operation::BuildError::missing_field(
60                    "key_id",
61                    "key_id was not specified but it is required when building Ssekms",
62                )
63            })?,
64        })
65    }
66}
67impl ::std::fmt::Debug for SsekmsBuilder {
68    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
69        let mut formatter = f.debug_struct("SsekmsBuilder");
70        formatter.field("key_id", &"*** Sensitive Data Redacted ***");
71        formatter.finish()
72    }
73}