src

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

api_op_ListResourceRecordSets.go (11379B)


      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 // Lists the resource record sets in a specified hosted zone.
     15 //
     16 // ListResourceRecordSets returns up to 300 resource record sets at a time in
     17 // ASCII order, beginning at a position specified by the name and type elements.
     18 //
     19 // # Sort order
     20 //
     21 // ListResourceRecordSets sorts results first by DNS name with the labels
     22 // reversed, for example:
     23 //
     24 //	com.example.www.
     25 //
     26 // Note the trailing dot, which can change the sort order when the record name
     27 // contains characters that appear before . (decimal 46) in the ASCII table. These
     28 // characters include the following: ! " # $ % & ' ( ) * + , -
     29 //
     30 // When multiple records have the same DNS name, ListResourceRecordSets sorts
     31 // results by the record type.
     32 //
     33 // # Specifying where to start listing records
     34 //
     35 // You can use the name and type elements to specify the resource record set that
     36 // the list begins with:
     37 //
     38 // If you do not specify Name or Type The results begin with the first resource
     39 // record set that the hosted zone contains.
     40 //
     41 // If you specify Name but not Type The results begin with the first resource
     42 // record set in the list whose name is greater than or equal to Name .
     43 //
     44 // If you specify Type but not Name Amazon Route 53 returns the InvalidInput error.
     45 //
     46 // If you specify both Name and Type The results begin with the first resource
     47 // record set in the list whose name is greater than or equal to Name , and whose
     48 // type is greater than or equal to Type .
     49 //
     50 // Type is only used to sort between records with the same record Name.
     51 //
     52 // # Resource record sets that are PENDING
     53 //
     54 // This action returns the most current version of the records. This includes
     55 // records that are PENDING , and that are not yet available on all Route 53 DNS
     56 // servers.
     57 //
     58 // # Changing resource record sets
     59 //
     60 // To ensure that you get an accurate listing of the resource record sets for a
     61 // hosted zone at a point in time, do not submit a ChangeResourceRecordSets
     62 // request while you're paging through the results of a ListResourceRecordSets
     63 // request. If you do, some pages may display results without the latest changes
     64 // while other pages display results with the latest changes.
     65 //
     66 // # Displaying the next page of results
     67 //
     68 // If a ListResourceRecordSets command returns more than one page of results, the
     69 // value of IsTruncated is true . To display the next page of results, get the
     70 // values of NextRecordName , NextRecordType , and NextRecordIdentifier (if any)
     71 // from the response. Then submit another ListResourceRecordSets request, and
     72 // specify those values for StartRecordName , StartRecordType , and
     73 // StartRecordIdentifier .
     74 func (c *Client) ListResourceRecordSets(ctx context.Context, params *ListResourceRecordSetsInput, optFns ...func(*Options)) (*ListResourceRecordSetsOutput, error) {
     75 	if params == nil {
     76 		params = &ListResourceRecordSetsInput{}
     77 	}
     78 
     79 	result, metadata, err := c.invokeOperation(ctx, "ListResourceRecordSets", params, optFns, c.addOperationListResourceRecordSetsMiddlewares)
     80 	if err != nil {
     81 		return nil, err
     82 	}
     83 
     84 	out := result.(*ListResourceRecordSetsOutput)
     85 	out.ResultMetadata = metadata
     86 	return out, nil
     87 }
     88 
     89 // A request for the resource record sets that are associated with a specified
     90 // hosted zone.
     91 type ListResourceRecordSetsInput struct {
     92 
     93 	// The ID of the hosted zone that contains the resource record sets that you want
     94 	// to list.
     95 	//
     96 	// This member is required.
     97 	HostedZoneId *string
     98 
     99 	// (Optional) The maximum number of resource records sets to include in the
    100 	// response body for this request. If the response includes more than maxitems
    101 	// resource record sets, the value of the IsTruncated element in the response is
    102 	// true , and the values of the NextRecordName and NextRecordType elements in the
    103 	// response identify the first resource record set in the next group of maxitems
    104 	// resource record sets.
    105 	MaxItems *int32
    106 
    107 	//  Resource record sets that have a routing policy other than simple: If results
    108 	// were truncated for a given DNS name and type, specify the value of
    109 	// NextRecordIdentifier from the previous response to get the next resource record
    110 	// set that has the current DNS name and type.
    111 	StartRecordIdentifier *string
    112 
    113 	// The first name in the lexicographic ordering of resource record sets that you
    114 	// want to list. If the specified record name doesn't exist, the results begin with
    115 	// the first resource record set that has a name greater than the value of name .
    116 	StartRecordName *string
    117 
    118 	// The type of resource record set to begin the record listing from.
    119 	//
    120 	// Valid values for basic resource record sets: A | AAAA | CAA | CNAME | MX | NAPTR
    121 	// | NS | PTR | SOA | SPF | SRV | TXT
    122 	//
    123 	// Values for weighted, latency, geolocation, and failover resource record sets: A
    124 	// | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | TXT
    125 	//
    126 	// Values for alias resource record sets:
    127 	//
    128 	//   - API Gateway custom regional API or edge-optimized API: A
    129 	//
    130 	//   - CloudFront distribution: A or AAAA
    131 	//
    132 	//   - Elastic Beanstalk environment that has a regionalized subdomain: A
    133 	//
    134 	//   - Elastic Load Balancing load balancer: A | AAAA
    135 	//
    136 	//   - S3 bucket: A
    137 	//
    138 	//   - VPC interface VPC endpoint: A
    139 	//
    140 	//   - Another resource record set in this hosted zone: The type of the resource
    141 	//   record set that the alias references.
    142 	//
    143 	// Constraint: Specifying type without specifying name returns an InvalidInput
    144 	// error.
    145 	StartRecordType types.RRType
    146 
    147 	noSmithyDocumentSerde
    148 }
    149 
    150 // A complex type that contains list information for the resource record set.
    151 type ListResourceRecordSetsOutput struct {
    152 
    153 	// A flag that indicates whether more resource record sets remain to be listed. If
    154 	// your results were truncated, you can make a follow-up pagination request by
    155 	// using the NextRecordName element.
    156 	//
    157 	// This member is required.
    158 	IsTruncated bool
    159 
    160 	// The maximum number of records you requested.
    161 	//
    162 	// This member is required.
    163 	MaxItems *int32
    164 
    165 	// Information about multiple resource record sets.
    166 	//
    167 	// This member is required.
    168 	ResourceRecordSets []types.ResourceRecordSet
    169 
    170 	//  Resource record sets that have a routing policy other than simple: If results
    171 	// were truncated for a given DNS name and type, the value of SetIdentifier for
    172 	// the next resource record set that has the current DNS name and type.
    173 	//
    174 	// For information about routing policies, see [Choosing a Routing Policy] in the Amazon Route 53 Developer
    175 	// Guide.
    176 	//
    177 	// [Choosing a Routing Policy]: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html
    178 	NextRecordIdentifier *string
    179 
    180 	// If the results were truncated, the name of the next record in the list.
    181 	//
    182 	// This element is present only if IsTruncated is true.
    183 	NextRecordName *string
    184 
    185 	// If the results were truncated, the type of the next record in the list.
    186 	//
    187 	// This element is present only if IsTruncated is true.
    188 	NextRecordType types.RRType
    189 
    190 	// Metadata pertaining to the operation's result.
    191 	ResultMetadata middleware.Metadata
    192 
    193 	noSmithyDocumentSerde
    194 }
    195 
    196 func (c *Client) addOperationListResourceRecordSetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
    197 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
    198 		return err
    199 	}
    200 	err = stack.Serialize.Add(&awsRestxml_serializeOpListResourceRecordSets{}, middleware.After)
    201 	if err != nil {
    202 		return err
    203 	}
    204 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListResourceRecordSets{}, middleware.After)
    205 	if err != nil {
    206 		return err
    207 	}
    208 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListResourceRecordSets"); err != nil {
    209 		return fmt.Errorf("add protocol finalizers: %v", err)
    210 	}
    211 
    212 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    213 		return err
    214 	}
    215 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    216 		return err
    217 	}
    218 	if err = addClientRequestID(stack); err != nil {
    219 		return err
    220 	}
    221 	if err = addComputeContentLength(stack); err != nil {
    222 		return err
    223 	}
    224 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    225 		return err
    226 	}
    227 	if err = addComputePayloadSHA256(stack); err != nil {
    228 		return err
    229 	}
    230 	if err = addRetry(stack, options); err != nil {
    231 		return err
    232 	}
    233 	if err = addRawResponseToMetadata(stack); err != nil {
    234 		return err
    235 	}
    236 	if err = addRecordResponseTiming(stack); err != nil {
    237 		return err
    238 	}
    239 	if err = addSpanRetryLoop(stack, options); err != nil {
    240 		return err
    241 	}
    242 	if err = addClientUserAgent(stack, options); err != nil {
    243 		return err
    244 	}
    245 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    246 		return err
    247 	}
    248 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    249 		return err
    250 	}
    251 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    252 		return err
    253 	}
    254 	if err = addTimeOffsetBuild(stack, c); err != nil {
    255 		return err
    256 	}
    257 	if err = addUserAgentRetryMode(stack, options); err != nil {
    258 		return err
    259 	}
    260 	if err = addCredentialSource(stack, options); err != nil {
    261 		return err
    262 	}
    263 	if err = addOpListResourceRecordSetsValidationMiddleware(stack); err != nil {
    264 		return err
    265 	}
    266 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceRecordSets(options.Region), middleware.Before); err != nil {
    267 		return err
    268 	}
    269 	if err = addRecursionDetection(stack); err != nil {
    270 		return err
    271 	}
    272 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    273 		return err
    274 	}
    275 	if err = addResponseErrorMiddleware(stack); err != nil {
    276 		return err
    277 	}
    278 	if err = addSanitizeURLMiddleware(stack); err != nil {
    279 		return err
    280 	}
    281 	if err = addRequestResponseLogging(stack, options); err != nil {
    282 		return err
    283 	}
    284 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    285 		return err
    286 	}
    287 	if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
    288 		return err
    289 	}
    290 	if err = addInterceptAttempt(stack, options); err != nil {
    291 		return err
    292 	}
    293 	if err = addInterceptExecution(stack, options); err != nil {
    294 		return err
    295 	}
    296 	if err = addInterceptBeforeSerialization(stack, options); err != nil {
    297 		return err
    298 	}
    299 	if err = addInterceptAfterSerialization(stack, options); err != nil {
    300 		return err
    301 	}
    302 	if err = addInterceptBeforeSigning(stack, options); err != nil {
    303 		return err
    304 	}
    305 	if err = addInterceptAfterSigning(stack, options); err != nil {
    306 		return err
    307 	}
    308 	if err = addInterceptTransmit(stack, options); err != nil {
    309 		return err
    310 	}
    311 	if err = addInterceptBeforeDeserialization(stack, options); err != nil {
    312 		return err
    313 	}
    314 	if err = addInterceptAfterDeserialization(stack, options); err != nil {
    315 		return err
    316 	}
    317 	if err = addSpanInitializeStart(stack); err != nil {
    318 		return err
    319 	}
    320 	if err = addSpanInitializeEnd(stack); err != nil {
    321 		return err
    322 	}
    323 	if err = addSpanBuildRequestStart(stack); err != nil {
    324 		return err
    325 	}
    326 	if err = addSpanBuildRequestEnd(stack); err != nil {
    327 		return err
    328 	}
    329 	return nil
    330 }
    331 
    332 func newServiceMetadataMiddleware_opListResourceRecordSets(region string) *awsmiddleware.RegisterServiceMetadata {
    333 	return &awsmiddleware.RegisterServiceMetadata{
    334 		Region:        region,
    335 		ServiceID:     ServiceID,
    336 		OperationName: "ListResourceRecordSets",
    337 	}
    338 }