1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Defines a condition under which a trigger fires.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Condition {
/// <p>A logical operator.</p>
pub logical_operator: ::std::option::Option<crate::types::LogicalOperator>,
/// <p>The name of the job whose <code>JobRuns</code> this condition applies to, and on which this trigger waits.</p>
pub job_name: ::std::option::Option<::std::string::String>,
/// <p>The condition state. Currently, the only job states that a trigger can listen for are <code>SUCCEEDED</code>, <code>STOPPED</code>, <code>FAILED</code>, and <code>TIMEOUT</code>. The only crawler states that a trigger can listen for are <code>SUCCEEDED</code>, <code>FAILED</code>, and <code>CANCELLED</code>.</p>
pub state: ::std::option::Option<crate::types::JobRunState>,
/// <p>The name of the crawler to which this condition applies.</p>
pub crawler_name: ::std::option::Option<::std::string::String>,
/// <p>The state of the crawler to which this condition applies.</p>
pub crawl_state: ::std::option::Option<crate::types::CrawlState>,
}
impl Condition {
/// <p>A logical operator.</p>
pub fn logical_operator(&self) -> ::std::option::Option<&crate::types::LogicalOperator> {
self.logical_operator.as_ref()
}
/// <p>The name of the job whose <code>JobRuns</code> this condition applies to, and on which this trigger waits.</p>
pub fn job_name(&self) -> ::std::option::Option<&str> {
self.job_name.as_deref()
}
/// <p>The condition state. Currently, the only job states that a trigger can listen for are <code>SUCCEEDED</code>, <code>STOPPED</code>, <code>FAILED</code>, and <code>TIMEOUT</code>. The only crawler states that a trigger can listen for are <code>SUCCEEDED</code>, <code>FAILED</code>, and <code>CANCELLED</code>.</p>
pub fn state(&self) -> ::std::option::Option<&crate::types::JobRunState> {
self.state.as_ref()
}
/// <p>The name of the crawler to which this condition applies.</p>
pub fn crawler_name(&self) -> ::std::option::Option<&str> {
self.crawler_name.as_deref()
}
/// <p>The state of the crawler to which this condition applies.</p>
pub fn crawl_state(&self) -> ::std::option::Option<&crate::types::CrawlState> {
self.crawl_state.as_ref()
}
}
impl Condition {
/// Creates a new builder-style object to manufacture [`Condition`](crate::types::Condition).
pub fn builder() -> crate::types::builders::ConditionBuilder {
crate::types::builders::ConditionBuilder::default()
}
}
/// A builder for [`Condition`](crate::types::Condition).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ConditionBuilder {
pub(crate) logical_operator: ::std::option::Option<crate::types::LogicalOperator>,
pub(crate) job_name: ::std::option::Option<::std::string::String>,
pub(crate) state: ::std::option::Option<crate::types::JobRunState>,
pub(crate) crawler_name: ::std::option::Option<::std::string::String>,
pub(crate) crawl_state: ::std::option::Option<crate::types::CrawlState>,
}
impl ConditionBuilder {
/// <p>A logical operator.</p>
pub fn logical_operator(mut self, input: crate::types::LogicalOperator) -> Self {
self.logical_operator = ::std::option::Option::Some(input);
self
}
/// <p>A logical operator.</p>
pub fn set_logical_operator(mut self, input: ::std::option::Option<crate::types::LogicalOperator>) -> Self {
self.logical_operator = input;
self
}
/// <p>A logical operator.</p>
pub fn get_logical_operator(&self) -> &::std::option::Option<crate::types::LogicalOperator> {
&self.logical_operator
}
/// <p>The name of the job whose <code>JobRuns</code> this condition applies to, and on which this trigger waits.</p>
pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.job_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the job whose <code>JobRuns</code> this condition applies to, and on which this trigger waits.</p>
pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.job_name = input;
self
}
/// <p>The name of the job whose <code>JobRuns</code> this condition applies to, and on which this trigger waits.</p>
pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
&self.job_name
}
/// <p>The condition state. Currently, the only job states that a trigger can listen for are <code>SUCCEEDED</code>, <code>STOPPED</code>, <code>FAILED</code>, and <code>TIMEOUT</code>. The only crawler states that a trigger can listen for are <code>SUCCEEDED</code>, <code>FAILED</code>, and <code>CANCELLED</code>.</p>
pub fn state(mut self, input: crate::types::JobRunState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>The condition state. Currently, the only job states that a trigger can listen for are <code>SUCCEEDED</code>, <code>STOPPED</code>, <code>FAILED</code>, and <code>TIMEOUT</code>. The only crawler states that a trigger can listen for are <code>SUCCEEDED</code>, <code>FAILED</code>, and <code>CANCELLED</code>.</p>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::JobRunState>) -> Self {
self.state = input;
self
}
/// <p>The condition state. Currently, the only job states that a trigger can listen for are <code>SUCCEEDED</code>, <code>STOPPED</code>, <code>FAILED</code>, and <code>TIMEOUT</code>. The only crawler states that a trigger can listen for are <code>SUCCEEDED</code>, <code>FAILED</code>, and <code>CANCELLED</code>.</p>
pub fn get_state(&self) -> &::std::option::Option<crate::types::JobRunState> {
&self.state
}
/// <p>The name of the crawler to which this condition applies.</p>
pub fn crawler_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.crawler_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the crawler to which this condition applies.</p>
pub fn set_crawler_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.crawler_name = input;
self
}
/// <p>The name of the crawler to which this condition applies.</p>
pub fn get_crawler_name(&self) -> &::std::option::Option<::std::string::String> {
&self.crawler_name
}
/// <p>The state of the crawler to which this condition applies.</p>
pub fn crawl_state(mut self, input: crate::types::CrawlState) -> Self {
self.crawl_state = ::std::option::Option::Some(input);
self
}
/// <p>The state of the crawler to which this condition applies.</p>
pub fn set_crawl_state(mut self, input: ::std::option::Option<crate::types::CrawlState>) -> Self {
self.crawl_state = input;
self
}
/// <p>The state of the crawler to which this condition applies.</p>
pub fn get_crawl_state(&self) -> &::std::option::Option<crate::types::CrawlState> {
&self.crawl_state
}
/// Consumes the builder and constructs a [`Condition`](crate::types::Condition).
pub fn build(self) -> crate::types::Condition {
crate::types::Condition {
logical_operator: self.logical_operator,
job_name: self.job_name,
state: self.state,
crawler_name: self.crawler_name,
crawl_state: self.crawl_state,
}
}
}