2016-01-29 20:53:56 +01:00
|
|
|
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
|
|
|
|
|
|
package iam
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aws/aws-sdk-go/private/waiter"
|
|
|
|
)
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilInstanceProfileExists uses the IAM API operation
|
|
|
|
// GetInstanceProfile to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-01-29 20:53:56 +01:00
|
|
|
func (c *IAM) WaitUntilInstanceProfileExists(input *GetInstanceProfileInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "GetInstanceProfile",
|
|
|
|
Delay: 1,
|
|
|
|
MaxAttempts: 40,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 200,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
State: "retry",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 404,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
w := waiter.Waiter{
|
|
|
|
Client: c,
|
|
|
|
Input: input,
|
|
|
|
Config: waiterCfg,
|
|
|
|
}
|
|
|
|
return w.Wait()
|
|
|
|
}
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilUserExists uses the IAM API operation
|
|
|
|
// GetUser to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-01-29 20:53:56 +01:00
|
|
|
func (c *IAM) WaitUntilUserExists(input *GetUserInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "GetUser",
|
|
|
|
Delay: 1,
|
|
|
|
MaxAttempts: 20,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 200,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
State: "retry",
|
|
|
|
Matcher: "error",
|
|
|
|
Argument: "",
|
|
|
|
Expected: "NoSuchEntity",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
w := waiter.Waiter{
|
|
|
|
Client: c,
|
|
|
|
Input: input,
|
|
|
|
Config: waiterCfg,
|
|
|
|
}
|
|
|
|
return w.Wait()
|
|
|
|
}
|