aws_sdk_eventbridge/operation/enable_rule/
_enable_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 EnableRuleInput {
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}
11impl EnableRuleInput {
12    /// <p>The name of the rule.</p>
13    pub fn name(&self) -> ::std::option::Option<&str> {
14        self.name.as_deref()
15    }
16    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
17    pub fn event_bus_name(&self) -> ::std::option::Option<&str> {
18        self.event_bus_name.as_deref()
19    }
20}
21impl EnableRuleInput {
22    /// Creates a new builder-style object to manufacture [`EnableRuleInput`](crate::operation::enable_rule::EnableRuleInput).
23    pub fn builder() -> crate::operation::enable_rule::builders::EnableRuleInputBuilder {
24        crate::operation::enable_rule::builders::EnableRuleInputBuilder::default()
25    }
26}
27
28/// A builder for [`EnableRuleInput`](crate::operation::enable_rule::EnableRuleInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct EnableRuleInputBuilder {
32    pub(crate) name: ::std::option::Option<::std::string::String>,
33    pub(crate) event_bus_name: ::std::option::Option<::std::string::String>,
34}
35impl EnableRuleInputBuilder {
36    /// <p>The name of the rule.</p>
37    /// This field is required.
38    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The name of the rule.</p>
43    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.name = input;
45        self
46    }
47    /// <p>The name of the rule.</p>
48    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.name
50    }
51    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
52    pub fn event_bus_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.event_bus_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
57    pub fn set_event_bus_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.event_bus_name = input;
59        self
60    }
61    /// <p>The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.</p>
62    pub fn get_event_bus_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.event_bus_name
64    }
65    /// Consumes the builder and constructs a [`EnableRuleInput`](crate::operation::enable_rule::EnableRuleInput).
66    pub fn build(self) -> ::std::result::Result<crate::operation::enable_rule::EnableRuleInput, ::aws_smithy_types::error::operation::BuildError> {
67        ::std::result::Result::Ok(crate::operation::enable_rule::EnableRuleInput {
68            name: self.name,
69            event_bus_name: self.event_bus_name,
70        })
71    }
72}