123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package workspaces_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/workspaces"
- )
- var _ time.Duration
- var _ bytes.Buffer
- 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)
- }
- func ExampleWorkSpaces_DescribeWorkspaceBundles() {
- svc := workspaces.New(nil)
- params := &workspaces.DescribeWorkspaceBundlesInput{
- BundleIds: []*string{
- aws.String("BundleId"), // Required
- // More values...
- },
- NextToken: aws.String("PaginationToken"),
- Owner: aws.String("BundleOwner"),
- }
- resp, err := svc.DescribeWorkspaceBundles(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 ExampleWorkSpaces_DescribeWorkspaceDirectories() {
- svc := workspaces.New(nil)
- params := &workspaces.DescribeWorkspaceDirectoriesInput{
- DirectoryIds: []*string{
- aws.String("DirectoryId"), // Required
- // More values...
- },
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.DescribeWorkspaceDirectories(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 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)
- }
- func ExampleWorkSpaces_RebootWorkspaces() {
- svc := workspaces.New(nil)
- params := &workspaces.RebootWorkspacesInput{
- RebootWorkspaceRequests: []*workspaces.RebootRequest{ // Required
- { // Required
- WorkspaceId: aws.String("WorkspaceId"), // Required
- },
- // More values...
- },
- }
- resp, err := svc.RebootWorkspaces(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 ExampleWorkSpaces_RebuildWorkspaces() {
- svc := workspaces.New(nil)
- params := &workspaces.RebuildWorkspacesInput{
- RebuildWorkspaceRequests: []*workspaces.RebuildRequest{ // Required
- { // Required
- WorkspaceId: aws.String("WorkspaceId"), // Required
- },
- // More values...
- },
- }
- resp, err := svc.RebuildWorkspaces(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 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)
- }
|