aws_sdk_glue/operation/get_plan/_get_plan_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetPlanInput {
6 /// <p>The list of mappings from a source table to target tables.</p>
7 pub mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
8 /// <p>The source table.</p>
9 pub source: ::std::option::Option<crate::types::CatalogEntry>,
10 /// <p>The target tables.</p>
11 pub sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
12 /// <p>The parameters for the mapping.</p>
13 pub location: ::std::option::Option<crate::types::Location>,
14 /// <p>The programming language of the code to perform the mapping.</p>
15 pub language: ::std::option::Option<crate::types::Language>,
16 /// <p>A map to hold additional optional key-value parameters.</p>
17 /// <p>Currently, these key-value pairs are supported:</p>
18 /// <ul>
19 /// <li>
20 /// <p><code>inferSchema</code> — Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
21 /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
22 /// </ul>
23 pub additional_plan_options_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
24}
25impl GetPlanInput {
26 /// <p>The list of mappings from a source table to target tables.</p>
27 ///
28 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mapping.is_none()`.
29 pub fn mapping(&self) -> &[crate::types::MappingEntry] {
30 self.mapping.as_deref().unwrap_or_default()
31 }
32 /// <p>The source table.</p>
33 pub fn source(&self) -> ::std::option::Option<&crate::types::CatalogEntry> {
34 self.source.as_ref()
35 }
36 /// <p>The target tables.</p>
37 ///
38 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sinks.is_none()`.
39 pub fn sinks(&self) -> &[crate::types::CatalogEntry] {
40 self.sinks.as_deref().unwrap_or_default()
41 }
42 /// <p>The parameters for the mapping.</p>
43 pub fn location(&self) -> ::std::option::Option<&crate::types::Location> {
44 self.location.as_ref()
45 }
46 /// <p>The programming language of the code to perform the mapping.</p>
47 pub fn language(&self) -> ::std::option::Option<&crate::types::Language> {
48 self.language.as_ref()
49 }
50 /// <p>A map to hold additional optional key-value parameters.</p>
51 /// <p>Currently, these key-value pairs are supported:</p>
52 /// <ul>
53 /// <li>
54 /// <p><code>inferSchema</code> — Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
55 /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
56 /// </ul>
57 pub fn additional_plan_options_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
58 self.additional_plan_options_map.as_ref()
59 }
60}
61impl GetPlanInput {
62 /// Creates a new builder-style object to manufacture [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
63 pub fn builder() -> crate::operation::get_plan::builders::GetPlanInputBuilder {
64 crate::operation::get_plan::builders::GetPlanInputBuilder::default()
65 }
66}
67
68/// A builder for [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct GetPlanInputBuilder {
72 pub(crate) mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
73 pub(crate) source: ::std::option::Option<crate::types::CatalogEntry>,
74 pub(crate) sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
75 pub(crate) location: ::std::option::Option<crate::types::Location>,
76 pub(crate) language: ::std::option::Option<crate::types::Language>,
77 pub(crate) additional_plan_options_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
78}
79impl GetPlanInputBuilder {
80 /// Appends an item to `mapping`.
81 ///
82 /// To override the contents of this collection use [`set_mapping`](Self::set_mapping).
83 ///
84 /// <p>The list of mappings from a source table to target tables.</p>
85 pub fn mapping(mut self, input: crate::types::MappingEntry) -> Self {
86 let mut v = self.mapping.unwrap_or_default();
87 v.push(input);
88 self.mapping = ::std::option::Option::Some(v);
89 self
90 }
91 /// <p>The list of mappings from a source table to target tables.</p>
92 pub fn set_mapping(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>) -> Self {
93 self.mapping = input;
94 self
95 }
96 /// <p>The list of mappings from a source table to target tables.</p>
97 pub fn get_mapping(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>> {
98 &self.mapping
99 }
100 /// <p>The source table.</p>
101 /// This field is required.
102 pub fn source(mut self, input: crate::types::CatalogEntry) -> Self {
103 self.source = ::std::option::Option::Some(input);
104 self
105 }
106 /// <p>The source table.</p>
107 pub fn set_source(mut self, input: ::std::option::Option<crate::types::CatalogEntry>) -> Self {
108 self.source = input;
109 self
110 }
111 /// <p>The source table.</p>
112 pub fn get_source(&self) -> &::std::option::Option<crate::types::CatalogEntry> {
113 &self.source
114 }
115 /// Appends an item to `sinks`.
116 ///
117 /// To override the contents of this collection use [`set_sinks`](Self::set_sinks).
118 ///
119 /// <p>The target tables.</p>
120 pub fn sinks(mut self, input: crate::types::CatalogEntry) -> Self {
121 let mut v = self.sinks.unwrap_or_default();
122 v.push(input);
123 self.sinks = ::std::option::Option::Some(v);
124 self
125 }
126 /// <p>The target tables.</p>
127 pub fn set_sinks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>) -> Self {
128 self.sinks = input;
129 self
130 }
131 /// <p>The target tables.</p>
132 pub fn get_sinks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>> {
133 &self.sinks
134 }
135 /// <p>The parameters for the mapping.</p>
136 pub fn location(mut self, input: crate::types::Location) -> Self {
137 self.location = ::std::option::Option::Some(input);
138 self
139 }
140 /// <p>The parameters for the mapping.</p>
141 pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
142 self.location = input;
143 self
144 }
145 /// <p>The parameters for the mapping.</p>
146 pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
147 &self.location
148 }
149 /// <p>The programming language of the code to perform the mapping.</p>
150 pub fn language(mut self, input: crate::types::Language) -> Self {
151 self.language = ::std::option::Option::Some(input);
152 self
153 }
154 /// <p>The programming language of the code to perform the mapping.</p>
155 pub fn set_language(mut self, input: ::std::option::Option<crate::types::Language>) -> Self {
156 self.language = input;
157 self
158 }
159 /// <p>The programming language of the code to perform the mapping.</p>
160 pub fn get_language(&self) -> &::std::option::Option<crate::types::Language> {
161 &self.language
162 }
163 /// Adds a key-value pair to `additional_plan_options_map`.
164 ///
165 /// To override the contents of this collection use [`set_additional_plan_options_map`](Self::set_additional_plan_options_map).
166 ///
167 /// <p>A map to hold additional optional key-value parameters.</p>
168 /// <p>Currently, these key-value pairs are supported:</p>
169 /// <ul>
170 /// <li>
171 /// <p><code>inferSchema</code> — Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
172 /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
173 /// </ul>
174 pub fn additional_plan_options_map(
175 mut self,
176 k: impl ::std::convert::Into<::std::string::String>,
177 v: impl ::std::convert::Into<::std::string::String>,
178 ) -> Self {
179 let mut hash_map = self.additional_plan_options_map.unwrap_or_default();
180 hash_map.insert(k.into(), v.into());
181 self.additional_plan_options_map = ::std::option::Option::Some(hash_map);
182 self
183 }
184 /// <p>A map to hold additional optional key-value parameters.</p>
185 /// <p>Currently, these key-value pairs are supported:</p>
186 /// <ul>
187 /// <li>
188 /// <p><code>inferSchema</code> — Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
189 /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
190 /// </ul>
191 pub fn set_additional_plan_options_map(
192 mut self,
193 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
194 ) -> Self {
195 self.additional_plan_options_map = input;
196 self
197 }
198 /// <p>A map to hold additional optional key-value parameters.</p>
199 /// <p>Currently, these key-value pairs are supported:</p>
200 /// <ul>
201 /// <li>
202 /// <p><code>inferSchema</code> — Specifies whether to set <code>inferSchema</code> to true or false for the default script generated by an Glue job. For example, to set <code>inferSchema</code> to true, pass the following key value pair:</p>
203 /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
204 /// </ul>
205 pub fn get_additional_plan_options_map(
206 &self,
207 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
208 &self.additional_plan_options_map
209 }
210 /// Consumes the builder and constructs a [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
211 pub fn build(self) -> ::std::result::Result<crate::operation::get_plan::GetPlanInput, ::aws_smithy_types::error::operation::BuildError> {
212 ::std::result::Result::Ok(crate::operation::get_plan::GetPlanInput {
213 mapping: self.mapping,
214 source: self.source,
215 sinks: self.sinks,
216 location: self.location,
217 language: self.language,
218 additional_plan_options_map: self.additional_plan_options_map,
219 })
220 }
221}