aws_sdk_eventbridge/operation/create_endpoint/
_create_endpoint_output.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 CreateEndpointOutput {
6    /// <p>The name of the endpoint that was created by this request.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN of the endpoint that was created by this request.</p>
9    pub arn: ::std::option::Option<::std::string::String>,
10    /// <p>The routing configuration defined by this request.</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>The event buses used by this request.</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    /// <p>The state of the endpoint that was created by this request.</p>
19    pub state: ::std::option::Option<crate::types::EndpointState>,
20    _request_id: Option<String>,
21}
22impl CreateEndpointOutput {
23    /// <p>The name of the endpoint that was created by this request.</p>
24    pub fn name(&self) -> ::std::option::Option<&str> {
25        self.name.as_deref()
26    }
27    /// <p>The ARN of the endpoint that was created by this request.</p>
28    pub fn arn(&self) -> ::std::option::Option<&str> {
29        self.arn.as_deref()
30    }
31    /// <p>The routing configuration defined by this request.</p>
32    pub fn routing_config(&self) -> ::std::option::Option<&crate::types::RoutingConfig> {
33        self.routing_config.as_ref()
34    }
35    /// <p>Whether event replication was enabled or disabled by this request.</p>
36    pub fn replication_config(&self) -> ::std::option::Option<&crate::types::ReplicationConfig> {
37        self.replication_config.as_ref()
38    }
39    /// <p>The event buses used by this request.</p>
40    ///
41    /// 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()`.
42    pub fn event_buses(&self) -> &[crate::types::EndpointEventBus] {
43        self.event_buses.as_deref().unwrap_or_default()
44    }
45    /// <p>The ARN of the role used by event replication for this request.</p>
46    pub fn role_arn(&self) -> ::std::option::Option<&str> {
47        self.role_arn.as_deref()
48    }
49    /// <p>The state of the endpoint that was created by this request.</p>
50    pub fn state(&self) -> ::std::option::Option<&crate::types::EndpointState> {
51        self.state.as_ref()
52    }
53}
54impl ::aws_types::request_id::RequestId for CreateEndpointOutput {
55    fn request_id(&self) -> Option<&str> {
56        self._request_id.as_deref()
57    }
58}
59impl CreateEndpointOutput {
60    /// Creates a new builder-style object to manufacture [`CreateEndpointOutput`](crate::operation::create_endpoint::CreateEndpointOutput).
61    pub fn builder() -> crate::operation::create_endpoint::builders::CreateEndpointOutputBuilder {
62        crate::operation::create_endpoint::builders::CreateEndpointOutputBuilder::default()
63    }
64}
65
66/// A builder for [`CreateEndpointOutput`](crate::operation::create_endpoint::CreateEndpointOutput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct CreateEndpointOutputBuilder {
70    pub(crate) name: ::std::option::Option<::std::string::String>,
71    pub(crate) arn: ::std::option::Option<::std::string::String>,
72    pub(crate) routing_config: ::std::option::Option<crate::types::RoutingConfig>,
73    pub(crate) replication_config: ::std::option::Option<crate::types::ReplicationConfig>,
74    pub(crate) event_buses: ::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>>,
75    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
76    pub(crate) state: ::std::option::Option<crate::types::EndpointState>,
77    _request_id: Option<String>,
78}
79impl CreateEndpointOutputBuilder {
80    /// <p>The name of the endpoint that was created by this request.</p>
81    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.name = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The name of the endpoint that was created by this request.</p>
86    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.name = input;
88        self
89    }
90    /// <p>The name of the endpoint that was created by this request.</p>
91    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.name
93    }
94    /// <p>The ARN of the endpoint that was created by this request.</p>
95    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.arn = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The ARN of the endpoint that was created by this request.</p>
100    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.arn = input;
102        self
103    }
104    /// <p>The ARN of the endpoint that was created by this request.</p>
105    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
106        &self.arn
107    }
108    /// <p>The routing configuration defined by this request.</p>
109    pub fn routing_config(mut self, input: crate::types::RoutingConfig) -> Self {
110        self.routing_config = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The routing configuration defined by this request.</p>
114    pub fn set_routing_config(mut self, input: ::std::option::Option<crate::types::RoutingConfig>) -> Self {
115        self.routing_config = input;
116        self
117    }
118    /// <p>The routing configuration defined by this request.</p>
119    pub fn get_routing_config(&self) -> &::std::option::Option<crate::types::RoutingConfig> {
120        &self.routing_config
121    }
122    /// <p>Whether event replication was enabled or disabled by this request.</p>
123    pub fn replication_config(mut self, input: crate::types::ReplicationConfig) -> Self {
124        self.replication_config = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>Whether event replication was enabled or disabled by this request.</p>
128    pub fn set_replication_config(mut self, input: ::std::option::Option<crate::types::ReplicationConfig>) -> Self {
129        self.replication_config = input;
130        self
131    }
132    /// <p>Whether event replication was enabled or disabled by this request.</p>
133    pub fn get_replication_config(&self) -> &::std::option::Option<crate::types::ReplicationConfig> {
134        &self.replication_config
135    }
136    /// Appends an item to `event_buses`.
137    ///
138    /// To override the contents of this collection use [`set_event_buses`](Self::set_event_buses).
139    ///
140    /// <p>The event buses used by this request.</p>
141    pub fn event_buses(mut self, input: crate::types::EndpointEventBus) -> Self {
142        let mut v = self.event_buses.unwrap_or_default();
143        v.push(input);
144        self.event_buses = ::std::option::Option::Some(v);
145        self
146    }
147    /// <p>The event buses used by this request.</p>
148    pub fn set_event_buses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>>) -> Self {
149        self.event_buses = input;
150        self
151    }
152    /// <p>The event buses used by this request.</p>
153    pub fn get_event_buses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndpointEventBus>> {
154        &self.event_buses
155    }
156    /// <p>The ARN of the role used by event replication for this request.</p>
157    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.role_arn = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>The ARN of the role used by event replication for this request.</p>
162    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.role_arn = input;
164        self
165    }
166    /// <p>The ARN of the role used by event replication for this request.</p>
167    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
168        &self.role_arn
169    }
170    /// <p>The state of the endpoint that was created by this request.</p>
171    pub fn state(mut self, input: crate::types::EndpointState) -> Self {
172        self.state = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>The state of the endpoint that was created by this request.</p>
176    pub fn set_state(mut self, input: ::std::option::Option<crate::types::EndpointState>) -> Self {
177        self.state = input;
178        self
179    }
180    /// <p>The state of the endpoint that was created by this request.</p>
181    pub fn get_state(&self) -> &::std::option::Option<crate::types::EndpointState> {
182        &self.state
183    }
184    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
185        self._request_id = Some(request_id.into());
186        self
187    }
188
189    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
190        self._request_id = request_id;
191        self
192    }
193    /// Consumes the builder and constructs a [`CreateEndpointOutput`](crate::operation::create_endpoint::CreateEndpointOutput).
194    pub fn build(self) -> crate::operation::create_endpoint::CreateEndpointOutput {
195        crate::operation::create_endpoint::CreateEndpointOutput {
196            name: self.name,
197            arn: self.arn,
198            routing_config: self.routing_config,
199            replication_config: self.replication_config,
200            event_buses: self.event_buses,
201            role_arn: self.role_arn,
202            state: self.state,
203            _request_id: self._request_id,
204        }
205    }
206}