aws_sdk_glue/operation/update_crawler/
_update_crawler_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 UpdateCrawlerInput {
6    /// <p>Name of the new crawler.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.</p>
9    pub role: ::std::option::Option<::std::string::String>,
10    /// <p>The Glue database where results are stored, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
11    pub database_name: ::std::option::Option<::std::string::String>,
12    /// <p>A description of the new crawler.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>A list of targets to crawl.</p>
15    pub targets: ::std::option::Option<crate::types::CrawlerTargets>,
16    /// <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>
17    pub schedule: ::std::option::Option<::std::string::String>,
18    /// <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>
19    pub classifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20    /// <p>The table prefix used for catalog tables that are created.</p>
21    pub table_prefix: ::std::option::Option<::std::string::String>,
22    /// <p>The policy for the crawler's update and deletion behavior.</p>
23    pub schema_change_policy: ::std::option::Option<crate::types::SchemaChangePolicy>,
24    /// <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>
25    pub recrawl_policy: ::std::option::Option<crate::types::RecrawlPolicy>,
26    /// <p>Specifies data lineage configuration settings for the crawler.</p>
27    pub lineage_configuration: ::std::option::Option<crate::types::LineageConfiguration>,
28    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
29    pub lake_formation_configuration: ::std::option::Option<crate::types::LakeFormationConfiguration>,
30    /// <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>
31    pub configuration: ::std::option::Option<::std::string::String>,
32    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
33    pub crawler_security_configuration: ::std::option::Option<::std::string::String>,
34}
35impl UpdateCrawlerInput {
36    /// <p>Name of the new crawler.</p>
37    pub fn name(&self) -> ::std::option::Option<&str> {
38        self.name.as_deref()
39    }
40    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.</p>
41    pub fn role(&self) -> ::std::option::Option<&str> {
42        self.role.as_deref()
43    }
44    /// <p>The Glue database where results are stored, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
45    pub fn database_name(&self) -> ::std::option::Option<&str> {
46        self.database_name.as_deref()
47    }
48    /// <p>A description of the new crawler.</p>
49    pub fn description(&self) -> ::std::option::Option<&str> {
50        self.description.as_deref()
51    }
52    /// <p>A list of targets to crawl.</p>
53    pub fn targets(&self) -> ::std::option::Option<&crate::types::CrawlerTargets> {
54        self.targets.as_ref()
55    }
56    /// <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>
57    pub fn schedule(&self) -> ::std::option::Option<&str> {
58        self.schedule.as_deref()
59    }
60    /// <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>
61    ///
62    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.classifiers.is_none()`.
63    pub fn classifiers(&self) -> &[::std::string::String] {
64        self.classifiers.as_deref().unwrap_or_default()
65    }
66    /// <p>The table prefix used for catalog tables that are created.</p>
67    pub fn table_prefix(&self) -> ::std::option::Option<&str> {
68        self.table_prefix.as_deref()
69    }
70    /// <p>The policy for the crawler's update and deletion behavior.</p>
71    pub fn schema_change_policy(&self) -> ::std::option::Option<&crate::types::SchemaChangePolicy> {
72        self.schema_change_policy.as_ref()
73    }
74    /// <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>
75    pub fn recrawl_policy(&self) -> ::std::option::Option<&crate::types::RecrawlPolicy> {
76        self.recrawl_policy.as_ref()
77    }
78    /// <p>Specifies data lineage configuration settings for the crawler.</p>
79    pub fn lineage_configuration(&self) -> ::std::option::Option<&crate::types::LineageConfiguration> {
80        self.lineage_configuration.as_ref()
81    }
82    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
83    pub fn lake_formation_configuration(&self) -> ::std::option::Option<&crate::types::LakeFormationConfiguration> {
84        self.lake_formation_configuration.as_ref()
85    }
86    /// <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>
87    pub fn configuration(&self) -> ::std::option::Option<&str> {
88        self.configuration.as_deref()
89    }
90    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
91    pub fn crawler_security_configuration(&self) -> ::std::option::Option<&str> {
92        self.crawler_security_configuration.as_deref()
93    }
94}
95impl UpdateCrawlerInput {
96    /// Creates a new builder-style object to manufacture [`UpdateCrawlerInput`](crate::operation::update_crawler::UpdateCrawlerInput).
97    pub fn builder() -> crate::operation::update_crawler::builders::UpdateCrawlerInputBuilder {
98        crate::operation::update_crawler::builders::UpdateCrawlerInputBuilder::default()
99    }
100}
101
102/// A builder for [`UpdateCrawlerInput`](crate::operation::update_crawler::UpdateCrawlerInput).
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
104#[non_exhaustive]
105pub struct UpdateCrawlerInputBuilder {
106    pub(crate) name: ::std::option::Option<::std::string::String>,
107    pub(crate) role: ::std::option::Option<::std::string::String>,
108    pub(crate) database_name: ::std::option::Option<::std::string::String>,
109    pub(crate) description: ::std::option::Option<::std::string::String>,
110    pub(crate) targets: ::std::option::Option<crate::types::CrawlerTargets>,
111    pub(crate) schedule: ::std::option::Option<::std::string::String>,
112    pub(crate) classifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
113    pub(crate) table_prefix: ::std::option::Option<::std::string::String>,
114    pub(crate) schema_change_policy: ::std::option::Option<crate::types::SchemaChangePolicy>,
115    pub(crate) recrawl_policy: ::std::option::Option<crate::types::RecrawlPolicy>,
116    pub(crate) lineage_configuration: ::std::option::Option<crate::types::LineageConfiguration>,
117    pub(crate) lake_formation_configuration: ::std::option::Option<crate::types::LakeFormationConfiguration>,
118    pub(crate) configuration: ::std::option::Option<::std::string::String>,
119    pub(crate) crawler_security_configuration: ::std::option::Option<::std::string::String>,
120}
121impl UpdateCrawlerInputBuilder {
122    /// <p>Name of the new crawler.</p>
123    /// This field is required.
124    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.name = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>Name of the new crawler.</p>
129    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.name = input;
131        self
132    }
133    /// <p>Name of the new crawler.</p>
134    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
135        &self.name
136    }
137    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.</p>
138    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.role = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.</p>
143    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.role = input;
145        self
146    }
147    /// <p>The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.</p>
148    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
149        &self.role
150    }
151    /// <p>The Glue database where results are stored, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
152    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.database_name = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The Glue database where results are stored, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
157    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.database_name = input;
159        self
160    }
161    /// <p>The Glue database where results are stored, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
162    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
163        &self.database_name
164    }
165    /// <p>A description of the new crawler.</p>
166    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.description = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>A description of the new crawler.</p>
171    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.description = input;
173        self
174    }
175    /// <p>A description of the new crawler.</p>
176    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
177        &self.description
178    }
179    /// <p>A list of targets to crawl.</p>
180    pub fn targets(mut self, input: crate::types::CrawlerTargets) -> Self {
181        self.targets = ::std::option::Option::Some(input);
182        self
183    }
184    /// <p>A list of targets to crawl.</p>
185    pub fn set_targets(mut self, input: ::std::option::Option<crate::types::CrawlerTargets>) -> Self {
186        self.targets = input;
187        self
188    }
189    /// <p>A list of targets to crawl.</p>
190    pub fn get_targets(&self) -> &::std::option::Option<crate::types::CrawlerTargets> {
191        &self.targets
192    }
193    /// <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>
194    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.schedule = ::std::option::Option::Some(input.into());
196        self
197    }
198    /// <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>
199    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.schedule = input;
201        self
202    }
203    /// <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>
204    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
205        &self.schedule
206    }
207    /// Appends an item to `classifiers`.
208    ///
209    /// To override the contents of this collection use [`set_classifiers`](Self::set_classifiers).
210    ///
211    /// <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>
212    pub fn classifiers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        let mut v = self.classifiers.unwrap_or_default();
214        v.push(input.into());
215        self.classifiers = ::std::option::Option::Some(v);
216        self
217    }
218    /// <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>
219    pub fn set_classifiers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
220        self.classifiers = input;
221        self
222    }
223    /// <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>
224    pub fn get_classifiers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
225        &self.classifiers
226    }
227    /// <p>The table prefix used for catalog tables that are created.</p>
228    pub fn table_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.table_prefix = ::std::option::Option::Some(input.into());
230        self
231    }
232    /// <p>The table prefix used for catalog tables that are created.</p>
233    pub fn set_table_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
234        self.table_prefix = input;
235        self
236    }
237    /// <p>The table prefix used for catalog tables that are created.</p>
238    pub fn get_table_prefix(&self) -> &::std::option::Option<::std::string::String> {
239        &self.table_prefix
240    }
241    /// <p>The policy for the crawler's update and deletion behavior.</p>
242    pub fn schema_change_policy(mut self, input: crate::types::SchemaChangePolicy) -> Self {
243        self.schema_change_policy = ::std::option::Option::Some(input);
244        self
245    }
246    /// <p>The policy for the crawler's update and deletion behavior.</p>
247    pub fn set_schema_change_policy(mut self, input: ::std::option::Option<crate::types::SchemaChangePolicy>) -> Self {
248        self.schema_change_policy = input;
249        self
250    }
251    /// <p>The policy for the crawler's update and deletion behavior.</p>
252    pub fn get_schema_change_policy(&self) -> &::std::option::Option<crate::types::SchemaChangePolicy> {
253        &self.schema_change_policy
254    }
255    /// <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>
256    pub fn recrawl_policy(mut self, input: crate::types::RecrawlPolicy) -> Self {
257        self.recrawl_policy = ::std::option::Option::Some(input);
258        self
259    }
260    /// <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>
261    pub fn set_recrawl_policy(mut self, input: ::std::option::Option<crate::types::RecrawlPolicy>) -> Self {
262        self.recrawl_policy = input;
263        self
264    }
265    /// <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>
266    pub fn get_recrawl_policy(&self) -> &::std::option::Option<crate::types::RecrawlPolicy> {
267        &self.recrawl_policy
268    }
269    /// <p>Specifies data lineage configuration settings for the crawler.</p>
270    pub fn lineage_configuration(mut self, input: crate::types::LineageConfiguration) -> Self {
271        self.lineage_configuration = ::std::option::Option::Some(input);
272        self
273    }
274    /// <p>Specifies data lineage configuration settings for the crawler.</p>
275    pub fn set_lineage_configuration(mut self, input: ::std::option::Option<crate::types::LineageConfiguration>) -> Self {
276        self.lineage_configuration = input;
277        self
278    }
279    /// <p>Specifies data lineage configuration settings for the crawler.</p>
280    pub fn get_lineage_configuration(&self) -> &::std::option::Option<crate::types::LineageConfiguration> {
281        &self.lineage_configuration
282    }
283    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
284    pub fn lake_formation_configuration(mut self, input: crate::types::LakeFormationConfiguration) -> Self {
285        self.lake_formation_configuration = ::std::option::Option::Some(input);
286        self
287    }
288    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
289    pub fn set_lake_formation_configuration(mut self, input: ::std::option::Option<crate::types::LakeFormationConfiguration>) -> Self {
290        self.lake_formation_configuration = input;
291        self
292    }
293    /// <p>Specifies Lake Formation configuration settings for the crawler.</p>
294    pub fn get_lake_formation_configuration(&self) -> &::std::option::Option<crate::types::LakeFormationConfiguration> {
295        &self.lake_formation_configuration
296    }
297    /// <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>
298    pub fn configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299        self.configuration = ::std::option::Option::Some(input.into());
300        self
301    }
302    /// <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>
303    pub fn set_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304        self.configuration = input;
305        self
306    }
307    /// <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>
308    pub fn get_configuration(&self) -> &::std::option::Option<::std::string::String> {
309        &self.configuration
310    }
311    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
312    pub fn crawler_security_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
313        self.crawler_security_configuration = ::std::option::Option::Some(input.into());
314        self
315    }
316    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
317    pub fn set_crawler_security_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
318        self.crawler_security_configuration = input;
319        self
320    }
321    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
322    pub fn get_crawler_security_configuration(&self) -> &::std::option::Option<::std::string::String> {
323        &self.crawler_security_configuration
324    }
325    /// Consumes the builder and constructs a [`UpdateCrawlerInput`](crate::operation::update_crawler::UpdateCrawlerInput).
326    pub fn build(
327        self,
328    ) -> ::std::result::Result<crate::operation::update_crawler::UpdateCrawlerInput, ::aws_smithy_types::error::operation::BuildError> {
329        ::std::result::Result::Ok(crate::operation::update_crawler::UpdateCrawlerInput {
330            name: self.name,
331            role: self.role,
332            database_name: self.database_name,
333            description: self.description,
334            targets: self.targets,
335            schedule: self.schedule,
336            classifiers: self.classifiers,
337            table_prefix: self.table_prefix,
338            schema_change_policy: self.schema_change_policy,
339            recrawl_policy: self.recrawl_policy,
340            lineage_configuration: self.lineage_configuration,
341            lake_formation_configuration: self.lake_formation_configuration,
342            configuration: self.configuration,
343            crawler_security_configuration: self.crawler_security_configuration,
344        })
345    }
346}