1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package route53recoverycontrolconfig
4
5import (
6	"time"
7
8	"github.com/aws/aws-sdk-go/aws"
9	"github.com/aws/aws-sdk-go/aws/request"
10)
11
12// WaitUntilClusterCreated uses the AWS Route53 Recovery Control Config API operation
13// DescribeCluster to wait for a condition to be met before returning.
14// If the condition is not met within the max attempt window, an error will
15// be returned.
16func (c *Route53RecoveryControlConfig) WaitUntilClusterCreated(input *DescribeClusterInput) error {
17	return c.WaitUntilClusterCreatedWithContext(aws.BackgroundContext(), input)
18}
19
20// WaitUntilClusterCreatedWithContext is an extended version of WaitUntilClusterCreated.
21// With the support for passing in a context and options to configure the
22// Waiter and the underlying request options.
23//
24// The context must be non-nil and will be used for request cancellation. If
25// the context is nil a panic will occur. In the future the SDK may create
26// sub-contexts for http.Requests. See https://golang.org/pkg/context/
27// for more information on using Contexts.
28func (c *Route53RecoveryControlConfig) WaitUntilClusterCreatedWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error {
29	w := request.Waiter{
30		Name:        "WaitUntilClusterCreated",
31		MaxAttempts: 26,
32		Delay:       request.ConstantWaiterDelay(5 * time.Second),
33		Acceptors: []request.WaiterAcceptor{
34			{
35				State:   request.SuccessWaiterState,
36				Matcher: request.PathWaiterMatch, Argument: "Cluster.Status",
37				Expected: "DEPLOYED",
38			},
39			{
40				State:   request.RetryWaiterState,
41				Matcher: request.PathWaiterMatch, Argument: "Cluster.Status",
42				Expected: "PENDING",
43			},
44			{
45				State:    request.RetryWaiterState,
46				Matcher:  request.StatusWaiterMatch,
47				Expected: 500,
48			},
49		},
50		Logger: c.Config.Logger,
51		NewRequest: func(opts []request.Option) (*request.Request, error) {
52			var inCpy *DescribeClusterInput
53			if input != nil {
54				tmp := *input
55				inCpy = &tmp
56			}
57			req, _ := c.DescribeClusterRequest(inCpy)
58			req.SetContext(ctx)
59			req.ApplyOptions(opts...)
60			return req, nil
61		},
62	}
63	w.ApplyOptions(opts...)
64
65	return w.WaitWithContext(ctx)
66}
67
68// WaitUntilClusterDeleted uses the AWS Route53 Recovery Control Config API operation
69// DescribeCluster to wait for a condition to be met before returning.
70// If the condition is not met within the max attempt window, an error will
71// be returned.
72func (c *Route53RecoveryControlConfig) WaitUntilClusterDeleted(input *DescribeClusterInput) error {
73	return c.WaitUntilClusterDeletedWithContext(aws.BackgroundContext(), input)
74}
75
76// WaitUntilClusterDeletedWithContext is an extended version of WaitUntilClusterDeleted.
77// With the support for passing in a context and options to configure the
78// Waiter and the underlying request options.
79//
80// The context must be non-nil and will be used for request cancellation. If
81// the context is nil a panic will occur. In the future the SDK may create
82// sub-contexts for http.Requests. See https://golang.org/pkg/context/
83// for more information on using Contexts.
84func (c *Route53RecoveryControlConfig) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error {
85	w := request.Waiter{
86		Name:        "WaitUntilClusterDeleted",
87		MaxAttempts: 26,
88		Delay:       request.ConstantWaiterDelay(5 * time.Second),
89		Acceptors: []request.WaiterAcceptor{
90			{
91				State:    request.SuccessWaiterState,
92				Matcher:  request.StatusWaiterMatch,
93				Expected: 404,
94			},
95			{
96				State:   request.RetryWaiterState,
97				Matcher: request.PathWaiterMatch, Argument: "Cluster.Status",
98				Expected: "PENDING_DELETION",
99			},
100			{
101				State:    request.RetryWaiterState,
102				Matcher:  request.StatusWaiterMatch,
103				Expected: 500,
104			},
105		},
106		Logger: c.Config.Logger,
107		NewRequest: func(opts []request.Option) (*request.Request, error) {
108			var inCpy *DescribeClusterInput
109			if input != nil {
110				tmp := *input
111				inCpy = &tmp
112			}
113			req, _ := c.DescribeClusterRequest(inCpy)
114			req.SetContext(ctx)
115			req.ApplyOptions(opts...)
116			return req, nil
117		},
118	}
119	w.ApplyOptions(opts...)
120
121	return w.WaitWithContext(ctx)
122}
123
124// WaitUntilControlPanelCreated uses the AWS Route53 Recovery Control Config API operation
125// DescribeControlPanel to wait for a condition to be met before returning.
126// If the condition is not met within the max attempt window, an error will
127// be returned.
128func (c *Route53RecoveryControlConfig) WaitUntilControlPanelCreated(input *DescribeControlPanelInput) error {
129	return c.WaitUntilControlPanelCreatedWithContext(aws.BackgroundContext(), input)
130}
131
132// WaitUntilControlPanelCreatedWithContext is an extended version of WaitUntilControlPanelCreated.
133// With the support for passing in a context and options to configure the
134// Waiter and the underlying request options.
135//
136// The context must be non-nil and will be used for request cancellation. If
137// the context is nil a panic will occur. In the future the SDK may create
138// sub-contexts for http.Requests. See https://golang.org/pkg/context/
139// for more information on using Contexts.
140func (c *Route53RecoveryControlConfig) WaitUntilControlPanelCreatedWithContext(ctx aws.Context, input *DescribeControlPanelInput, opts ...request.WaiterOption) error {
141	w := request.Waiter{
142		Name:        "WaitUntilControlPanelCreated",
143		MaxAttempts: 26,
144		Delay:       request.ConstantWaiterDelay(5 * time.Second),
145		Acceptors: []request.WaiterAcceptor{
146			{
147				State:   request.SuccessWaiterState,
148				Matcher: request.PathWaiterMatch, Argument: "ControlPanel.Status",
149				Expected: "DEPLOYED",
150			},
151			{
152				State:   request.RetryWaiterState,
153				Matcher: request.PathWaiterMatch, Argument: "ControlPanel.Status",
154				Expected: "PENDING",
155			},
156			{
157				State:    request.RetryWaiterState,
158				Matcher:  request.StatusWaiterMatch,
159				Expected: 500,
160			},
161		},
162		Logger: c.Config.Logger,
163		NewRequest: func(opts []request.Option) (*request.Request, error) {
164			var inCpy *DescribeControlPanelInput
165			if input != nil {
166				tmp := *input
167				inCpy = &tmp
168			}
169			req, _ := c.DescribeControlPanelRequest(inCpy)
170			req.SetContext(ctx)
171			req.ApplyOptions(opts...)
172			return req, nil
173		},
174	}
175	w.ApplyOptions(opts...)
176
177	return w.WaitWithContext(ctx)
178}
179
180// WaitUntilControlPanelDeleted uses the AWS Route53 Recovery Control Config API operation
181// DescribeControlPanel to wait for a condition to be met before returning.
182// If the condition is not met within the max attempt window, an error will
183// be returned.
184func (c *Route53RecoveryControlConfig) WaitUntilControlPanelDeleted(input *DescribeControlPanelInput) error {
185	return c.WaitUntilControlPanelDeletedWithContext(aws.BackgroundContext(), input)
186}
187
188// WaitUntilControlPanelDeletedWithContext is an extended version of WaitUntilControlPanelDeleted.
189// With the support for passing in a context and options to configure the
190// Waiter and the underlying request options.
191//
192// The context must be non-nil and will be used for request cancellation. If
193// the context is nil a panic will occur. In the future the SDK may create
194// sub-contexts for http.Requests. See https://golang.org/pkg/context/
195// for more information on using Contexts.
196func (c *Route53RecoveryControlConfig) WaitUntilControlPanelDeletedWithContext(ctx aws.Context, input *DescribeControlPanelInput, opts ...request.WaiterOption) error {
197	w := request.Waiter{
198		Name:        "WaitUntilControlPanelDeleted",
199		MaxAttempts: 26,
200		Delay:       request.ConstantWaiterDelay(5 * time.Second),
201		Acceptors: []request.WaiterAcceptor{
202			{
203				State:    request.SuccessWaiterState,
204				Matcher:  request.StatusWaiterMatch,
205				Expected: 404,
206			},
207			{
208				State:   request.RetryWaiterState,
209				Matcher: request.PathWaiterMatch, Argument: "ControlPanel.Status",
210				Expected: "PENDING_DELETION",
211			},
212			{
213				State:    request.RetryWaiterState,
214				Matcher:  request.StatusWaiterMatch,
215				Expected: 500,
216			},
217		},
218		Logger: c.Config.Logger,
219		NewRequest: func(opts []request.Option) (*request.Request, error) {
220			var inCpy *DescribeControlPanelInput
221			if input != nil {
222				tmp := *input
223				inCpy = &tmp
224			}
225			req, _ := c.DescribeControlPanelRequest(inCpy)
226			req.SetContext(ctx)
227			req.ApplyOptions(opts...)
228			return req, nil
229		},
230	}
231	w.ApplyOptions(opts...)
232
233	return w.WaitWithContext(ctx)
234}
235
236// WaitUntilRoutingControlCreated uses the AWS Route53 Recovery Control Config API operation
237// DescribeRoutingControl to wait for a condition to be met before returning.
238// If the condition is not met within the max attempt window, an error will
239// be returned.
240func (c *Route53RecoveryControlConfig) WaitUntilRoutingControlCreated(input *DescribeRoutingControlInput) error {
241	return c.WaitUntilRoutingControlCreatedWithContext(aws.BackgroundContext(), input)
242}
243
244// WaitUntilRoutingControlCreatedWithContext is an extended version of WaitUntilRoutingControlCreated.
245// With the support for passing in a context and options to configure the
246// Waiter and the underlying request options.
247//
248// The context must be non-nil and will be used for request cancellation. If
249// the context is nil a panic will occur. In the future the SDK may create
250// sub-contexts for http.Requests. See https://golang.org/pkg/context/
251// for more information on using Contexts.
252func (c *Route53RecoveryControlConfig) WaitUntilRoutingControlCreatedWithContext(ctx aws.Context, input *DescribeRoutingControlInput, opts ...request.WaiterOption) error {
253	w := request.Waiter{
254		Name:        "WaitUntilRoutingControlCreated",
255		MaxAttempts: 26,
256		Delay:       request.ConstantWaiterDelay(5 * time.Second),
257		Acceptors: []request.WaiterAcceptor{
258			{
259				State:   request.SuccessWaiterState,
260				Matcher: request.PathWaiterMatch, Argument: "RoutingControl.Status",
261				Expected: "DEPLOYED",
262			},
263			{
264				State:   request.RetryWaiterState,
265				Matcher: request.PathWaiterMatch, Argument: "RoutingControl.Status",
266				Expected: "PENDING",
267			},
268			{
269				State:    request.RetryWaiterState,
270				Matcher:  request.StatusWaiterMatch,
271				Expected: 500,
272			},
273		},
274		Logger: c.Config.Logger,
275		NewRequest: func(opts []request.Option) (*request.Request, error) {
276			var inCpy *DescribeRoutingControlInput
277			if input != nil {
278				tmp := *input
279				inCpy = &tmp
280			}
281			req, _ := c.DescribeRoutingControlRequest(inCpy)
282			req.SetContext(ctx)
283			req.ApplyOptions(opts...)
284			return req, nil
285		},
286	}
287	w.ApplyOptions(opts...)
288
289	return w.WaitWithContext(ctx)
290}
291
292// WaitUntilRoutingControlDeleted uses the AWS Route53 Recovery Control Config API operation
293// DescribeRoutingControl to wait for a condition to be met before returning.
294// If the condition is not met within the max attempt window, an error will
295// be returned.
296func (c *Route53RecoveryControlConfig) WaitUntilRoutingControlDeleted(input *DescribeRoutingControlInput) error {
297	return c.WaitUntilRoutingControlDeletedWithContext(aws.BackgroundContext(), input)
298}
299
300// WaitUntilRoutingControlDeletedWithContext is an extended version of WaitUntilRoutingControlDeleted.
301// With the support for passing in a context and options to configure the
302// Waiter and the underlying request options.
303//
304// The context must be non-nil and will be used for request cancellation. If
305// the context is nil a panic will occur. In the future the SDK may create
306// sub-contexts for http.Requests. See https://golang.org/pkg/context/
307// for more information on using Contexts.
308func (c *Route53RecoveryControlConfig) WaitUntilRoutingControlDeletedWithContext(ctx aws.Context, input *DescribeRoutingControlInput, opts ...request.WaiterOption) error {
309	w := request.Waiter{
310		Name:        "WaitUntilRoutingControlDeleted",
311		MaxAttempts: 26,
312		Delay:       request.ConstantWaiterDelay(5 * time.Second),
313		Acceptors: []request.WaiterAcceptor{
314			{
315				State:    request.SuccessWaiterState,
316				Matcher:  request.StatusWaiterMatch,
317				Expected: 404,
318			},
319			{
320				State:   request.RetryWaiterState,
321				Matcher: request.PathWaiterMatch, Argument: "RoutingControl.Status",
322				Expected: "PENDING_DELETION",
323			},
324			{
325				State:    request.RetryWaiterState,
326				Matcher:  request.StatusWaiterMatch,
327				Expected: 500,
328			},
329		},
330		Logger: c.Config.Logger,
331		NewRequest: func(opts []request.Option) (*request.Request, error) {
332			var inCpy *DescribeRoutingControlInput
333			if input != nil {
334				tmp := *input
335				inCpy = &tmp
336			}
337			req, _ := c.DescribeRoutingControlRequest(inCpy)
338			req.SetContext(ctx)
339			req.ApplyOptions(opts...)
340			return req, nil
341		},
342	}
343	w.ApplyOptions(opts...)
344
345	return w.WaitWithContext(ctx)
346}
347