drone-s3-sync/vendor/github.com/aws/aws-sdk-go/service/cloudfront/waiters.go

149 lines
5.5 KiB
Go
Raw Normal View History

2017-09-25 07:38:14 +00:00
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2016-03-10 01:22:40 +00:00
package cloudfront
import (
2017-09-25 07:38:14 +00:00
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
2016-03-10 01:22:40 +00:00
)
2017-09-25 07:38:14 +00:00
// WaitUntilDistributionDeployed uses the CloudFront API operation
// GetDistribution to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
2016-03-10 01:22:40 +00:00
func (c *CloudFront) WaitUntilDistributionDeployed(input *GetDistributionInput) error {
2017-09-25 07:38:14 +00:00
return c.WaitUntilDistributionDeployedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilDistributionDeployedWithContext is an extended version of WaitUntilDistributionDeployed.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) WaitUntilDistributionDeployedWithContext(ctx aws.Context, input *GetDistributionInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilDistributionDeployed",
2016-03-10 01:22:40 +00:00
MaxAttempts: 25,
2017-09-25 07:38:14 +00:00
Delay: request.ConstantWaiterDelay(60 * time.Second),
Acceptors: []request.WaiterAcceptor{
2016-03-10 01:22:40 +00:00
{
2017-09-25 07:38:14 +00:00
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "Distribution.Status",
2016-03-10 01:22:40 +00:00
Expected: "Deployed",
},
},
2017-09-25 07:38:14 +00:00
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *GetDistributionInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetDistributionRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
2016-03-10 01:22:40 +00:00
}
2017-09-25 07:38:14 +00:00
w.ApplyOptions(opts...)
2016-03-10 01:22:40 +00:00
2017-09-25 07:38:14 +00:00
return w.WaitWithContext(ctx)
2016-03-10 01:22:40 +00:00
}
2017-09-25 07:38:14 +00:00
// WaitUntilInvalidationCompleted uses the CloudFront API operation
// GetInvalidation to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
2016-03-10 01:22:40 +00:00
func (c *CloudFront) WaitUntilInvalidationCompleted(input *GetInvalidationInput) error {
2017-09-25 07:38:14 +00:00
return c.WaitUntilInvalidationCompletedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilInvalidationCompletedWithContext is an extended version of WaitUntilInvalidationCompleted.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) WaitUntilInvalidationCompletedWithContext(ctx aws.Context, input *GetInvalidationInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilInvalidationCompleted",
2016-03-10 01:22:40 +00:00
MaxAttempts: 30,
2017-09-25 07:38:14 +00:00
Delay: request.ConstantWaiterDelay(20 * time.Second),
Acceptors: []request.WaiterAcceptor{
2016-03-10 01:22:40 +00:00
{
2017-09-25 07:38:14 +00:00
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "Invalidation.Status",
2016-03-10 01:22:40 +00:00
Expected: "Completed",
},
},
2017-09-25 07:38:14 +00:00
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *GetInvalidationInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetInvalidationRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
2016-03-10 01:22:40 +00:00
}
2017-09-25 07:38:14 +00:00
w.ApplyOptions(opts...)
2016-03-10 01:22:40 +00:00
2017-09-25 07:38:14 +00:00
return w.WaitWithContext(ctx)
2016-03-10 01:22:40 +00:00
}
2017-09-25 07:38:14 +00:00
// WaitUntilStreamingDistributionDeployed uses the CloudFront API operation
// GetStreamingDistribution to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
2016-03-10 01:22:40 +00:00
func (c *CloudFront) WaitUntilStreamingDistributionDeployed(input *GetStreamingDistributionInput) error {
2017-09-25 07:38:14 +00:00
return c.WaitUntilStreamingDistributionDeployedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilStreamingDistributionDeployedWithContext is an extended version of WaitUntilStreamingDistributionDeployed.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFront) WaitUntilStreamingDistributionDeployedWithContext(ctx aws.Context, input *GetStreamingDistributionInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilStreamingDistributionDeployed",
2016-03-10 01:22:40 +00:00
MaxAttempts: 25,
2017-09-25 07:38:14 +00:00
Delay: request.ConstantWaiterDelay(60 * time.Second),
Acceptors: []request.WaiterAcceptor{
2016-03-10 01:22:40 +00:00
{
2017-09-25 07:38:14 +00:00
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "StreamingDistribution.Status",
2016-03-10 01:22:40 +00:00
Expected: "Deployed",
},
},
2017-09-25 07:38:14 +00:00
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *GetStreamingDistributionInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetStreamingDistributionRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
2016-03-10 01:22:40 +00:00
}
2017-09-25 07:38:14 +00:00
w.ApplyOptions(opts...)
2016-03-10 01:22:40 +00:00
2017-09-25 07:38:14 +00:00
return w.WaitWithContext(ctx)
2016-03-10 01:22:40 +00:00
}