aws_sdk_eventbridge/operation/describe_rule/
_describe_rule_output.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 DescribeRuleOutput {
6    /// <p>The name of the rule.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
9    pub arn: ::std::option::Option<::std::string::String>,
10    /// <p>The event pattern. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html">Events and Event Patterns</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
11    pub event_pattern: ::std::option::Option<::std::string::String>,
12    /// <p>The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".</p>
13    pub schedule_expression: ::std::option::Option<::std::string::String>,
14    /// <p>Specifies whether the rule is enabled or disabled.</p>
15    pub state: ::std::option::Option<crate::types::RuleState>,
16    /// <p>The description of the rule.</p>
17    pub description: ::std::option::Option<::std::string::String>,
18    /// <p>The Amazon Resource Name (ARN) of the IAM role associated with the rule.</p>
19    pub role_arn: ::std::option::Option<::std::string::String>,
20    /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, this field displays the principal name of the Amazon Web Services service that created the rule.</p>
21    pub managed_by: ::std::option::Option<::std::string::String>,
22    /// <p>The name of the event bus associated with the rule.</p>
23    pub event_bus_name: ::std::option::Option<::std::string::String>,
24    /// <p>The account ID of the user that created the rule. If you use <code>PutRule</code> to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for <code>CreatedBy</code> is the account ID as the account that created the rule in the other account.</p>
25    pub created_by: ::std::option::Option<::std::string::String>,
26    _request_id: Option<String>,
27}
28impl DescribeRuleOutput {
29    /// <p>The name of the rule.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
34    pub fn arn(&self) -> ::std::option::Option<&str> {
35        self.arn.as_deref()
36    }
37    /// <p>The event pattern. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html">Events and Event Patterns</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
38    pub fn event_pattern(&self) -> ::std::option::Option<&str> {
39        self.event_pattern.as_deref()
40    }
41    /// <p>The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".</p>
42    pub fn schedule_expression(&self) -> ::std::option::Option<&str> {
43        self.schedule_expression.as_deref()
44    }
45    /// <p>Specifies whether the rule is enabled or disabled.</p>
46    pub fn state(&self) -> ::std::option::Option<&crate::types::RuleState> {
47        self.state.as_ref()
48    }
49    /// <p>The description of the rule.</p>
50    pub fn description(&self) -> ::std::option::Option<&str> {
51        self.description.as_deref()
52    }
53    /// <p>The Amazon Resource Name (ARN) of the IAM role associated with the rule.</p>
54    pub fn role_arn(&self) -> ::std::option::Option<&str> {
55        self.role_arn.as_deref()
56    }
57    /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, this field displays the principal name of the Amazon Web Services service that created the rule.</p>
58    pub fn managed_by(&self) -> ::std::option::Option<&str> {
59        self.managed_by.as_deref()
60    }
61    /// <p>The name of the event bus associated with the rule.</p>
62    pub fn event_bus_name(&self) -> ::std::option::Option<&str> {
63        self.event_bus_name.as_deref()
64    }
65    /// <p>The account ID of the user that created the rule. If you use <code>PutRule</code> to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for <code>CreatedBy</code> is the account ID as the account that created the rule in the other account.</p>
66    pub fn created_by(&self) -> ::std::option::Option<&str> {
67        self.created_by.as_deref()
68    }
69}
70impl ::aws_types::request_id::RequestId for DescribeRuleOutput {
71    fn request_id(&self) -> Option<&str> {
72        self._request_id.as_deref()
73    }
74}
75impl DescribeRuleOutput {
76    /// Creates a new builder-style object to manufacture [`DescribeRuleOutput`](crate::operation::describe_rule::DescribeRuleOutput).
77    pub fn builder() -> crate::operation::describe_rule::builders::DescribeRuleOutputBuilder {
78        crate::operation::describe_rule::builders::DescribeRuleOutputBuilder::default()
79    }
80}
81
82/// A builder for [`DescribeRuleOutput`](crate::operation::describe_rule::DescribeRuleOutput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct DescribeRuleOutputBuilder {
86    pub(crate) name: ::std::option::Option<::std::string::String>,
87    pub(crate) arn: ::std::option::Option<::std::string::String>,
88    pub(crate) event_pattern: ::std::option::Option<::std::string::String>,
89    pub(crate) schedule_expression: ::std::option::Option<::std::string::String>,
90    pub(crate) state: ::std::option::Option<crate::types::RuleState>,
91    pub(crate) description: ::std::option::Option<::std::string::String>,
92    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
93    pub(crate) managed_by: ::std::option::Option<::std::string::String>,
94    pub(crate) event_bus_name: ::std::option::Option<::std::string::String>,
95    pub(crate) created_by: ::std::option::Option<::std::string::String>,
96    _request_id: Option<String>,
97}
98impl DescribeRuleOutputBuilder {
99    /// <p>The name of the rule.</p>
100    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.name = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The name of the rule.</p>
105    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.name = input;
107        self
108    }
109    /// <p>The name of the rule.</p>
110    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
111        &self.name
112    }
113    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
114    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.arn = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
119    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.arn = input;
121        self
122    }
123    /// <p>The Amazon Resource Name (ARN) of the rule.</p>
124    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
125        &self.arn
126    }
127    /// <p>The event pattern. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html">Events and Event Patterns</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
128    pub fn event_pattern(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.event_pattern = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>The event pattern. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html">Events and Event Patterns</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
133    pub fn set_event_pattern(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.event_pattern = input;
135        self
136    }
137    /// <p>The event pattern. For more information, see <a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html">Events and Event Patterns</a> in the <i> <i>Amazon EventBridge User Guide</i> </i>.</p>
138    pub fn get_event_pattern(&self) -> &::std::option::Option<::std::string::String> {
139        &self.event_pattern
140    }
141    /// <p>The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".</p>
142    pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.schedule_expression = ::std::option::Option::Some(input.into());
144        self
145    }
146    /// <p>The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".</p>
147    pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.schedule_expression = input;
149        self
150    }
151    /// <p>The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".</p>
152    pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
153        &self.schedule_expression
154    }
155    /// <p>Specifies whether the rule is enabled or disabled.</p>
156    pub fn state(mut self, input: crate::types::RuleState) -> Self {
157        self.state = ::std::option::Option::Some(input);
158        self
159    }
160    /// <p>Specifies whether the rule is enabled or disabled.</p>
161    pub fn set_state(mut self, input: ::std::option::Option<crate::types::RuleState>) -> Self {
162        self.state = input;
163        self
164    }
165    /// <p>Specifies whether the rule is enabled or disabled.</p>
166    pub fn get_state(&self) -> &::std::option::Option<crate::types::RuleState> {
167        &self.state
168    }
169    /// <p>The description of the rule.</p>
170    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.description = ::std::option::Option::Some(input.into());
172        self
173    }
174    /// <p>The description of the rule.</p>
175    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.description = input;
177        self
178    }
179    /// <p>The description of the rule.</p>
180    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
181        &self.description
182    }
183    /// <p>The Amazon Resource Name (ARN) of the IAM role associated with the rule.</p>
184    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.role_arn = ::std::option::Option::Some(input.into());
186        self
187    }
188    /// <p>The Amazon Resource Name (ARN) of the IAM role associated with the rule.</p>
189    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.role_arn = input;
191        self
192    }
193    /// <p>The Amazon Resource Name (ARN) of the IAM role associated with the rule.</p>
194    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
195        &self.role_arn
196    }
197    /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, this field displays the principal name of the Amazon Web Services service that created the rule.</p>
198    pub fn managed_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.managed_by = ::std::option::Option::Some(input.into());
200        self
201    }
202    /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, this field displays the principal name of the Amazon Web Services service that created the rule.</p>
203    pub fn set_managed_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.managed_by = input;
205        self
206    }
207    /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, this field displays the principal name of the Amazon Web Services service that created the rule.</p>
208    pub fn get_managed_by(&self) -> &::std::option::Option<::std::string::String> {
209        &self.managed_by
210    }
211    /// <p>The name of the event bus associated with the rule.</p>
212    pub fn event_bus_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.event_bus_name = ::std::option::Option::Some(input.into());
214        self
215    }
216    /// <p>The name of the event bus associated with the rule.</p>
217    pub fn set_event_bus_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.event_bus_name = input;
219        self
220    }
221    /// <p>The name of the event bus associated with the rule.</p>
222    pub fn get_event_bus_name(&self) -> &::std::option::Option<::std::string::String> {
223        &self.event_bus_name
224    }
225    /// <p>The account ID of the user that created the rule. If you use <code>PutRule</code> to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for <code>CreatedBy</code> is the account ID as the account that created the rule in the other account.</p>
226    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.created_by = ::std::option::Option::Some(input.into());
228        self
229    }
230    /// <p>The account ID of the user that created the rule. If you use <code>PutRule</code> to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for <code>CreatedBy</code> is the account ID as the account that created the rule in the other account.</p>
231    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.created_by = input;
233        self
234    }
235    /// <p>The account ID of the user that created the rule. If you use <code>PutRule</code> to put a rule on an event bus in another account, the other account is the owner of the rule, and the rule ARN includes the account ID for that account. However, the value for <code>CreatedBy</code> is the account ID as the account that created the rule in the other account.</p>
236    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
237        &self.created_by
238    }
239    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
240        self._request_id = Some(request_id.into());
241        self
242    }
243
244    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
245        self._request_id = request_id;
246        self
247    }
248    /// Consumes the builder and constructs a [`DescribeRuleOutput`](crate::operation::describe_rule::DescribeRuleOutput).
249    pub fn build(self) -> crate::operation::describe_rule::DescribeRuleOutput {
250        crate::operation::describe_rule::DescribeRuleOutput {
251            name: self.name,
252            arn: self.arn,
253            event_pattern: self.event_pattern,
254            schedule_expression: self.schedule_expression,
255            state: self.state,
256            description: self.description,
257            role_arn: self.role_arn,
258            managed_by: self.managed_by,
259            event_bus_name: self.event_bus_name,
260            created_by: self.created_by,
261            _request_id: self._request_id,
262        }
263    }
264}