api_op_GetGeoLocation.go (4499B)
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 // Gets information about whether a specified geographic location is supported for 13 // Amazon Route 53 geolocation resource record sets. 14 // 15 // Route 53 does not perform authorization for this API because it retrieves 16 // information that is already available to the public. 17 // 18 // Use the following syntax to determine whether a continent is supported for 19 // geolocation: 20 // 21 // GET /2013-04-01/geolocation?continentcode=two-letter abbreviation for a 22 // continent 23 // 24 // Use the following syntax to determine whether a country is supported for 25 // geolocation: 26 // 27 // GET /2013-04-01/geolocation?countrycode=two-character country code 28 // 29 // Use the following syntax to determine whether a subdivision of a country is 30 // supported for geolocation: 31 // 32 // GET /2013-04-01/geolocation?countrycode=two-character country 33 // code&subdivisioncode=subdivision code 34 func (c *Client) GetGeoLocation(ctx context.Context, params *GetGeoLocationInput, optFns ...func(*Options)) (*GetGeoLocationOutput, error) { 35 if params == nil { 36 params = &GetGeoLocationInput{} 37 } 38 39 result, metadata, err := c.invokeOperation(ctx, "GetGeoLocation", params, optFns, c.addOperationGetGeoLocationMiddlewares) 40 if err != nil { 41 return nil, err 42 } 43 44 out := result.(*GetGeoLocationOutput) 45 out.ResultMetadata = metadata 46 return out, nil 47 } 48 49 // A request for information about whether a specified geographic location is 50 // supported for Amazon Route 53 geolocation resource record sets. 51 type GetGeoLocationInput struct { 52 53 // For geolocation resource record sets, a two-letter abbreviation that identifies 54 // a continent. Amazon Route 53 supports the following continent codes: 55 // 56 // - AF: Africa 57 // 58 // - AN: Antarctica 59 // 60 // - AS: Asia 61 // 62 // - EU: Europe 63 // 64 // - OC: Oceania 65 // 66 // - NA: North America 67 // 68 // - SA: South America 69 ContinentCode *string 70 71 // Amazon Route 53 uses the two-letter country codes that are specified in [ISO standard 3166-1 alpha-2]. 72 // 73 // Route 53 also supports the country code UA for Ukraine. 74 // 75 // [ISO standard 3166-1 alpha-2]: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 76 CountryCode *string 77 78 // The code for the subdivision, such as a particular state within the United 79 // States. For a list of US state abbreviations, see [Appendix B: Two–Letter State and Possession Abbreviations]on the United States Postal 80 // Service website. For a list of all supported subdivision codes, use the [ListGeoLocations]API. 81 // 82 // [ListGeoLocations]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListGeoLocations.html 83 // [Appendix B: Two–Letter State and Possession Abbreviations]: https://pe.usps.com/text/pub28/28apb.htm 84 SubdivisionCode *string 85 86 noSmithyDocumentSerde 87 } 88 89 // A complex type that contains the response information for the specified 90 // geolocation code. 91 type GetGeoLocationOutput struct { 92 93 // A complex type that contains the codes and full continent, country, and 94 // subdivision names for the specified geolocation code. 95 // 96 // This member is required. 97 GeoLocationDetails *types.GeoLocationDetails 98 99 // Metadata pertaining to the operation's result. 100 ResultMetadata middleware.Metadata 101 102 noSmithyDocumentSerde 103 } 104 105 func (c *Client) addOperationGetGeoLocationMiddlewares(stack *middleware.Stack, options Options) (err error) { 106 err = stack.Serialize.Add(&awsRestxml_serializeOpGetGeoLocation{}, middleware.After) 107 if err != nil { 108 return err 109 } 110 err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetGeoLocation{}, middleware.After) 111 if err != nil { 112 return err 113 } 114 115 if err = addComputeContentLength(stack); err != nil { 116 return err 117 } 118 if err = addResolveEndpointMiddleware(stack, options); err != nil { 119 return err 120 } 121 if err = addComputePayloadSHA256(stack); err != nil { 122 return err 123 } 124 if err = addRecordResponseTiming(stack, options); err != nil { 125 return err 126 } 127 if err = addCredentialSource(stack, options); err != nil { 128 return err 129 } 130 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 131 return err 132 } 133 if err = addResponseErrorMiddleware(stack); err != nil { 134 return err 135 } 136 if err = addRequestResponseLogging(stack, options); err != nil { 137 return err 138 } 139 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 140 return err 141 } 142 if err = addInterceptors(stack, options); err != nil { 143 return err 144 } 145 return nil 146 }