api_op_TestDNSAnswer.go (5774B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 8 "github.com/aws/aws-sdk-go-v2/service/route53/types" 9 "github.com/aws/smithy-go/middleware" 10 ) 11 12 // Gets the value that Amazon Route 53 returns in response to a DNS request for a 13 // specified record name and type. You can optionally specify the IP address of a 14 // DNS resolver, an EDNS0 client subnet IP address, and a subnet mask. 15 // 16 // This call only supports querying public hosted zones. 17 // 18 // The TestDnsAnswer returns information similar to what you would expect from 19 // the answer section of the dig command. Therefore, if you query for the name 20 // servers of a subdomain that point to the parent name servers, those will not be 21 // returned. 22 func (c *Client) TestDNSAnswer(ctx context.Context, params *TestDNSAnswerInput, optFns ...func(*Options)) (*TestDNSAnswerOutput, error) { 23 if params == nil { 24 params = &TestDNSAnswerInput{} 25 } 26 27 result, metadata, err := c.invokeOperation(ctx, "TestDNSAnswer", params, optFns, c.addOperationTestDNSAnswerMiddlewares) 28 if err != nil { 29 return nil, err 30 } 31 32 out := result.(*TestDNSAnswerOutput) 33 out.ResultMetadata = metadata 34 return out, nil 35 } 36 37 // Gets the value that Amazon Route 53 returns in response to a DNS request for a 38 // specified record name and type. You can optionally specify the IP address of a 39 // DNS resolver, an EDNS0 client subnet IP address, and a subnet mask. 40 type TestDNSAnswerInput struct { 41 42 // The ID of the hosted zone that you want Amazon Route 53 to simulate a query for. 43 // 44 // This member is required. 45 HostedZoneId *string 46 47 // The name of the resource record set that you want Amazon Route 53 to simulate a 48 // query for. 49 // 50 // This member is required. 51 RecordName *string 52 53 // The type of the resource record set. 54 // 55 // This member is required. 56 RecordType types.RRType 57 58 // If the resolver that you specified for resolverip supports EDNS0, specify the 59 // IPv4 or IPv6 address of a client in the applicable location, for example, 60 // 192.0.2.44 or 2001:db8:85a3::8a2e:370:7334 . 61 EDNS0ClientSubnetIP *string 62 63 // If you specify an IP address for edns0clientsubnetip , you can optionally 64 // specify the number of bits of the IP address that you want the checking tool to 65 // include in the DNS query. For example, if you specify 192.0.2.44 for 66 // edns0clientsubnetip and 24 for edns0clientsubnetmask , the checking tool will 67 // simulate a request from 192.0.2.0/24. The default value is 24 bits for IPv4 68 // addresses and 64 bits for IPv6 addresses. 69 // 70 // The range of valid values depends on whether edns0clientsubnetip is an IPv4 or 71 // an IPv6 address: 72 // 73 // - IPv4: Specify a value between 0 and 32 74 // 75 // - IPv6: Specify a value between 0 and 128 76 EDNS0ClientSubnetMask *string 77 78 // If you want to simulate a request from a specific DNS resolver, specify the IP 79 // address for that resolver. If you omit this value, TestDnsAnswer uses the IP 80 // address of a DNS resolver in the Amazon Web Services US East (N. Virginia) 81 // Region ( us-east-1 ). 82 ResolverIP *string 83 84 noSmithyDocumentSerde 85 } 86 87 // A complex type that contains the response to a TestDNSAnswer request. 88 type TestDNSAnswerOutput struct { 89 90 // The Amazon Route 53 name server used to respond to the request. 91 // 92 // This member is required. 93 Nameserver *string 94 95 // The protocol that Amazon Route 53 used to respond to the request, either UDP or 96 // TCP . 97 // 98 // This member is required. 99 Protocol *string 100 101 // A list that contains values that Amazon Route 53 returned for this resource 102 // record set. 103 // 104 // This member is required. 105 RecordData []string 106 107 // The name of the resource record set that you submitted a request for. 108 // 109 // This member is required. 110 RecordName *string 111 112 // The type of the resource record set that you submitted a request for. 113 // 114 // This member is required. 115 RecordType types.RRType 116 117 // A code that indicates whether the request is valid or not. The most common 118 // response code is NOERROR , meaning that the request is valid. If the response is 119 // not valid, Amazon Route 53 returns a response code that describes the error. For 120 // a list of possible response codes, see [DNS RCODES]on the IANA website. 121 // 122 // [DNS RCODES]: http://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6 123 // 124 // This member is required. 125 ResponseCode *string 126 127 // Metadata pertaining to the operation's result. 128 ResultMetadata middleware.Metadata 129 130 noSmithyDocumentSerde 131 } 132 133 func (c *Client) addOperationTestDNSAnswerMiddlewares(stack *middleware.Stack, options Options) (err error) { 134 err = stack.Serialize.Add(&awsRestxml_serializeOpTestDNSAnswer{}, middleware.After) 135 if err != nil { 136 return err 137 } 138 err = stack.Deserialize.Add(&awsRestxml_deserializeOpTestDNSAnswer{}, middleware.After) 139 if err != nil { 140 return err 141 } 142 143 if err = addComputeContentLength(stack); err != nil { 144 return err 145 } 146 if err = addResolveEndpointMiddleware(stack, options); err != nil { 147 return err 148 } 149 if err = addComputePayloadSHA256(stack); err != nil { 150 return err 151 } 152 if err = addRecordResponseTiming(stack, options); err != nil { 153 return err 154 } 155 if err = addCredentialSource(stack, options); err != nil { 156 return err 157 } 158 if err = addOpTestDNSAnswerValidationMiddleware(stack); err != nil { 159 return err 160 } 161 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 162 return err 163 } 164 if err = addResponseErrorMiddleware(stack); err != nil { 165 return err 166 } 167 if err = addSanitizeURLMiddleware(stack); err != nil { 168 return err 169 } 170 if err = addRequestResponseLogging(stack, options); err != nil { 171 return err 172 } 173 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 174 return err 175 } 176 if err = addInterceptors(stack, options); err != nil { 177 return err 178 } 179 return nil 180 }