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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies a target that writes to a Delta Lake data source in Amazon S3.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct S3DeltaDirectTarget {
    /// <p>The name of the data target.</p>
    pub name: ::std::string::String,
    /// <p>The nodes that are inputs to the data target.</p>
    pub inputs: ::std::vec::Vec<::std::string::String>,
    /// <p>Specifies native partitioning using a sequence of keys.</p>
    pub partition_keys: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
    /// <p>The Amazon S3 path of your Delta Lake data source to write to.</p>
    pub path: ::std::string::String,
    /// <p>Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are <code>"gzip"</code> and <code>"bzip"</code>).</p>
    pub compression: crate::types::DeltaTargetCompressionType,
    /// <p>Specifies the data output format for the target.</p>
    pub format: crate::types::TargetFormat,
    /// <p>Specifies additional connection options for the connector.</p>
    pub additional_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>A policy that specifies update behavior for the crawler.</p>
    pub schema_change_policy: ::std::option::Option<crate::types::DirectSchemaChangePolicy>,
}
impl S3DeltaDirectTarget {
    /// <p>The name of the data target.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The nodes that are inputs to the data target.</p>
    pub fn inputs(&self) -> &[::std::string::String] {
        use std::ops::Deref;
        self.inputs.deref()
    }
    /// <p>Specifies native partitioning using a sequence of keys.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.partition_keys.is_none()`.
    pub fn partition_keys(&self) -> &[::std::vec::Vec<::std::string::String>] {
        self.partition_keys.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon S3 path of your Delta Lake data source to write to.</p>
    pub fn path(&self) -> &str {
        use std::ops::Deref;
        self.path.deref()
    }
    /// <p>Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are <code>"gzip"</code> and <code>"bzip"</code>).</p>
    pub fn compression(&self) -> &crate::types::DeltaTargetCompressionType {
        &self.compression
    }
    /// <p>Specifies the data output format for the target.</p>
    pub fn format(&self) -> &crate::types::TargetFormat {
        &self.format
    }
    /// <p>Specifies additional connection options for the connector.</p>
    pub fn additional_options(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.additional_options.as_ref()
    }
    /// <p>A policy that specifies update behavior for the crawler.</p>
    pub fn schema_change_policy(&self) -> ::std::option::Option<&crate::types::DirectSchemaChangePolicy> {
        self.schema_change_policy.as_ref()
    }
}
impl S3DeltaDirectTarget {
    /// Creates a new builder-style object to manufacture [`S3DeltaDirectTarget`](crate::types::S3DeltaDirectTarget).
    pub fn builder() -> crate::types::builders::S3DeltaDirectTargetBuilder {
        crate::types::builders::S3DeltaDirectTargetBuilder::default()
    }
}

/// A builder for [`S3DeltaDirectTarget`](crate::types::S3DeltaDirectTarget).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct S3DeltaDirectTargetBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) partition_keys: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
    pub(crate) path: ::std::option::Option<::std::string::String>,
    pub(crate) compression: ::std::option::Option<crate::types::DeltaTargetCompressionType>,
    pub(crate) format: ::std::option::Option<crate::types::TargetFormat>,
    pub(crate) additional_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) schema_change_policy: ::std::option::Option<crate::types::DirectSchemaChangePolicy>,
}
impl S3DeltaDirectTargetBuilder {
    /// <p>The name of the data target.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the data target.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the data target.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `inputs`.
    ///
    /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
    ///
    /// <p>The nodes that are inputs to the data target.</p>
    pub fn inputs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.inputs.unwrap_or_default();
        v.push(input.into());
        self.inputs = ::std::option::Option::Some(v);
        self
    }
    /// <p>The nodes that are inputs to the data target.</p>
    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inputs = input;
        self
    }
    /// <p>The nodes that are inputs to the data target.</p>
    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.inputs
    }
    /// Appends an item to `partition_keys`.
    ///
    /// To override the contents of this collection use [`set_partition_keys`](Self::set_partition_keys).
    ///
    /// <p>Specifies native partitioning using a sequence of keys.</p>
    pub fn partition_keys(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
        let mut v = self.partition_keys.unwrap_or_default();
        v.push(input);
        self.partition_keys = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies native partitioning using a sequence of keys.</p>
    pub fn set_partition_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>) -> Self {
        self.partition_keys = input;
        self
    }
    /// <p>Specifies native partitioning using a sequence of keys.</p>
    pub fn get_partition_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
        &self.partition_keys
    }
    /// <p>The Amazon S3 path of your Delta Lake data source to write to.</p>
    /// This field is required.
    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon S3 path of your Delta Lake data source to write to.</p>
    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.path = input;
        self
    }
    /// <p>The Amazon S3 path of your Delta Lake data source to write to.</p>
    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.path
    }
    /// <p>Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are <code>"gzip"</code> and <code>"bzip"</code>).</p>
    /// This field is required.
    pub fn compression(mut self, input: crate::types::DeltaTargetCompressionType) -> Self {
        self.compression = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are <code>"gzip"</code> and <code>"bzip"</code>).</p>
    pub fn set_compression(mut self, input: ::std::option::Option<crate::types::DeltaTargetCompressionType>) -> Self {
        self.compression = input;
        self
    }
    /// <p>Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are <code>"gzip"</code> and <code>"bzip"</code>).</p>
    pub fn get_compression(&self) -> &::std::option::Option<crate::types::DeltaTargetCompressionType> {
        &self.compression
    }
    /// <p>Specifies the data output format for the target.</p>
    /// This field is required.
    pub fn format(mut self, input: crate::types::TargetFormat) -> Self {
        self.format = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the data output format for the target.</p>
    pub fn set_format(mut self, input: ::std::option::Option<crate::types::TargetFormat>) -> Self {
        self.format = input;
        self
    }
    /// <p>Specifies the data output format for the target.</p>
    pub fn get_format(&self) -> &::std::option::Option<crate::types::TargetFormat> {
        &self.format
    }
    /// Adds a key-value pair to `additional_options`.
    ///
    /// To override the contents of this collection use [`set_additional_options`](Self::set_additional_options).
    ///
    /// <p>Specifies additional connection options for the connector.</p>
    pub fn additional_options(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.additional_options.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.additional_options = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Specifies additional connection options for the connector.</p>
    pub fn set_additional_options(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.additional_options = input;
        self
    }
    /// <p>Specifies additional connection options for the connector.</p>
    pub fn get_additional_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.additional_options
    }
    /// <p>A policy that specifies update behavior for the crawler.</p>
    pub fn schema_change_policy(mut self, input: crate::types::DirectSchemaChangePolicy) -> Self {
        self.schema_change_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>A policy that specifies update behavior for the crawler.</p>
    pub fn set_schema_change_policy(mut self, input: ::std::option::Option<crate::types::DirectSchemaChangePolicy>) -> Self {
        self.schema_change_policy = input;
        self
    }
    /// <p>A policy that specifies update behavior for the crawler.</p>
    pub fn get_schema_change_policy(&self) -> &::std::option::Option<crate::types::DirectSchemaChangePolicy> {
        &self.schema_change_policy
    }
    /// Consumes the builder and constructs a [`S3DeltaDirectTarget`](crate::types::S3DeltaDirectTarget).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::S3DeltaDirectTargetBuilder::name)
    /// - [`inputs`](crate::types::builders::S3DeltaDirectTargetBuilder::inputs)
    /// - [`path`](crate::types::builders::S3DeltaDirectTargetBuilder::path)
    /// - [`compression`](crate::types::builders::S3DeltaDirectTargetBuilder::compression)
    /// - [`format`](crate::types::builders::S3DeltaDirectTargetBuilder::format)
    pub fn build(self) -> ::std::result::Result<crate::types::S3DeltaDirectTarget, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::S3DeltaDirectTarget {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building S3DeltaDirectTarget",
                )
            })?,
            inputs: self.inputs.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "inputs",
                    "inputs was not specified but it is required when building S3DeltaDirectTarget",
                )
            })?,
            partition_keys: self.partition_keys,
            path: self.path.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "path",
                    "path was not specified but it is required when building S3DeltaDirectTarget",
                )
            })?,
            compression: self.compression.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "compression",
                    "compression was not specified but it is required when building S3DeltaDirectTarget",
                )
            })?,
            format: self.format.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "format",
                    "format was not specified but it is required when building S3DeltaDirectTarget",
                )
            })?,
            additional_options: self.additional_options,
            schema_change_policy: self.schema_change_policy,
        })
    }
}