src

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

api_op_ListTrafficPolicies.go (4666B)


      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 the latest version for every traffic policy that is
     13 // associated with the current Amazon Web Services account. Policies are listed in
     14 // the order that they were created in.
     15 //
     16 // For information about how of deleting a traffic policy affects the response
     17 // from ListTrafficPolicies , see [DeleteTrafficPolicy].
     18 //
     19 // [DeleteTrafficPolicy]: 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.
     49 	//
     50 	// If you have more traffic policies than the value of MaxItems ,
     51 	// ListTrafficPolicies returns only the first MaxItems traffic policies. To get
     52 	// the next group of policies, submit another request to ListTrafficPolicies . For
     53 	// the value of TrafficPolicyIdMarker , specify the value of TrafficPolicyIdMarker
     54 	// that was returned in the previous response.
     55 	TrafficPolicyIdMarker *string
     56 
     57 	noSmithyDocumentSerde
     58 }
     59 
     60 // A complex type that contains the response information for the request.
     61 type ListTrafficPoliciesOutput 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 ListTrafficPolicies request and specifying the value of
     66 	// TrafficPolicyIdMarker in the TrafficPolicyIdMarker request parameter.
     67 	//
     68 	// This member is required.
     69 	IsTruncated bool
     70 
     71 	// The value that you specified for the MaxItems parameter in the
     72 	// ListTrafficPolicies request that produced the current response.
     73 	//
     74 	// This member is required.
     75 	MaxItems *int32
     76 
     77 	// If the value of IsTruncated is true , TrafficPolicyIdMarker is the ID of the
     78 	// first traffic policy in the next group of MaxItems traffic policies.
     79 	//
     80 	// This member is required.
     81 	TrafficPolicyIdMarker *string
     82 
     83 	// A list that contains one TrafficPolicySummary element for each traffic policy
     84 	// that was created by the current Amazon Web Services account.
     85 	//
     86 	// This member is required.
     87 	TrafficPolicySummaries []types.TrafficPolicySummary
     88 
     89 	// Metadata pertaining to the operation's result.
     90 	ResultMetadata middleware.Metadata
     91 
     92 	noSmithyDocumentSerde
     93 }
     94 
     95 func (c *Client) addOperationListTrafficPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
     96 	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicies{}, middleware.After)
     97 	if err != nil {
     98 		return err
     99 	}
    100 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicies{}, middleware.After)
    101 	if err != nil {
    102 		return err
    103 	}
    104 
    105 	if err = addComputeContentLength(stack); err != nil {
    106 		return err
    107 	}
    108 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    109 		return err
    110 	}
    111 	if err = addComputePayloadSHA256(stack); err != nil {
    112 		return err
    113 	}
    114 	if err = addRecordResponseTiming(stack, options); err != nil {
    115 		return err
    116 	}
    117 	if err = addCredentialSource(stack, options); err != nil {
    118 		return err
    119 	}
    120 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    121 		return err
    122 	}
    123 	if err = addResponseErrorMiddleware(stack); err != nil {
    124 		return err
    125 	}
    126 	if err = addRequestResponseLogging(stack, options); err != nil {
    127 		return err
    128 	}
    129 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    130 		return err
    131 	}
    132 	if err = addInterceptors(stack, options); err != nil {
    133 		return err
    134 	}
    135 	return nil
    136 }