waiters.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. // WaitUntilBucketExists uses the Amazon S3 API operation
  7. // HeadBucket 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 *S3) WaitUntilBucketExists(input *HeadBucketInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "HeadBucket",
  13. Delay: 5,
  14. MaxAttempts: 20,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "status",
  19. Argument: "",
  20. Expected: 200,
  21. },
  22. {
  23. State: "success",
  24. Matcher: "status",
  25. Argument: "",
  26. Expected: 301,
  27. },
  28. {
  29. State: "success",
  30. Matcher: "status",
  31. Argument: "",
  32. Expected: 403,
  33. },
  34. {
  35. State: "retry",
  36. Matcher: "status",
  37. Argument: "",
  38. Expected: 404,
  39. },
  40. },
  41. }
  42. w := waiter.Waiter{
  43. Client: c,
  44. Input: input,
  45. Config: waiterCfg,
  46. }
  47. return w.Wait()
  48. }
  49. // WaitUntilBucketNotExists uses the Amazon S3 API operation
  50. // HeadBucket to wait for a condition to be met before returning.
  51. // If the condition is not meet within the max attempt window an error will
  52. // be returned.
  53. func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error {
  54. waiterCfg := waiter.Config{
  55. Operation: "HeadBucket",
  56. Delay: 5,
  57. MaxAttempts: 20,
  58. Acceptors: []waiter.WaitAcceptor{
  59. {
  60. State: "success",
  61. Matcher: "status",
  62. Argument: "",
  63. Expected: 404,
  64. },
  65. },
  66. }
  67. w := waiter.Waiter{
  68. Client: c,
  69. Input: input,
  70. Config: waiterCfg,
  71. }
  72. return w.Wait()
  73. }
  74. // WaitUntilObjectExists uses the Amazon S3 API operation
  75. // HeadObject to wait for a condition to be met before returning.
  76. // If the condition is not meet within the max attempt window an error will
  77. // be returned.
  78. func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error {
  79. waiterCfg := waiter.Config{
  80. Operation: "HeadObject",
  81. Delay: 5,
  82. MaxAttempts: 20,
  83. Acceptors: []waiter.WaitAcceptor{
  84. {
  85. State: "success",
  86. Matcher: "status",
  87. Argument: "",
  88. Expected: 200,
  89. },
  90. {
  91. State: "retry",
  92. Matcher: "status",
  93. Argument: "",
  94. Expected: 404,
  95. },
  96. },
  97. }
  98. w := waiter.Waiter{
  99. Client: c,
  100. Input: input,
  101. Config: waiterCfg,
  102. }
  103. return w.Wait()
  104. }
  105. // WaitUntilObjectNotExists uses the Amazon S3 API operation
  106. // HeadObject to wait for a condition to be met before returning.
  107. // If the condition is not meet within the max attempt window an error will
  108. // be returned.
  109. func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error {
  110. waiterCfg := waiter.Config{
  111. Operation: "HeadObject",
  112. Delay: 5,
  113. MaxAttempts: 20,
  114. Acceptors: []waiter.WaitAcceptor{
  115. {
  116. State: "success",
  117. Matcher: "status",
  118. Argument: "",
  119. Expected: 404,
  120. },
  121. },
  122. }
  123. w := waiter.Waiter{
  124. Client: c,
  125. Input: input,
  126. Config: waiterCfg,
  127. }
  128. return w.Wait()
  129. }