src

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

api_op_ListTrafficPolicyInstancesByHostedZone.go (7913B)


      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 in a
     15 // specified hosted zone. After you submit a CreateTrafficPolicyInstance or 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) ListTrafficPolicyInstancesByHostedZone(ctx context.Context, params *ListTrafficPolicyInstancesByHostedZoneInput, optFns ...func(*Options)) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) {
     23 	if params == nil {
     24 		params = &ListTrafficPolicyInstancesByHostedZoneInput{}
     25 	}
     26 
     27 	result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyInstancesByHostedZone", params, optFns, c.addOperationListTrafficPolicyInstancesByHostedZoneMiddlewares)
     28 	if err != nil {
     29 		return nil, err
     30 	}
     31 
     32 	out := result.(*ListTrafficPolicyInstancesByHostedZoneOutput)
     33 	out.ResultMetadata = metadata
     34 	return out, nil
     35 }
     36 
     37 // A request for the traffic policy instances that you created in a specified
     38 // hosted zone.
     39 type ListTrafficPolicyInstancesByHostedZoneInput struct {
     40 
     41 	// The ID of the hosted zone that you want to list traffic policy instances for.
     42 	//
     43 	// This member is required.
     44 	HostedZoneId *string
     45 
     46 	// The maximum number of traffic policy instances to be included in the response
     47 	// body for this request. If you have more than MaxItems traffic policy instances,
     48 	// the value of the IsTruncated element in the response is true , and the values of
     49 	// HostedZoneIdMarker , TrafficPolicyInstanceNameMarker , and
     50 	// TrafficPolicyInstanceTypeMarker represent the first traffic policy instance that
     51 	// Amazon Route 53 will return if you submit another request.
     52 	MaxItems *int32
     53 
     54 	// If the value of IsTruncated in the previous response is true, you have more
     55 	// traffic policy instances. To get more traffic policy instances, submit another
     56 	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename ,
     57 	// specify the value of TrafficPolicyInstanceNameMarker from the previous
     58 	// response, which is the name of the first traffic policy instance in the next
     59 	// group of traffic policy instances. If the value of IsTruncated in the previous
     60 	// response was false , there are no more traffic policy instances to get.
     61 	TrafficPolicyInstanceNameMarker *string
     62 
     63 	// If the value of IsTruncated in the previous response is true, you have more
     64 	// traffic policy instances. To get more traffic policy instances, submit another
     65 	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype ,
     66 	// specify the value of TrafficPolicyInstanceTypeMarker from the previous
     67 	// response, which is the type of the first traffic policy instance in the next
     68 	// group of traffic policy instances. If the value of IsTruncated in the previous
     69 	// response was false , there are no more traffic policy instances to get.
     70 	TrafficPolicyInstanceTypeMarker types.RRType
     71 
     72 	noSmithyDocumentSerde
     73 }
     74 
     75 // A complex type that contains the response information for the request.
     76 type ListTrafficPolicyInstancesByHostedZoneOutput struct {
     77 
     78 	// A flag that indicates whether there are more traffic policy instances to be
     79 	// listed. If the response was truncated, you can get the next group of traffic
     80 	// policy instances by submitting another ListTrafficPolicyInstancesByHostedZone
     81 	// request and specifying the values of HostedZoneIdMarker ,
     82 	// TrafficPolicyInstanceNameMarker , and TrafficPolicyInstanceTypeMarker in the
     83 	// corresponding request parameters.
     84 	//
     85 	// This member is required.
     86 	IsTruncated bool
     87 
     88 	// The value that you specified for the MaxItems parameter in the
     89 	// ListTrafficPolicyInstancesByHostedZone request that produced the current
     90 	// response.
     91 	//
     92 	// This member is required.
     93 	MaxItems *int32
     94 
     95 	// A list that contains one TrafficPolicyInstance element for each traffic policy
     96 	// instance that matches the elements in the request.
     97 	//
     98 	// This member is required.
     99 	TrafficPolicyInstances []types.TrafficPolicyInstance
    100 
    101 	// If IsTruncated is true , TrafficPolicyInstanceNameMarker is the name of the
    102 	// first traffic policy instance in the next group of traffic policy instances.
    103 	TrafficPolicyInstanceNameMarker *string
    104 
    105 	// If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of the
    106 	// resource record sets that are associated with the first traffic policy instance
    107 	// in the next group of traffic policy instances.
    108 	TrafficPolicyInstanceTypeMarker types.RRType
    109 
    110 	// Metadata pertaining to the operation's result.
    111 	ResultMetadata middleware.Metadata
    112 
    113 	noSmithyDocumentSerde
    114 }
    115 
    116 func (c *Client) addOperationListTrafficPolicyInstancesByHostedZoneMiddlewares(stack *middleware.Stack, options Options) (err error) {
    117 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
    118 		return err
    119 	}
    120 	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstancesByHostedZone{}, middleware.After)
    121 	if err != nil {
    122 		return err
    123 	}
    124 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone{}, middleware.After)
    125 	if err != nil {
    126 		return err
    127 	}
    128 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListTrafficPolicyInstancesByHostedZone"); err != nil {
    129 		return fmt.Errorf("add protocol finalizers: %v", err)
    130 	}
    131 
    132 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    133 		return err
    134 	}
    135 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    136 		return err
    137 	}
    138 	if err = addClientRequestID(stack); err != nil {
    139 		return err
    140 	}
    141 	if err = addComputeContentLength(stack); err != nil {
    142 		return err
    143 	}
    144 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    145 		return err
    146 	}
    147 	if err = addComputePayloadSHA256(stack); err != nil {
    148 		return err
    149 	}
    150 	if err = addRetry(stack, options); err != nil {
    151 		return err
    152 	}
    153 	if err = addRawResponseToMetadata(stack); err != nil {
    154 		return err
    155 	}
    156 	if err = addRecordResponseTiming(stack); err != nil {
    157 		return err
    158 	}
    159 	if err = addClientUserAgent(stack, options); err != nil {
    160 		return err
    161 	}
    162 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    163 		return err
    164 	}
    165 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    166 		return err
    167 	}
    168 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    169 		return err
    170 	}
    171 	if err = addOpListTrafficPolicyInstancesByHostedZoneValidationMiddleware(stack); err != nil {
    172 		return err
    173 	}
    174 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstancesByHostedZone(options.Region), middleware.Before); err != nil {
    175 		return err
    176 	}
    177 	if err = addRecursionDetection(stack); err != nil {
    178 		return err
    179 	}
    180 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    181 		return err
    182 	}
    183 	if err = addResponseErrorMiddleware(stack); err != nil {
    184 		return err
    185 	}
    186 	if err = addSanitizeURLMiddleware(stack); err != nil {
    187 		return err
    188 	}
    189 	if err = addRequestResponseLogging(stack, options); err != nil {
    190 		return err
    191 	}
    192 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    193 		return err
    194 	}
    195 	return nil
    196 }
    197 
    198 func newServiceMetadataMiddleware_opListTrafficPolicyInstancesByHostedZone(region string) *awsmiddleware.RegisterServiceMetadata {
    199 	return &awsmiddleware.RegisterServiceMetadata{
    200 		Region:        region,
    201 		ServiceID:     ServiceID,
    202 		OperationName: "ListTrafficPolicyInstancesByHostedZone",
    203 	}
    204 }