-
Notifications
You must be signed in to change notification settings - Fork 597
/
api_op_TestDNSAnswer.go
223 lines (198 loc) · 7.01 KB
/
api_op_TestDNSAnswer.go
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
// Code generated by smithy-go-codegen DO NOT EDIT.
package route53
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/route53/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the value that Amazon Route 53 returns in response to a DNS request for a
// specified record name and type. You can optionally specify the IP address of a
// DNS resolver, an EDNS0 client subnet IP address, and a subnet mask.
//
// This call only supports querying public hosted zones.
//
// The TestDnsAnswer returns information similar to what you would expect from
// the answer section of the dig command. Therefore, if you query for the name
// servers of a subdomain that point to the parent name servers, those will not be
// returned.
func (c *Client) TestDNSAnswer(ctx context.Context, params *TestDNSAnswerInput, optFns ...func(*Options)) (*TestDNSAnswerOutput, error) {
if params == nil {
params = &TestDNSAnswerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TestDNSAnswer", params, optFns, c.addOperationTestDNSAnswerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TestDNSAnswerOutput)
out.ResultMetadata = metadata
return out, nil
}
// Gets the value that Amazon Route 53 returns in response to a DNS request for a
// specified record name and type. You can optionally specify the IP address of a
// DNS resolver, an EDNS0 client subnet IP address, and a subnet mask.
type TestDNSAnswerInput struct {
// The ID of the hosted zone that you want Amazon Route 53 to simulate a query for.
//
// This member is required.
HostedZoneId *string
// The name of the resource record set that you want Amazon Route 53 to simulate a
// query for.
//
// This member is required.
RecordName *string
// The type of the resource record set.
//
// This member is required.
RecordType types.RRType
// If the resolver that you specified for resolverip supports EDNS0, specify the
// IPv4 or IPv6 address of a client in the applicable location, for example,
// 192.0.2.44 or 2001:db8:85a3::8a2e:370:7334 .
EDNS0ClientSubnetIP *string
// If you specify an IP address for edns0clientsubnetip , you can optionally
// specify the number of bits of the IP address that you want the checking tool to
// include in the DNS query. For example, if you specify 192.0.2.44 for
// edns0clientsubnetip and 24 for edns0clientsubnetmask , the checking tool will
// simulate a request from 192.0.2.0/24. The default value is 24 bits for IPv4
// addresses and 64 bits for IPv6 addresses.
//
// The range of valid values depends on whether edns0clientsubnetip is an IPv4 or
// an IPv6 address:
//
// - IPv4: Specify a value between 0 and 32
//
// - IPv6: Specify a value between 0 and 128
EDNS0ClientSubnetMask *string
// If you want to simulate a request from a specific DNS resolver, specify the IP
// address for that resolver. If you omit this value, TestDnsAnswer uses the IP
// address of a DNS resolver in the Amazon Web Services US East (N. Virginia)
// Region ( us-east-1 ).
ResolverIP *string
noSmithyDocumentSerde
}
// A complex type that contains the response to a TestDNSAnswer request.
type TestDNSAnswerOutput struct {
// The Amazon Route 53 name server used to respond to the request.
//
// This member is required.
Nameserver *string
// The protocol that Amazon Route 53 used to respond to the request, either UDP or
// TCP .
//
// This member is required.
Protocol *string
// A list that contains values that Amazon Route 53 returned for this resource
// record set.
//
// This member is required.
RecordData []string
// The name of the resource record set that you submitted a request for.
//
// This member is required.
RecordName *string
// The type of the resource record set that you submitted a request for.
//
// This member is required.
RecordType types.RRType
// A code that indicates whether the request is valid or not. The most common
// response code is NOERROR , 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 [DNS RCODES]on the IANA website.
//
// [DNS RCODES]: http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
//
// This member is required.
ResponseCode *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTestDNSAnswerMiddlewares(stack *middleware.Stack, options Options) (err error) {
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
return err
}
err = stack.Serialize.Add(&awsRestxml_serializeOpTestDNSAnswer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpTestDNSAnswer{}, middleware.After)
if err != nil {
return err
}
if err := addProtocolFinalizerMiddlewares(stack, options, "TestDNSAnswer"); err != nil {
return fmt.Errorf("add protocol finalizers: %v", err)
}
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = addClientRequestID(stack); err != nil {
return err
}
if err = addComputeContentLength(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addComputePayloadSHA256(stack); err != nil {
return err
}
if err = addRetry(stack, options); err != nil {
return err
}
if err = addRawResponseToMetadata(stack); err != nil {
return err
}
if err = addRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack, options); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
return err
}
if err = addOpTestDNSAnswerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestDNSAnswer(options.Region), middleware.Before); err != nil {
return err
}
if err = addRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addSanitizeURLMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTestDNSAnswer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
OperationName: "TestDNSAnswer",
}
}