src

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

api_op_ListTrafficPolicyVersions.go (4852B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 
      8 	"github.com/aws/aws-sdk-go-v2/service/route53/types"
      9 	"github.com/aws/smithy-go/middleware"
     10 )
     11 
     12 // Gets information about all of the versions for a specified traffic policy.
     13 //
     14 // Traffic policy versions are listed in numerical order by VersionNumber .
     15 func (c *Client) ListTrafficPolicyVersions(ctx context.Context, params *ListTrafficPolicyVersionsInput, optFns ...func(*Options)) (*ListTrafficPolicyVersionsOutput, error) {
     16 	if params == nil {
     17 		params = &ListTrafficPolicyVersionsInput{}
     18 	}
     19 
     20 	result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyVersions", params, optFns, c.addOperationListTrafficPolicyVersionsMiddlewares)
     21 	if err != nil {
     22 		return nil, err
     23 	}
     24 
     25 	out := result.(*ListTrafficPolicyVersionsOutput)
     26 	out.ResultMetadata = metadata
     27 	return out, nil
     28 }
     29 
     30 // A complex type that contains the information about the request to list your
     31 // traffic policies.
     32 type ListTrafficPolicyVersionsInput struct {
     33 
     34 	// Specify the value of Id of the traffic policy for which you want to list all
     35 	// versions.
     36 	//
     37 	// This member is required.
     38 	Id *string
     39 
     40 	// The maximum number of traffic policy versions that you want Amazon Route 53 to
     41 	// include in the response body for this request. If the specified traffic policy
     42 	// has more than MaxItems versions, the value of IsTruncated in the response is
     43 	// true , and the value of the TrafficPolicyVersionMarker element is the ID of the
     44 	// first version that Route 53 will return if you submit another request.
     45 	MaxItems *int32
     46 
     47 	// For your first request to ListTrafficPolicyVersions , don't include the
     48 	// TrafficPolicyVersionMarker parameter.
     49 	//
     50 	// If you have more traffic policy versions than the value of MaxItems ,
     51 	// ListTrafficPolicyVersions returns only the first group of MaxItems versions. To
     52 	// get more traffic policy versions, submit another ListTrafficPolicyVersions
     53 	// request. For the value of TrafficPolicyVersionMarker , specify the value of
     54 	// TrafficPolicyVersionMarker in the previous response.
     55 	TrafficPolicyVersionMarker *string
     56 
     57 	noSmithyDocumentSerde
     58 }
     59 
     60 // A complex type that contains the response information for the request.
     61 type ListTrafficPolicyVersionsOutput struct {
     62 
     63 	// A flag that indicates whether there are more traffic policies to be listed. If
     64 	// the response was truncated, you can get the next group of traffic policies by
     65 	// submitting another ListTrafficPolicyVersions request and specifying the value
     66 	// of NextMarker in the marker parameter.
     67 	//
     68 	// This member is required.
     69 	IsTruncated bool
     70 
     71 	// The value that you specified for the maxitems parameter in the
     72 	// ListTrafficPolicyVersions request that produced the current response.
     73 	//
     74 	// This member is required.
     75 	MaxItems *int32
     76 
     77 	// A list that contains one TrafficPolicy element for each traffic policy version
     78 	// that is associated with the specified traffic policy.
     79 	//
     80 	// This member is required.
     81 	TrafficPolicies []types.TrafficPolicy
     82 
     83 	// If IsTruncated is true , the value of TrafficPolicyVersionMarker identifies the
     84 	// first traffic policy that Amazon Route 53 will return if you submit another
     85 	// request. Call ListTrafficPolicyVersions again and specify the value of
     86 	// TrafficPolicyVersionMarker in the TrafficPolicyVersionMarker request parameter.
     87 	//
     88 	// This element is present only if IsTruncated is true .
     89 	//
     90 	// This member is required.
     91 	TrafficPolicyVersionMarker *string
     92 
     93 	// Metadata pertaining to the operation's result.
     94 	ResultMetadata middleware.Metadata
     95 
     96 	noSmithyDocumentSerde
     97 }
     98 
     99 func (c *Client) addOperationListTrafficPolicyVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
    100 	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyVersions{}, middleware.After)
    101 	if err != nil {
    102 		return err
    103 	}
    104 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyVersions{}, middleware.After)
    105 	if err != nil {
    106 		return err
    107 	}
    108 
    109 	if err = addComputeContentLength(stack); err != nil {
    110 		return err
    111 	}
    112 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    113 		return err
    114 	}
    115 	if err = addComputePayloadSHA256(stack); err != nil {
    116 		return err
    117 	}
    118 	if err = addRecordResponseTiming(stack, options); err != nil {
    119 		return err
    120 	}
    121 	if err = addCredentialSource(stack, options); err != nil {
    122 		return err
    123 	}
    124 	if err = addOpListTrafficPolicyVersionsValidationMiddleware(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = addResponseErrorMiddleware(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = addRequestResponseLogging(stack, options); err != nil {
    134 		return err
    135 	}
    136 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    137 		return err
    138 	}
    139 	if err = addInterceptors(stack, options); err != nil {
    140 		return err
    141 	}
    142 	return nil
    143 }