api_op_ListTrafficPolicyInstances.go (8009B)
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 // Gets information about the traffic policy instances that you created by using 15 // the current Amazon Web Services account. After you submit an 16 // UpdateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 17 // creates the resource record sets that are specified in the traffic policy 18 // definition. For more information, see the State response element. Route 53 19 // 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) ListTrafficPolicyInstances(ctx context.Context, params *ListTrafficPolicyInstancesInput, optFns ...func(*Options)) (*ListTrafficPolicyInstancesOutput, error) { 23 if params == nil { 24 params = &ListTrafficPolicyInstancesInput{} 25 } 26 27 result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyInstances", params, optFns, c.addOperationListTrafficPolicyInstancesMiddlewares) 28 if err != nil { 29 return nil, err 30 } 31 32 out := result.(*ListTrafficPolicyInstancesOutput) 33 out.ResultMetadata = metadata 34 return out, nil 35 } 36 37 // A request to get information about the traffic policy instances that you created 38 // by using the current Amazon Web Services account. 39 type ListTrafficPolicyInstancesInput struct { 40 41 // If the value of IsTruncated in the previous response was true, you have more 42 // traffic policy instances. To get more traffic policy instances, submit another 43 // ListTrafficPolicyInstances request. For the value of HostedZoneId, specify the 44 // value of HostedZoneIdMarker from the previous response, which is the hosted zone 45 // ID of the first traffic policy instance in the next group of traffic policy 46 // instances. If the value of IsTruncated in the previous response was false, there 47 // are no more traffic policy instances to get. 48 HostedZoneIdMarker *string 49 50 // The maximum number of traffic policy instances that you want Amazon Route 53 to 51 // return in response to a ListTrafficPolicyInstances request. If you have more 52 // than MaxItems traffic policy instances, the value of the IsTruncated element in 53 // the response is true, and the values of HostedZoneIdMarker, 54 // TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker represent 55 // the first traffic policy instance in the next group of MaxItems traffic policy 56 // instances. 57 MaxItems *int32 58 59 // If the value of IsTruncated in the previous response was true, you have more 60 // traffic policy instances. To get more traffic policy instances, submit another 61 // ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename, 62 // specify the value of TrafficPolicyInstanceNameMarker from the previous response, 63 // which is the name of the first traffic policy instance in the next group of 64 // traffic policy instances. If the value of IsTruncated in the previous response 65 // was false, there are no more traffic policy instances to get. 66 TrafficPolicyInstanceNameMarker *string 67 68 // If the value of IsTruncated in the previous response was true, you have more 69 // traffic policy instances. To get more traffic policy instances, submit another 70 // ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype, 71 // specify the value of TrafficPolicyInstanceTypeMarker from the previous response, 72 // which is the type of the first traffic policy instance in the next group of 73 // traffic policy instances. If the value of IsTruncated in the previous response 74 // was false, there are no more traffic policy instances to get. 75 TrafficPolicyInstanceTypeMarker types.RRType 76 77 noSmithyDocumentSerde 78 } 79 80 // A complex type that contains the response information for the request. 81 type ListTrafficPolicyInstancesOutput struct { 82 83 // A flag that indicates whether there are more traffic policy instances to be 84 // listed. If the response was truncated, you can get more traffic policy instances 85 // by calling ListTrafficPolicyInstances again and specifying the values of the 86 // HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and 87 // TrafficPolicyInstanceTypeMarker in the corresponding request parameters. 88 // 89 // This member is required. 90 IsTruncated bool 91 92 // The value that you specified for the MaxItems parameter in the call to 93 // ListTrafficPolicyInstances that produced the current response. 94 // 95 // This member is required. 96 MaxItems *int32 97 98 // A list that contains one TrafficPolicyInstance element for each traffic policy 99 // instance that matches the elements in the request. 100 // 101 // This member is required. 102 TrafficPolicyInstances []types.TrafficPolicyInstance 103 104 // If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of the 105 // first traffic policy instance that Route 53 will return if you submit another 106 // ListTrafficPolicyInstances request. 107 HostedZoneIdMarker *string 108 109 // If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the first 110 // traffic policy instance that Route 53 will return if you submit another 111 // ListTrafficPolicyInstances request. 112 TrafficPolicyInstanceNameMarker *string 113 114 // If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of the 115 // resource record sets that are associated with the first traffic policy instance 116 // that Amazon Route 53 will return if you submit another 117 // ListTrafficPolicyInstances request. 118 TrafficPolicyInstanceTypeMarker types.RRType 119 120 // Metadata pertaining to the operation's result. 121 ResultMetadata middleware.Metadata 122 123 noSmithyDocumentSerde 124 } 125 126 func (c *Client) addOperationListTrafficPolicyInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { 127 err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstances{}, middleware.After) 128 if err != nil { 129 return err 130 } 131 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstances{}, middleware.After) 132 if err != nil { 133 return err 134 } 135 if err = addSetLoggerMiddleware(stack, options); err != nil { 136 return err 137 } 138 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 139 return err 140 } 141 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 142 return err 143 } 144 if err = addResolveEndpointMiddleware(stack, options); err != nil { 145 return err 146 } 147 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 148 return err 149 } 150 if err = addRetryMiddlewares(stack, options); err != nil { 151 return err 152 } 153 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 154 return err 155 } 156 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 157 return err 158 } 159 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 160 return err 161 } 162 if err = addClientUserAgent(stack); err != nil { 163 return err 164 } 165 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 166 return err 167 } 168 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 169 return err 170 } 171 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstances(options.Region), middleware.Before); err != nil { 172 return err 173 } 174 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 175 return err 176 } 177 if err = addResponseErrorMiddleware(stack); err != nil { 178 return err 179 } 180 if err = addSanitizeURLMiddleware(stack); err != nil { 181 return err 182 } 183 if err = addRequestResponseLogging(stack, options); err != nil { 184 return err 185 } 186 return nil 187 } 188 189 func newServiceMetadataMiddleware_opListTrafficPolicyInstances(region string) *awsmiddleware.RegisterServiceMetadata { 190 return &awsmiddleware.RegisterServiceMetadata{ 191 Region: region, 192 ServiceID: ServiceID, 193 SigningName: "route53", 194 OperationName: "ListTrafficPolicyInstances", 195 } 196 }