aws_sdk_glue/operation/create_crawler/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_crawler::_create_crawler_output::CreateCrawlerOutputBuilder;
3
4pub use crate::operation::create_crawler::_create_crawler_input::CreateCrawlerInputBuilder;
5
6impl crate::operation::create_crawler::builders::CreateCrawlerInputBuilder {
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::create_crawler::CreateCrawlerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_crawler::CreateCrawlerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_crawler();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCrawler`.
24///
25/// <p>Creates a new crawler with specified targets, role, configuration, and optional schedule. At least one crawl target must be specified, in the <code>s3Targets</code> field, the <code>jdbcTargets</code> field, or the <code>DynamoDBTargets</code> field.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateCrawlerFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_crawler::builders::CreateCrawlerInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_crawler::CreateCrawlerOutput,
35        crate::operation::create_crawler::CreateCrawlerError,
36    > for CreateCrawlerFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_crawler::CreateCrawlerOutput,
44            crate::operation::create_crawler::CreateCrawlerError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateCrawlerFluentBuilder {
51    /// Creates a new `CreateCrawlerFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateCrawler as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_crawler::builders::CreateCrawlerInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_crawler::CreateCrawlerOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_crawler::CreateCrawlerError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_crawler::CreateCrawler::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_crawler::CreateCrawler::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_crawler::CreateCrawlerOutput,
97        crate::operation::create_crawler::CreateCrawlerError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Name of the new crawler.</p>
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.name(input.into());
114        self
115    }
116    /// <p>Name of the new crawler.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_name(input);
119        self
120    }
121    /// <p>Name of the new crawler.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role used by the new crawler to access customer resources.</p>
126    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.role(input.into());
128        self
129    }
130    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role used by the new crawler to access customer resources.</p>
131    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_role(input);
133        self
134    }
135    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role used by the new crawler to access customer resources.</p>
136    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_role()
138    }
139    /// <p>The Glue database where results are written, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
140    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.database_name(input.into());
142        self
143    }
144    /// <p>The Glue database where results are written, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
145    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_database_name(input);
147        self
148    }
149    /// <p>The Glue database where results are written, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
150    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_database_name()
152    }
153    /// <p>A description of the new crawler.</p>
154    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.description(input.into());
156        self
157    }
158    /// <p>A description of the new crawler.</p>
159    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_description(input);
161        self
162    }
163    /// <p>A description of the new crawler.</p>
164    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_description()
166    }
167    /// <p>A list of collection of targets to crawl.</p>
168    pub fn targets(mut self, input: crate::types::CrawlerTargets) -> Self {
169        self.inner = self.inner.targets(input);
170        self
171    }
172    /// <p>A list of collection of targets to crawl.</p>
173    pub fn set_targets(mut self, input: ::std::option::Option<crate::types::CrawlerTargets>) -> Self {
174        self.inner = self.inner.set_targets(input);
175        self
176    }
177    /// <p>A list of collection of targets to crawl.</p>
178    pub fn get_targets(&self) -> &::std::option::Option<crate::types::CrawlerTargets> {
179        self.inner.get_targets()
180    }
181    /// <p>A <code>cron</code> expression used to specify the schedule (see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html">Time-Based Schedules for Jobs and Crawlers</a>. For example, to run something every day at 12:15 UTC, you would specify: <code>cron(15 12 * * ? *)</code>.</p>
182    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.schedule(input.into());
184        self
185    }
186    /// <p>A <code>cron</code> expression used to specify the schedule (see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html">Time-Based Schedules for Jobs and Crawlers</a>. For example, to run something every day at 12:15 UTC, you would specify: <code>cron(15 12 * * ? *)</code>.</p>
187    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_schedule(input);
189        self
190    }
191    /// <p>A <code>cron</code> expression used to specify the schedule (see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html">Time-Based Schedules for Jobs and Crawlers</a>. For example, to run something every day at 12:15 UTC, you would specify: <code>cron(15 12 * * ? *)</code>.</p>
192    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_schedule()
194    }
195    ///
196    /// Appends an item to `Classifiers`.
197    ///
198    /// To override the contents of this collection use [`set_classifiers`](Self::set_classifiers).
199    ///
200    /// <p>A list of custom classifiers that the user has registered. By default, all built-in classifiers are included in a crawl, but these custom classifiers always override the default classifiers for a given classification.</p>
201    pub fn classifiers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.classifiers(input.into());
203        self
204    }
205    /// <p>A list of custom classifiers that the user has registered. By default, all built-in classifiers are included in a crawl, but these custom classifiers always override the default classifiers for a given classification.</p>
206    pub fn set_classifiers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
207        self.inner = self.inner.set_classifiers(input);
208        self
209    }
210    /// <p>A list of custom classifiers that the user has registered. By default, all built-in classifiers are included in a crawl, but these custom classifiers always override the default classifiers for a given classification.</p>
211    pub fn get_classifiers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
212        self.inner.get_classifiers()
213    }
214    /// <p>The table prefix used for catalog tables that are created.</p>
215    pub fn table_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.inner = self.inner.table_prefix(input.into());
217        self
218    }
219    /// <p>The table prefix used for catalog tables that are created.</p>
220    pub fn set_table_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_table_prefix(input);
222        self
223    }
224    /// <p>The table prefix used for catalog tables that are created.</p>
225    pub fn get_table_prefix(&self) -> &::std::option::Option<::std::string::String> {
226        self.inner.get_table_prefix()
227    }
228    /// <p>The policy for the crawler's update and deletion behavior.</p>
229    pub fn schema_change_policy(mut self, input: crate::types::SchemaChangePolicy) -> Self {
230        self.inner = self.inner.schema_change_policy(input);
231        self
232    }
233    /// <p>The policy for the crawler's update and deletion behavior.</p>
234    pub fn set_schema_change_policy(mut self, input: ::std::option::Option<crate::types::SchemaChangePolicy>) -> Self {
235        self.inner = self.inner.set_schema_change_policy(input);
236        self
237    }
238    /// <p>The policy for the crawler's update and deletion behavior.</p>
239    pub fn get_schema_change_policy(&self) -> &::std::option::Option<crate::types::SchemaChangePolicy> {
240        self.inner.get_schema_change_policy()
241    }
242    /// <p>A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.</p>
243    pub fn recrawl_policy(mut self, input: crate::types::RecrawlPolicy) -> Self {
244        self.inner = self.inner.recrawl_policy(input);
245        self
246    }
247    /// <p>A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.</p>
248    pub fn set_recrawl_policy(mut self, input: ::std::option::Option<crate::types::RecrawlPolicy>) -> Self {
249        self.inner = self.inner.set_recrawl_policy(input);
250        self
251    }
252    /// <p>A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.</p>
253    pub fn get_recrawl_policy(&self) -> &::std::option::Option<crate::types::RecrawlPolicy> {
254        self.inner.get_recrawl_policy()
255    }
256    /// <p>Specifies data lineage configuration settings for the crawler.</p>
257    pub fn lineage_configuration(mut self, input: crate::types::LineageConfiguration) -> Self {
258        self.inner = self.inner.lineage_configuration(input);
259        self
260    }
261    /// <p>Specifies data lineage configuration settings for the crawler.</p>
262    pub fn set_lineage_configuration(mut self, input: ::std::option::Option<crate::types::LineageConfiguration>) -> Self {
263        self.inner = self.inner.set_lineage_configuration(input);
264        self
265    }
266    /// <p>Specifies data lineage configuration settings for the crawler.</p>
267    pub fn get_lineage_configuration(&self) -> &::std::option::Option<crate::types::LineageConfiguration> {
268        self.inner.get_lineage_configuration()
269    }
270    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
271    pub fn lake_formation_configuration(mut self, input: crate::types::LakeFormationConfiguration) -> Self {
272        self.inner = self.inner.lake_formation_configuration(input);
273        self
274    }
275    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
276    pub fn set_lake_formation_configuration(mut self, input: ::std::option::Option<crate::types::LakeFormationConfiguration>) -> Self {
277        self.inner = self.inner.set_lake_formation_configuration(input);
278        self
279    }
280    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
281    pub fn get_lake_formation_configuration(&self) -> &::std::option::Option<crate::types::LakeFormationConfiguration> {
282        self.inner.get_lake_formation_configuration()
283    }
284    /// <p>Crawler configuration information. This versioned JSON string allows users to specify aspects of a crawler's behavior. For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html">Setting crawler configuration options</a>.</p>
285    pub fn configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286        self.inner = self.inner.configuration(input.into());
287        self
288    }
289    /// <p>Crawler configuration information. This versioned JSON string allows users to specify aspects of a crawler's behavior. For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html">Setting crawler configuration options</a>.</p>
290    pub fn set_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291        self.inner = self.inner.set_configuration(input);
292        self
293    }
294    /// <p>Crawler configuration information. This versioned JSON string allows users to specify aspects of a crawler's behavior. For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html">Setting crawler configuration options</a>.</p>
295    pub fn get_configuration(&self) -> &::std::option::Option<::std::string::String> {
296        self.inner.get_configuration()
297    }
298    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
299    pub fn crawler_security_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300        self.inner = self.inner.crawler_security_configuration(input.into());
301        self
302    }
303    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
304    pub fn set_crawler_security_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305        self.inner = self.inner.set_crawler_security_configuration(input);
306        self
307    }
308    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
309    pub fn get_crawler_security_configuration(&self) -> &::std::option::Option<::std::string::String> {
310        self.inner.get_crawler_security_configuration()
311    }
312    ///
313    /// Adds a key-value pair to `Tags`.
314    ///
315    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
316    ///
317    /// <p>The tags to use with this crawler request. You may use tags to limit access to the crawler. For more information about tags in Glue, see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">Amazon Web Services Tags in Glue</a> in the developer guide.</p>
318    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
319        self.inner = self.inner.tags(k.into(), v.into());
320        self
321    }
322    /// <p>The tags to use with this crawler request. You may use tags to limit access to the crawler. For more information about tags in Glue, see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">Amazon Web Services Tags in Glue</a> in the developer guide.</p>
323    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
324        self.inner = self.inner.set_tags(input);
325        self
326    }
327    /// <p>The tags to use with this crawler request. You may use tags to limit access to the crawler. For more information about tags in Glue, see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html">Amazon Web Services Tags in Glue</a> in the developer guide.</p>
328    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
329        self.inner.get_tags()
330    }
331}