aws_sdk_eventbridge/operation/update_endpoint/
_update_endpoint_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 UpdateEndpointInput {
6    /// <p>The name of the endpoint you want to update.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description for the endpoint.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>Configure the routing policy, including the health check and secondary Region.</p>
11    pub routing_config: ::std::option::Option<crate::types::RoutingConfig>,
12    /// <p>Whether event replication was enabled or disabled by this request.</p>
13    pub replication_config: ::std::option::Option<crate::types::ReplicationConfig>,
14    /// <p>Define event buses used for replication.</p>
15    pub event_buses: ::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>>,
16    /// <p>The ARN of the role used by event replication for this request.</p>
17    pub role_arn: ::std::option::Option<::std::string::String>,
18}
19impl UpdateEndpointInput {
20    /// <p>The name of the endpoint you want to update.</p>
21    pub fn name(&self) -> ::std::option::Option<&str> {
22        self.name.as_deref()
23    }
24    /// <p>A description for the endpoint.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>Configure the routing policy, including the health check and secondary Region.</p>
29    pub fn routing_config(&self) -> ::std::option::Option<&crate::types::RoutingConfig> {
30        self.routing_config.as_ref()
31    }
32    /// <p>Whether event replication was enabled or disabled by this request.</p>
33    pub fn replication_config(&self) -> ::std::option::Option<&crate::types::ReplicationConfig> {
34        self.replication_config.as_ref()
35    }
36    /// <p>Define event buses used for replication.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.event_buses.is_none()`.
39    pub fn event_buses(&self) -> &[crate::types::EndpointEventBus] {
40        self.event_buses.as_deref().unwrap_or_default()
41    }
42    /// <p>The ARN of the role used by event replication for this request.</p>
43    pub fn role_arn(&self) -> ::std::option::Option<&str> {
44        self.role_arn.as_deref()
45    }
46}
47impl UpdateEndpointInput {
48    /// Creates a new builder-style object to manufacture [`UpdateEndpointInput`](crate::operation::update_endpoint::UpdateEndpointInput).
49    pub fn builder() -> crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder {
50        crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder::default()
51    }
52}
53
54/// A builder for [`UpdateEndpointInput`](crate::operation::update_endpoint::UpdateEndpointInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct UpdateEndpointInputBuilder {
58    pub(crate) name: ::std::option::Option<::std::string::String>,
59    pub(crate) description: ::std::option::Option<::std::string::String>,
60    pub(crate) routing_config: ::std::option::Option<crate::types::RoutingConfig>,
61    pub(crate) replication_config: ::std::option::Option<crate::types::ReplicationConfig>,
62    pub(crate) event_buses: ::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>>,
63    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
64}
65impl UpdateEndpointInputBuilder {
66    /// <p>The name of the endpoint you want to update.</p>
67    /// This field is required.
68    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name of the endpoint you want to update.</p>
73    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.name = input;
75        self
76    }
77    /// <p>The name of the endpoint you want to update.</p>
78    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.name
80    }
81    /// <p>A description for the endpoint.</p>
82    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.description = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>A description for the endpoint.</p>
87    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.description = input;
89        self
90    }
91    /// <p>A description for the endpoint.</p>
92    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
93        &self.description
94    }
95    /// <p>Configure the routing policy, including the health check and secondary Region.</p>
96    pub fn routing_config(mut self, input: crate::types::RoutingConfig) -> Self {
97        self.routing_config = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>Configure the routing policy, including the health check and secondary Region.</p>
101    pub fn set_routing_config(mut self, input: ::std::option::Option<crate::types::RoutingConfig>) -> Self {
102        self.routing_config = input;
103        self
104    }
105    /// <p>Configure the routing policy, including the health check and secondary Region.</p>
106    pub fn get_routing_config(&self) -> &::std::option::Option<crate::types::RoutingConfig> {
107        &self.routing_config
108    }
109    /// <p>Whether event replication was enabled or disabled by this request.</p>
110    pub fn replication_config(mut self, input: crate::types::ReplicationConfig) -> Self {
111        self.replication_config = ::std::option::Option::Some(input);
112        self
113    }
114    /// <p>Whether event replication was enabled or disabled by this request.</p>
115    pub fn set_replication_config(mut self, input: ::std::option::Option<crate::types::ReplicationConfig>) -> Self {
116        self.replication_config = input;
117        self
118    }
119    /// <p>Whether event replication was enabled or disabled by this request.</p>
120    pub fn get_replication_config(&self) -> &::std::option::Option<crate::types::ReplicationConfig> {
121        &self.replication_config
122    }
123    /// Appends an item to `event_buses`.
124    ///
125    /// To override the contents of this collection use [`set_event_buses`](Self::set_event_buses).
126    ///
127    /// <p>Define event buses used for replication.</p>
128    pub fn event_buses(mut self, input: crate::types::EndpointEventBus) -> Self {
129        let mut v = self.event_buses.unwrap_or_default();
130        v.push(input);
131        self.event_buses = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>Define event buses used for replication.</p>
135    pub fn set_event_buses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>>) -> Self {
136        self.event_buses = input;
137        self
138    }
139    /// <p>Define event buses used for replication.</p>
140    pub fn get_event_buses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>> {
141        &self.event_buses
142    }
143    /// <p>The ARN of the role used by event replication for this request.</p>
144    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.role_arn = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The ARN of the role used by event replication for this request.</p>
149    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.role_arn = input;
151        self
152    }
153    /// <p>The ARN of the role used by event replication for this request.</p>
154    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
155        &self.role_arn
156    }
157    /// Consumes the builder and constructs a [`UpdateEndpointInput`](crate::operation::update_endpoint::UpdateEndpointInput).
158    pub fn build(
159        self,
160    ) -> ::std::result::Result<crate::operation::update_endpoint::UpdateEndpointInput, ::aws_smithy_types::error::operation::BuildError> {
161        ::std::result::Result::Ok(crate::operation::update_endpoint::UpdateEndpointInput {
162            name: self.name,
163            description: self.description,
164            routing_config: self.routing_config,
165            replication_config: self.replication_config,
166            event_buses: self.event_buses,
167            role_arn: self.role_arn,
168        })
169    }
170}