예제 #1
0
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 {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.Prettify(resp))
}
예제 #2
0
파일: client.go 프로젝트: gunosy/aws-sdk-go
func init() {
	Before("@workspaces", func() {
		World["client"] = workspaces.New(nil)
	})
}
예제 #3
0
func TestInterface(t *testing.T) {
	assert.Implements(t, (*workspacesiface.WorkSpacesAPI)(nil), workspaces.New(nil))
}