src

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

api_op_ListTrafficPolicyInstances.go (9830B)


      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 // Gets information about the traffic policy instances that you created by using
     15 // the current Amazon Web Services account.
     16 //
     17 // After you submit an UpdateTrafficPolicyInstance request, there's a brief delay
     18 // while Amazon Route 53 creates the resource record sets that are specified in the
     19 // traffic policy definition. For more information, see the State response element.
     20 //
     21 // Route 53 returns a maximum of 100 items in each response. If you have a lot of
     22 // traffic policy instances, you can use the MaxItems parameter to list them in
     23 // groups of up to 100.
     24 func (c *Client) ListTrafficPolicyInstances(ctx context.Context, params *ListTrafficPolicyInstancesInput, optFns ...func(*Options)) (*ListTrafficPolicyInstancesOutput, error) {
     25 	if params == nil {
     26 		params = &ListTrafficPolicyInstancesInput{}
     27 	}
     28 
     29 	result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyInstances", params, optFns, c.addOperationListTrafficPolicyInstancesMiddlewares)
     30 	if err != nil {
     31 		return nil, err
     32 	}
     33 
     34 	out := result.(*ListTrafficPolicyInstancesOutput)
     35 	out.ResultMetadata = metadata
     36 	return out, nil
     37 }
     38 
     39 // A request to get information about the traffic policy instances that you
     40 // created by using the current Amazon Web Services account.
     41 type ListTrafficPolicyInstancesInput struct {
     42 
     43 	// If the value of IsTruncated in the previous response was true , you have more
     44 	// traffic policy instances. To get more traffic policy instances, submit another
     45 	// ListTrafficPolicyInstances request. For the value of HostedZoneId , specify the
     46 	// value of HostedZoneIdMarker from the previous response, which is the hosted
     47 	// zone ID of the first traffic policy instance in the next group of traffic policy
     48 	// instances.
     49 	//
     50 	// If the value of IsTruncated in the previous response was false , there are no
     51 	// more traffic policy instances to get.
     52 	HostedZoneIdMarker *string
     53 
     54 	// The maximum number of traffic policy instances that you want Amazon Route 53 to
     55 	// return in response to a ListTrafficPolicyInstances request. If you have more
     56 	// than MaxItems traffic policy instances, the value of the IsTruncated element in
     57 	// the response is true , and the values of HostedZoneIdMarker ,
     58 	// TrafficPolicyInstanceNameMarker , and TrafficPolicyInstanceTypeMarker represent
     59 	// the first traffic policy instance in the next group of MaxItems traffic policy
     60 	// instances.
     61 	MaxItems *int32
     62 
     63 	// If the value of IsTruncated in the previous response was true , you have more
     64 	// traffic policy instances. To get more traffic policy instances, submit another
     65 	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename ,
     66 	// specify the value of TrafficPolicyInstanceNameMarker from the previous
     67 	// response, which is the name of the first traffic policy instance in the next
     68 	// group of traffic policy instances.
     69 	//
     70 	// If the value of IsTruncated in the previous response was false , there are no
     71 	// more traffic policy instances to get.
     72 	TrafficPolicyInstanceNameMarker *string
     73 
     74 	// If the value of IsTruncated in the previous response was true , you have more
     75 	// traffic policy instances. To get more traffic policy instances, submit another
     76 	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype ,
     77 	// specify the value of TrafficPolicyInstanceTypeMarker from the previous
     78 	// response, which is the type of the first traffic policy instance in the next
     79 	// group of traffic policy instances.
     80 	//
     81 	// If the value of IsTruncated in the previous response was false , there are no
     82 	// more traffic policy instances to get.
     83 	TrafficPolicyInstanceTypeMarker types.RRType
     84 
     85 	noSmithyDocumentSerde
     86 }
     87 
     88 // A complex type that contains the response information for the request.
     89 type ListTrafficPolicyInstancesOutput struct {
     90 
     91 	// A flag that indicates whether there are more traffic policy instances to be
     92 	// listed. If the response was truncated, you can get more traffic policy instances
     93 	// by calling ListTrafficPolicyInstances again and specifying the values of the
     94 	// HostedZoneIdMarker , TrafficPolicyInstanceNameMarker , and
     95 	// TrafficPolicyInstanceTypeMarker in the corresponding request parameters.
     96 	//
     97 	// This member is required.
     98 	IsTruncated bool
     99 
    100 	// The value that you specified for the MaxItems parameter in the call to
    101 	// ListTrafficPolicyInstances that produced the current response.
    102 	//
    103 	// This member is required.
    104 	MaxItems *int32
    105 
    106 	// A list that contains one TrafficPolicyInstance element for each traffic policy
    107 	// instance that matches the elements in the request.
    108 	//
    109 	// This member is required.
    110 	TrafficPolicyInstances []types.TrafficPolicyInstance
    111 
    112 	// If IsTruncated is true , HostedZoneIdMarker is the ID of the hosted zone of the
    113 	// first traffic policy instance that Route 53 will return if you submit another
    114 	// ListTrafficPolicyInstances request.
    115 	HostedZoneIdMarker *string
    116 
    117 	// If IsTruncated is true , TrafficPolicyInstanceNameMarker is the name of the
    118 	// first traffic policy instance that Route 53 will return if you submit another
    119 	// ListTrafficPolicyInstances request.
    120 	TrafficPolicyInstanceNameMarker *string
    121 
    122 	// If IsTruncated is true , TrafficPolicyInstanceTypeMarker is the DNS type of the
    123 	// resource record sets that are associated with the first traffic policy instance
    124 	// that Amazon Route 53 will return if you submit another
    125 	// ListTrafficPolicyInstances request.
    126 	TrafficPolicyInstanceTypeMarker types.RRType
    127 
    128 	// Metadata pertaining to the operation's result.
    129 	ResultMetadata middleware.Metadata
    130 
    131 	noSmithyDocumentSerde
    132 }
    133 
    134 func (c *Client) addOperationListTrafficPolicyInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
    135 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
    136 		return err
    137 	}
    138 	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstances{}, middleware.After)
    139 	if err != nil {
    140 		return err
    141 	}
    142 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstances{}, middleware.After)
    143 	if err != nil {
    144 		return err
    145 	}
    146 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListTrafficPolicyInstances"); err != nil {
    147 		return fmt.Errorf("add protocol finalizers: %v", err)
    148 	}
    149 
    150 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    151 		return err
    152 	}
    153 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    154 		return err
    155 	}
    156 	if err = addClientRequestID(stack); err != nil {
    157 		return err
    158 	}
    159 	if err = addComputeContentLength(stack); err != nil {
    160 		return err
    161 	}
    162 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    163 		return err
    164 	}
    165 	if err = addComputePayloadSHA256(stack); err != nil {
    166 		return err
    167 	}
    168 	if err = addRetry(stack, options); err != nil {
    169 		return err
    170 	}
    171 	if err = addRawResponseToMetadata(stack); err != nil {
    172 		return err
    173 	}
    174 	if err = addRecordResponseTiming(stack); err != nil {
    175 		return err
    176 	}
    177 	if err = addSpanRetryLoop(stack, options); err != nil {
    178 		return err
    179 	}
    180 	if err = addClientUserAgent(stack, options); err != nil {
    181 		return err
    182 	}
    183 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    184 		return err
    185 	}
    186 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    187 		return err
    188 	}
    189 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    190 		return err
    191 	}
    192 	if err = addTimeOffsetBuild(stack, c); err != nil {
    193 		return err
    194 	}
    195 	if err = addUserAgentRetryMode(stack, options); err != nil {
    196 		return err
    197 	}
    198 	if err = addCredentialSource(stack, options); err != nil {
    199 		return err
    200 	}
    201 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstances(options.Region), middleware.Before); err != nil {
    202 		return err
    203 	}
    204 	if err = addRecursionDetection(stack); err != nil {
    205 		return err
    206 	}
    207 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    208 		return err
    209 	}
    210 	if err = addResponseErrorMiddleware(stack); err != nil {
    211 		return err
    212 	}
    213 	if err = addSanitizeURLMiddleware(stack); err != nil {
    214 		return err
    215 	}
    216 	if err = addRequestResponseLogging(stack, options); err != nil {
    217 		return err
    218 	}
    219 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    220 		return err
    221 	}
    222 	if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
    223 		return err
    224 	}
    225 	if err = addInterceptAttempt(stack, options); err != nil {
    226 		return err
    227 	}
    228 	if err = addInterceptExecution(stack, options); err != nil {
    229 		return err
    230 	}
    231 	if err = addInterceptBeforeSerialization(stack, options); err != nil {
    232 		return err
    233 	}
    234 	if err = addInterceptAfterSerialization(stack, options); err != nil {
    235 		return err
    236 	}
    237 	if err = addInterceptBeforeSigning(stack, options); err != nil {
    238 		return err
    239 	}
    240 	if err = addInterceptAfterSigning(stack, options); err != nil {
    241 		return err
    242 	}
    243 	if err = addInterceptTransmit(stack, options); err != nil {
    244 		return err
    245 	}
    246 	if err = addInterceptBeforeDeserialization(stack, options); err != nil {
    247 		return err
    248 	}
    249 	if err = addInterceptAfterDeserialization(stack, options); err != nil {
    250 		return err
    251 	}
    252 	if err = addSpanInitializeStart(stack); err != nil {
    253 		return err
    254 	}
    255 	if err = addSpanInitializeEnd(stack); err != nil {
    256 		return err
    257 	}
    258 	if err = addSpanBuildRequestStart(stack); err != nil {
    259 		return err
    260 	}
    261 	if err = addSpanBuildRequestEnd(stack); err != nil {
    262 		return err
    263 	}
    264 	return nil
    265 }
    266 
    267 func newServiceMetadataMiddleware_opListTrafficPolicyInstances(region string) *awsmiddleware.RegisterServiceMetadata {
    268 	return &awsmiddleware.RegisterServiceMetadata{
    269 		Region:        region,
    270 		ServiceID:     ServiceID,
    271 		OperationName: "ListTrafficPolicyInstances",
    272 	}
    273 }