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
15// the current AWS account. After you submit an UpdateTrafficPolicyInstance
16// request, there's a brief delay while Amazon Route 53 creates the resource record
17// sets that are specified in the traffic policy definition. For more information,
18// see the State response element. Route 53 returns a maximum of 100 items in each
19// response. If you have a lot of traffic policy instances, you can use the
20// MaxItems parameter to list them in groups of up to 100.
21func (c *Client) ListTrafficPolicyInstances(ctx context.Context, params *ListTrafficPolicyInstancesInput, optFns ...func(*Options)) (*ListTrafficPolicyInstancesOutput, error) {
22	if params == nil {
23		params = &ListTrafficPolicyInstancesInput{}
24	}
25
26	result, metadata, err := c.invokeOperation(ctx, "ListTrafficPolicyInstances", params, optFns, addOperationListTrafficPolicyInstancesMiddlewares)
27	if err != nil {
28		return nil, err
29	}
30
31	out := result.(*ListTrafficPolicyInstancesOutput)
32	out.ResultMetadata = metadata
33	return out, nil
34}
35
36// A request to get information about the traffic policy instances that you created
37// by using the current AWS account.
38type ListTrafficPolicyInstancesInput struct {
39
40	// If the value of IsTruncated in the previous response was true, you have more
41	// traffic policy instances. To get more traffic policy instances, submit another
42	// ListTrafficPolicyInstances request. For the value of HostedZoneId, specify the
43	// value of HostedZoneIdMarker from the previous response, which is the hosted zone
44	// ID of the first traffic policy instance in the next group of traffic policy
45	// instances. If the value of IsTruncated in the previous response was false, there
46	// are no more traffic policy instances to get.
47	HostedZoneIdMarker *string
48
49	// The maximum number of traffic policy instances that you want Amazon Route 53 to
50	// return in response to a ListTrafficPolicyInstances request. If you have more
51	// than MaxItems traffic policy instances, the value of the IsTruncated element in
52	// the response is true, and the values of HostedZoneIdMarker,
53	// TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker represent
54	// the first traffic policy instance in the next group of MaxItems traffic policy
55	// instances.
56	MaxItems *int32
57
58	// If the value of IsTruncated in the previous response was true, you have more
59	// traffic policy instances. To get more traffic policy instances, submit another
60	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename,
61	// specify the value of TrafficPolicyInstanceNameMarker from the previous response,
62	// which is the name of the first traffic policy instance in the next group of
63	// traffic policy instances. If the value of IsTruncated in the previous response
64	// was false, there are no more traffic policy instances to get.
65	TrafficPolicyInstanceNameMarker *string
66
67	// If the value of IsTruncated in the previous response was true, you have more
68	// traffic policy instances. To get more traffic policy instances, submit another
69	// ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype,
70	// specify the value of TrafficPolicyInstanceTypeMarker from the previous response,
71	// which is the type of the first traffic policy instance in the next group of
72	// traffic policy instances. If the value of IsTruncated in the previous response
73	// was false, there are no more traffic policy instances to get.
74	TrafficPolicyInstanceTypeMarker types.RRType
75}
76
77// A complex type that contains the response information for the request.
78type ListTrafficPolicyInstancesOutput struct {
79
80	// A flag that indicates whether there are more traffic policy instances to be
81	// listed. If the response was truncated, you can get more traffic policy instances
82	// by calling ListTrafficPolicyInstances again and specifying the values of the
83	// HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and
84	// TrafficPolicyInstanceTypeMarker in the corresponding request parameters.
85	//
86	// This member is required.
87	IsTruncated bool
88
89	// The value that you specified for the MaxItems parameter in the call to
90	// ListTrafficPolicyInstances that produced the current 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, HostedZoneIdMarker is the ID of the hosted zone of the
102	// first traffic policy instance that Route 53 will return if you submit another
103	// ListTrafficPolicyInstances request.
104	HostedZoneIdMarker *string
105
106	// If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the first
107	// traffic policy instance that Route 53 will return if you submit another
108	// ListTrafficPolicyInstances request.
109	TrafficPolicyInstanceNameMarker *string
110
111	// If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of the
112	// resource record sets that are associated with the first traffic policy instance
113	// that Amazon Route 53 will return if you submit another
114	// ListTrafficPolicyInstances request.
115	TrafficPolicyInstanceTypeMarker types.RRType
116
117	// Metadata pertaining to the operation's result.
118	ResultMetadata middleware.Metadata
119}
120
121func addOperationListTrafficPolicyInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
122	err = stack.Serialize.Add(&awsRestxml_serializeOpListTrafficPolicyInstances{}, middleware.After)
123	if err != nil {
124		return err
125	}
126	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTrafficPolicyInstances{}, middleware.After)
127	if err != nil {
128		return err
129	}
130	if err = addSetLoggerMiddleware(stack, options); err != nil {
131		return err
132	}
133	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
134		return err
135	}
136	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
137		return err
138	}
139	if err = addResolveEndpointMiddleware(stack, options); err != nil {
140		return err
141	}
142	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
143		return err
144	}
145	if err = addRetryMiddlewares(stack, options); err != nil {
146		return err
147	}
148	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
149		return err
150	}
151	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
152		return err
153	}
154	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
155		return err
156	}
157	if err = addClientUserAgent(stack); err != nil {
158		return err
159	}
160	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
161		return err
162	}
163	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
164		return err
165	}
166	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrafficPolicyInstances(options.Region), middleware.Before); err != nil {
167		return err
168	}
169	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
170		return err
171	}
172	if err = addResponseErrorMiddleware(stack); err != nil {
173		return err
174	}
175	if err = addSanitizeURLMiddleware(stack); err != nil {
176		return err
177	}
178	if err = addRequestResponseLogging(stack, options); err != nil {
179		return err
180	}
181	return nil
182}
183
184func newServiceMetadataMiddleware_opListTrafficPolicyInstances(region string) *awsmiddleware.RegisterServiceMetadata {
185	return &awsmiddleware.RegisterServiceMetadata{
186		Region:        region,
187		ServiceID:     ServiceID,
188		SigningName:   "route53",
189		OperationName: "ListTrafficPolicyInstances",
190	}
191}
192