Skip to main content

aws_sdk_glue/operation/update_crawler_schedule/
_update_crawler_schedule_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 UpdateCrawlerScheduleInput {
6    /// <p>The name of the crawler whose schedule to update.</p>
7    pub crawler_name: ::std::option::Option<::std::string::String>,
8    /// <p>The updated <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>
9    pub schedule: ::std::option::Option<::std::string::String>,
10}
11impl UpdateCrawlerScheduleInput {
12    /// <p>The name of the crawler whose schedule to update.</p>
13    pub fn crawler_name(&self) -> ::std::option::Option<&str> {
14        self.crawler_name.as_deref()
15    }
16    /// <p>The updated <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 fn schedule(&self) -> ::std::option::Option<&str> {
18        self.schedule.as_deref()
19    }
20}
21impl UpdateCrawlerScheduleInput {
22    /// Creates a new builder-style object to manufacture [`UpdateCrawlerScheduleInput`](crate::operation::update_crawler_schedule::UpdateCrawlerScheduleInput).
23    pub fn builder() -> crate::operation::update_crawler_schedule::builders::UpdateCrawlerScheduleInputBuilder {
24        crate::operation::update_crawler_schedule::builders::UpdateCrawlerScheduleInputBuilder::default()
25    }
26}
27
28/// A builder for [`UpdateCrawlerScheduleInput`](crate::operation::update_crawler_schedule::UpdateCrawlerScheduleInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct UpdateCrawlerScheduleInputBuilder {
32    pub(crate) crawler_name: ::std::option::Option<::std::string::String>,
33    pub(crate) schedule: ::std::option::Option<::std::string::String>,
34}
35impl UpdateCrawlerScheduleInputBuilder {
36    /// <p>The name of the crawler whose schedule to update.</p>
37    /// This field is required.
38    pub fn crawler_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.crawler_name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The name of the crawler whose schedule to update.</p>
43    pub fn set_crawler_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.crawler_name = input;
45        self
46    }
47    /// <p>The name of the crawler whose schedule to update.</p>
48    pub fn get_crawler_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.crawler_name
50    }
51    /// <p>The updated <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>
52    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.schedule = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The updated <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 set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.schedule = input;
59        self
60    }
61    /// <p>The updated <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>
62    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
63        &self.schedule
64    }
65    /// Consumes the builder and constructs a [`UpdateCrawlerScheduleInput`](crate::operation::update_crawler_schedule::UpdateCrawlerScheduleInput).
66    pub fn build(
67        self,
68    ) -> ::std::result::Result<crate::operation::update_crawler_schedule::UpdateCrawlerScheduleInput, ::aws_smithy_types::error::operation::BuildError>
69    {
70        ::std::result::Result::Ok(crate::operation::update_crawler_schedule::UpdateCrawlerScheduleInput {
71            crawler_name: self.crawler_name,
72            schedule: self.schedule,
73        })
74    }
75}