api_op_ListTrafficPolicyInstances.go (8392B)
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. 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 38 // created 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 45 // zone 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 , 47 // there 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 63 // response, which is the name of the first traffic policy instance in the next 64 // group of traffic policy instances. If the value of IsTruncated in the previous 65 // response 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 72 // response, which is the type of the first traffic policy instance in the next 73 // group of traffic policy instances. If the value of IsTruncated in the previous 74 // response 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 110 // first 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 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 128 return err 129 } 130 err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstances{}, middleware.After) 131 if err != nil { 132 return err 133 } 134 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstances{}, middleware.After) 135 if err != nil { 136 return err 137 } 138 if err := addProtocolFinalizerMiddlewares(stack, options, "ListTrafficPolicyInstances"); err != nil { 139 return fmt.Errorf("add protocol finalizers: %v", err) 140 } 141 142 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 143 return err 144 } 145 if err = addSetLoggerMiddleware(stack, options); err != nil { 146 return err 147 } 148 if err = addClientRequestID(stack); err != nil { 149 return err 150 } 151 if err = addComputeContentLength(stack); err != nil { 152 return err 153 } 154 if err = addResolveEndpointMiddleware(stack, options); err != nil { 155 return err 156 } 157 if err = addComputePayloadSHA256(stack); err != nil { 158 return err 159 } 160 if err = addRetry(stack, options); err != nil { 161 return err 162 } 163 if err = addRawResponseToMetadata(stack); err != nil { 164 return err 165 } 166 if err = addRecordResponseTiming(stack); err != nil { 167 return err 168 } 169 if err = addClientUserAgent(stack, options); err != nil { 170 return err 171 } 172 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 173 return err 174 } 175 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 176 return err 177 } 178 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 179 return err 180 } 181 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstances(options.Region), middleware.Before); err != nil { 182 return err 183 } 184 if err = addRecursionDetection(stack); err != nil { 185 return err 186 } 187 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 188 return err 189 } 190 if err = addResponseErrorMiddleware(stack); err != nil { 191 return err 192 } 193 if err = addSanitizeURLMiddleware(stack); err != nil { 194 return err 195 } 196 if err = addRequestResponseLogging(stack, options); err != nil { 197 return err 198 } 199 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 200 return err 201 } 202 return nil 203 } 204 205 func newServiceMetadataMiddleware_opListTrafficPolicyInstances(region string) *awsmiddleware.RegisterServiceMetadata { 206 return &awsmiddleware.RegisterServiceMetadata{ 207 Region: region, 208 ServiceID: ServiceID, 209 OperationName: "ListTrafficPolicyInstances", 210 } 211 }