aws_sdk_eventbridge/operation/delete_rule/_delete_rule_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 DeleteRuleInput {
6 /// <p>The name of the rule.</p>
7 pub name: ::std::option::Option<::std::string::String>,
8 /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
9 pub event_bus_name: ::std::option::Option<::std::string::String>,
10 /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify <code>Force</code> as <code>True</code> to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using <code>DescribeRule</code> or <code>ListRules</code> and checking the <code>ManagedBy</code> field of the response.</p>
11 pub force: ::std::option::Option<bool>,
12}
13impl DeleteRuleInput {
14 /// <p>The name of the rule.</p>
15 pub fn name(&self) -> ::std::option::Option<&str> {
16 self.name.as_deref()
17 }
18 /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
19 pub fn event_bus_name(&self) -> ::std::option::Option<&str> {
20 self.event_bus_name.as_deref()
21 }
22 /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify <code>Force</code> as <code>True</code> to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using <code>DescribeRule</code> or <code>ListRules</code> and checking the <code>ManagedBy</code> field of the response.</p>
23 pub fn force(&self) -> ::std::option::Option<bool> {
24 self.force
25 }
26}
27impl DeleteRuleInput {
28 /// Creates a new builder-style object to manufacture [`DeleteRuleInput`](crate::operation::delete_rule::DeleteRuleInput).
29 pub fn builder() -> crate::operation::delete_rule::builders::DeleteRuleInputBuilder {
30 crate::operation::delete_rule::builders::DeleteRuleInputBuilder::default()
31 }
32}
33
34/// A builder for [`DeleteRuleInput`](crate::operation::delete_rule::DeleteRuleInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct DeleteRuleInputBuilder {
38 pub(crate) name: ::std::option::Option<::std::string::String>,
39 pub(crate) event_bus_name: ::std::option::Option<::std::string::String>,
40 pub(crate) force: ::std::option::Option<bool>,
41}
42impl DeleteRuleInputBuilder {
43 /// <p>The name of the rule.</p>
44 /// This field is required.
45 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.name = ::std::option::Option::Some(input.into());
47 self
48 }
49 /// <p>The name of the rule.</p>
50 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.name = input;
52 self
53 }
54 /// <p>The name of the rule.</p>
55 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
56 &self.name
57 }
58 /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
59 pub fn event_bus_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60 self.event_bus_name = ::std::option::Option::Some(input.into());
61 self
62 }
63 /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
64 pub fn set_event_bus_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.event_bus_name = input;
66 self
67 }
68 /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
69 pub fn get_event_bus_name(&self) -> &::std::option::Option<::std::string::String> {
70 &self.event_bus_name
71 }
72 /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify <code>Force</code> as <code>True</code> to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using <code>DescribeRule</code> or <code>ListRules</code> and checking the <code>ManagedBy</code> field of the response.</p>
73 pub fn force(mut self, input: bool) -> Self {
74 self.force = ::std::option::Option::Some(input);
75 self
76 }
77 /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify <code>Force</code> as <code>True</code> to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using <code>DescribeRule</code> or <code>ListRules</code> and checking the <code>ManagedBy</code> field of the response.</p>
78 pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
79 self.force = input;
80 self
81 }
82 /// <p>If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify <code>Force</code> as <code>True</code> to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using <code>DescribeRule</code> or <code>ListRules</code> and checking the <code>ManagedBy</code> field of the response.</p>
83 pub fn get_force(&self) -> &::std::option::Option<bool> {
84 &self.force
85 }
86 /// Consumes the builder and constructs a [`DeleteRuleInput`](crate::operation::delete_rule::DeleteRuleInput).
87 pub fn build(self) -> ::std::result::Result<crate::operation::delete_rule::DeleteRuleInput, ::aws_smithy_types::error::operation::BuildError> {
88 ::std::result::Result::Ok(crate::operation::delete_rule::DeleteRuleInput {
89 name: self.name,
90 event_bus_name: self.event_bus_name,
91 force: self.force,
92 })
93 }
94}