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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A complex type that contains the response to a <code>TestDNSAnswer</code> request.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TestDnsAnswerOutput {
/// <p>The Amazon Route 53 name server used to respond to the request.</p>
pub nameserver: ::std::string::String,
/// <p>The name of the resource record set that you submitted a request for.</p>
pub record_name: ::std::string::String,
/// <p>The type of the resource record set that you submitted a request for.</p>
pub record_type: crate::types::RrType,
/// <p>A list that contains values that Amazon Route 53 returned for this resource record set.</p>
pub record_data: ::std::vec::Vec<::std::string::String>,
/// <p>A code that indicates whether the request is valid or not. The most common response code is <code>NOERROR</code>, meaning that the request is valid. If the response is not valid, Amazon Route 53 returns a response code that describes the error. For a list of possible response codes, see <a href="http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODES</a> on the IANA website.</p>
pub response_code: ::std::string::String,
/// <p>The protocol that Amazon Route 53 used to respond to the request, either <code>UDP</code> or <code>TCP</code>.</p>
pub protocol: ::std::string::String,
_request_id: Option<String>,
}
impl TestDnsAnswerOutput {
/// <p>The Amazon Route 53 name server used to respond to the request.</p>
pub fn nameserver(&self) -> &str {
use std::ops::Deref;
self.nameserver.deref()
}
/// <p>The name of the resource record set that you submitted a request for.</p>
pub fn record_name(&self) -> &str {
use std::ops::Deref;
self.record_name.deref()
}
/// <p>The type of the resource record set that you submitted a request for.</p>
pub fn record_type(&self) -> &crate::types::RrType {
&self.record_type
}
/// <p>A list that contains values that Amazon Route 53 returned for this resource record set.</p>
pub fn record_data(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.record_data.deref()
}
/// <p>A code that indicates whether the request is valid or not. The most common response code is <code>NOERROR</code>, meaning that the request is valid. If the response is not valid, Amazon Route 53 returns a response code that describes the error. For a list of possible response codes, see <a href="http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODES</a> on the IANA website.</p>
pub fn response_code(&self) -> &str {
use std::ops::Deref;
self.response_code.deref()
}
/// <p>The protocol that Amazon Route 53 used to respond to the request, either <code>UDP</code> or <code>TCP</code>.</p>
pub fn protocol(&self) -> &str {
use std::ops::Deref;
self.protocol.deref()
}
}
impl ::aws_types::request_id::RequestId for TestDnsAnswerOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl TestDnsAnswerOutput {
/// Creates a new builder-style object to manufacture [`TestDnsAnswerOutput`](crate::operation::test_dns_answer::TestDnsAnswerOutput).
pub fn builder() -> crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder {
crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::default()
}
}
/// A builder for [`TestDnsAnswerOutput`](crate::operation::test_dns_answer::TestDnsAnswerOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TestDnsAnswerOutputBuilder {
pub(crate) nameserver: ::std::option::Option<::std::string::String>,
pub(crate) record_name: ::std::option::Option<::std::string::String>,
pub(crate) record_type: ::std::option::Option<crate::types::RrType>,
pub(crate) record_data: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) response_code: ::std::option::Option<::std::string::String>,
pub(crate) protocol: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl TestDnsAnswerOutputBuilder {
/// <p>The Amazon Route 53 name server used to respond to the request.</p>
/// This field is required.
pub fn nameserver(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.nameserver = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Route 53 name server used to respond to the request.</p>
pub fn set_nameserver(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.nameserver = input;
self
}
/// <p>The Amazon Route 53 name server used to respond to the request.</p>
pub fn get_nameserver(&self) -> &::std::option::Option<::std::string::String> {
&self.nameserver
}
/// <p>The name of the resource record set that you submitted a request for.</p>
/// This field is required.
pub fn record_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.record_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the resource record set that you submitted a request for.</p>
pub fn set_record_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.record_name = input;
self
}
/// <p>The name of the resource record set that you submitted a request for.</p>
pub fn get_record_name(&self) -> &::std::option::Option<::std::string::String> {
&self.record_name
}
/// <p>The type of the resource record set that you submitted a request for.</p>
/// This field is required.
pub fn record_type(mut self, input: crate::types::RrType) -> Self {
self.record_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the resource record set that you submitted a request for.</p>
pub fn set_record_type(mut self, input: ::std::option::Option<crate::types::RrType>) -> Self {
self.record_type = input;
self
}
/// <p>The type of the resource record set that you submitted a request for.</p>
pub fn get_record_type(&self) -> &::std::option::Option<crate::types::RrType> {
&self.record_type
}
/// Appends an item to `record_data`.
///
/// To override the contents of this collection use [`set_record_data`](Self::set_record_data).
///
/// <p>A list that contains values that Amazon Route 53 returned for this resource record set.</p>
pub fn record_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.record_data.unwrap_or_default();
v.push(input.into());
self.record_data = ::std::option::Option::Some(v);
self
}
/// <p>A list that contains values that Amazon Route 53 returned for this resource record set.</p>
pub fn set_record_data(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.record_data = input;
self
}
/// <p>A list that contains values that Amazon Route 53 returned for this resource record set.</p>
pub fn get_record_data(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.record_data
}
/// <p>A code that indicates whether the request is valid or not. The most common response code is <code>NOERROR</code>, meaning that the request is valid. If the response is not valid, Amazon Route 53 returns a response code that describes the error. For a list of possible response codes, see <a href="http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODES</a> on the IANA website.</p>
/// This field is required.
pub fn response_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.response_code = ::std::option::Option::Some(input.into());
self
}
/// <p>A code that indicates whether the request is valid or not. The most common response code is <code>NOERROR</code>, meaning that the request is valid. If the response is not valid, Amazon Route 53 returns a response code that describes the error. For a list of possible response codes, see <a href="http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODES</a> on the IANA website.</p>
pub fn set_response_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.response_code = input;
self
}
/// <p>A code that indicates whether the request is valid or not. The most common response code is <code>NOERROR</code>, meaning that the request is valid. If the response is not valid, Amazon Route 53 returns a response code that describes the error. For a list of possible response codes, see <a href="http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6">DNS RCODES</a> on the IANA website.</p>
pub fn get_response_code(&self) -> &::std::option::Option<::std::string::String> {
&self.response_code
}
/// <p>The protocol that Amazon Route 53 used to respond to the request, either <code>UDP</code> or <code>TCP</code>.</p>
/// This field is required.
pub fn protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.protocol = ::std::option::Option::Some(input.into());
self
}
/// <p>The protocol that Amazon Route 53 used to respond to the request, either <code>UDP</code> or <code>TCP</code>.</p>
pub fn set_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.protocol = input;
self
}
/// <p>The protocol that Amazon Route 53 used to respond to the request, either <code>UDP</code> or <code>TCP</code>.</p>
pub fn get_protocol(&self) -> &::std::option::Option<::std::string::String> {
&self.protocol
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`TestDnsAnswerOutput`](crate::operation::test_dns_answer::TestDnsAnswerOutput).
/// This method will fail if any of the following fields are not set:
/// - [`nameserver`](crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::nameserver)
/// - [`record_name`](crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::record_name)
/// - [`record_type`](crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::record_type)
/// - [`record_data`](crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::record_data)
/// - [`response_code`](crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::response_code)
/// - [`protocol`](crate::operation::test_dns_answer::builders::TestDnsAnswerOutputBuilder::protocol)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::test_dns_answer::TestDnsAnswerOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::test_dns_answer::TestDnsAnswerOutput {
nameserver: self.nameserver.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"nameserver",
"nameserver was not specified but it is required when building TestDnsAnswerOutput",
)
})?,
record_name: self.record_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"record_name",
"record_name was not specified but it is required when building TestDnsAnswerOutput",
)
})?,
record_type: self.record_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"record_type",
"record_type was not specified but it is required when building TestDnsAnswerOutput",
)
})?,
record_data: self.record_data.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"record_data",
"record_data was not specified but it is required when building TestDnsAnswerOutput",
)
})?,
response_code: self.response_code.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"response_code",
"response_code was not specified but it is required when building TestDnsAnswerOutput",
)
})?,
protocol: self.protocol.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"protocol",
"protocol was not specified but it is required when building TestDnsAnswerOutput",
)
})?,
_request_id: self._request_id,
})
}
}