code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_ListGeoLocations.go (7082B)


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