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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetPlanInput {
/// <p>The list of mappings from a source table to target tables.</p>
pub mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
/// <p>The source table.</p>
pub source: ::std::option::Option<crate::types::CatalogEntry>,
/// <p>The target tables.</p>
pub sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
/// <p>The parameters for the mapping.</p>
pub location: ::std::option::Option<crate::types::Location>,
/// <p>The programming language of the code to perform the mapping.</p>
pub language: ::std::option::Option<crate::types::Language>,
/// <p>A map to hold additional optional key-value parameters.</p>
/// <p>Currently, these key-value pairs are supported:</p>
/// <ul>
/// <li>
/// <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>
/// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
/// </ul>
pub additional_plan_options_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetPlanInput {
/// <p>The list of mappings from a source table to target tables.</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 `.mapping.is_none()`.
pub fn mapping(&self) -> &[crate::types::MappingEntry] {
self.mapping.as_deref().unwrap_or_default()
}
/// <p>The source table.</p>
pub fn source(&self) -> ::std::option::Option<&crate::types::CatalogEntry> {
self.source.as_ref()
}
/// <p>The target tables.</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 `.sinks.is_none()`.
pub fn sinks(&self) -> &[crate::types::CatalogEntry] {
self.sinks.as_deref().unwrap_or_default()
}
/// <p>The parameters for the mapping.</p>
pub fn location(&self) -> ::std::option::Option<&crate::types::Location> {
self.location.as_ref()
}
/// <p>The programming language of the code to perform the mapping.</p>
pub fn language(&self) -> ::std::option::Option<&crate::types::Language> {
self.language.as_ref()
}
/// <p>A map to hold additional optional key-value parameters.</p>
/// <p>Currently, these key-value pairs are supported:</p>
/// <ul>
/// <li>
/// <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>
/// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
/// </ul>
pub fn additional_plan_options_map(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.additional_plan_options_map.as_ref()
}
}
impl GetPlanInput {
/// Creates a new builder-style object to manufacture [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
pub fn builder() -> crate::operation::get_plan::builders::GetPlanInputBuilder {
crate::operation::get_plan::builders::GetPlanInputBuilder::default()
}
}
/// A builder for [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetPlanInputBuilder {
pub(crate) mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
pub(crate) source: ::std::option::Option<crate::types::CatalogEntry>,
pub(crate) sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
pub(crate) location: ::std::option::Option<crate::types::Location>,
pub(crate) language: ::std::option::Option<crate::types::Language>,
pub(crate) additional_plan_options_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetPlanInputBuilder {
/// Appends an item to `mapping`.
///
/// To override the contents of this collection use [`set_mapping`](Self::set_mapping).
///
/// <p>The list of mappings from a source table to target tables.</p>
pub fn mapping(mut self, input: crate::types::MappingEntry) -> Self {
let mut v = self.mapping.unwrap_or_default();
v.push(input);
self.mapping = ::std::option::Option::Some(v);
self
}
/// <p>The list of mappings from a source table to target tables.</p>
pub fn set_mapping(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>) -> Self {
self.mapping = input;
self
}
/// <p>The list of mappings from a source table to target tables.</p>
pub fn get_mapping(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>> {
&self.mapping
}
/// <p>The source table.</p>
/// This field is required.
pub fn source(mut self, input: crate::types::CatalogEntry) -> Self {
self.source = ::std::option::Option::Some(input);
self
}
/// <p>The source table.</p>
pub fn set_source(mut self, input: ::std::option::Option<crate::types::CatalogEntry>) -> Self {
self.source = input;
self
}
/// <p>The source table.</p>
pub fn get_source(&self) -> &::std::option::Option<crate::types::CatalogEntry> {
&self.source
}
/// Appends an item to `sinks`.
///
/// To override the contents of this collection use [`set_sinks`](Self::set_sinks).
///
/// <p>The target tables.</p>
pub fn sinks(mut self, input: crate::types::CatalogEntry) -> Self {
let mut v = self.sinks.unwrap_or_default();
v.push(input);
self.sinks = ::std::option::Option::Some(v);
self
}
/// <p>The target tables.</p>
pub fn set_sinks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>) -> Self {
self.sinks = input;
self
}
/// <p>The target tables.</p>
pub fn get_sinks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>> {
&self.sinks
}
/// <p>The parameters for the mapping.</p>
pub fn location(mut self, input: crate::types::Location) -> Self {
self.location = ::std::option::Option::Some(input);
self
}
/// <p>The parameters for the mapping.</p>
pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
self.location = input;
self
}
/// <p>The parameters for the mapping.</p>
pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
&self.location
}
/// <p>The programming language of the code to perform the mapping.</p>
pub fn language(mut self, input: crate::types::Language) -> Self {
self.language = ::std::option::Option::Some(input);
self
}
/// <p>The programming language of the code to perform the mapping.</p>
pub fn set_language(mut self, input: ::std::option::Option<crate::types::Language>) -> Self {
self.language = input;
self
}
/// <p>The programming language of the code to perform the mapping.</p>
pub fn get_language(&self) -> &::std::option::Option<crate::types::Language> {
&self.language
}
/// Adds a key-value pair to `additional_plan_options_map`.
///
/// To override the contents of this collection use [`set_additional_plan_options_map`](Self::set_additional_plan_options_map).
///
/// <p>A map to hold additional optional key-value parameters.</p>
/// <p>Currently, these key-value pairs are supported:</p>
/// <ul>
/// <li>
/// <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>
/// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
/// </ul>
pub fn additional_plan_options_map(
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_plan_options_map.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.additional_plan_options_map = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map to hold additional optional key-value parameters.</p>
/// <p>Currently, these key-value pairs are supported:</p>
/// <ul>
/// <li>
/// <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>
/// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
/// </ul>
pub fn set_additional_plan_options_map(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.additional_plan_options_map = input;
self
}
/// <p>A map to hold additional optional key-value parameters.</p>
/// <p>Currently, these key-value pairs are supported:</p>
/// <ul>
/// <li>
/// <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>
/// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
/// </ul>
pub fn get_additional_plan_options_map(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.additional_plan_options_map
}
/// Consumes the builder and constructs a [`GetPlanInput`](crate::operation::get_plan::GetPlanInput).
pub fn build(self) -> ::std::result::Result<crate::operation::get_plan::GetPlanInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_plan::GetPlanInput {
mapping: self.mapping,
source: self.source,
sinks: self.sinks,
location: self.location,
language: self.language,
additional_plan_options_map: self.additional_plan_options_map,
})
}
}