src

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

api_op_ListTrafficPolicyInstancesByPolicy.go (10464B)


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