waiters.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package route53
  3. import (
  4. "time"
  5. "github.com/aws/aws-sdk-go/aws"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. )
  8. // WaitUntilResourceRecordSetsChanged uses the Route 53 API operation
  9. // GetChange to wait for a condition to be met before returning.
  10. // If the condition is not met within the max attempt window, an error will
  11. // be returned.
  12. func (c *Route53) WaitUntilResourceRecordSetsChanged(input *GetChangeInput) error {
  13. return c.WaitUntilResourceRecordSetsChangedWithContext(aws.BackgroundContext(), input)
  14. }
  15. // WaitUntilResourceRecordSetsChangedWithContext is an extended version of WaitUntilResourceRecordSetsChanged.
  16. // With the support for passing in a context and options to configure the
  17. // Waiter and the underlying request options.
  18. //
  19. // The context must be non-nil and will be used for request cancellation. If
  20. // the context is nil a panic will occur. In the future the SDK may create
  21. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  22. // for more information on using Contexts.
  23. func (c *Route53) WaitUntilResourceRecordSetsChangedWithContext(ctx aws.Context, input *GetChangeInput, opts ...request.WaiterOption) error {
  24. w := request.Waiter{
  25. Name: "WaitUntilResourceRecordSetsChanged",
  26. MaxAttempts: 60,
  27. Delay: request.ConstantWaiterDelay(30 * time.Second),
  28. Acceptors: []request.WaiterAcceptor{
  29. {
  30. State: request.SuccessWaiterState,
  31. Matcher: request.PathWaiterMatch, Argument: "ChangeInfo.Status",
  32. Expected: "INSYNC",
  33. },
  34. },
  35. Logger: c.Config.Logger,
  36. NewRequest: func(opts []request.Option) (*request.Request, error) {
  37. var inCpy *GetChangeInput
  38. if input != nil {
  39. tmp := *input
  40. inCpy = &tmp
  41. }
  42. req, _ := c.GetChangeRequest(inCpy)
  43. req.SetContext(ctx)
  44. req.ApplyOptions(opts...)
  45. return req, nil
  46. },
  47. }
  48. w.ApplyOptions(opts...)
  49. return w.WaitWithContext(ctx)
  50. }