api_op_ListTrafficPolicies.go (5687B)
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 latest version for every traffic policy that is 15 // associated with the current Amazon Web Services account. Policies are listed in 16 // the order that they were created in. For information about how of deleting a 17 // traffic policy affects the response from ListTrafficPolicies, see 18 // DeleteTrafficPolicy 19 // (https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicy.html). 20 func (c *Client) ListTrafficPolicies(ctx context.Context, params *ListTrafficPoliciesInput, optFns ...func(*Options)) (*ListTrafficPoliciesOutput, error) { 21 if params == nil { 22 params = &ListTrafficPoliciesInput{} 23 } 24 25 result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicies", params, optFns, c.addOperationListTrafficPoliciesMiddlewares) 26 if err != nil { 27 return nil, err 28 } 29 30 out := result.(*ListTrafficPoliciesOutput) 31 out.ResultMetadata = metadata 32 return out, nil 33 } 34 35 // A complex type that contains the information about the request to list the 36 // traffic policies that are associated with the current Amazon Web Services 37 // account. 38 type ListTrafficPoliciesInput struct { 39 40 // (Optional) The maximum number of traffic policies that you want Amazon Route 53 41 // to return in response to this request. If you have more than MaxItems traffic 42 // policies, the value of IsTruncated in the response is true, and the value of 43 // TrafficPolicyIdMarker is the ID of the first traffic policy that Route 53 will 44 // return if you submit another request. 45 MaxItems *int32 46 47 // (Conditional) For your first request to ListTrafficPolicies, don't include the 48 // TrafficPolicyIdMarker parameter. If you have more traffic policies than the 49 // value of MaxItems, ListTrafficPolicies returns only the first MaxItems traffic 50 // policies. To get the next group of policies, submit another request to 51 // ListTrafficPolicies. For the value of TrafficPolicyIdMarker, specify the value 52 // of TrafficPolicyIdMarker that was returned in the previous response. 53 TrafficPolicyIdMarker *string 54 55 noSmithyDocumentSerde 56 } 57 58 // A complex type that contains the response information for the request. 59 type ListTrafficPoliciesOutput struct { 60 61 // A flag that indicates whether there are more traffic policies to be listed. If 62 // the response was truncated, you can get the next group of traffic policies by 63 // submitting another ListTrafficPolicies request and specifying the value of 64 // TrafficPolicyIdMarker in the TrafficPolicyIdMarker request parameter. 65 // 66 // This member is required. 67 IsTruncated bool 68 69 // The value that you specified for the MaxItems parameter in the 70 // ListTrafficPolicies request that produced the current response. 71 // 72 // This member is required. 73 MaxItems *int32 74 75 // If the value of IsTruncated is true, TrafficPolicyIdMarker is the ID of the 76 // first traffic policy in the next group of MaxItems traffic policies. 77 // 78 // This member is required. 79 TrafficPolicyIdMarker *string 80 81 // A list that contains one TrafficPolicySummary element for each traffic policy 82 // that was created by the current Amazon Web Services account. 83 // 84 // This member is required. 85 TrafficPolicySummaries []types.TrafficPolicySummary 86 87 // Metadata pertaining to the operation's result. 88 ResultMetadata middleware.Metadata 89 90 noSmithyDocumentSerde 91 } 92 93 func (c *Client) addOperationListTrafficPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { 94 err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicies{}, middleware.After) 95 if err != nil { 96 return err 97 } 98 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicies{}, middleware.After) 99 if err != nil { 100 return err 101 } 102 if err = addSetLoggerMiddleware(stack, options); err != nil { 103 return err 104 } 105 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 106 return err 107 } 108 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 109 return err 110 } 111 if err = addResolveEndpointMiddleware(stack, options); err != nil { 112 return err 113 } 114 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 115 return err 116 } 117 if err = addRetryMiddlewares(stack, options); err != nil { 118 return err 119 } 120 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 121 return err 122 } 123 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 124 return err 125 } 126 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 127 return err 128 } 129 if err = addClientUserAgent(stack); err != nil { 130 return err 131 } 132 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 133 return err 134 } 135 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 136 return err 137 } 138 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicies(options.Region), middleware.Before); err != nil { 139 return err 140 } 141 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 142 return err 143 } 144 if err = addResponseErrorMiddleware(stack); err != nil { 145 return err 146 } 147 if err = addRequestResponseLogging(stack, options); err != nil { 148 return err 149 } 150 return nil 151 } 152 153 func newServiceMetadataMiddleware_opListTrafficPolicies(region string) *awsmiddleware.RegisterServiceMetadata { 154 return &awsmiddleware.RegisterServiceMetadata{ 155 Region: region, 156 ServiceID: ServiceID, 157 SigningName: "route53", 158 OperationName: "ListTrafficPolicies", 159 } 160 }