code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_ListHostedZonesByName.go (9174B)


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