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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Specifies the mapping of data property keys.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Mapping {
/// <p>After the apply mapping, what the name of the column should be. Can be the same as <code>FromPath</code>.</p>
pub to_key: ::std::option::Option<::std::string::String>,
/// <p>The table or column to be modified.</p>
pub from_path: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The type of the data to be modified.</p>
pub from_type: ::std::option::Option<::std::string::String>,
/// <p>The data type that the data is to be modified to.</p>
pub to_type: ::std::option::Option<::std::string::String>,
/// <p>If true, then the column is removed.</p>
pub dropped: ::std::option::Option<bool>,
/// <p>Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also <code>Mapping</code>, but its <code>FromPath</code> will be the parent's <code>FromPath</code> plus the <code>FromPath</code> from this structure.</p>
/// <p>For the children part, suppose you have the structure:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
/// <p>You can specify a <code>Mapping</code> that looks like:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
pub children: ::std::option::Option<::std::vec::Vec<crate::types::Mapping>>,
}
impl Mapping {
/// <p>After the apply mapping, what the name of the column should be. Can be the same as <code>FromPath</code>.</p>
pub fn to_key(&self) -> ::std::option::Option<&str> {
self.to_key.as_deref()
}
/// <p>The table or column to be modified.</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 `.from_path.is_none()`.
pub fn from_path(&self) -> &[::std::string::String] {
self.from_path.as_deref().unwrap_or_default()
}
/// <p>The type of the data to be modified.</p>
pub fn from_type(&self) -> ::std::option::Option<&str> {
self.from_type.as_deref()
}
/// <p>The data type that the data is to be modified to.</p>
pub fn to_type(&self) -> ::std::option::Option<&str> {
self.to_type.as_deref()
}
/// <p>If true, then the column is removed.</p>
pub fn dropped(&self) -> ::std::option::Option<bool> {
self.dropped
}
/// <p>Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also <code>Mapping</code>, but its <code>FromPath</code> will be the parent's <code>FromPath</code> plus the <code>FromPath</code> from this structure.</p>
/// <p>For the children part, suppose you have the structure:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
/// <p>You can specify a <code>Mapping</code> that looks like:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></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 `.children.is_none()`.
pub fn children(&self) -> &[crate::types::Mapping] {
self.children.as_deref().unwrap_or_default()
}
}
impl Mapping {
/// Creates a new builder-style object to manufacture [`Mapping`](crate::types::Mapping).
pub fn builder() -> crate::types::builders::MappingBuilder {
crate::types::builders::MappingBuilder::default()
}
}
/// A builder for [`Mapping`](crate::types::Mapping).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct MappingBuilder {
pub(crate) to_key: ::std::option::Option<::std::string::String>,
pub(crate) from_path: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) from_type: ::std::option::Option<::std::string::String>,
pub(crate) to_type: ::std::option::Option<::std::string::String>,
pub(crate) dropped: ::std::option::Option<bool>,
pub(crate) children: ::std::option::Option<::std::vec::Vec<crate::types::Mapping>>,
}
impl MappingBuilder {
/// <p>After the apply mapping, what the name of the column should be. Can be the same as <code>FromPath</code>.</p>
pub fn to_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.to_key = ::std::option::Option::Some(input.into());
self
}
/// <p>After the apply mapping, what the name of the column should be. Can be the same as <code>FromPath</code>.</p>
pub fn set_to_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.to_key = input;
self
}
/// <p>After the apply mapping, what the name of the column should be. Can be the same as <code>FromPath</code>.</p>
pub fn get_to_key(&self) -> &::std::option::Option<::std::string::String> {
&self.to_key
}
/// Appends an item to `from_path`.
///
/// To override the contents of this collection use [`set_from_path`](Self::set_from_path).
///
/// <p>The table or column to be modified.</p>
pub fn from_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.from_path.unwrap_or_default();
v.push(input.into());
self.from_path = ::std::option::Option::Some(v);
self
}
/// <p>The table or column to be modified.</p>
pub fn set_from_path(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.from_path = input;
self
}
/// <p>The table or column to be modified.</p>
pub fn get_from_path(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.from_path
}
/// <p>The type of the data to be modified.</p>
pub fn from_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.from_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of the data to be modified.</p>
pub fn set_from_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.from_type = input;
self
}
/// <p>The type of the data to be modified.</p>
pub fn get_from_type(&self) -> &::std::option::Option<::std::string::String> {
&self.from_type
}
/// <p>The data type that the data is to be modified to.</p>
pub fn to_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.to_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The data type that the data is to be modified to.</p>
pub fn set_to_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.to_type = input;
self
}
/// <p>The data type that the data is to be modified to.</p>
pub fn get_to_type(&self) -> &::std::option::Option<::std::string::String> {
&self.to_type
}
/// <p>If true, then the column is removed.</p>
pub fn dropped(mut self, input: bool) -> Self {
self.dropped = ::std::option::Option::Some(input);
self
}
/// <p>If true, then the column is removed.</p>
pub fn set_dropped(mut self, input: ::std::option::Option<bool>) -> Self {
self.dropped = input;
self
}
/// <p>If true, then the column is removed.</p>
pub fn get_dropped(&self) -> &::std::option::Option<bool> {
&self.dropped
}
/// Appends an item to `children`.
///
/// To override the contents of this collection use [`set_children`](Self::set_children).
///
/// <p>Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also <code>Mapping</code>, but its <code>FromPath</code> will be the parent's <code>FromPath</code> plus the <code>FromPath</code> from this structure.</p>
/// <p>For the children part, suppose you have the structure:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
/// <p>You can specify a <code>Mapping</code> that looks like:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
pub fn children(mut self, input: crate::types::Mapping) -> Self {
let mut v = self.children.unwrap_or_default();
v.push(input);
self.children = ::std::option::Option::Some(v);
self
}
/// <p>Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also <code>Mapping</code>, but its <code>FromPath</code> will be the parent's <code>FromPath</code> plus the <code>FromPath</code> from this structure.</p>
/// <p>For the children part, suppose you have the structure:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
/// <p>You can specify a <code>Mapping</code> that looks like:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
pub fn set_children(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Mapping>>) -> Self {
self.children = input;
self
}
/// <p>Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also <code>Mapping</code>, but its <code>FromPath</code> will be the parent's <code>FromPath</code> plus the <code>FromPath</code> from this structure.</p>
/// <p>For the children part, suppose you have the structure:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
/// <p>You can specify a <code>Mapping</code> that looks like:</p>
/// <p><code>{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": \[{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }\] }</code></p>
pub fn get_children(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Mapping>> {
&self.children
}
/// Consumes the builder and constructs a [`Mapping`](crate::types::Mapping).
pub fn build(self) -> crate::types::Mapping {
crate::types::Mapping {
to_key: self.to_key,
from_path: self.from_path,
from_type: self.from_type,
to_type: self.to_type,
dropped: self.dropped,
children: self.children,
}
}
}