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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Instance config object
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct InstanceConfig {
    /// Amazon Connect Instance Id
    pub connect_instance_id: ::std::string::String,
    /// Service linked role arn
    pub service_linked_role_arn: ::std::string::String,
    /// Encryption config for Connect Instance. Note that sensitive data will always be encrypted. If disabled, service will perform encryption with its own key. If enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is only type supported
    pub encryption_config: ::std::option::Option<crate::types::EncryptionConfig>,
}
impl InstanceConfig {
    /// Amazon Connect Instance Id
    pub fn connect_instance_id(&self) -> &str {
        use std::ops::Deref;
        self.connect_instance_id.deref()
    }
    /// Service linked role arn
    pub fn service_linked_role_arn(&self) -> &str {
        use std::ops::Deref;
        self.service_linked_role_arn.deref()
    }
    /// Encryption config for Connect Instance. Note that sensitive data will always be encrypted. If disabled, service will perform encryption with its own key. If enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is only type supported
    pub fn encryption_config(&self) -> ::std::option::Option<&crate::types::EncryptionConfig> {
        self.encryption_config.as_ref()
    }
}
impl InstanceConfig {
    /// Creates a new builder-style object to manufacture [`InstanceConfig`](crate::types::InstanceConfig).
    pub fn builder() -> crate::types::builders::InstanceConfigBuilder {
        crate::types::builders::InstanceConfigBuilder::default()
    }
}

/// A builder for [`InstanceConfig`](crate::types::InstanceConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct InstanceConfigBuilder {
    pub(crate) connect_instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) service_linked_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) encryption_config: ::std::option::Option<crate::types::EncryptionConfig>,
}
impl InstanceConfigBuilder {
    /// Amazon Connect Instance Id
    /// This field is required.
    pub fn connect_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.connect_instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Amazon Connect Instance Id
    pub fn set_connect_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.connect_instance_id = input;
        self
    }
    /// Amazon Connect Instance Id
    pub fn get_connect_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.connect_instance_id
    }
    /// Service linked role arn
    /// This field is required.
    pub fn service_linked_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_linked_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// Service linked role arn
    pub fn set_service_linked_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_linked_role_arn = input;
        self
    }
    /// Service linked role arn
    pub fn get_service_linked_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_linked_role_arn
    }
    /// Encryption config for Connect Instance. Note that sensitive data will always be encrypted. If disabled, service will perform encryption with its own key. If enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is only type supported
    /// This field is required.
    pub fn encryption_config(mut self, input: crate::types::EncryptionConfig) -> Self {
        self.encryption_config = ::std::option::Option::Some(input);
        self
    }
    /// Encryption config for Connect Instance. Note that sensitive data will always be encrypted. If disabled, service will perform encryption with its own key. If enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is only type supported
    pub fn set_encryption_config(mut self, input: ::std::option::Option<crate::types::EncryptionConfig>) -> Self {
        self.encryption_config = input;
        self
    }
    /// Encryption config for Connect Instance. Note that sensitive data will always be encrypted. If disabled, service will perform encryption with its own key. If enabled, a KMS key id needs to be provided and KMS charges will apply. KMS is only type supported
    pub fn get_encryption_config(&self) -> &::std::option::Option<crate::types::EncryptionConfig> {
        &self.encryption_config
    }
    /// Consumes the builder and constructs a [`InstanceConfig`](crate::types::InstanceConfig).
    /// This method will fail if any of the following fields are not set:
    /// - [`connect_instance_id`](crate::types::builders::InstanceConfigBuilder::connect_instance_id)
    /// - [`service_linked_role_arn`](crate::types::builders::InstanceConfigBuilder::service_linked_role_arn)
    pub fn build(self) -> ::std::result::Result<crate::types::InstanceConfig, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::InstanceConfig {
            connect_instance_id: self.connect_instance_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "connect_instance_id",
                    "connect_instance_id was not specified but it is required when building InstanceConfig",
                )
            })?,
            service_linked_role_arn: self.service_linked_role_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "service_linked_role_arn",
                    "service_linked_role_arn was not specified but it is required when building InstanceConfig",
                )
            })?,
            encryption_config: self.encryption_config,
        })
    }
}