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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The channel through which Config delivers notifications and updated configuration states.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeliveryChannel {
    /// <p>The name of the delivery channel. By default, Config assigns the name "default" when creating the delivery channel. To change the delivery channel name, you must use the DeleteDeliveryChannel action to delete your current delivery channel, and then you must use the PutDeliveryChannel command to create a delivery channel that has the desired name.</p>
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// <p>The name of the Amazon S3 bucket to which Config delivers configuration snapshots and configuration history files.</p>
    /// <p>If you specify a bucket that belongs to another Amazon Web Services account, that bucket must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html">Permissions for the Amazon S3 Bucket</a> in the <i>Config Developer Guide</i>.</p>
    #[doc(hidden)]
    pub s3_bucket_name: std::option::Option<std::string::String>,
    /// <p>The prefix for the specified Amazon S3 bucket.</p>
    #[doc(hidden)]
    pub s3_key_prefix: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS key (KMS key) used to encrypt objects delivered by Config. Must belong to the same Region as the destination S3 bucket.</p>
    #[doc(hidden)]
    pub s3_kms_key_arn: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config sends notifications about configuration changes.</p>
    /// <p>If you choose a topic from another account, the topic must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html">Permissions for the Amazon SNS Topic</a> in the <i>Config Developer Guide</i>.</p>
    #[doc(hidden)]
    pub sns_topic_arn: std::option::Option<std::string::String>,
    /// <p>The options for how often Config delivers configuration snapshots to the Amazon S3 bucket.</p>
    #[doc(hidden)]
    pub config_snapshot_delivery_properties:
        std::option::Option<crate::types::ConfigSnapshotDeliveryProperties>,
}
impl DeliveryChannel {
    /// <p>The name of the delivery channel. By default, Config assigns the name "default" when creating the delivery channel. To change the delivery channel name, you must use the DeleteDeliveryChannel action to delete your current delivery channel, and then you must use the PutDeliveryChannel command to create a delivery channel that has the desired name.</p>
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The name of the Amazon S3 bucket to which Config delivers configuration snapshots and configuration history files.</p>
    /// <p>If you specify a bucket that belongs to another Amazon Web Services account, that bucket must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html">Permissions for the Amazon S3 Bucket</a> in the <i>Config Developer Guide</i>.</p>
    pub fn s3_bucket_name(&self) -> std::option::Option<&str> {
        self.s3_bucket_name.as_deref()
    }
    /// <p>The prefix for the specified Amazon S3 bucket.</p>
    pub fn s3_key_prefix(&self) -> std::option::Option<&str> {
        self.s3_key_prefix.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS key (KMS key) used to encrypt objects delivered by Config. Must belong to the same Region as the destination S3 bucket.</p>
    pub fn s3_kms_key_arn(&self) -> std::option::Option<&str> {
        self.s3_kms_key_arn.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config sends notifications about configuration changes.</p>
    /// <p>If you choose a topic from another account, the topic must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html">Permissions for the Amazon SNS Topic</a> in the <i>Config Developer Guide</i>.</p>
    pub fn sns_topic_arn(&self) -> std::option::Option<&str> {
        self.sns_topic_arn.as_deref()
    }
    /// <p>The options for how often Config delivers configuration snapshots to the Amazon S3 bucket.</p>
    pub fn config_snapshot_delivery_properties(
        &self,
    ) -> std::option::Option<&crate::types::ConfigSnapshotDeliveryProperties> {
        self.config_snapshot_delivery_properties.as_ref()
    }
}
impl DeliveryChannel {
    /// Creates a new builder-style object to manufacture [`DeliveryChannel`](crate::types::DeliveryChannel).
    pub fn builder() -> crate::types::builders::DeliveryChannelBuilder {
        crate::types::builders::DeliveryChannelBuilder::default()
    }
}

/// A builder for [`DeliveryChannel`](crate::types::DeliveryChannel).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct DeliveryChannelBuilder {
    pub(crate) name: std::option::Option<std::string::String>,
    pub(crate) s3_bucket_name: std::option::Option<std::string::String>,
    pub(crate) s3_key_prefix: std::option::Option<std::string::String>,
    pub(crate) s3_kms_key_arn: std::option::Option<std::string::String>,
    pub(crate) sns_topic_arn: std::option::Option<std::string::String>,
    pub(crate) config_snapshot_delivery_properties:
        std::option::Option<crate::types::ConfigSnapshotDeliveryProperties>,
}
impl DeliveryChannelBuilder {
    /// <p>The name of the delivery channel. By default, Config assigns the name "default" when creating the delivery channel. To change the delivery channel name, you must use the DeleteDeliveryChannel action to delete your current delivery channel, and then you must use the PutDeliveryChannel command to create a delivery channel that has the desired name.</p>
    pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
        self.name = Some(input.into());
        self
    }
    /// <p>The name of the delivery channel. By default, Config assigns the name "default" when creating the delivery channel. To change the delivery channel name, you must use the DeleteDeliveryChannel action to delete your current delivery channel, and then you must use the PutDeliveryChannel command to create a delivery channel that has the desired name.</p>
    pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the Amazon S3 bucket to which Config delivers configuration snapshots and configuration history files.</p>
    /// <p>If you specify a bucket that belongs to another Amazon Web Services account, that bucket must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html">Permissions for the Amazon S3 Bucket</a> in the <i>Config Developer Guide</i>.</p>
    pub fn s3_bucket_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.s3_bucket_name = Some(input.into());
        self
    }
    /// <p>The name of the Amazon S3 bucket to which Config delivers configuration snapshots and configuration history files.</p>
    /// <p>If you specify a bucket that belongs to another Amazon Web Services account, that bucket must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html">Permissions for the Amazon S3 Bucket</a> in the <i>Config Developer Guide</i>.</p>
    pub fn set_s3_bucket_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.s3_bucket_name = input;
        self
    }
    /// <p>The prefix for the specified Amazon S3 bucket.</p>
    pub fn s3_key_prefix(mut self, input: impl Into<std::string::String>) -> Self {
        self.s3_key_prefix = Some(input.into());
        self
    }
    /// <p>The prefix for the specified Amazon S3 bucket.</p>
    pub fn set_s3_key_prefix(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.s3_key_prefix = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS key (KMS key) used to encrypt objects delivered by Config. Must belong to the same Region as the destination S3 bucket.</p>
    pub fn s3_kms_key_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.s3_kms_key_arn = Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS ) KMS key (KMS key) used to encrypt objects delivered by Config. Must belong to the same Region as the destination S3 bucket.</p>
    pub fn set_s3_kms_key_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.s3_kms_key_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config sends notifications about configuration changes.</p>
    /// <p>If you choose a topic from another account, the topic must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html">Permissions for the Amazon SNS Topic</a> in the <i>Config Developer Guide</i>.</p>
    pub fn sns_topic_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.sns_topic_arn = Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon SNS topic to which Config sends notifications about configuration changes.</p>
    /// <p>If you choose a topic from another account, the topic must have policies that grant access permissions to Config. For more information, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html">Permissions for the Amazon SNS Topic</a> in the <i>Config Developer Guide</i>.</p>
    pub fn set_sns_topic_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.sns_topic_arn = input;
        self
    }
    /// <p>The options for how often Config delivers configuration snapshots to the Amazon S3 bucket.</p>
    pub fn config_snapshot_delivery_properties(
        mut self,
        input: crate::types::ConfigSnapshotDeliveryProperties,
    ) -> Self {
        self.config_snapshot_delivery_properties = Some(input);
        self
    }
    /// <p>The options for how often Config delivers configuration snapshots to the Amazon S3 bucket.</p>
    pub fn set_config_snapshot_delivery_properties(
        mut self,
        input: std::option::Option<crate::types::ConfigSnapshotDeliveryProperties>,
    ) -> Self {
        self.config_snapshot_delivery_properties = input;
        self
    }
    /// Consumes the builder and constructs a [`DeliveryChannel`](crate::types::DeliveryChannel).
    pub fn build(self) -> crate::types::DeliveryChannel {
        crate::types::DeliveryChannel {
            name: self.name,
            s3_bucket_name: self.s3_bucket_name,
            s3_key_prefix: self.s3_key_prefix,
            s3_kms_key_arn: self.s3_kms_key_arn,
            sns_topic_arn: self.sns_topic_arn,
            config_snapshot_delivery_properties: self.config_snapshot_delivery_properties,
        }
    }
}