api_op_ListGeoLocations.go (6082B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 8 "github.com/aws/aws-sdk-go-v2/service/route53/types" 9 "github.com/aws/smithy-go/middleware" 10 ) 11 12 // Retrieves a list of supported geographic locations. 13 // 14 // Countries are listed first, and continents are listed last. If Amazon Route 53 15 // supports subdivisions for a country (for example, states or provinces), the 16 // subdivisions for that country are listed in alphabetical order immediately after 17 // the corresponding country. 18 // 19 // Route 53 does not perform authorization for this API because it retrieves 20 // information that is already available to the public. 21 // 22 // For a list of supported geolocation codes, see the [GeoLocation] data type. 23 // 24 // [GeoLocation]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_GeoLocation.html 25 func (c *Client) ListGeoLocations(ctx context.Context, params *ListGeoLocationsInput, optFns ...func(*Options)) (*ListGeoLocationsOutput, error) { 26 if params == nil { 27 params = &ListGeoLocationsInput{} 28 } 29 30 result, metadata, err := c.invokeOperation(ctx, "ListGeoLocations", params, optFns, c.addOperationListGeoLocationsMiddlewares) 31 if err != nil { 32 return nil, err 33 } 34 35 out := result.(*ListGeoLocationsOutput) 36 out.ResultMetadata = metadata 37 return out, nil 38 } 39 40 // A request to get a list of geographic locations that Amazon Route 53 supports 41 // for geolocation resource record sets. 42 type ListGeoLocationsInput struct { 43 44 // (Optional) The maximum number of geolocations to be included in the response 45 // body for this request. If more than maxitems geolocations remain to be listed, 46 // then the value of the IsTruncated element in the response is true . 47 MaxItems *int32 48 49 // The code for the continent with which you want to start listing locations that 50 // Amazon Route 53 supports for geolocation. If Route 53 has already returned a 51 // page or more of results, if IsTruncated is true, and if NextContinentCode from 52 // the previous response has a value, enter that value in startcontinentcode to 53 // return the next page of results. 54 // 55 // Include startcontinentcode only if you want to list continents. Don't include 56 // startcontinentcode when you're listing countries or countries with their 57 // subdivisions. 58 StartContinentCode *string 59 60 // The code for the country with which you want to start listing locations that 61 // Amazon Route 53 supports for geolocation. If Route 53 has already returned a 62 // page or more of results, if IsTruncated is true , and if NextCountryCode from 63 // the previous response has a value, enter that value in startcountrycode to 64 // return the next page of results. 65 StartCountryCode *string 66 67 // The code for the state of the United States with which you want to start 68 // listing locations that Amazon Route 53 supports for geolocation. If Route 53 has 69 // already returned a page or more of results, if IsTruncated is true , and if 70 // NextSubdivisionCode from the previous response has a value, enter that value in 71 // startsubdivisioncode to return the next page of results. 72 // 73 // To list subdivisions (U.S. states), you must include both startcountrycode and 74 // startsubdivisioncode . 75 StartSubdivisionCode *string 76 77 noSmithyDocumentSerde 78 } 79 80 // A complex type containing the response information for the request. 81 type ListGeoLocationsOutput struct { 82 83 // A complex type that contains one GeoLocationDetails element for each location 84 // that Amazon Route 53 supports for geolocation. 85 // 86 // This member is required. 87 GeoLocationDetailsList []types.GeoLocationDetails 88 89 // A value that indicates whether more locations remain to be listed after the 90 // last location in this response. If so, the value of IsTruncated is true . To get 91 // more values, submit another request and include the values of NextContinentCode 92 // , NextCountryCode , and NextSubdivisionCode in the startcontinentcode , 93 // startcountrycode , and startsubdivisioncode , as applicable. 94 // 95 // This member is required. 96 IsTruncated bool 97 98 // The value that you specified for MaxItems in the request. 99 // 100 // This member is required. 101 MaxItems *int32 102 103 // If IsTruncated is true , you can make a follow-up request to display more 104 // locations. Enter the value of NextContinentCode in the startcontinentcode 105 // parameter in another ListGeoLocations request. 106 NextContinentCode *string 107 108 // If IsTruncated is true , you can make a follow-up request to display more 109 // locations. Enter the value of NextCountryCode in the startcountrycode parameter 110 // in another ListGeoLocations request. 111 NextCountryCode *string 112 113 // If IsTruncated is true , you can make a follow-up request to display more 114 // locations. Enter the value of NextSubdivisionCode in the startsubdivisioncode 115 // parameter in another ListGeoLocations request. 116 NextSubdivisionCode *string 117 118 // Metadata pertaining to the operation's result. 119 ResultMetadata middleware.Metadata 120 121 noSmithyDocumentSerde 122 } 123 124 func (c *Client) addOperationListGeoLocationsMiddlewares(stack *middleware.Stack, options Options) (err error) { 125 err = stack.Serialize.Add(&awsRestxml_serializeOpListGeoLocations{}, middleware.After) 126 if err != nil { 127 return err 128 } 129 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListGeoLocations{}, middleware.After) 130 if err != nil { 131 return err 132 } 133 134 if err = addComputeContentLength(stack); err != nil { 135 return err 136 } 137 if err = addResolveEndpointMiddleware(stack, options); err != nil { 138 return err 139 } 140 if err = addComputePayloadSHA256(stack); err != nil { 141 return err 142 } 143 if err = addRecordResponseTiming(stack, options); err != nil { 144 return err 145 } 146 if err = addCredentialSource(stack, options); err != nil { 147 return err 148 } 149 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 150 return err 151 } 152 if err = addResponseErrorMiddleware(stack); err != nil { 153 return err 154 } 155 if err = addRequestResponseLogging(stack, options); err != nil { 156 return err 157 } 158 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 159 return err 160 } 161 if err = addInterceptors(stack, options); err != nil { 162 return err 163 } 164 return nil 165 }