api_op_ListGeoLocations.go (8902B)
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 supported geographic locations. 15 // 16 // Countries are listed first, and continents are listed last. If Amazon Route 53 17 // supports subdivisions for a country (for example, states or provinces), the 18 // subdivisions for that country are listed in alphabetical order immediately after 19 // the corresponding country. 20 // 21 // Route 53 does not perform authorization for this API because it retrieves 22 // information that is already available to the public. 23 // 24 // For a list of supported geolocation codes, see the [GeoLocation] data type. 25 // 26 // [GeoLocation]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_GeoLocation.html 27 func (c *Client) ListGeoLocations(ctx context.Context, params *ListGeoLocationsInput, optFns ...func(*Options)) (*ListGeoLocationsOutput, error) { 28 if params == nil { 29 params = &ListGeoLocationsInput{} 30 } 31 32 result, metadata, err := c.invokeOperation(ctx, "ListGeoLocations", params, optFns, c.addOperationListGeoLocationsMiddlewares) 33 if err != nil { 34 return nil, err 35 } 36 37 out := result.(*ListGeoLocationsOutput) 38 out.ResultMetadata = metadata 39 return out, nil 40 } 41 42 // A request to get a list of geographic locations that Amazon Route 53 supports 43 // for geolocation resource record sets. 44 type ListGeoLocationsInput struct { 45 46 // (Optional) The maximum number of geolocations to be included in the response 47 // body for this request. If more than maxitems geolocations remain to be listed, 48 // then the value of the IsTruncated element in the response is true . 49 MaxItems *int32 50 51 // The code for the continent with which you want to start listing locations that 52 // Amazon Route 53 supports for geolocation. If Route 53 has already returned a 53 // page or more of results, if IsTruncated is true, and if NextContinentCode from 54 // the previous response has a value, enter that value in startcontinentcode to 55 // return the next page of results. 56 // 57 // Include startcontinentcode only if you want to list continents. Don't include 58 // startcontinentcode when you're listing countries or countries with their 59 // subdivisions. 60 StartContinentCode *string 61 62 // The code for the country with which you want to start listing locations that 63 // Amazon Route 53 supports for geolocation. If Route 53 has already returned a 64 // page or more of results, if IsTruncated is true , and if NextCountryCode from 65 // the previous response has a value, enter that value in startcountrycode to 66 // return the next page of results. 67 StartCountryCode *string 68 69 // The code for the state of the United States with which you want to start 70 // listing locations that Amazon Route 53 supports for geolocation. If Route 53 has 71 // already returned a page or more of results, if IsTruncated is true , and if 72 // NextSubdivisionCode from the previous response has a value, enter that value in 73 // startsubdivisioncode to return the next page of results. 74 // 75 // To list subdivisions (U.S. states), you must include both startcountrycode and 76 // startsubdivisioncode . 77 StartSubdivisionCode *string 78 79 noSmithyDocumentSerde 80 } 81 82 // A complex type containing the response information for the request. 83 type ListGeoLocationsOutput struct { 84 85 // A complex type that contains one GeoLocationDetails element for each location 86 // that Amazon Route 53 supports for geolocation. 87 // 88 // This member is required. 89 GeoLocationDetailsList []types.GeoLocationDetails 90 91 // A value that indicates whether more locations remain to be listed after the 92 // last location in this response. If so, the value of IsTruncated is true . To get 93 // more values, submit another request and include the values of NextContinentCode 94 // , NextCountryCode , and NextSubdivisionCode in the startcontinentcode , 95 // startcountrycode , and startsubdivisioncode , as applicable. 96 // 97 // This member is required. 98 IsTruncated bool 99 100 // The value that you specified for MaxItems in the request. 101 // 102 // This member is required. 103 MaxItems *int32 104 105 // If IsTruncated is true , you can make a follow-up request to display more 106 // locations. Enter the value of NextContinentCode in the startcontinentcode 107 // parameter in another ListGeoLocations request. 108 NextContinentCode *string 109 110 // If IsTruncated is true , you can make a follow-up request to display more 111 // locations. Enter the value of NextCountryCode in the startcountrycode parameter 112 // in another ListGeoLocations request. 113 NextCountryCode *string 114 115 // If IsTruncated is true , you can make a follow-up request to display more 116 // locations. Enter the value of NextSubdivisionCode in the startsubdivisioncode 117 // parameter in another ListGeoLocations request. 118 NextSubdivisionCode *string 119 120 // Metadata pertaining to the operation's result. 121 ResultMetadata middleware.Metadata 122 123 noSmithyDocumentSerde 124 } 125 126 func (c *Client) addOperationListGeoLocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { 127 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 128 return err 129 } 130 err = stack.Serialize.Add(&awsRestxml_serializeOpListGeoLocations{}, middleware.After) 131 if err != nil { 132 return err 133 } 134 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListGeoLocations{}, middleware.After) 135 if err != nil { 136 return err 137 } 138 if err := addProtocolFinalizerMiddlewares(stack, options, "ListGeoLocations"); err != nil { 139 return fmt.Errorf("add protocol finalizers: %v", err) 140 } 141 142 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 143 return err 144 } 145 if err = addSetLoggerMiddleware(stack, options); err != nil { 146 return err 147 } 148 if err = addClientRequestID(stack); err != nil { 149 return err 150 } 151 if err = addComputeContentLength(stack); err != nil { 152 return err 153 } 154 if err = addResolveEndpointMiddleware(stack, options); err != nil { 155 return err 156 } 157 if err = addComputePayloadSHA256(stack); err != nil { 158 return err 159 } 160 if err = addRetry(stack, options); err != nil { 161 return err 162 } 163 if err = addRawResponseToMetadata(stack); err != nil { 164 return err 165 } 166 if err = addRecordResponseTiming(stack); err != nil { 167 return err 168 } 169 if err = addSpanRetryLoop(stack, options); err != nil { 170 return err 171 } 172 if err = addClientUserAgent(stack, options); err != nil { 173 return err 174 } 175 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 176 return err 177 } 178 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 179 return err 180 } 181 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 182 return err 183 } 184 if err = addTimeOffsetBuild(stack, c); err != nil { 185 return err 186 } 187 if err = addUserAgentRetryMode(stack, options); err != nil { 188 return err 189 } 190 if err = addCredentialSource(stack, options); err != nil { 191 return err 192 } 193 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListGeoLocations(options.Region), middleware.Before); err != nil { 194 return err 195 } 196 if err = addRecursionDetection(stack); 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 = addRequestResponseLogging(stack, options); err != nil { 206 return err 207 } 208 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 209 return err 210 } 211 if err = addInterceptBeforeRetryLoop(stack, options); err != nil { 212 return err 213 } 214 if err = addInterceptAttempt(stack, options); err != nil { 215 return err 216 } 217 if err = addInterceptExecution(stack, options); err != nil { 218 return err 219 } 220 if err = addInterceptBeforeSerialization(stack, options); err != nil { 221 return err 222 } 223 if err = addInterceptAfterSerialization(stack, options); err != nil { 224 return err 225 } 226 if err = addInterceptBeforeSigning(stack, options); err != nil { 227 return err 228 } 229 if err = addInterceptAfterSigning(stack, options); err != nil { 230 return err 231 } 232 if err = addInterceptTransmit(stack, options); err != nil { 233 return err 234 } 235 if err = addInterceptBeforeDeserialization(stack, options); err != nil { 236 return err 237 } 238 if err = addInterceptAfterDeserialization(stack, options); err != nil { 239 return err 240 } 241 if err = addSpanInitializeStart(stack); err != nil { 242 return err 243 } 244 if err = addSpanInitializeEnd(stack); err != nil { 245 return err 246 } 247 if err = addSpanBuildRequestStart(stack); err != nil { 248 return err 249 } 250 if err = addSpanBuildRequestEnd(stack); err != nil { 251 return err 252 } 253 return nil 254 } 255 256 func newServiceMetadataMiddleware_opListGeoLocations(region string) *awsmiddleware.RegisterServiceMetadata { 257 return &awsmiddleware.RegisterServiceMetadata{ 258 Region: region, 259 ServiceID: ServiceID, 260 OperationName: "ListGeoLocations", 261 } 262 }