123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package devicefarm_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/devicefarm"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleDeviceFarm_CreateDevicePool() {
- svc := devicefarm.New(nil)
- params := &devicefarm.CreateDevicePoolInput{
- Name: aws.String("Name"), // Required
- ProjectArn: aws.String("AmazonResourceName"), // Required
- Rules: []*devicefarm.Rule{ // Required
- { // Required
- Attribute: aws.String("DeviceAttribute"),
- Operator: aws.String("RuleOperator"),
- Value: aws.String("String"),
- },
- // More values...
- },
- Description: aws.String("Message"),
- }
- resp, err := svc.CreateDevicePool(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 ExampleDeviceFarm_CreateProject() {
- svc := devicefarm.New(nil)
- params := &devicefarm.CreateProjectInput{
- Name: aws.String("Name"), // Required
- }
- resp, err := svc.CreateProject(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 ExampleDeviceFarm_CreateUpload() {
- svc := devicefarm.New(nil)
- params := &devicefarm.CreateUploadInput{
- Name: aws.String("Name"), // Required
- ProjectArn: aws.String("AmazonResourceName"), // Required
- Type: aws.String("UploadType"), // Required
- ContentType: aws.String("ContentType"),
- }
- resp, err := svc.CreateUpload(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 ExampleDeviceFarm_GetAccountSettings() {
- svc := devicefarm.New(nil)
- var params *devicefarm.GetAccountSettingsInput
- resp, err := svc.GetAccountSettings(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 ExampleDeviceFarm_GetDevice() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetDeviceInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetDevice(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 ExampleDeviceFarm_GetDevicePool() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetDevicePoolInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetDevicePool(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 ExampleDeviceFarm_GetDevicePoolCompatibility() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetDevicePoolCompatibilityInput{
- AppArn: aws.String("AmazonResourceName"), // Required
- DevicePoolArn: aws.String("AmazonResourceName"), // Required
- TestType: aws.String("TestType"),
- }
- resp, err := svc.GetDevicePoolCompatibility(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 ExampleDeviceFarm_GetJob() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetJobInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetJob(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 ExampleDeviceFarm_GetProject() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetProjectInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetProject(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 ExampleDeviceFarm_GetRun() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetRunInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetRun(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 ExampleDeviceFarm_GetSuite() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetSuiteInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetSuite(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 ExampleDeviceFarm_GetTest() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetTestInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetTest(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 ExampleDeviceFarm_GetUpload() {
- svc := devicefarm.New(nil)
- params := &devicefarm.GetUploadInput{
- Arn: aws.String("AmazonResourceName"), // Required
- }
- resp, err := svc.GetUpload(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 ExampleDeviceFarm_ListArtifacts() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListArtifactsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- Type: aws.String("ArtifactCategory"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListArtifacts(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 ExampleDeviceFarm_ListDevicePools() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListDevicePoolsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- Type: aws.String("DevicePoolType"),
- }
- resp, err := svc.ListDevicePools(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 ExampleDeviceFarm_ListDevices() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListDevicesInput{
- Arn: aws.String("AmazonResourceName"),
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListDevices(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 ExampleDeviceFarm_ListJobs() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListJobsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListJobs(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 ExampleDeviceFarm_ListProjects() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListProjectsInput{
- Arn: aws.String("AmazonResourceName"),
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListProjects(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 ExampleDeviceFarm_ListRuns() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListRunsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListRuns(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 ExampleDeviceFarm_ListSamples() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListSamplesInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListSamples(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 ExampleDeviceFarm_ListSuites() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListSuitesInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListSuites(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 ExampleDeviceFarm_ListTests() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListTestsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListTests(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 ExampleDeviceFarm_ListUniqueProblems() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListUniqueProblemsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListUniqueProblems(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 ExampleDeviceFarm_ListUploads() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ListUploadsInput{
- Arn: aws.String("AmazonResourceName"), // Required
- NextToken: aws.String("PaginationToken"),
- }
- resp, err := svc.ListUploads(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 ExampleDeviceFarm_ScheduleRun() {
- svc := devicefarm.New(nil)
- params := &devicefarm.ScheduleRunInput{
- AppArn: aws.String("AmazonResourceName"), // Required
- DevicePoolArn: aws.String("AmazonResourceName"), // Required
- ProjectArn: aws.String("AmazonResourceName"), // Required
- Test: &devicefarm.ScheduleRunTest{ // Required
- Type: aws.String("TestType"), // Required
- Filter: aws.String("Filter"),
- Parameters: map[string]*string{
- "Key": aws.String("String"), // Required
- // More values...
- },
- TestPackageArn: aws.String("AmazonResourceName"),
- },
- Configuration: &devicefarm.ScheduleRunConfiguration{
- AuxiliaryApps: []*string{
- aws.String("AmazonResourceName"), // Required
- // More values...
- },
- BillingMethod: aws.String("BillingMethod"),
- ExtraDataPackageArn: aws.String("AmazonResourceName"),
- Locale: aws.String("String"),
- Location: &devicefarm.Location{
- Latitude: aws.Float64(1.0), // Required
- Longitude: aws.Float64(1.0), // Required
- },
- NetworkProfileArn: aws.String("AmazonResourceName"),
- Radios: &devicefarm.Radios{
- Bluetooth: aws.Bool(true),
- Gps: aws.Bool(true),
- Nfc: aws.Bool(true),
- Wifi: aws.Bool(true),
- },
- },
- Name: aws.String("Name"),
- }
- resp, err := svc.ScheduleRun(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)
- }
|