Conver to regular Go vendor + dep tool

This commit is contained in:
Andrey Smirnov
2017-03-22 17:38:32 +03:00
parent 070347295e
commit c6c1012330
3260 changed files with 1742550 additions and 72 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,142 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package appstreamiface provides an interface to enable mocking the Amazon AppStream service client
// for testing your code.
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters.
package appstreamiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/appstream"
)
// AppStreamAPI provides an interface to enable mocking the
// appstream.AppStream service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon AppStream.
// func myFunc(svc appstreamiface.AppStreamAPI) bool {
// // Make svc.AssociateFleet request
// }
//
// func main() {
// sess := session.New()
// svc := appstream.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockAppStreamClient struct {
// appstreamiface.AppStreamAPI
// }
// func (m *mockAppStreamClient) AssociateFleet(input *appstream.AssociateFleetInput) (*appstream.AssociateFleetOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockAppStreamClient{}
//
// myfunc(mockSvc)
//
// // Verify myFunc's functionality
// }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type AppStreamAPI interface {
AssociateFleet(*appstream.AssociateFleetInput) (*appstream.AssociateFleetOutput, error)
AssociateFleetWithContext(aws.Context, *appstream.AssociateFleetInput, ...request.Option) (*appstream.AssociateFleetOutput, error)
AssociateFleetRequest(*appstream.AssociateFleetInput) (*request.Request, *appstream.AssociateFleetOutput)
CreateFleet(*appstream.CreateFleetInput) (*appstream.CreateFleetOutput, error)
CreateFleetWithContext(aws.Context, *appstream.CreateFleetInput, ...request.Option) (*appstream.CreateFleetOutput, error)
CreateFleetRequest(*appstream.CreateFleetInput) (*request.Request, *appstream.CreateFleetOutput)
CreateStack(*appstream.CreateStackInput) (*appstream.CreateStackOutput, error)
CreateStackWithContext(aws.Context, *appstream.CreateStackInput, ...request.Option) (*appstream.CreateStackOutput, error)
CreateStackRequest(*appstream.CreateStackInput) (*request.Request, *appstream.CreateStackOutput)
CreateStreamingURL(*appstream.CreateStreamingURLInput) (*appstream.CreateStreamingURLOutput, error)
CreateStreamingURLWithContext(aws.Context, *appstream.CreateStreamingURLInput, ...request.Option) (*appstream.CreateStreamingURLOutput, error)
CreateStreamingURLRequest(*appstream.CreateStreamingURLInput) (*request.Request, *appstream.CreateStreamingURLOutput)
DeleteFleet(*appstream.DeleteFleetInput) (*appstream.DeleteFleetOutput, error)
DeleteFleetWithContext(aws.Context, *appstream.DeleteFleetInput, ...request.Option) (*appstream.DeleteFleetOutput, error)
DeleteFleetRequest(*appstream.DeleteFleetInput) (*request.Request, *appstream.DeleteFleetOutput)
DeleteStack(*appstream.DeleteStackInput) (*appstream.DeleteStackOutput, error)
DeleteStackWithContext(aws.Context, *appstream.DeleteStackInput, ...request.Option) (*appstream.DeleteStackOutput, error)
DeleteStackRequest(*appstream.DeleteStackInput) (*request.Request, *appstream.DeleteStackOutput)
DescribeFleets(*appstream.DescribeFleetsInput) (*appstream.DescribeFleetsOutput, error)
DescribeFleetsWithContext(aws.Context, *appstream.DescribeFleetsInput, ...request.Option) (*appstream.DescribeFleetsOutput, error)
DescribeFleetsRequest(*appstream.DescribeFleetsInput) (*request.Request, *appstream.DescribeFleetsOutput)
DescribeImages(*appstream.DescribeImagesInput) (*appstream.DescribeImagesOutput, error)
DescribeImagesWithContext(aws.Context, *appstream.DescribeImagesInput, ...request.Option) (*appstream.DescribeImagesOutput, error)
DescribeImagesRequest(*appstream.DescribeImagesInput) (*request.Request, *appstream.DescribeImagesOutput)
DescribeSessions(*appstream.DescribeSessionsInput) (*appstream.DescribeSessionsOutput, error)
DescribeSessionsWithContext(aws.Context, *appstream.DescribeSessionsInput, ...request.Option) (*appstream.DescribeSessionsOutput, error)
DescribeSessionsRequest(*appstream.DescribeSessionsInput) (*request.Request, *appstream.DescribeSessionsOutput)
DescribeStacks(*appstream.DescribeStacksInput) (*appstream.DescribeStacksOutput, error)
DescribeStacksWithContext(aws.Context, *appstream.DescribeStacksInput, ...request.Option) (*appstream.DescribeStacksOutput, error)
DescribeStacksRequest(*appstream.DescribeStacksInput) (*request.Request, *appstream.DescribeStacksOutput)
DisassociateFleet(*appstream.DisassociateFleetInput) (*appstream.DisassociateFleetOutput, error)
DisassociateFleetWithContext(aws.Context, *appstream.DisassociateFleetInput, ...request.Option) (*appstream.DisassociateFleetOutput, error)
DisassociateFleetRequest(*appstream.DisassociateFleetInput) (*request.Request, *appstream.DisassociateFleetOutput)
ExpireSession(*appstream.ExpireSessionInput) (*appstream.ExpireSessionOutput, error)
ExpireSessionWithContext(aws.Context, *appstream.ExpireSessionInput, ...request.Option) (*appstream.ExpireSessionOutput, error)
ExpireSessionRequest(*appstream.ExpireSessionInput) (*request.Request, *appstream.ExpireSessionOutput)
ListAssociatedFleets(*appstream.ListAssociatedFleetsInput) (*appstream.ListAssociatedFleetsOutput, error)
ListAssociatedFleetsWithContext(aws.Context, *appstream.ListAssociatedFleetsInput, ...request.Option) (*appstream.ListAssociatedFleetsOutput, error)
ListAssociatedFleetsRequest(*appstream.ListAssociatedFleetsInput) (*request.Request, *appstream.ListAssociatedFleetsOutput)
ListAssociatedStacks(*appstream.ListAssociatedStacksInput) (*appstream.ListAssociatedStacksOutput, error)
ListAssociatedStacksWithContext(aws.Context, *appstream.ListAssociatedStacksInput, ...request.Option) (*appstream.ListAssociatedStacksOutput, error)
ListAssociatedStacksRequest(*appstream.ListAssociatedStacksInput) (*request.Request, *appstream.ListAssociatedStacksOutput)
StartFleet(*appstream.StartFleetInput) (*appstream.StartFleetOutput, error)
StartFleetWithContext(aws.Context, *appstream.StartFleetInput, ...request.Option) (*appstream.StartFleetOutput, error)
StartFleetRequest(*appstream.StartFleetInput) (*request.Request, *appstream.StartFleetOutput)
StopFleet(*appstream.StopFleetInput) (*appstream.StopFleetOutput, error)
StopFleetWithContext(aws.Context, *appstream.StopFleetInput, ...request.Option) (*appstream.StopFleetOutput, error)
StopFleetRequest(*appstream.StopFleetInput) (*request.Request, *appstream.StopFleetOutput)
UpdateFleet(*appstream.UpdateFleetInput) (*appstream.UpdateFleetOutput, error)
UpdateFleetWithContext(aws.Context, *appstream.UpdateFleetInput, ...request.Option) (*appstream.UpdateFleetOutput, error)
UpdateFleetRequest(*appstream.UpdateFleetInput) (*request.Request, *appstream.UpdateFleetOutput)
UpdateStack(*appstream.UpdateStackInput) (*appstream.UpdateStackOutput, error)
UpdateStackWithContext(aws.Context, *appstream.UpdateStackInput, ...request.Option) (*appstream.UpdateStackOutput, error)
UpdateStackRequest(*appstream.UpdateStackInput) (*request.Request, *appstream.UpdateStackOutput)
WaitUntilFleetStarted(*appstream.DescribeFleetsInput) error
WaitUntilFleetStartedWithContext(aws.Context, *appstream.DescribeFleetsInput, ...request.WaiterOption) error
WaitUntilFleetStopped(*appstream.DescribeFleetsInput) error
WaitUntilFleetStoppedWithContext(aws.Context, *appstream.DescribeFleetsInput, ...request.WaiterOption) error
}
var _ AppStreamAPI = (*appstream.AppStream)(nil)
+48
View File
@@ -0,0 +1,48 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package appstream
const (
// ErrCodeInvalidRoleException for service response error code
// "InvalidRoleException".
//
// The specified role is invalid.
ErrCodeInvalidRoleException = "InvalidRoleException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// The requested limit exceeds the permitted limit for an account.
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeOperationNotPermittedException for service response error code
// "OperationNotPermittedException".
//
// The attempted operation is not permitted.
ErrCodeOperationNotPermittedException = "OperationNotPermittedException"
// ErrCodeResourceAlreadyExistsException for service response error code
// "ResourceAlreadyExistsException".
//
// The specified resource already exists.
ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException"
// ErrCodeResourceInUseException for service response error code
// "ResourceInUseException".
//
// The specified resource is in use.
ErrCodeResourceInUseException = "ResourceInUseException"
// ErrCodeResourceNotAvailableException for service response error code
// "ResourceNotAvailableException".
//
// The specified resource exists and is not in use, but isn't available.
ErrCodeResourceNotAvailableException = "ResourceNotAvailableException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The specified resource was not found.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
)
+453
View File
@@ -0,0 +1,453 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package appstream_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/appstream"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleAppStream_AssociateFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.AssociateFleetInput{
FleetName: aws.String("String"), // Required
StackName: aws.String("String"), // Required
}
resp, err := svc.AssociateFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_CreateFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.CreateFleetInput{
ComputeCapacity: &appstream.ComputeCapacity{ // Required
DesiredInstances: aws.Int64(1), // Required
},
ImageName: aws.String("String"), // Required
InstanceType: aws.String("String"), // Required
Name: aws.String("Name"), // Required
Description: aws.String("Description"),
DisconnectTimeoutInSeconds: aws.Int64(1),
DisplayName: aws.String("DisplayName"),
MaxUserDurationInSeconds: aws.Int64(1),
VpcConfig: &appstream.VpcConfig{
SubnetIds: []*string{ // Required
aws.String("String"), // Required
// More values...
},
},
}
resp, err := svc.CreateFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_CreateStack() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.CreateStackInput{
Name: aws.String("String"), // Required
Description: aws.String("Description"),
DisplayName: aws.String("DisplayName"),
}
resp, err := svc.CreateStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_CreateStreamingURL() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.CreateStreamingURLInput{
FleetName: aws.String("String"), // Required
StackName: aws.String("String"), // Required
UserId: aws.String("UserId"), // Required
ApplicationId: aws.String("String"),
SessionContext: aws.String("String"),
Validity: aws.Int64(1),
}
resp, err := svc.CreateStreamingURL(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DeleteFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DeleteFleetInput{
Name: aws.String("String"), // Required
}
resp, err := svc.DeleteFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DeleteStack() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DeleteStackInput{
Name: aws.String("String"), // Required
}
resp, err := svc.DeleteStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DescribeFleets() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DescribeFleetsInput{
Names: []*string{
aws.String("String"), // Required
// More values...
},
NextToken: aws.String("String"),
}
resp, err := svc.DescribeFleets(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DescribeImages() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DescribeImagesInput{
Names: []*string{
aws.String("String"), // Required
// More values...
},
}
resp, err := svc.DescribeImages(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DescribeSessions() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DescribeSessionsInput{
FleetName: aws.String("String"), // Required
StackName: aws.String("String"), // Required
Limit: aws.Int64(1),
NextToken: aws.String("String"),
UserId: aws.String("UserId"),
}
resp, err := svc.DescribeSessions(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DescribeStacks() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DescribeStacksInput{
Names: []*string{
aws.String("String"), // Required
// More values...
},
NextToken: aws.String("String"),
}
resp, err := svc.DescribeStacks(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_DisassociateFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.DisassociateFleetInput{
FleetName: aws.String("String"), // Required
StackName: aws.String("String"), // Required
}
resp, err := svc.DisassociateFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_ExpireSession() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.ExpireSessionInput{
SessionId: aws.String("String"), // Required
}
resp, err := svc.ExpireSession(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_ListAssociatedFleets() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.ListAssociatedFleetsInput{
StackName: aws.String("String"), // Required
NextToken: aws.String("String"),
}
resp, err := svc.ListAssociatedFleets(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_ListAssociatedStacks() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.ListAssociatedStacksInput{
FleetName: aws.String("String"), // Required
NextToken: aws.String("String"),
}
resp, err := svc.ListAssociatedStacks(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_StartFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.StartFleetInput{
Name: aws.String("String"), // Required
}
resp, err := svc.StartFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_StopFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.StopFleetInput{
Name: aws.String("String"), // Required
}
resp, err := svc.StopFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_UpdateFleet() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.UpdateFleetInput{
Name: aws.String("String"), // Required
ComputeCapacity: &appstream.ComputeCapacity{
DesiredInstances: aws.Int64(1), // Required
},
DeleteVpcConfig: aws.Bool(true),
Description: aws.String("Description"),
DisconnectTimeoutInSeconds: aws.Int64(1),
DisplayName: aws.String("DisplayName"),
ImageName: aws.String("String"),
InstanceType: aws.String("String"),
MaxUserDurationInSeconds: aws.Int64(1),
VpcConfig: &appstream.VpcConfig{
SubnetIds: []*string{ // Required
aws.String("String"), // Required
// More values...
},
},
}
resp, err := svc.UpdateFleet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleAppStream_UpdateStack() {
sess := session.Must(session.NewSession())
svc := appstream.New(sess)
params := &appstream.UpdateStackInput{
Name: aws.String("String"), // Required
Description: aws.String("Description"),
DisplayName: aws.String("DisplayName"),
}
resp, err := svc.UpdateStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
+96
View File
@@ -0,0 +1,96 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package appstream
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
// API documentation for Amazon AppStream 2.0.
// The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01
type AppStream struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "appstream2" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the AppStream client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a AppStream client from just a session.
// svc := appstream.New(mySession)
//
// // Create a AppStream client with additional configuration
// svc := appstream.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppStream {
c := p.ClientConfig(EndpointsID, cfgs...)
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AppStream {
if len(signingName) == 0 {
signingName = "appstream"
}
svc := &AppStream{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2016-12-01",
JSONVersion: "1.1",
TargetPrefix: "PhotonAdminProxyService",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a AppStream operation and runs any
// custom request initialization.
func (c *AppStream) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}
+112
View File
@@ -0,0 +1,112 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package appstream
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
// WaitUntilFleetStarted uses the Amazon AppStream API operation
// DescribeFleets 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.
func (c *AppStream) WaitUntilFleetStarted(input *DescribeFleetsInput) error {
return c.WaitUntilFleetStartedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilFleetStartedWithContext is an extended version of WaitUntilFleetStarted.
// 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 *AppStream) WaitUntilFleetStartedWithContext(ctx aws.Context, input *DescribeFleetsInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilFleetStarted",
MaxAttempts: 40,
Delay: request.ConstantWaiterDelay(30 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathAllWaiterMatch, Argument: "fleets[].state",
Expected: "ACTIVE",
},
{
State: request.FailureWaiterState,
Matcher: request.PathAnyWaiterMatch, Argument: "fleets[].state",
Expected: "PENDING_DEACTIVATE",
},
{
State: request.FailureWaiterState,
Matcher: request.PathAnyWaiterMatch, Argument: "fleets[].state",
Expected: "INACTIVE",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
req, _ := c.DescribeFleetsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilFleetStopped uses the Amazon AppStream API operation
// DescribeFleets 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.
func (c *AppStream) WaitUntilFleetStopped(input *DescribeFleetsInput) error {
return c.WaitUntilFleetStoppedWithContext(aws.BackgroundContext(), input)
}
// WaitUntilFleetStoppedWithContext is an extended version of WaitUntilFleetStopped.
// 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 *AppStream) WaitUntilFleetStoppedWithContext(ctx aws.Context, input *DescribeFleetsInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilFleetStopped",
MaxAttempts: 40,
Delay: request.ConstantWaiterDelay(30 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathAllWaiterMatch, Argument: "fleets[].state",
Expected: "INACTIVE",
},
{
State: request.FailureWaiterState,
Matcher: request.PathAnyWaiterMatch, Argument: "fleets[].state",
Expected: "PENDING_ACTIVATE",
},
{
State: request.FailureWaiterState,
Matcher: request.PathAnyWaiterMatch, Argument: "fleets[].state",
Expected: "ACTIVE",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
req, _ := c.DescribeFleetsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}