src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

api_op_ListHostedZonesByName.go (9587B)


      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. ListHostedZonesByName sorts hosted zones
     17 // by name with the labels reversed. For example: com.example.www. Note the
     18 // trailing dot, which can change the sort order in some circumstances. If the
     19 // domain name includes escape characters or Punycode, ListHostedZonesByName
     20 // alphabetizes the domain name using the escaped or Punycoded value, which is the
     21 // format that Amazon Route 53 saves in its database. For example, to create a
     22 // hosted zone for exämple.com, you specify ex\344mple.com for the domain name.
     23 // ListHostedZonesByName alphabetizes it as: com.ex\344mple. The labels are
     24 // reversed and alphabetized using the escaped value. For more information about
     25 // valid domain name formats, including internationalized domain names, see DNS
     26 // Domain Name Format (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html)
     27 // in the Amazon Route 53 Developer Guide. Route 53 returns up to 100 items in each
     28 // response. If you have a lot of hosted zones, use the MaxItems parameter to list
     29 // them in groups of up to 100. The response includes values that help navigate
     30 // from one group of MaxItems hosted zones to the next:
     31 //   - The DNSName and HostedZoneId elements in the response contain the values, if
     32 //     any, specified for the dnsname and hostedzoneid parameters in the request that
     33 //     produced the current response.
     34 //   - The MaxItems element in the response contains the value, if any, that you
     35 //     specified for the maxitems parameter in the request that produced the current
     36 //     response.
     37 //   - If the value of IsTruncated in the response is true, there are more hosted
     38 //     zones associated with the current Amazon Web Services account. If IsTruncated
     39 //     is false, this response includes the last hosted zone that is associated with
     40 //     the current account. The NextDNSName element and NextHostedZoneId elements are
     41 //     omitted from the response.
     42 //   - The NextDNSName and NextHostedZoneId elements in the response contain the
     43 //     domain name and the hosted zone ID of the next hosted zone that is associated
     44 //     with the current Amazon Web Services account. If you want to list more hosted
     45 //     zones, make another call to ListHostedZonesByName , and specify the value of
     46 //     NextDNSName and NextHostedZoneId in the dnsname and hostedzoneid parameters,
     47 //     respectively.
     48 func (c *Client) ListHostedZonesByName(ctx context.Context, params *ListHostedZonesByNameInput, optFns ...func(*Options)) (*ListHostedZonesByNameOutput, error) {
     49 	if params == nil {
     50 		params = &ListHostedZonesByNameInput{}
     51 	}
     52 
     53 	result, metadata, err := c.invokeOperation(ctx, "ListHostedZonesByName", params, optFns, c.addOperationListHostedZonesByNameMiddlewares)
     54 	if err != nil {
     55 		return nil, err
     56 	}
     57 
     58 	out := result.(*ListHostedZonesByNameOutput)
     59 	out.ResultMetadata = metadata
     60 	return out, nil
     61 }
     62 
     63 // Retrieves a list of the public and private hosted zones that are associated
     64 // with the current Amazon Web Services account in ASCII order by domain name.
     65 type ListHostedZonesByNameInput struct {
     66 
     67 	// (Optional) For your first request to ListHostedZonesByName , include the dnsname
     68 	// parameter only if you want to specify the name of the first hosted zone in the
     69 	// response. If you don't include the dnsname parameter, Amazon Route 53 returns
     70 	// all of the hosted zones that were created by the current Amazon Web Services
     71 	// account, in ASCII order. For subsequent requests, include both dnsname and
     72 	// hostedzoneid parameters. For dnsname , specify the value of NextDNSName from
     73 	// the previous response.
     74 	DNSName *string
     75 
     76 	// (Optional) For your first request to ListHostedZonesByName , do not include the
     77 	// hostedzoneid parameter. If you have more hosted zones than the value of maxitems
     78 	// , ListHostedZonesByName returns only the first maxitems hosted zones. To get
     79 	// the next group of maxitems hosted zones, submit another request to
     80 	// ListHostedZonesByName and include both dnsname and hostedzoneid parameters. For
     81 	// the value of hostedzoneid , specify the value of the NextHostedZoneId element
     82 	// from the previous response.
     83 	HostedZoneId *string
     84 
     85 	// The maximum number of hosted zones to be included in the response body for this
     86 	// request. If you have more than maxitems hosted zones, then the value of the
     87 	// IsTruncated element in the response is true, and the values of NextDNSName and
     88 	// NextHostedZoneId specify the first hosted zone in the next group of maxitems
     89 	// hosted zones.
     90 	MaxItems *int32
     91 
     92 	noSmithyDocumentSerde
     93 }
     94 
     95 // A complex type that contains the response information for the request.
     96 type ListHostedZonesByNameOutput struct {
     97 
     98 	// A complex type that contains general information about the hosted zone.
     99 	//
    100 	// This member is required.
    101 	HostedZones []types.HostedZone
    102 
    103 	// A flag that indicates whether there are more hosted zones to be listed. If the
    104 	// response was truncated, you can get the next group of maxitems hosted zones by
    105 	// calling ListHostedZonesByName again and specifying the values of NextDNSName
    106 	// and NextHostedZoneId elements in the dnsname and hostedzoneid parameters.
    107 	//
    108 	// This member is required.
    109 	IsTruncated bool
    110 
    111 	// The value that you specified for the maxitems parameter in the call to
    112 	// ListHostedZonesByName that produced the current response.
    113 	//
    114 	// This member is required.
    115 	MaxItems *int32
    116 
    117 	// For the second and subsequent calls to ListHostedZonesByName , DNSName is the
    118 	// value that you specified for the dnsname parameter in the request that produced
    119 	// the current response.
    120 	DNSName *string
    121 
    122 	// The ID that Amazon Route 53 assigned to the hosted zone when you created it.
    123 	HostedZoneId *string
    124 
    125 	// If IsTruncated is true, the value of NextDNSName is the name of the first
    126 	// hosted zone in the next group of maxitems hosted zones. Call
    127 	// ListHostedZonesByName again and specify the value of NextDNSName and
    128 	// NextHostedZoneId in the dnsname and hostedzoneid parameters, respectively. This
    129 	// element is present only if IsTruncated is true .
    130 	NextDNSName *string
    131 
    132 	// If IsTruncated is true , the value of NextHostedZoneId identifies the first
    133 	// hosted zone in the next group of maxitems hosted zones. Call
    134 	// ListHostedZonesByName again and specify the value of NextDNSName and
    135 	// NextHostedZoneId in the dnsname and hostedzoneid parameters, respectively. This
    136 	// element is present only if IsTruncated is true .
    137 	NextHostedZoneId *string
    138 
    139 	// Metadata pertaining to the operation's result.
    140 	ResultMetadata middleware.Metadata
    141 
    142 	noSmithyDocumentSerde
    143 }
    144 
    145 func (c *Client) addOperationListHostedZonesByNameMiddlewares(stack *middleware.Stack, options Options) (err error) {
    146 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
    147 		return err
    148 	}
    149 	err = stack.Serialize.Add(&awsRestxml_serializeOpListHostedZonesByName{}, middleware.After)
    150 	if err != nil {
    151 		return err
    152 	}
    153 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListHostedZonesByName{}, middleware.After)
    154 	if err != nil {
    155 		return err
    156 	}
    157 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListHostedZonesByName"); err != nil {
    158 		return fmt.Errorf("add protocol finalizers: %v", err)
    159 	}
    160 
    161 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    162 		return err
    163 	}
    164 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    165 		return err
    166 	}
    167 	if err = addClientRequestID(stack); err != nil {
    168 		return err
    169 	}
    170 	if err = addComputeContentLength(stack); err != nil {
    171 		return err
    172 	}
    173 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    174 		return err
    175 	}
    176 	if err = addComputePayloadSHA256(stack); err != nil {
    177 		return err
    178 	}
    179 	if err = addRetry(stack, options); err != nil {
    180 		return err
    181 	}
    182 	if err = addRawResponseToMetadata(stack); err != nil {
    183 		return err
    184 	}
    185 	if err = addRecordResponseTiming(stack); err != nil {
    186 		return err
    187 	}
    188 	if err = addClientUserAgent(stack, options); err != nil {
    189 		return err
    190 	}
    191 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    192 		return err
    193 	}
    194 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    195 		return err
    196 	}
    197 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    198 		return err
    199 	}
    200 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHostedZonesByName(options.Region), middleware.Before); err != nil {
    201 		return err
    202 	}
    203 	if err = addRecursionDetection(stack); err != nil {
    204 		return err
    205 	}
    206 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    207 		return err
    208 	}
    209 	if err = addResponseErrorMiddleware(stack); err != nil {
    210 		return err
    211 	}
    212 	if err = addSanitizeURLMiddleware(stack); err != nil {
    213 		return err
    214 	}
    215 	if err = addRequestResponseLogging(stack, options); err != nil {
    216 		return err
    217 	}
    218 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    219 		return err
    220 	}
    221 	return nil
    222 }
    223 
    224 func newServiceMetadataMiddleware_opListHostedZonesByName(region string) *awsmiddleware.RegisterServiceMetadata {
    225 	return &awsmiddleware.RegisterServiceMetadata{
    226 		Region:        region,
    227 		ServiceID:     ServiceID,
    228 		OperationName: "ListHostedZonesByName",
    229 	}
    230 }