1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package route53
4
5import (
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// Gets information about whether a specified geographic location is supported for
15// Amazon Route 53 geolocation resource record sets. Use the following syntax to
16// determine whether a continent is supported for geolocation: GET
17// /2013-04-01/geolocation?continentcode=two-letter abbreviation for a continent
18// Use the following syntax to determine whether a country is supported for
19// geolocation: GET /2013-04-01/geolocation?countrycode=two-character country code
20// Use the following syntax to determine whether a subdivision of a country is
21// supported for geolocation: GET /2013-04-01/geolocation?countrycode=two-character
22// country code&subdivisioncode=subdivision code
23func (c *Client) GetGeoLocation(ctx context.Context, params *GetGeoLocationInput, optFns ...func(*Options)) (*GetGeoLocationOutput, error) {
24	if params == nil {
25		params = &GetGeoLocationInput{}
26	}
27
28	result, metadata, err := c.invokeOperation(ctx, "GetGeoLocation", params, optFns, addOperationGetGeoLocationMiddlewares)
29	if err != nil {
30		return nil, err
31	}
32
33	out := result.(*GetGeoLocationOutput)
34	out.ResultMetadata = metadata
35	return out, nil
36}
37
38// A request for information about whether a specified geographic location is
39// supported for Amazon Route 53 geolocation resource record sets.
40type GetGeoLocationInput struct {
41
42	// For geolocation resource record sets, a two-letter abbreviation that identifies
43	// a continent. Amazon Route 53 supports the following continent codes:
44	//
45	// * AF:
46	// Africa
47	//
48	// * AN: Antarctica
49	//
50	// * AS: Asia
51	//
52	// * EU: Europe
53	//
54	// * OC: Oceania
55	//
56	// * NA: North
57	// America
58	//
59	// * SA: South America
60	ContinentCode *string
61
62	// Amazon Route 53 uses the two-letter country codes that are specified in ISO
63	// standard 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
64	CountryCode *string
65
66	// For SubdivisionCode, Amazon Route 53 supports only states of the United States.
67	// For a list of state abbreviations, see Appendix B: Two–Letter State and
68	// Possession Abbreviations (https://pe.usps.com/text/pub28/28apb.htm) on the
69	// United States Postal Service website. If you specify subdivisioncode, you must
70	// also specify US for CountryCode.
71	SubdivisionCode *string
72}
73
74// A complex type that contains the response information for the specified
75// geolocation code.
76type GetGeoLocationOutput struct {
77
78	// A complex type that contains the codes and full continent, country, and
79	// subdivision names for the specified geolocation code.
80	//
81	// This member is required.
82	GeoLocationDetails *types.GeoLocationDetails
83
84	// Metadata pertaining to the operation's result.
85	ResultMetadata middleware.Metadata
86}
87
88func addOperationGetGeoLocationMiddlewares(stack *middleware.Stack, options Options) (err error) {
89	err = stack.Serialize.Add(&awsRestxml_serializeOpGetGeoLocation{}, middleware.After)
90	if err != nil {
91		return err
92	}
93	err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetGeoLocation{}, middleware.After)
94	if err != nil {
95		return err
96	}
97	if err = addSetLoggerMiddleware(stack, options); err != nil {
98		return err
99	}
100	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
101		return err
102	}
103	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
104		return err
105	}
106	if err = addResolveEndpointMiddleware(stack, options); err != nil {
107		return err
108	}
109	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
110		return err
111	}
112	if err = addRetryMiddlewares(stack, options); err != nil {
113		return err
114	}
115	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
116		return err
117	}
118	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
119		return err
120	}
121	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
122		return err
123	}
124	if err = addClientUserAgent(stack); err != nil {
125		return err
126	}
127	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
128		return err
129	}
130	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
131		return err
132	}
133	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGeoLocation(options.Region), middleware.Before); err != nil {
134		return err
135	}
136	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
137		return err
138	}
139	if err = addResponseErrorMiddleware(stack); err != nil {
140		return err
141	}
142	if err = addRequestResponseLogging(stack, options); err != nil {
143		return err
144	}
145	return nil
146}
147
148func newServiceMetadataMiddleware_opGetGeoLocation(region string) *awsmiddleware.RegisterServiceMetadata {
149	return &awsmiddleware.RegisterServiceMetadata{
150		Region:        region,
151		ServiceID:     ServiceID,
152		SigningName:   "route53",
153		OperationName: "GetGeoLocation",
154	}
155}
156