api_op_ListHostedZonesByName.go (11052B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 "fmt" 8 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 9 "github.com/aws/aws-sdk-go-v2/service/route53/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 ) 13 14 // Retrieves a list of your hosted zones in lexicographic order. The response 15 // includes a HostedZones child element for each hosted zone created by the 16 // current Amazon Web Services account. 17 // 18 // ListHostedZonesByName sorts hosted zones by name with the labels reversed. For 19 // example: 20 // 21 // com.example.www. 22 // 23 // Note the trailing dot, which can change the sort order in some circumstances. 24 // 25 // If the domain name includes escape characters or Punycode, ListHostedZonesByName 26 // alphabetizes the domain name using the escaped or Punycoded value, which is the 27 // format that Amazon Route 53 saves in its database. For example, to create a 28 // hosted zone for exämple.com, you specify ex\344mple.com for the domain name. 29 // ListHostedZonesByName alphabetizes it as: 30 // 31 // com.ex\344mple. 32 // 33 // The labels are reversed and alphabetized using the escaped value. For more 34 // information about valid domain name formats, including internationalized domain 35 // names, see [DNS Domain Name Format]in the Amazon Route 53 Developer Guide. 36 // 37 // Route 53 returns up to 100 items in each response. If you have a lot of hosted 38 // zones, use the MaxItems parameter to list them in groups of up to 100. The 39 // response includes values that help navigate from one group of MaxItems hosted 40 // zones to the next: 41 // 42 // - The DNSName and HostedZoneId elements in the response contain the values, if 43 // any, specified for the dnsname and hostedzoneid parameters in the request that 44 // produced the current response. 45 // 46 // - The MaxItems element in the response contains the value, if any, that you 47 // specified for the maxitems parameter in the request that produced the current 48 // response. 49 // 50 // - If the value of IsTruncated in the response is true, there are more hosted 51 // zones associated with the current Amazon Web Services account. 52 // 53 // If IsTruncated is false, this response includes the last hosted zone that is 54 // 55 // associated with the current account. The NextDNSName element and 56 // NextHostedZoneId elements are omitted from the response. 57 // 58 // - The NextDNSName and NextHostedZoneId elements in the response contain the 59 // domain name and the hosted zone ID of the next hosted zone that is associated 60 // with the current Amazon Web Services account. If you want to list more hosted 61 // zones, make another call to ListHostedZonesByName , and specify the value of 62 // NextDNSName and NextHostedZoneId in the dnsname and hostedzoneid parameters, 63 // respectively. 64 // 65 // [DNS Domain Name Format]: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html 66 func (c *Client) ListHostedZonesByName(ctx context.Context, params *ListHostedZonesByNameInput, optFns ...func(*Options)) (*ListHostedZonesByNameOutput, error) { 67 if params == nil { 68 params = &ListHostedZonesByNameInput{} 69 } 70 71 result, metadata, err := c.invokeOperation(ctx, "ListHostedZonesByName", params, optFns, c.addOperationListHostedZonesByNameMiddlewares) 72 if err != nil { 73 return nil, err 74 } 75 76 out := result.(*ListHostedZonesByNameOutput) 77 out.ResultMetadata = metadata 78 return out, nil 79 } 80 81 // Retrieves a list of the public and private hosted zones that are associated 82 // with the current Amazon Web Services account in ASCII order by domain name. 83 type ListHostedZonesByNameInput struct { 84 85 // (Optional) For your first request to ListHostedZonesByName , include the dnsname 86 // parameter only if you want to specify the name of the first hosted zone in the 87 // response. If you don't include the dnsname parameter, Amazon Route 53 returns 88 // all of the hosted zones that were created by the current Amazon Web Services 89 // account, in ASCII order. For subsequent requests, include both dnsname and 90 // hostedzoneid parameters. For dnsname , specify the value of NextDNSName from 91 // the previous response. 92 DNSName *string 93 94 // (Optional) For your first request to ListHostedZonesByName , do not include the 95 // hostedzoneid parameter. 96 // 97 // If you have more hosted zones than the value of maxitems , ListHostedZonesByName 98 // returns only the first maxitems hosted zones. To get the next group of maxitems 99 // hosted zones, submit another request to ListHostedZonesByName and include both 100 // dnsname and hostedzoneid parameters. For the value of hostedzoneid , specify the 101 // value of the NextHostedZoneId element from the previous response. 102 HostedZoneId *string 103 104 // The maximum number of hosted zones to be included in the response body for this 105 // request. If you have more than maxitems hosted zones, then the value of the 106 // IsTruncated element in the response is true, and the values of NextDNSName and 107 // NextHostedZoneId specify the first hosted zone in the next group of maxitems 108 // hosted zones. 109 MaxItems *int32 110 111 noSmithyDocumentSerde 112 } 113 114 // A complex type that contains the response information for the request. 115 type ListHostedZonesByNameOutput struct { 116 117 // A complex type that contains general information about the hosted zone. 118 // 119 // This member is required. 120 HostedZones []types.HostedZone 121 122 // A flag that indicates whether there are more hosted zones to be listed. If the 123 // response was truncated, you can get the next group of maxitems hosted zones by 124 // calling ListHostedZonesByName again and specifying the values of NextDNSName 125 // and NextHostedZoneId elements in the dnsname and hostedzoneid parameters. 126 // 127 // This member is required. 128 IsTruncated bool 129 130 // The value that you specified for the maxitems parameter in the call to 131 // ListHostedZonesByName that produced the current response. 132 // 133 // This member is required. 134 MaxItems *int32 135 136 // For the second and subsequent calls to ListHostedZonesByName , DNSName is the 137 // value that you specified for the dnsname parameter in the request that produced 138 // the current response. 139 DNSName *string 140 141 // The ID that Amazon Route 53 assigned to the hosted zone when you created it. 142 HostedZoneId *string 143 144 // If IsTruncated is true, the value of NextDNSName is the name of the first 145 // hosted zone in the next group of maxitems hosted zones. Call 146 // ListHostedZonesByName again and specify the value of NextDNSName and 147 // NextHostedZoneId in the dnsname and hostedzoneid parameters, respectively. 148 // 149 // This element is present only if IsTruncated is true . 150 NextDNSName *string 151 152 // If IsTruncated is true , the value of NextHostedZoneId identifies the first 153 // hosted zone in the next group of maxitems hosted zones. Call 154 // ListHostedZonesByName again and specify the value of NextDNSName and 155 // NextHostedZoneId in the dnsname and hostedzoneid parameters, respectively. 156 // 157 // This element is present only if IsTruncated is true . 158 NextHostedZoneId *string 159 160 // Metadata pertaining to the operation's result. 161 ResultMetadata middleware.Metadata 162 163 noSmithyDocumentSerde 164 } 165 166 func (c *Client) addOperationListHostedZonesByNameMiddlewares(stack *middleware.Stack, options Options) (err error) { 167 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 168 return err 169 } 170 err = stack.Serialize.Add(&awsRestxml_serializeOpListHostedZonesByName{}, middleware.After) 171 if err != nil { 172 return err 173 } 174 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListHostedZonesByName{}, middleware.After) 175 if err != nil { 176 return err 177 } 178 if err := addProtocolFinalizerMiddlewares(stack, options, "ListHostedZonesByName"); err != nil { 179 return fmt.Errorf("add protocol finalizers: %v", err) 180 } 181 182 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 183 return err 184 } 185 if err = addSetLoggerMiddleware(stack, options); err != nil { 186 return err 187 } 188 if err = addClientRequestID(stack); err != nil { 189 return err 190 } 191 if err = addComputeContentLength(stack); err != nil { 192 return err 193 } 194 if err = addResolveEndpointMiddleware(stack, options); err != nil { 195 return err 196 } 197 if err = addComputePayloadSHA256(stack); err != nil { 198 return err 199 } 200 if err = addRetry(stack, options); err != nil { 201 return err 202 } 203 if err = addRawResponseToMetadata(stack); err != nil { 204 return err 205 } 206 if err = addRecordResponseTiming(stack); err != nil { 207 return err 208 } 209 if err = addSpanRetryLoop(stack, options); err != nil { 210 return err 211 } 212 if err = addClientUserAgent(stack, options); err != nil { 213 return err 214 } 215 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 216 return err 217 } 218 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 219 return err 220 } 221 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 222 return err 223 } 224 if err = addTimeOffsetBuild(stack, c); err != nil { 225 return err 226 } 227 if err = addUserAgentRetryMode(stack, options); err != nil { 228 return err 229 } 230 if err = addCredentialSource(stack, options); err != nil { 231 return err 232 } 233 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHostedZonesByName(options.Region), middleware.Before); err != nil { 234 return err 235 } 236 if err = addRecursionDetection(stack); err != nil { 237 return err 238 } 239 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 240 return err 241 } 242 if err = addResponseErrorMiddleware(stack); err != nil { 243 return err 244 } 245 if err = addSanitizeURLMiddleware(stack); err != nil { 246 return err 247 } 248 if err = addRequestResponseLogging(stack, options); err != nil { 249 return err 250 } 251 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 252 return err 253 } 254 if err = addInterceptBeforeRetryLoop(stack, options); err != nil { 255 return err 256 } 257 if err = addInterceptAttempt(stack, options); err != nil { 258 return err 259 } 260 if err = addInterceptExecution(stack, options); err != nil { 261 return err 262 } 263 if err = addInterceptBeforeSerialization(stack, options); err != nil { 264 return err 265 } 266 if err = addInterceptAfterSerialization(stack, options); err != nil { 267 return err 268 } 269 if err = addInterceptBeforeSigning(stack, options); err != nil { 270 return err 271 } 272 if err = addInterceptAfterSigning(stack, options); err != nil { 273 return err 274 } 275 if err = addInterceptTransmit(stack, options); err != nil { 276 return err 277 } 278 if err = addInterceptBeforeDeserialization(stack, options); err != nil { 279 return err 280 } 281 if err = addInterceptAfterDeserialization(stack, options); err != nil { 282 return err 283 } 284 if err = addSpanInitializeStart(stack); err != nil { 285 return err 286 } 287 if err = addSpanInitializeEnd(stack); err != nil { 288 return err 289 } 290 if err = addSpanBuildRequestStart(stack); err != nil { 291 return err 292 } 293 if err = addSpanBuildRequestEnd(stack); err != nil { 294 return err 295 } 296 return nil 297 } 298 299 func newServiceMetadataMiddleware_opListHostedZonesByName(region string) *awsmiddleware.RegisterServiceMetadata { 300 return &awsmiddleware.RegisterServiceMetadata{ 301 Region: region, 302 ServiceID: ServiceID, 303 OperationName: "ListHostedZonesByName", 304 } 305 }