Exemple #1
0
func ExampleWorkSpaces_DescribeWorkspaces() {
	svc := workspaces.New(nil)

	params := &workspaces.DescribeWorkspacesInput{
		BundleId:    aws.String("BundleId"),
		DirectoryId: aws.String("DirectoryId"),
		Limit:       aws.Int64(1),
		NextToken:   aws.String("PaginationToken"),
		UserName:    aws.String("UserName"),
		WorkspaceIds: []*string{
			aws.String("WorkspaceId"), // Required
			// More values...
		},
	}
	resp, err := svc.DescribeWorkspaces(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)
}
Exemple #2
0
func ExampleWorkSpaces_CreateWorkspaces() {
	svc := workspaces.New(nil)

	params := &workspaces.CreateWorkspacesInput{
		Workspaces: []*workspaces.WorkspaceRequest{ // Required
			{ // Required
				BundleId:    aws.String("BundleId"),    // Required
				DirectoryId: aws.String("DirectoryId"), // Required
				UserName:    aws.String("UserName"),    // Required
			},
			// More values...
		},
	}
	resp, err := svc.CreateWorkspaces(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)
}
Exemple #3
0
func ExampleWorkSpaces_TerminateWorkspaces() {
	svc := workspaces.New(nil)

	params := &workspaces.TerminateWorkspacesInput{
		TerminateWorkspaceRequests: []*workspaces.TerminateRequest{ // Required
			{ // Required
				WorkspaceId: aws.String("WorkspaceId"), // Required
			},
			// More values...
		},
	}
	resp, err := svc.TerminateWorkspaces(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 TestInterface(t *testing.T) {
	assert.Implements(t, (*workspacesiface.WorkSpacesAPI)(nil), workspaces.New(nil))
}
Exemple #5
0
func init() {
	Before("@workspaces", func() {
		World["client"] = workspaces.New(nil)
	})
}