aws_sdk_glue/operation/get_plan/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_plan::_get_plan_output::GetPlanOutputBuilder;
3
4pub use crate::operation::get_plan::_get_plan_input::GetPlanInputBuilder;
5
6impl crate::operation::get_plan::builders::GetPlanInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::get_plan::GetPlanOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_plan::GetPlanError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_plan();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetPlan`.
24///
25/// <p>Gets code to perform a specified mapping.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetPlanFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_plan::builders::GetPlanInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::get_plan::GetPlanOutput, crate::operation::get_plan::GetPlanError>
33    for GetPlanFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::get_plan::GetPlanOutput, crate::operation::get_plan::GetPlanError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl GetPlanFluentBuilder {
45    /// Creates a new `GetPlanFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the GetPlan as a reference.
54    pub fn as_input(&self) -> &crate::operation::get_plan::builders::GetPlanInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::get_plan::GetPlanOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::get_plan::GetPlanError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::get_plan::GetPlan::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::get_plan::GetPlan::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_plan::GetPlanOutput, crate::operation::get_plan::GetPlanError, Self>
90    {
91        crate::client::customize::CustomizableOperation::new(self)
92    }
93    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
94        self.set_config_override(::std::option::Option::Some(config_override.into()));
95        self
96    }
97
98    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
99        self.config_override = config_override;
100        self
101    }
102    ///
103    /// Appends an item to `Mapping`.
104    ///
105    /// To override the contents of this collection use [`set_mapping`](Self::set_mapping).
106    ///
107    /// <p>The list of mappings from a source table to target tables.</p>
108    pub fn mapping(mut self, input: crate::types::MappingEntry) -> Self {
109        self.inner = self.inner.mapping(input);
110        self
111    }
112    /// <p>The list of mappings from a source table to target tables.</p>
113    pub fn set_mapping(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>) -> Self {
114        self.inner = self.inner.set_mapping(input);
115        self
116    }
117    /// <p>The list of mappings from a source table to target tables.</p>
118    pub fn get_mapping(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>> {
119        self.inner.get_mapping()
120    }
121    /// <p>The source table.</p>
122    pub fn source(mut self, input: crate::types::CatalogEntry) -> Self {
123        self.inner = self.inner.source(input);
124        self
125    }
126    /// <p>The source table.</p>
127    pub fn set_source(mut self, input: ::std::option::Option<crate::types::CatalogEntry>) -> Self {
128        self.inner = self.inner.set_source(input);
129        self
130    }
131    /// <p>The source table.</p>
132    pub fn get_source(&self) -> &::std::option::Option<crate::types::CatalogEntry> {
133        self.inner.get_source()
134    }
135    ///
136    /// Appends an item to `Sinks`.
137    ///
138    /// To override the contents of this collection use [`set_sinks`](Self::set_sinks).
139    ///
140    /// <p>The target tables.</p>
141    pub fn sinks(mut self, input: crate::types::CatalogEntry) -> Self {
142        self.inner = self.inner.sinks(input);
143        self
144    }
145    /// <p>The target tables.</p>
146    pub fn set_sinks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>) -> Self {
147        self.inner = self.inner.set_sinks(input);
148        self
149    }
150    /// <p>The target tables.</p>
151    pub fn get_sinks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>> {
152        self.inner.get_sinks()
153    }
154    /// <p>The parameters for the mapping.</p>
155    pub fn location(mut self, input: crate::types::Location) -> Self {
156        self.inner = self.inner.location(input);
157        self
158    }
159    /// <p>The parameters for the mapping.</p>
160    pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
161        self.inner = self.inner.set_location(input);
162        self
163    }
164    /// <p>The parameters for the mapping.</p>
165    pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
166        self.inner.get_location()
167    }
168    /// <p>The programming language of the code to perform the mapping.</p>
169    pub fn language(mut self, input: crate::types::Language) -> Self {
170        self.inner = self.inner.language(input);
171        self
172    }
173    /// <p>The programming language of the code to perform the mapping.</p>
174    pub fn set_language(mut self, input: ::std::option::Option<crate::types::Language>) -> Self {
175        self.inner = self.inner.set_language(input);
176        self
177    }
178    /// <p>The programming language of the code to perform the mapping.</p>
179    pub fn get_language(&self) -> &::std::option::Option<crate::types::Language> {
180        self.inner.get_language()
181    }
182    ///
183    /// Adds a key-value pair to `AdditionalPlanOptionsMap`.
184    ///
185    /// To override the contents of this collection use [`set_additional_plan_options_map`](Self::set_additional_plan_options_map).
186    ///
187    /// <p>A map to hold additional optional key-value parameters.</p>
188    /// <p>Currently, these key-value pairs are supported:</p>
189    /// <ul>
190    /// <li>
191    /// <p><code>inferSchema</code>&nbsp; — &nbsp;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>
192    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
193    /// </ul>
194    pub fn additional_plan_options_map(
195        mut self,
196        k: impl ::std::convert::Into<::std::string::String>,
197        v: impl ::std::convert::Into<::std::string::String>,
198    ) -> Self {
199        self.inner = self.inner.additional_plan_options_map(k.into(), v.into());
200        self
201    }
202    /// <p>A map to hold additional optional key-value parameters.</p>
203    /// <p>Currently, these key-value pairs are supported:</p>
204    /// <ul>
205    /// <li>
206    /// <p><code>inferSchema</code>&nbsp; — &nbsp;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>
207    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
208    /// </ul>
209    pub fn set_additional_plan_options_map(
210        mut self,
211        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
212    ) -> Self {
213        self.inner = self.inner.set_additional_plan_options_map(input);
214        self
215    }
216    /// <p>A map to hold additional optional key-value parameters.</p>
217    /// <p>Currently, these key-value pairs are supported:</p>
218    /// <ul>
219    /// <li>
220    /// <p><code>inferSchema</code>&nbsp; — &nbsp;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>
221    /// <p><code>--additional-plan-options-map '{"inferSchema":"true"}'</code></p></li>
222    /// </ul>
223    pub fn get_additional_plan_options_map(
224        &self,
225    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
226        self.inner.get_additional_plan_options_map()
227    }
228}