waiters.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package iam
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilInstanceProfileExists uses the IAM API operation
  7. // GetInstanceProfile 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 *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "GetInstanceProfile",
  13. Delay: 1,
  14. MaxAttempts: 40,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "status",
  19. Argument: "",
  20. Expected: 200,
  21. },
  22. {
  23. State: "retry",
  24. Matcher: "status",
  25. Argument: "",
  26. Expected: 404,
  27. },
  28. },
  29. }
  30. w := waiter.Waiter{
  31. Client: c,
  32. Input: input,
  33. Config: waiterCfg,
  34. }
  35. return w.Wait()
  36. }
  37. // WaitUntilUserExists uses the IAM API operation
  38. // GetUser 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 *IAM) WaitUntilUserExists(input *GetUserInput) error {
  42. waiterCfg := waiter.Config{
  43. Operation: "GetUser",
  44. Delay: 1,
  45. MaxAttempts: 20,
  46. Acceptors: []waiter.WaitAcceptor{
  47. {
  48. State: "success",
  49. Matcher: "status",
  50. Argument: "",
  51. Expected: 200,
  52. },
  53. {
  54. State: "retry",
  55. Matcher: "error",
  56. Argument: "",
  57. Expected: "NoSuchEntity",
  58. },
  59. },
  60. }
  61. w := waiter.Waiter{
  62. Client: c,
  63. Input: input,
  64. Config: waiterCfg,
  65. }
  66. return w.Wait()
  67. }