waiters.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package dynamodb
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilTableExists uses the DynamoDB API operation
  7. // DescribeTable to wait for a condition to be met before returning.
  8. // If the condition is not meet within the max attempt window an error will
  9. // be returned.
  10. func (c *DynamoDB) WaitUntilTableExists(input *DescribeTableInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeTable",
  13. Delay: 20,
  14. MaxAttempts: 25,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "path",
  19. Argument: "Table.TableStatus",
  20. Expected: "ACTIVE",
  21. },
  22. {
  23. State: "retry",
  24. Matcher: "error",
  25. Argument: "",
  26. Expected: "ResourceNotFoundException",
  27. },
  28. },
  29. }
  30. w := waiter.Waiter{
  31. Client: c,
  32. Input: input,
  33. Config: waiterCfg,
  34. }
  35. return w.Wait()
  36. }
  37. // WaitUntilTableNotExists uses the DynamoDB API operation
  38. // DescribeTable to wait for a condition to be met before returning.
  39. // If the condition is not meet within the max attempt window an error will
  40. // be returned.
  41. func (c *DynamoDB) WaitUntilTableNotExists(input *DescribeTableInput) error {
  42. waiterCfg := waiter.Config{
  43. Operation: "DescribeTable",
  44. Delay: 20,
  45. MaxAttempts: 25,
  46. Acceptors: []waiter.WaitAcceptor{
  47. {
  48. State: "success",
  49. Matcher: "error",
  50. Argument: "",
  51. Expected: "ResourceNotFoundException",
  52. },
  53. },
  54. }
  55. w := waiter.Waiter{
  56. Client: c,
  57. Input: input,
  58. Config: waiterCfg,
  59. }
  60. return w.Wait()
  61. }