src

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

api_op_ListTrafficPolicyInstancesByPolicy.go (9011B)


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