aws_sdk_eventbridge/operation/remove_targets/
_remove_targets_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 RemoveTargetsInput {
6    /// <p>The name of the rule.</p>
7    pub rule: ::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>The IDs of the targets to remove from the rule.</p>
11    pub ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <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 remove targets. 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>
13    pub force: ::std::option::Option<bool>,
14}
15impl RemoveTargetsInput {
16    /// <p>The name of the rule.</p>
17    pub fn rule(&self) -> ::std::option::Option<&str> {
18        self.rule.as_deref()
19    }
20    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
21    pub fn event_bus_name(&self) -> ::std::option::Option<&str> {
22        self.event_bus_name.as_deref()
23    }
24    /// <p>The IDs of the targets to remove from the rule.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ids.is_none()`.
27    pub fn ids(&self) -> &[::std::string::String] {
28        self.ids.as_deref().unwrap_or_default()
29    }
30    /// <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 remove targets. 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>
31    pub fn force(&self) -> ::std::option::Option<bool> {
32        self.force
33    }
34}
35impl RemoveTargetsInput {
36    /// Creates a new builder-style object to manufacture [`RemoveTargetsInput`](crate::operation::remove_targets::RemoveTargetsInput).
37    pub fn builder() -> crate::operation::remove_targets::builders::RemoveTargetsInputBuilder {
38        crate::operation::remove_targets::builders::RemoveTargetsInputBuilder::default()
39    }
40}
41
42/// A builder for [`RemoveTargetsInput`](crate::operation::remove_targets::RemoveTargetsInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct RemoveTargetsInputBuilder {
46    pub(crate) rule: ::std::option::Option<::std::string::String>,
47    pub(crate) event_bus_name: ::std::option::Option<::std::string::String>,
48    pub(crate) ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
49    pub(crate) force: ::std::option::Option<bool>,
50}
51impl RemoveTargetsInputBuilder {
52    /// <p>The name of the rule.</p>
53    /// This field is required.
54    pub fn rule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.rule = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The name of the rule.</p>
59    pub fn set_rule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.rule = input;
61        self
62    }
63    /// <p>The name of the rule.</p>
64    pub fn get_rule(&self) -> &::std::option::Option<::std::string::String> {
65        &self.rule
66    }
67    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
68    pub fn event_bus_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.event_bus_name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
73    pub fn set_event_bus_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.event_bus_name = input;
75        self
76    }
77    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
78    pub fn get_event_bus_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.event_bus_name
80    }
81    /// Appends an item to `ids`.
82    ///
83    /// To override the contents of this collection use [`set_ids`](Self::set_ids).
84    ///
85    /// <p>The IDs of the targets to remove from the rule.</p>
86    pub fn ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        let mut v = self.ids.unwrap_or_default();
88        v.push(input.into());
89        self.ids = ::std::option::Option::Some(v);
90        self
91    }
92    /// <p>The IDs of the targets to remove from the rule.</p>
93    pub fn set_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
94        self.ids = input;
95        self
96    }
97    /// <p>The IDs of the targets to remove from the rule.</p>
98    pub fn get_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
99        &self.ids
100    }
101    /// <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 remove targets. 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>
102    pub fn force(mut self, input: bool) -> Self {
103        self.force = ::std::option::Option::Some(input);
104        self
105    }
106    /// <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 remove targets. 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>
107    pub fn set_force(mut self, input: ::std::option::Option<bool>) -> Self {
108        self.force = input;
109        self
110    }
111    /// <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 remove targets. 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>
112    pub fn get_force(&self) -> &::std::option::Option<bool> {
113        &self.force
114    }
115    /// Consumes the builder and constructs a [`RemoveTargetsInput`](crate::operation::remove_targets::RemoveTargetsInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::remove_targets::RemoveTargetsInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::remove_targets::RemoveTargetsInput {
120            rule: self.rule,
121            event_bus_name: self.event_bus_name,
122            ids: self.ids,
123            force: self.force,
124        })
125    }
126}