api_op_ListTrafficPolicyVersions.go (6285B)
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 all of the versions for a specified traffic policy. 15 // Traffic policy versions are listed in numerical order by VersionNumber . 16 func (c *Client) ListTrafficPolicyVersions(ctx context.Context, params *ListTrafficPolicyVersionsInput, optFns ...func(*Options)) (*ListTrafficPolicyVersionsOutput, error) { 17 if params == nil { 18 params = &ListTrafficPolicyVersionsInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyVersions", params, optFns, c.addOperationListTrafficPolicyVersionsMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*ListTrafficPolicyVersionsOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29 } 30 31 // A complex type that contains the information about the request to list your 32 // traffic policies. 33 type ListTrafficPolicyVersionsInput struct { 34 35 // Specify the value of Id of the traffic policy for which you want to list all 36 // versions. 37 // 38 // This member is required. 39 Id *string 40 41 // The maximum number of traffic policy versions that you want Amazon Route 53 to 42 // include in the response body for this request. If the specified traffic policy 43 // has more than MaxItems versions, the value of IsTruncated in the response is 44 // true , and the value of the TrafficPolicyVersionMarker element is the ID of the 45 // first version that Route 53 will return if you submit another request. 46 MaxItems *int32 47 48 // For your first request to ListTrafficPolicyVersions , don't include the 49 // TrafficPolicyVersionMarker parameter. If you have more traffic policy versions 50 // than the value of MaxItems , ListTrafficPolicyVersions returns only the first 51 // group of MaxItems versions. To get more traffic policy versions, submit another 52 // ListTrafficPolicyVersions request. For the value of TrafficPolicyVersionMarker , 53 // specify the value of TrafficPolicyVersionMarker in the previous response. 54 TrafficPolicyVersionMarker *string 55 56 noSmithyDocumentSerde 57 } 58 59 // A complex type that contains the response information for the request. 60 type ListTrafficPolicyVersionsOutput struct { 61 62 // A flag that indicates whether there are more traffic policies to be listed. If 63 // the response was truncated, you can get the next group of traffic policies by 64 // submitting another ListTrafficPolicyVersions request and specifying the value 65 // of NextMarker in the marker parameter. 66 // 67 // This member is required. 68 IsTruncated bool 69 70 // The value that you specified for the maxitems parameter in the 71 // ListTrafficPolicyVersions request that produced the current response. 72 // 73 // This member is required. 74 MaxItems *int32 75 76 // A list that contains one TrafficPolicy element for each traffic policy version 77 // that is associated with the specified traffic policy. 78 // 79 // This member is required. 80 TrafficPolicies []types.TrafficPolicy 81 82 // If IsTruncated is true , the value of TrafficPolicyVersionMarker identifies the 83 // first traffic policy that Amazon Route 53 will return if you submit another 84 // request. Call ListTrafficPolicyVersions again and specify the value of 85 // TrafficPolicyVersionMarker in the TrafficPolicyVersionMarker request parameter. 86 // This element is present only if IsTruncated is true . 87 // 88 // This member is required. 89 TrafficPolicyVersionMarker *string 90 91 // Metadata pertaining to the operation's result. 92 ResultMetadata middleware.Metadata 93 94 noSmithyDocumentSerde 95 } 96 97 func (c *Client) addOperationListTrafficPolicyVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { 98 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 99 return err 100 } 101 err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyVersions{}, middleware.After) 102 if err != nil { 103 return err 104 } 105 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyVersions{}, middleware.After) 106 if err != nil { 107 return err 108 } 109 if err := addProtocolFinalizerMiddlewares(stack, options, "ListTrafficPolicyVersions"); err != nil { 110 return fmt.Errorf("add protocol finalizers: %v", err) 111 } 112 113 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 114 return err 115 } 116 if err = addSetLoggerMiddleware(stack, options); err != nil { 117 return err 118 } 119 if err = addClientRequestID(stack); err != nil { 120 return err 121 } 122 if err = addComputeContentLength(stack); err != nil { 123 return err 124 } 125 if err = addResolveEndpointMiddleware(stack, options); err != nil { 126 return err 127 } 128 if err = addComputePayloadSHA256(stack); err != nil { 129 return err 130 } 131 if err = addRetry(stack, options); err != nil { 132 return err 133 } 134 if err = addRawResponseToMetadata(stack); err != nil { 135 return err 136 } 137 if err = addRecordResponseTiming(stack); err != nil { 138 return err 139 } 140 if err = addClientUserAgent(stack, options); err != nil { 141 return err 142 } 143 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 144 return err 145 } 146 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 147 return err 148 } 149 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 150 return err 151 } 152 if err = addOpListTrafficPolicyVersionsValidationMiddleware(stack); err != nil { 153 return err 154 } 155 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyVersions(options.Region), middleware.Before); err != nil { 156 return err 157 } 158 if err = addRecursionDetection(stack); err != nil { 159 return err 160 } 161 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 162 return err 163 } 164 if err = addResponseErrorMiddleware(stack); err != nil { 165 return err 166 } 167 if err = addRequestResponseLogging(stack, options); err != nil { 168 return err 169 } 170 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 171 return err 172 } 173 return nil 174 } 175 176 func newServiceMetadataMiddleware_opListTrafficPolicyVersions(region string) *awsmiddleware.RegisterServiceMetadata { 177 return &awsmiddleware.RegisterServiceMetadata{ 178 Region: region, 179 ServiceID: ServiceID, 180 OperationName: "ListTrafficPolicyVersions", 181 } 182 }