src

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

api_op_ListTrafficPolicyInstancesByHostedZone.go (9346B)


      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.
     16 //
     17 // After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance
     18 // request, there's a brief delay while Amazon Route 53 creates the resource record
     19 // sets that are specified in the traffic policy definition. For more information,
     20 // see the State response element.
     21 //
     22 // Route 53 returns a maximum of 100 items in each response. If you have a lot of
     23 // traffic policy instances, you can use the MaxItems parameter to list them in
     24 // groups of up to 100.
     25 func (c *Client) ListTrafficPolicyInstancesByHostedZone(ctx context.Context, params *ListTrafficPolicyInstancesByHostedZoneInput, optFns ...func(*Options)) (*ListTrafficPolicyInstancesByHostedZoneOutput, error) {
     26 	if params == nil {
     27 		params = &ListTrafficPolicyInstancesByHostedZoneInput{}
     28 	}
     29 
     30 	result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyInstancesByHostedZone", params, optFns, c.addOperationListTrafficPolicyInstancesByHostedZoneMiddlewares)
     31 	if err != nil {
     32 		return nil, err
     33 	}
     34 
     35 	out := result.(*ListTrafficPolicyInstancesByHostedZoneOutput)
     36 	out.ResultMetadata = metadata
     37 	return out, nil
     38 }
     39 
     40 // A request for the traffic policy instances that you created in a specified
     41 // hosted zone.
     42 type ListTrafficPolicyInstancesByHostedZoneInput struct {
     43 
     44 	// The ID of the hosted zone that you want to list traffic policy instances for.
     45 	//
     46 	// This member is required.
     47 	HostedZoneId *string
     48 
     49 	// The maximum number of traffic policy instances to be included in the response
     50 	// body for this request. If you have more than MaxItems traffic policy instances,
     51 	// the value of the IsTruncated element in the response is true , and the values of
     52 	// HostedZoneIdMarker , TrafficPolicyInstanceNameMarker , and
     53 	// TrafficPolicyInstanceTypeMarker represent the first traffic policy instance that
     54 	// Amazon Route 53 will return if you submit another request.
     55 	MaxItems *int32
     56 
     57 	// If the value of IsTruncated in the previous response is true, you have more
     58 	// traffic policy instances. To get more traffic policy instances, submit another
     59 	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename ,
     60 	// specify the value of TrafficPolicyInstanceNameMarker from the previous
     61 	// response, which is the name of the first traffic policy instance in the next
     62 	// group of traffic policy instances.
     63 	//
     64 	// If the value of IsTruncated in the previous response was false , there are no
     65 	// more traffic policy instances to get.
     66 	TrafficPolicyInstanceNameMarker *string
     67 
     68 	// If the value of IsTruncated in the previous response is true, you have more
     69 	// traffic policy instances. To get more traffic policy instances, submit another
     70 	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype ,
     71 	// specify the value of TrafficPolicyInstanceTypeMarker from the previous
     72 	// response, which is the type of the first traffic policy instance in the next
     73 	// group of traffic policy instances.
     74 	//
     75 	// If the value of IsTruncated in the previous response was false , there are no
     76 	// more traffic policy instances to get.
     77 	TrafficPolicyInstanceTypeMarker types.RRType
     78 
     79 	noSmithyDocumentSerde
     80 }
     81 
     82 // A complex type that contains the response information for the request.
     83 type ListTrafficPolicyInstancesByHostedZoneOutput struct {
     84 
     85 	// A flag that indicates whether there are more traffic policy instances to be
     86 	// listed. If the response was truncated, you can get the next group of traffic
     87 	// policy instances by submitting another ListTrafficPolicyInstancesByHostedZone
     88 	// request and specifying the values of HostedZoneIdMarker ,
     89 	// TrafficPolicyInstanceNameMarker , and TrafficPolicyInstanceTypeMarker in the
     90 	// corresponding request parameters.
     91 	//
     92 	// This member is required.
     93 	IsTruncated bool
     94 
     95 	// The value that you specified for the MaxItems parameter in the
     96 	// ListTrafficPolicyInstancesByHostedZone request that produced the current
     97 	// response.
     98 	//
     99 	// This member is required.
    100 	MaxItems *int32
    101 
    102 	// A list that contains one TrafficPolicyInstance element for each traffic policy
    103 	// instance that matches the elements in the request.
    104 	//
    105 	// This member is required.
    106 	TrafficPolicyInstances []types.TrafficPolicyInstance
    107 
    108 	// If IsTruncated is true , TrafficPolicyInstanceNameMarker is the name of the
    109 	// first traffic policy instance in the next group of traffic policy instances.
    110 	TrafficPolicyInstanceNameMarker *string
    111 
    112 	// If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of the
    113 	// resource record sets that are associated with the first traffic policy instance
    114 	// in the next group of traffic policy instances.
    115 	TrafficPolicyInstanceTypeMarker types.RRType
    116 
    117 	// Metadata pertaining to the operation's result.
    118 	ResultMetadata middleware.Metadata
    119 
    120 	noSmithyDocumentSerde
    121 }
    122 
    123 func (c *Client) addOperationListTrafficPolicyInstancesByHostedZoneMiddlewares(stack *middleware.Stack, options Options) (err error) {
    124 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
    125 		return err
    126 	}
    127 	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstancesByHostedZone{}, middleware.After)
    128 	if err != nil {
    129 		return err
    130 	}
    131 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone{}, middleware.After)
    132 	if err != nil {
    133 		return err
    134 	}
    135 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListTrafficPolicyInstancesByHostedZone"); err != nil {
    136 		return fmt.Errorf("add protocol finalizers: %v", err)
    137 	}
    138 
    139 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    140 		return err
    141 	}
    142 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    143 		return err
    144 	}
    145 	if err = addClientRequestID(stack); err != nil {
    146 		return err
    147 	}
    148 	if err = addComputeContentLength(stack); err != nil {
    149 		return err
    150 	}
    151 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    152 		return err
    153 	}
    154 	if err = addComputePayloadSHA256(stack); err != nil {
    155 		return err
    156 	}
    157 	if err = addRetry(stack, options); err != nil {
    158 		return err
    159 	}
    160 	if err = addRawResponseToMetadata(stack); err != nil {
    161 		return err
    162 	}
    163 	if err = addRecordResponseTiming(stack); err != nil {
    164 		return err
    165 	}
    166 	if err = addSpanRetryLoop(stack, options); err != nil {
    167 		return err
    168 	}
    169 	if err = addClientUserAgent(stack, options); err != nil {
    170 		return err
    171 	}
    172 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    173 		return err
    174 	}
    175 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    176 		return err
    177 	}
    178 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    179 		return err
    180 	}
    181 	if err = addTimeOffsetBuild(stack, c); err != nil {
    182 		return err
    183 	}
    184 	if err = addUserAgentRetryMode(stack, options); err != nil {
    185 		return err
    186 	}
    187 	if err = addCredentialSource(stack, options); err != nil {
    188 		return err
    189 	}
    190 	if err = addOpListTrafficPolicyInstancesByHostedZoneValidationMiddleware(stack); err != nil {
    191 		return err
    192 	}
    193 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstancesByHostedZone(options.Region), middleware.Before); err != nil {
    194 		return err
    195 	}
    196 	if err = addRecursionDetection(stack); err != nil {
    197 		return err
    198 	}
    199 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    200 		return err
    201 	}
    202 	if err = addResponseErrorMiddleware(stack); err != nil {
    203 		return err
    204 	}
    205 	if err = addSanitizeURLMiddleware(stack); err != nil {
    206 		return err
    207 	}
    208 	if err = addRequestResponseLogging(stack, options); err != nil {
    209 		return err
    210 	}
    211 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    212 		return err
    213 	}
    214 	if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
    215 		return err
    216 	}
    217 	if err = addInterceptAttempt(stack, options); err != nil {
    218 		return err
    219 	}
    220 	if err = addInterceptExecution(stack, options); err != nil {
    221 		return err
    222 	}
    223 	if err = addInterceptBeforeSerialization(stack, options); err != nil {
    224 		return err
    225 	}
    226 	if err = addInterceptAfterSerialization(stack, options); err != nil {
    227 		return err
    228 	}
    229 	if err = addInterceptBeforeSigning(stack, options); err != nil {
    230 		return err
    231 	}
    232 	if err = addInterceptAfterSigning(stack, options); err != nil {
    233 		return err
    234 	}
    235 	if err = addInterceptTransmit(stack, options); err != nil {
    236 		return err
    237 	}
    238 	if err = addInterceptBeforeDeserialization(stack, options); err != nil {
    239 		return err
    240 	}
    241 	if err = addInterceptAfterDeserialization(stack, options); err != nil {
    242 		return err
    243 	}
    244 	if err = addSpanInitializeStart(stack); err != nil {
    245 		return err
    246 	}
    247 	if err = addSpanInitializeEnd(stack); err != nil {
    248 		return err
    249 	}
    250 	if err = addSpanBuildRequestStart(stack); err != nil {
    251 		return err
    252 	}
    253 	if err = addSpanBuildRequestEnd(stack); err != nil {
    254 		return err
    255 	}
    256 	return nil
    257 }
    258 
    259 func newServiceMetadataMiddleware_opListTrafficPolicyInstancesByHostedZone(region string) *awsmiddleware.RegisterServiceMetadata {
    260 	return &awsmiddleware.RegisterServiceMetadata{
    261 		Region:        region,
    262 		ServiceID:     ServiceID,
    263 		OperationName: "ListTrafficPolicyInstancesByHostedZone",
    264 	}
    265 }