aws_sdk_glue/operation/create_trigger/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_trigger::_create_trigger_output::CreateTriggerOutputBuilder;
3
4pub use crate::operation::create_trigger::_create_trigger_input::CreateTriggerInputBuilder;
5
6impl crate::operation::create_trigger::builders::CreateTriggerInputBuilder {
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_trigger::CreateTriggerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_trigger::CreateTriggerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_trigger();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTrigger`.
24///
25/// <p>Creates a new trigger.</p>
26/// <p>Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Amazon Web Services Secrets Manager or other secret management mechanism if you intend to keep them within the Job.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateTriggerFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_trigger::builders::CreateTriggerInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_trigger::CreateTriggerOutput,
36        crate::operation::create_trigger::CreateTriggerError,
37    > for CreateTriggerFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_trigger::CreateTriggerOutput,
45            crate::operation::create_trigger::CreateTriggerError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateTriggerFluentBuilder {
52    /// Creates a new `CreateTriggerFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateTrigger as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_trigger::builders::CreateTriggerInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_trigger::CreateTriggerOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_trigger::CreateTriggerError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_trigger::CreateTrigger::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_trigger::CreateTrigger::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_trigger::CreateTriggerOutput,
98        crate::operation::create_trigger::CreateTriggerError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The name of the trigger.</p>
113    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.name(input.into());
115        self
116    }
117    /// <p>The name of the trigger.</p>
118    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_name(input);
120        self
121    }
122    /// <p>The name of the trigger.</p>
123    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_name()
125    }
126    /// <p>The name of the workflow associated with the trigger.</p>
127    pub fn workflow_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.workflow_name(input.into());
129        self
130    }
131    /// <p>The name of the workflow associated with the trigger.</p>
132    pub fn set_workflow_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_workflow_name(input);
134        self
135    }
136    /// <p>The name of the workflow associated with the trigger.</p>
137    pub fn get_workflow_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_workflow_name()
139    }
140    /// <p>The type of the new trigger.</p>
141    pub fn r#type(mut self, input: crate::types::TriggerType) -> Self {
142        self.inner = self.inner.r#type(input);
143        self
144    }
145    /// <p>The type of the new trigger.</p>
146    pub fn set_type(mut self, input: ::std::option::Option<crate::types::TriggerType>) -> Self {
147        self.inner = self.inner.set_type(input);
148        self
149    }
150    /// <p>The type of the new trigger.</p>
151    pub fn get_type(&self) -> &::std::option::Option<crate::types::TriggerType> {
152        self.inner.get_type()
153    }
154    /// <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>
155    /// <p>This field is required when the trigger type is SCHEDULED.</p>
156    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.schedule(input.into());
158        self
159    }
160    /// <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>
161    /// <p>This field is required when the trigger type is SCHEDULED.</p>
162    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_schedule(input);
164        self
165    }
166    /// <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>
167    /// <p>This field is required when the trigger type is SCHEDULED.</p>
168    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_schedule()
170    }
171    /// <p>A predicate to specify when the new trigger should fire.</p>
172    /// <p>This field is required when the trigger type is <code>CONDITIONAL</code>.</p>
173    pub fn predicate(mut self, input: crate::types::Predicate) -> Self {
174        self.inner = self.inner.predicate(input);
175        self
176    }
177    /// <p>A predicate to specify when the new trigger should fire.</p>
178    /// <p>This field is required when the trigger type is <code>CONDITIONAL</code>.</p>
179    pub fn set_predicate(mut self, input: ::std::option::Option<crate::types::Predicate>) -> Self {
180        self.inner = self.inner.set_predicate(input);
181        self
182    }
183    /// <p>A predicate to specify when the new trigger should fire.</p>
184    /// <p>This field is required when the trigger type is <code>CONDITIONAL</code>.</p>
185    pub fn get_predicate(&self) -> &::std::option::Option<crate::types::Predicate> {
186        self.inner.get_predicate()
187    }
188    ///
189    /// Appends an item to `Actions`.
190    ///
191    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
192    ///
193    /// <p>The actions initiated by this trigger when it fires.</p>
194    pub fn actions(mut self, input: crate::types::Action) -> Self {
195        self.inner = self.inner.actions(input);
196        self
197    }
198    /// <p>The actions initiated by this trigger when it fires.</p>
199    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Action>>) -> Self {
200        self.inner = self.inner.set_actions(input);
201        self
202    }
203    /// <p>The actions initiated by this trigger when it fires.</p>
204    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Action>> {
205        self.inner.get_actions()
206    }
207    /// <p>A description of the new trigger.</p>
208    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.description(input.into());
210        self
211    }
212    /// <p>A description of the new trigger.</p>
213    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_description(input);
215        self
216    }
217    /// <p>A description of the new trigger.</p>
218    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
219        self.inner.get_description()
220    }
221    /// <p>Set to <code>true</code> to start <code>SCHEDULED</code> and <code>CONDITIONAL</code> triggers when created. True is not supported for <code>ON_DEMAND</code> triggers.</p>
222    pub fn start_on_creation(mut self, input: bool) -> Self {
223        self.inner = self.inner.start_on_creation(input);
224        self
225    }
226    /// <p>Set to <code>true</code> to start <code>SCHEDULED</code> and <code>CONDITIONAL</code> triggers when created. True is not supported for <code>ON_DEMAND</code> triggers.</p>
227    pub fn set_start_on_creation(mut self, input: ::std::option::Option<bool>) -> Self {
228        self.inner = self.inner.set_start_on_creation(input);
229        self
230    }
231    /// <p>Set to <code>true</code> to start <code>SCHEDULED</code> and <code>CONDITIONAL</code> triggers when created. True is not supported for <code>ON_DEMAND</code> triggers.</p>
232    pub fn get_start_on_creation(&self) -> &::std::option::Option<bool> {
233        self.inner.get_start_on_creation()
234    }
235    ///
236    /// Adds a key-value pair to `Tags`.
237    ///
238    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
239    ///
240    /// <p>The tags to use with this trigger. You may use tags to limit access to the trigger. 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>
241    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
242        self.inner = self.inner.tags(k.into(), v.into());
243        self
244    }
245    /// <p>The tags to use with this trigger. You may use tags to limit access to the trigger. 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>
246    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
247        self.inner = self.inner.set_tags(input);
248        self
249    }
250    /// <p>The tags to use with this trigger. You may use tags to limit access to the trigger. 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>
251    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
252        self.inner.get_tags()
253    }
254    /// <p>Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.</p>
255    pub fn event_batching_condition(mut self, input: crate::types::EventBatchingCondition) -> Self {
256        self.inner = self.inner.event_batching_condition(input);
257        self
258    }
259    /// <p>Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.</p>
260    pub fn set_event_batching_condition(mut self, input: ::std::option::Option<crate::types::EventBatchingCondition>) -> Self {
261        self.inner = self.inner.set_event_batching_condition(input);
262        self
263    }
264    /// <p>Batch condition that must be met (specified number of events received or batch time window expired) before EventBridge event trigger fires.</p>
265    pub fn get_event_batching_condition(&self) -> &::std::option::Option<crate::types::EventBatchingCondition> {
266        self.inner.get_event_batching_condition()
267    }
268}