waiters.go 1010 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elastictranscoder
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilJobComplete uses the Amazon Elastic Transcoder API operation
  7. // ReadJob 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 *ElasticTranscoder) WaitUntilJobComplete(input *ReadJobInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "ReadJob",
  13. Delay: 30,
  14. MaxAttempts: 120,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "path",
  19. Argument: "Job.Status",
  20. Expected: "Complete",
  21. },
  22. {
  23. State: "failure",
  24. Matcher: "path",
  25. Argument: "Job.Status",
  26. Expected: "Canceled",
  27. },
  28. {
  29. State: "failure",
  30. Matcher: "path",
  31. Argument: "Job.Status",
  32. Expected: "Error",
  33. },
  34. },
  35. }
  36. w := waiter.Waiter{
  37. Client: c,
  38. Input: input,
  39. Config: waiterCfg,
  40. }
  41. return w.Wait()
  42. }