1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An endpoint available for interaction with the scheduler.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Endpoint {
/// <p>Indicates the type of endpoint running at the specific IP address.</p>
pub r#type: crate::types::EndpointType,
/// <p>For clusters that use IPv4, this is the endpoint's private IP address.</p>
/// <p>Example: <code>10.1.2.3</code></p>
/// <p>For clusters configured to use IPv6, this is an empty string.</p>
pub private_ip_address: ::std::string::String,
/// <p>The endpoint's public IP address.</p>
/// <p>Example: <code>192.0.2.1</code></p>
pub public_ip_address: ::std::option::Option<::std::string::String>,
/// <p>The endpoint's IPv6 address.</p>
/// <p>Example: <code>2001:db8::1</code></p>
pub ipv6_address: ::std::option::Option<::std::string::String>,
/// <p>The endpoint's connection port number.</p>
/// <p>Example: <code>1234</code></p>
pub port: ::std::string::String,
}
impl Endpoint {
/// <p>Indicates the type of endpoint running at the specific IP address.</p>
pub fn r#type(&self) -> &crate::types::EndpointType {
&self.r#type
}
/// <p>For clusters that use IPv4, this is the endpoint's private IP address.</p>
/// <p>Example: <code>10.1.2.3</code></p>
/// <p>For clusters configured to use IPv6, this is an empty string.</p>
pub fn private_ip_address(&self) -> &str {
use std::ops::Deref;
self.private_ip_address.deref()
}
/// <p>The endpoint's public IP address.</p>
/// <p>Example: <code>192.0.2.1</code></p>
pub fn public_ip_address(&self) -> ::std::option::Option<&str> {
self.public_ip_address.as_deref()
}
/// <p>The endpoint's IPv6 address.</p>
/// <p>Example: <code>2001:db8::1</code></p>
pub fn ipv6_address(&self) -> ::std::option::Option<&str> {
self.ipv6_address.as_deref()
}
/// <p>The endpoint's connection port number.</p>
/// <p>Example: <code>1234</code></p>
pub fn port(&self) -> &str {
use std::ops::Deref;
self.port.deref()
}
}
impl Endpoint {
/// Creates a new builder-style object to manufacture [`Endpoint`](crate::types::Endpoint).
pub fn builder() -> crate::types::builders::EndpointBuilder {
crate::types::builders::EndpointBuilder::default()
}
}
/// A builder for [`Endpoint`](crate::types::Endpoint).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EndpointBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::EndpointType>,
pub(crate) private_ip_address: ::std::option::Option<::std::string::String>,
pub(crate) public_ip_address: ::std::option::Option<::std::string::String>,
pub(crate) ipv6_address: ::std::option::Option<::std::string::String>,
pub(crate) port: ::std::option::Option<::std::string::String>,
}
impl EndpointBuilder {
/// <p>Indicates the type of endpoint running at the specific IP address.</p>
/// This field is required.
pub fn r#type(mut self, input: crate::types::EndpointType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>Indicates the type of endpoint running at the specific IP address.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::EndpointType>) -> Self {
self.r#type = input;
self
}
/// <p>Indicates the type of endpoint running at the specific IP address.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::EndpointType> {
&self.r#type
}
/// <p>For clusters that use IPv4, this is the endpoint's private IP address.</p>
/// <p>Example: <code>10.1.2.3</code></p>
/// <p>For clusters configured to use IPv6, this is an empty string.</p>
/// This field is required.
pub fn private_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.private_ip_address = ::std::option::Option::Some(input.into());
self
}
/// <p>For clusters that use IPv4, this is the endpoint's private IP address.</p>
/// <p>Example: <code>10.1.2.3</code></p>
/// <p>For clusters configured to use IPv6, this is an empty string.</p>
pub fn set_private_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.private_ip_address = input;
self
}
/// <p>For clusters that use IPv4, this is the endpoint's private IP address.</p>
/// <p>Example: <code>10.1.2.3</code></p>
/// <p>For clusters configured to use IPv6, this is an empty string.</p>
pub fn get_private_ip_address(&self) -> &::std::option::Option<::std::string::String> {
&self.private_ip_address
}
/// <p>The endpoint's public IP address.</p>
/// <p>Example: <code>192.0.2.1</code></p>
pub fn public_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.public_ip_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The endpoint's public IP address.</p>
/// <p>Example: <code>192.0.2.1</code></p>
pub fn set_public_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.public_ip_address = input;
self
}
/// <p>The endpoint's public IP address.</p>
/// <p>Example: <code>192.0.2.1</code></p>
pub fn get_public_ip_address(&self) -> &::std::option::Option<::std::string::String> {
&self.public_ip_address
}
/// <p>The endpoint's IPv6 address.</p>
/// <p>Example: <code>2001:db8::1</code></p>
pub fn ipv6_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.ipv6_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The endpoint's IPv6 address.</p>
/// <p>Example: <code>2001:db8::1</code></p>
pub fn set_ipv6_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.ipv6_address = input;
self
}
/// <p>The endpoint's IPv6 address.</p>
/// <p>Example: <code>2001:db8::1</code></p>
pub fn get_ipv6_address(&self) -> &::std::option::Option<::std::string::String> {
&self.ipv6_address
}
/// <p>The endpoint's connection port number.</p>
/// <p>Example: <code>1234</code></p>
/// This field is required.
pub fn port(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.port = ::std::option::Option::Some(input.into());
self
}
/// <p>The endpoint's connection port number.</p>
/// <p>Example: <code>1234</code></p>
pub fn set_port(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.port = input;
self
}
/// <p>The endpoint's connection port number.</p>
/// <p>Example: <code>1234</code></p>
pub fn get_port(&self) -> &::std::option::Option<::std::string::String> {
&self.port
}
/// Consumes the builder and constructs a [`Endpoint`](crate::types::Endpoint).
/// This method will fail if any of the following fields are not set:
/// - [`r#type`](crate::types::builders::EndpointBuilder::type)
/// - [`private_ip_address`](crate::types::builders::EndpointBuilder::private_ip_address)
/// - [`port`](crate::types::builders::EndpointBuilder::port)
pub fn build(self) -> ::std::result::Result<crate::types::Endpoint, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Endpoint {
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Endpoint",
)
})?,
private_ip_address: self.private_ip_address.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"private_ip_address",
"private_ip_address was not specified but it is required when building Endpoint",
)
})?,
public_ip_address: self.public_ip_address,
ipv6_address: self.ipv6_address,
port: self.port.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"port",
"port was not specified but it is required when building Endpoint",
)
})?,
})
}
}