api_op_ListResourceRecordSets.go (9368B)
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 // Lists the resource record sets in a specified hosted zone. 15 // ListResourceRecordSets returns up to 300 resource record sets at a time in ASCII 16 // order, beginning at a position specified by the name and type elements. Sort 17 // order ListResourceRecordSets sorts results first by DNS name with the labels 18 // reversed, for example: com.example.www. Note the trailing dot, which can change 19 // the sort order when the record name contains characters that appear before . 20 // (decimal 46) in the ASCII table. These characters include the following: ! " # $ 21 // % & ' ( ) * + , - When multiple records have the same DNS name, 22 // ListResourceRecordSets sorts results by the record type. Specifying where to 23 // start listing records You can use the name and type elements to specify the 24 // resource record set that the list begins with: If you do not specify Name or 25 // Type The results begin with the first resource record set that the hosted zone 26 // contains. If you specify Name but not Type The results begin with the first 27 // resource record set in the list whose name is greater than or equal to Name. If 28 // you specify Type but not Name Amazon Route 53 returns the InvalidInput error. If 29 // you specify both Name and Type The results begin with the first resource record 30 // set in the list whose name is greater than or equal to Name, and whose type is 31 // greater than or equal to Type. Resource record sets that are PENDING This action 32 // returns the most current version of the records. This includes records that are 33 // PENDING, and that are not yet available on all Route 53 DNS servers. Changing 34 // resource record sets To ensure that you get an accurate listing of the resource 35 // record sets for a hosted zone at a point in time, do not submit a 36 // ChangeResourceRecordSets request while you're paging through the results of a 37 // ListResourceRecordSets request. If you do, some pages may display results 38 // without the latest changes while other pages display results with the latest 39 // changes. Displaying the next page of results If a ListResourceRecordSets command 40 // returns more than one page of results, the value of IsTruncated is true. To 41 // display the next page of results, get the values of NextRecordName, 42 // NextRecordType, and NextRecordIdentifier (if any) from the response. Then submit 43 // another ListResourceRecordSets request, and specify those values for 44 // StartRecordName, StartRecordType, and StartRecordIdentifier. 45 func (c *Client) ListResourceRecordSets(ctx context.Context, params *ListResourceRecordSetsInput, optFns ...func(*Options)) (*ListResourceRecordSetsOutput, error) { 46 if params == nil { 47 params = &ListResourceRecordSetsInput{} 48 } 49 50 result, metadata, err := c.invokeOperation(ctx, "ListResourceRecordSets", params, optFns, c.addOperationListResourceRecordSetsMiddlewares) 51 if err != nil { 52 return nil, err 53 } 54 55 out := result.(*ListResourceRecordSetsOutput) 56 out.ResultMetadata = metadata 57 return out, nil 58 } 59 60 // A request for the resource record sets that are associated with a specified 61 // hosted zone. 62 type ListResourceRecordSetsInput struct { 63 64 // The ID of the hosted zone that contains the resource record sets that you want 65 // to list. 66 // 67 // This member is required. 68 HostedZoneId *string 69 70 // (Optional) The maximum number of resource records sets to include in the 71 // response body for this request. If the response includes more than maxitems 72 // resource record sets, the value of the IsTruncated element in the response is 73 // true, and the values of the NextRecordName and NextRecordType elements in the 74 // response identify the first resource record set in the next group of maxitems 75 // resource record sets. 76 MaxItems *int32 77 78 // Resource record sets that have a routing policy other than simple: If results 79 // were truncated for a given DNS name and type, specify the value of 80 // NextRecordIdentifier from the previous response to get the next resource record 81 // set that has the current DNS name and type. 82 StartRecordIdentifier *string 83 84 // The first name in the lexicographic ordering of resource record sets that you 85 // want to list. If the specified record name doesn't exist, the results begin with 86 // the first resource record set that has a name greater than the value of name. 87 StartRecordName *string 88 89 // The type of resource record set to begin the record listing from. Valid values 90 // for basic resource record sets: A | AAAA | CAA | CNAME | MX | NAPTR | NS | PTR | 91 // SOA | SPF | SRV | TXT Values for weighted, latency, geolocation, and failover 92 // resource record sets: A | AAAA | CAA | CNAME | MX | NAPTR | PTR | SPF | SRV | 93 // TXT Values for alias resource record sets: 94 // 95 // * API Gateway custom regional API or 96 // edge-optimized API: A 97 // 98 // * CloudFront distribution: A or AAAA 99 // 100 // * Elastic Beanstalk 101 // environment that has a regionalized subdomain: A 102 // 103 // * Elastic Load Balancing load 104 // balancer: A | AAAA 105 // 106 // * S3 bucket: A 107 // 108 // * VPC interface VPC endpoint: A 109 // 110 // * Another 111 // resource record set in this hosted zone: The type of the resource record set 112 // that the alias references. 113 // 114 // Constraint: Specifying type without specifying name 115 // returns an InvalidInput error. 116 StartRecordType types.RRType 117 118 noSmithyDocumentSerde 119 } 120 121 // A complex type that contains list information for the resource record set. 122 type ListResourceRecordSetsOutput struct { 123 124 // A flag that indicates whether more resource record sets remain to be listed. If 125 // your results were truncated, you can make a follow-up pagination request by 126 // using the NextRecordName element. 127 // 128 // This member is required. 129 IsTruncated bool 130 131 // The maximum number of records you requested. 132 // 133 // This member is required. 134 MaxItems *int32 135 136 // Information about multiple resource record sets. 137 // 138 // This member is required. 139 ResourceRecordSets []types.ResourceRecordSet 140 141 // Resource record sets that have a routing policy other than simple: If results 142 // were truncated for a given DNS name and type, the value of SetIdentifier for the 143 // next resource record set that has the current DNS name and type. For information 144 // about routing policies, see Choosing a Routing Policy 145 // (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html) 146 // in the Amazon Route 53 Developer Guide. 147 NextRecordIdentifier *string 148 149 // If the results were truncated, the name of the next record in the list. This 150 // element is present only if IsTruncated is true. 151 NextRecordName *string 152 153 // If the results were truncated, the type of the next record in the list. This 154 // element is present only if IsTruncated is true. 155 NextRecordType types.RRType 156 157 // Metadata pertaining to the operation's result. 158 ResultMetadata middleware.Metadata 159 160 noSmithyDocumentSerde 161 } 162 163 func (c *Client) addOperationListResourceRecordSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { 164 err = stack.Serialize.Add(&awsRestxml_serializeOpListResourceRecordSets{}, middleware.After) 165 if err != nil { 166 return err 167 } 168 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListResourceRecordSets{}, middleware.After) 169 if err != nil { 170 return err 171 } 172 if err = addSetLoggerMiddleware(stack, options); err != nil { 173 return err 174 } 175 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 176 return err 177 } 178 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 179 return err 180 } 181 if err = addResolveEndpointMiddleware(stack, options); err != nil { 182 return err 183 } 184 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 185 return err 186 } 187 if err = addRetryMiddlewares(stack, options); err != nil { 188 return err 189 } 190 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 191 return err 192 } 193 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 194 return err 195 } 196 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 197 return err 198 } 199 if err = addClientUserAgent(stack); err != nil { 200 return err 201 } 202 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 203 return err 204 } 205 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 206 return err 207 } 208 if err = addOpListResourceRecordSetsValidationMiddleware(stack); err != nil { 209 return err 210 } 211 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceRecordSets(options.Region), middleware.Before); err != nil { 212 return err 213 } 214 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 215 return err 216 } 217 if err = addResponseErrorMiddleware(stack); err != nil { 218 return err 219 } 220 if err = addSanitizeURLMiddleware(stack); err != nil { 221 return err 222 } 223 if err = addRequestResponseLogging(stack, options); err != nil { 224 return err 225 } 226 return nil 227 } 228 229 func newServiceMetadataMiddleware_opListResourceRecordSets(region string) *awsmiddleware.RegisterServiceMetadata { 230 return &awsmiddleware.RegisterServiceMetadata{ 231 Region: region, 232 ServiceID: ServiceID, 233 SigningName: "route53", 234 OperationName: "ListResourceRecordSets", 235 } 236 }