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