src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

api_op_ListGeoLocations.go (7448B)


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