2016-01-29 20:53:56 +01:00
|
|
|
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
|
|
|
|
|
|
package s3
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aws/aws-sdk-go/private/waiter"
|
|
|
|
)
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilBucketExists uses the Amazon S3 API operation
|
|
|
|
// HeadBucket 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 *S3) WaitUntilBucketExists(input *HeadBucketInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "HeadBucket",
|
|
|
|
Delay: 5,
|
|
|
|
MaxAttempts: 20,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 200,
|
|
|
|
},
|
2016-03-18 20:35:09 +01:00
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 301,
|
|
|
|
},
|
2016-01-29 20:53:56 +01:00
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 403,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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
|
|
|
// WaitUntilBucketNotExists uses the Amazon S3 API operation
|
|
|
|
// HeadBucket 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 *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "HeadBucket",
|
|
|
|
Delay: 5,
|
|
|
|
MaxAttempts: 20,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
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
|
|
|
// WaitUntilObjectExists uses the Amazon S3 API operation
|
|
|
|
// HeadObject 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 *S3) WaitUntilObjectExists(input *HeadObjectInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "HeadObject",
|
|
|
|
Delay: 5,
|
|
|
|
MaxAttempts: 20,
|
|
|
|
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
|
|
|
// WaitUntilObjectNotExists uses the Amazon S3 API operation
|
|
|
|
// HeadObject 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 *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "HeadObject",
|
|
|
|
Delay: 5,
|
|
|
|
MaxAttempts: 20,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
|
|
|
Matcher: "status",
|
|
|
|
Argument: "",
|
|
|
|
Expected: 404,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
w := waiter.Waiter{
|
|
|
|
Client: c,
|
|
|
|
Input: input,
|
|
|
|
Config: waiterCfg,
|
|
|
|
}
|
|
|
|
return w.Wait()
|
|
|
|
}
|