waiters.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package s3
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "HeadBucket",
  9. Delay: 5,
  10. MaxAttempts: 20,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "success",
  14. Matcher: "status",
  15. Argument: "",
  16. Expected: 200,
  17. },
  18. {
  19. State: "success",
  20. Matcher: "status",
  21. Argument: "",
  22. Expected: 301,
  23. },
  24. {
  25. State: "success",
  26. Matcher: "status",
  27. Argument: "",
  28. Expected: 403,
  29. },
  30. {
  31. State: "retry",
  32. Matcher: "status",
  33. Argument: "",
  34. Expected: 404,
  35. },
  36. },
  37. }
  38. w := waiter.Waiter{
  39. Client: c,
  40. Input: input,
  41. Config: waiterCfg,
  42. }
  43. return w.Wait()
  44. }
  45. func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error {
  46. waiterCfg := waiter.Config{
  47. Operation: "HeadBucket",
  48. Delay: 5,
  49. MaxAttempts: 20,
  50. Acceptors: []waiter.WaitAcceptor{
  51. {
  52. State: "success",
  53. Matcher: "status",
  54. Argument: "",
  55. Expected: 404,
  56. },
  57. },
  58. }
  59. w := waiter.Waiter{
  60. Client: c,
  61. Input: input,
  62. Config: waiterCfg,
  63. }
  64. return w.Wait()
  65. }
  66. func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error {
  67. waiterCfg := waiter.Config{
  68. Operation: "HeadObject",
  69. Delay: 5,
  70. MaxAttempts: 20,
  71. Acceptors: []waiter.WaitAcceptor{
  72. {
  73. State: "success",
  74. Matcher: "status",
  75. Argument: "",
  76. Expected: 200,
  77. },
  78. {
  79. State: "retry",
  80. Matcher: "status",
  81. Argument: "",
  82. Expected: 404,
  83. },
  84. },
  85. }
  86. w := waiter.Waiter{
  87. Client: c,
  88. Input: input,
  89. Config: waiterCfg,
  90. }
  91. return w.Wait()
  92. }
  93. func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error {
  94. waiterCfg := waiter.Config{
  95. Operation: "HeadObject",
  96. Delay: 5,
  97. MaxAttempts: 20,
  98. Acceptors: []waiter.WaitAcceptor{
  99. {
  100. State: "success",
  101. Matcher: "status",
  102. Argument: "",
  103. Expected: 404,
  104. },
  105. },
  106. }
  107. w := waiter.Waiter{
  108. Client: c,
  109. Input: input,
  110. Config: waiterCfg,
  111. }
  112. return w.Wait()
  113. }