code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_GetGeoLocation.go (5334B)


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