1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package route53
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
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 by using a
15// specify traffic policy version. After you submit a CreateTrafficPolicyInstance
16// or an UpdateTrafficPolicyInstance request, there's a brief delay while Amazon
17// Route 53 creates the resource record sets that are specified in the traffic
18// policy definition. For more information, see the State response element. Route
19// 53 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.
22func (c *Client) ListTrafficPolicyInstancesByPolicy(ctx context.Context, params *ListTrafficPolicyInstancesByPolicyInput, optFns ...func(*Options)) (*ListTrafficPolicyInstancesByPolicyOutput, error) {
23	if params == nil {
24		params = &ListTrafficPolicyInstancesByPolicyInput{}
25	}
26
27	result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyInstancesByPolicy", params, optFns, addOperationListTrafficPolicyInstancesByPolicyMiddlewares)
28	if err != nil {
29		return nil, err
30	}
31
32	out := result.(*ListTrafficPolicyInstancesByPolicyOutput)
33	out.ResultMetadata = metadata
34	return out, nil
35}
36
37// A complex type that contains the information about the request to list your
38// traffic policy instances.
39type ListTrafficPolicyInstancesByPolicyInput struct {
40
41	// The ID of the traffic policy for which you want to list traffic policy
42	// instances.
43	//
44	// This member is required.
45	TrafficPolicyId *string
46
47	// The version of the traffic policy for which you want to list traffic policy
48	// instances. The version must be associated with the traffic policy that is
49	// specified by TrafficPolicyId.
50	//
51	// This member is required.
52	TrafficPolicyVersion *int32
53
54	// If the value of IsTruncated in the previous response was true, you have more
55	// traffic policy instances. To get more traffic policy instances, submit another
56	// ListTrafficPolicyInstancesByPolicy request. For the value of hostedzoneid,
57	// specify the value of HostedZoneIdMarker from the previous response, which is the
58	// hosted zone ID of the first traffic policy instance that Amazon Route 53 will
59	// return if you submit another request. If the value of IsTruncated in the
60	// previous response was false, there are no more traffic policy instances to get.
61	HostedZoneIdMarker *string
62
63	// The maximum number of traffic policy instances to be included in the response
64	// body for this request. If you have more than MaxItems traffic policy instances,
65	// the value of the IsTruncated element in the response is true, and the values of
66	// HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and
67	// TrafficPolicyInstanceTypeMarker represent the first traffic policy instance that
68	// Amazon Route 53 will return if you submit another request.
69	MaxItems *int32
70
71	// If the value of IsTruncated in the previous response was true, you have more
72	// traffic policy instances. To get more traffic policy instances, submit another
73	// ListTrafficPolicyInstancesByPolicy request. For the value of
74	// trafficpolicyinstancename, specify the value of TrafficPolicyInstanceNameMarker
75	// from the previous response, which is the name of the first traffic policy
76	// instance that Amazon Route 53 will return if you submit another request. If the
77	// value of IsTruncated in the previous response was false, there are no more
78	// traffic policy instances to get.
79	TrafficPolicyInstanceNameMarker *string
80
81	// If the value of IsTruncated in the previous response was true, you have more
82	// traffic policy instances. To get more traffic policy instances, submit another
83	// ListTrafficPolicyInstancesByPolicy request. For the value of
84	// trafficpolicyinstancetype, specify the value of TrafficPolicyInstanceTypeMarker
85	// from the previous response, which is the name of the first traffic policy
86	// instance that Amazon Route 53 will return if you submit another request. If the
87	// value of IsTruncated in the previous response was false, there are no more
88	// traffic policy instances to get.
89	TrafficPolicyInstanceTypeMarker types.RRType
90}
91
92// A complex type that contains the response information for the request.
93type ListTrafficPolicyInstancesByPolicyOutput struct {
94
95	// A flag that indicates whether there are more traffic policy instances to be
96	// listed. If the response was truncated, you can get the next group of traffic
97	// policy instances by calling ListTrafficPolicyInstancesByPolicy again and
98	// specifying the values of the HostedZoneIdMarker,
99	// TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker elements in
100	// the corresponding request parameters.
101	//
102	// This member is required.
103	IsTruncated bool
104
105	// The value that you specified for the MaxItems parameter in the call to
106	// ListTrafficPolicyInstancesByPolicy that produced the current response.
107	//
108	// This member is required.
109	MaxItems *int32
110
111	// A list that contains one TrafficPolicyInstance element for each traffic policy
112	// instance that matches the elements in the request.
113	//
114	// This member is required.
115	TrafficPolicyInstances []types.TrafficPolicyInstance
116
117	// If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of the
118	// first traffic policy instance in the next group of traffic policy instances.
119	HostedZoneIdMarker *string
120
121	// If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the first
122	// traffic policy instance in the next group of MaxItems traffic policy instances.
123	TrafficPolicyInstanceNameMarker *string
124
125	// If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of the
126	// resource record sets that are associated with the first traffic policy instance
127	// in the next group of MaxItems traffic policy instances.
128	TrafficPolicyInstanceTypeMarker types.RRType
129
130	// Metadata pertaining to the operation's result.
131	ResultMetadata middleware.Metadata
132}
133
134func addOperationListTrafficPolicyInstancesByPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
135	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstancesByPolicy{}, middleware.After)
136	if err != nil {
137		return err
138	}
139	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy{}, middleware.After)
140	if err != nil {
141		return err
142	}
143	if err = addSetLoggerMiddleware(stack, options); err != nil {
144		return err
145	}
146	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
147		return err
148	}
149	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
150		return err
151	}
152	if err = addResolveEndpointMiddleware(stack, options); err != nil {
153		return err
154	}
155	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
156		return err
157	}
158	if err = addRetryMiddlewares(stack, options); err != nil {
159		return err
160	}
161	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
162		return err
163	}
164	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
165		return err
166	}
167	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
168		return err
169	}
170	if err = addClientUserAgent(stack); err != nil {
171		return err
172	}
173	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
174		return err
175	}
176	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
177		return err
178	}
179	if err = addOpListTrafficPolicyInstancesByPolicyValidationMiddleware(stack); err != nil {
180		return err
181	}
182	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstancesByPolicy(options.Region), middleware.Before); err != nil {
183		return err
184	}
185	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
186		return err
187	}
188	if err = addResponseErrorMiddleware(stack); err != nil {
189		return err
190	}
191	if err = addSanitizeURLMiddleware(stack); err != nil {
192		return err
193	}
194	if err = addRequestResponseLogging(stack, options); err != nil {
195		return err
196	}
197	return nil
198}
199
200func newServiceMetadataMiddleware_opListTrafficPolicyInstancesByPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
201	return &awsmiddleware.RegisterServiceMetadata{
202		Region:        region,
203		ServiceID:     ServiceID,
204		SigningName:   "route53",
205		OperationName: "ListTrafficPolicyInstancesByPolicy",
206	}
207}
208