api_op_ListResourceRecordSets.go (9706B)
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 // 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. 29 // If you specify both Name and Type The results begin with the first resource 30 // record set in the list whose name is greater than or equal to Name , and whose 31 // type is greater than or equal to Type . Resource record sets that are PENDING 32 // This action returns the most current version of the records. This includes 33 // records that are PENDING , and that are not yet available on all Route 53 DNS 34 // servers. Changing resource record sets To ensure that you get an accurate 35 // listing of the resource record sets for a hosted zone at a point in time, do not 36 // submit a ChangeResourceRecordSets request while you're paging through the 37 // results of a ListResourceRecordSets request. If you do, some pages may display 38 // results without the latest changes while other pages display results with the 39 // latest changes. Displaying the next page of results If a ListResourceRecordSets 40 // command returns more than one page of results, the value of IsTruncated is true 41 // . To display the next page of results, get the values of NextRecordName , 42 // NextRecordType , and NextRecordIdentifier (if any) from the response. Then 43 // submit 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 // - API Gateway custom regional API or edge-optimized API: A 95 // - CloudFront distribution: A or AAAA 96 // - Elastic Beanstalk environment that has a regionalized subdomain: A 97 // - Elastic Load Balancing load balancer: A | AAAA 98 // - S3 bucket: A 99 // - VPC interface VPC endpoint: A 100 // - Another resource record set in this hosted zone: The type of the resource 101 // record set that the alias references. 102 // Constraint: Specifying type without specifying name returns an InvalidInput 103 // error. 104 StartRecordType types.RRType 105 106 noSmithyDocumentSerde 107 } 108 109 // A complex type that contains list information for the resource record set. 110 type ListResourceRecordSetsOutput struct { 111 112 // A flag that indicates whether more resource record sets remain to be listed. If 113 // your results were truncated, you can make a follow-up pagination request by 114 // using the NextRecordName element. 115 // 116 // This member is required. 117 IsTruncated bool 118 119 // The maximum number of records you requested. 120 // 121 // This member is required. 122 MaxItems *int32 123 124 // Information about multiple resource record sets. 125 // 126 // This member is required. 127 ResourceRecordSets []types.ResourceRecordSet 128 129 // Resource record sets that have a routing policy other than simple: If results 130 // were truncated for a given DNS name and type, the value of SetIdentifier for 131 // the next resource record set that has the current DNS name and type. For 132 // information about routing policies, see Choosing a Routing Policy (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html) 133 // in the Amazon Route 53 Developer Guide. 134 NextRecordIdentifier *string 135 136 // If the results were truncated, the name of the next record in the list. This 137 // element is present only if IsTruncated is true. 138 NextRecordName *string 139 140 // If the results were truncated, the type of the next record in the list. This 141 // element is present only if IsTruncated is true. 142 NextRecordType types.RRType 143 144 // Metadata pertaining to the operation's result. 145 ResultMetadata middleware.Metadata 146 147 noSmithyDocumentSerde 148 } 149 150 func (c *Client) addOperationListResourceRecordSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { 151 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 152 return err 153 } 154 err = stack.Serialize.Add(&awsRestxml_serializeOpListResourceRecordSets{}, middleware.After) 155 if err != nil { 156 return err 157 } 158 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListResourceRecordSets{}, middleware.After) 159 if err != nil { 160 return err 161 } 162 if err := addProtocolFinalizerMiddlewares(stack, options, "ListResourceRecordSets"); err != nil { 163 return fmt.Errorf("add protocol finalizers: %v", err) 164 } 165 166 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 167 return err 168 } 169 if err = addSetLoggerMiddleware(stack, options); err != nil { 170 return err 171 } 172 if err = addClientRequestID(stack); err != nil { 173 return err 174 } 175 if err = addComputeContentLength(stack); err != nil { 176 return err 177 } 178 if err = addResolveEndpointMiddleware(stack, options); err != nil { 179 return err 180 } 181 if err = addComputePayloadSHA256(stack); err != nil { 182 return err 183 } 184 if err = addRetry(stack, options); err != nil { 185 return err 186 } 187 if err = addRawResponseToMetadata(stack); err != nil { 188 return err 189 } 190 if err = addRecordResponseTiming(stack); err != nil { 191 return err 192 } 193 if err = addClientUserAgent(stack, options); err != nil { 194 return err 195 } 196 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 197 return err 198 } 199 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 200 return err 201 } 202 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 203 return err 204 } 205 if err = addOpListResourceRecordSetsValidationMiddleware(stack); err != nil { 206 return err 207 } 208 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourceRecordSets(options.Region), middleware.Before); err != nil { 209 return err 210 } 211 if err = addRecursionDetection(stack); 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 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 227 return err 228 } 229 return nil 230 } 231 232 func newServiceMetadataMiddleware_opListResourceRecordSets(region string) *awsmiddleware.RegisterServiceMetadata { 233 return &awsmiddleware.RegisterServiceMetadata{ 234 Region: region, 235 ServiceID: ServiceID, 236 OperationName: "ListResourceRecordSets", 237 } 238 }