aws_sdk_nimble/types/
_studio_encryption_configuration.rs

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