waiters.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudfront
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilDistributionDeployed uses the CloudFront API operation
  7. // GetDistribution 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 *CloudFront) WaitUntilDistributionDeployed(input *GetDistributionInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "GetDistribution",
  13. Delay: 60,
  14. MaxAttempts: 25,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "path",
  19. Argument: "Distribution.Status",
  20. Expected: "Deployed",
  21. },
  22. },
  23. }
  24. w := waiter.Waiter{
  25. Client: c,
  26. Input: input,
  27. Config: waiterCfg,
  28. }
  29. return w.Wait()
  30. }
  31. // WaitUntilInvalidationCompleted uses the CloudFront API operation
  32. // GetInvalidation to wait for a condition to be met before returning.
  33. // If the condition is not meet within the max attempt window an error will
  34. // be returned.
  35. func (c *CloudFront) WaitUntilInvalidationCompleted(input *GetInvalidationInput) error {
  36. waiterCfg := waiter.Config{
  37. Operation: "GetInvalidation",
  38. Delay: 20,
  39. MaxAttempts: 30,
  40. Acceptors: []waiter.WaitAcceptor{
  41. {
  42. State: "success",
  43. Matcher: "path",
  44. Argument: "Invalidation.Status",
  45. Expected: "Completed",
  46. },
  47. },
  48. }
  49. w := waiter.Waiter{
  50. Client: c,
  51. Input: input,
  52. Config: waiterCfg,
  53. }
  54. return w.Wait()
  55. }
  56. // WaitUntilStreamingDistributionDeployed uses the CloudFront API operation
  57. // GetStreamingDistribution to wait for a condition to be met before returning.
  58. // If the condition is not meet within the max attempt window an error will
  59. // be returned.
  60. func (c *CloudFront) WaitUntilStreamingDistributionDeployed(input *GetStreamingDistributionInput) error {
  61. waiterCfg := waiter.Config{
  62. Operation: "GetStreamingDistribution",
  63. Delay: 60,
  64. MaxAttempts: 25,
  65. Acceptors: []waiter.WaitAcceptor{
  66. {
  67. State: "success",
  68. Matcher: "path",
  69. Argument: "StreamingDistribution.Status",
  70. Expected: "Deployed",
  71. },
  72. },
  73. }
  74. w := waiter.Waiter{
  75. Client: c,
  76. Input: input,
  77. Config: waiterCfg,
  78. }
  79. return w.Wait()
  80. }