123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package swf_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/swf"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleSWF_CountClosedWorkflowExecutions() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.CountClosedWorkflowExecutionsInput{
- Domain: aws.String("DomainName"), // Required
- CloseStatusFilter: &swf.CloseStatusFilter{
- Status: aws.String("CloseStatus"), // Required
- },
- CloseTimeFilter: &swf.ExecutionTimeFilter{
- OldestDate: aws.Time(time.Now()), // Required
- LatestDate: aws.Time(time.Now()),
- },
- ExecutionFilter: &swf.WorkflowExecutionFilter{
- WorkflowId: aws.String("WorkflowId"), // Required
- },
- StartTimeFilter: &swf.ExecutionTimeFilter{
- OldestDate: aws.Time(time.Now()), // Required
- LatestDate: aws.Time(time.Now()),
- },
- TagFilter: &swf.TagFilter{
- Tag: aws.String("Tag"), // Required
- },
- TypeFilter: &swf.WorkflowTypeFilter{
- Name: aws.String("Name"), // Required
- Version: aws.String("VersionOptional"),
- },
- }
- resp, err := svc.CountClosedWorkflowExecutions(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 ExampleSWF_CountOpenWorkflowExecutions() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.CountOpenWorkflowExecutionsInput{
- Domain: aws.String("DomainName"), // Required
- StartTimeFilter: &swf.ExecutionTimeFilter{ // Required
- OldestDate: aws.Time(time.Now()), // Required
- LatestDate: aws.Time(time.Now()),
- },
- ExecutionFilter: &swf.WorkflowExecutionFilter{
- WorkflowId: aws.String("WorkflowId"), // Required
- },
- TagFilter: &swf.TagFilter{
- Tag: aws.String("Tag"), // Required
- },
- TypeFilter: &swf.WorkflowTypeFilter{
- Name: aws.String("Name"), // Required
- Version: aws.String("VersionOptional"),
- },
- }
- resp, err := svc.CountOpenWorkflowExecutions(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 ExampleSWF_CountPendingActivityTasks() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.CountPendingActivityTasksInput{
- Domain: aws.String("DomainName"), // Required
- TaskList: &swf.TaskList{ // Required
- Name: aws.String("Name"), // Required
- },
- }
- resp, err := svc.CountPendingActivityTasks(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 ExampleSWF_CountPendingDecisionTasks() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.CountPendingDecisionTasksInput{
- Domain: aws.String("DomainName"), // Required
- TaskList: &swf.TaskList{ // Required
- Name: aws.String("Name"), // Required
- },
- }
- resp, err := svc.CountPendingDecisionTasks(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 ExampleSWF_DeprecateActivityType() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DeprecateActivityTypeInput{
- ActivityType: &swf.ActivityType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- Domain: aws.String("DomainName"), // Required
- }
- resp, err := svc.DeprecateActivityType(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 ExampleSWF_DeprecateDomain() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DeprecateDomainInput{
- Name: aws.String("DomainName"), // Required
- }
- resp, err := svc.DeprecateDomain(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 ExampleSWF_DeprecateWorkflowType() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DeprecateWorkflowTypeInput{
- Domain: aws.String("DomainName"), // Required
- WorkflowType: &swf.WorkflowType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- }
- resp, err := svc.DeprecateWorkflowType(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 ExampleSWF_DescribeActivityType() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DescribeActivityTypeInput{
- ActivityType: &swf.ActivityType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- Domain: aws.String("DomainName"), // Required
- }
- resp, err := svc.DescribeActivityType(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 ExampleSWF_DescribeDomain() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DescribeDomainInput{
- Name: aws.String("DomainName"), // Required
- }
- resp, err := svc.DescribeDomain(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 ExampleSWF_DescribeWorkflowExecution() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DescribeWorkflowExecutionInput{
- Domain: aws.String("DomainName"), // Required
- Execution: &swf.WorkflowExecution{ // Required
- RunId: aws.String("RunId"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- },
- }
- resp, err := svc.DescribeWorkflowExecution(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 ExampleSWF_DescribeWorkflowType() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.DescribeWorkflowTypeInput{
- Domain: aws.String("DomainName"), // Required
- WorkflowType: &swf.WorkflowType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- }
- resp, err := svc.DescribeWorkflowType(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 ExampleSWF_GetWorkflowExecutionHistory() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.GetWorkflowExecutionHistoryInput{
- Domain: aws.String("DomainName"), // Required
- Execution: &swf.WorkflowExecution{ // Required
- RunId: aws.String("RunId"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- },
- MaximumPageSize: aws.Int64(1),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- }
- resp, err := svc.GetWorkflowExecutionHistory(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 ExampleSWF_ListActivityTypes() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.ListActivityTypesInput{
- Domain: aws.String("DomainName"), // Required
- RegistrationStatus: aws.String("RegistrationStatus"), // Required
- MaximumPageSize: aws.Int64(1),
- Name: aws.String("Name"),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- }
- resp, err := svc.ListActivityTypes(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 ExampleSWF_ListClosedWorkflowExecutions() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.ListClosedWorkflowExecutionsInput{
- Domain: aws.String("DomainName"), // Required
- CloseStatusFilter: &swf.CloseStatusFilter{
- Status: aws.String("CloseStatus"), // Required
- },
- CloseTimeFilter: &swf.ExecutionTimeFilter{
- OldestDate: aws.Time(time.Now()), // Required
- LatestDate: aws.Time(time.Now()),
- },
- ExecutionFilter: &swf.WorkflowExecutionFilter{
- WorkflowId: aws.String("WorkflowId"), // Required
- },
- MaximumPageSize: aws.Int64(1),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- StartTimeFilter: &swf.ExecutionTimeFilter{
- OldestDate: aws.Time(time.Now()), // Required
- LatestDate: aws.Time(time.Now()),
- },
- TagFilter: &swf.TagFilter{
- Tag: aws.String("Tag"), // Required
- },
- TypeFilter: &swf.WorkflowTypeFilter{
- Name: aws.String("Name"), // Required
- Version: aws.String("VersionOptional"),
- },
- }
- resp, err := svc.ListClosedWorkflowExecutions(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 ExampleSWF_ListDomains() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.ListDomainsInput{
- RegistrationStatus: aws.String("RegistrationStatus"), // Required
- MaximumPageSize: aws.Int64(1),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- }
- resp, err := svc.ListDomains(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 ExampleSWF_ListOpenWorkflowExecutions() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.ListOpenWorkflowExecutionsInput{
- Domain: aws.String("DomainName"), // Required
- StartTimeFilter: &swf.ExecutionTimeFilter{ // Required
- OldestDate: aws.Time(time.Now()), // Required
- LatestDate: aws.Time(time.Now()),
- },
- ExecutionFilter: &swf.WorkflowExecutionFilter{
- WorkflowId: aws.String("WorkflowId"), // Required
- },
- MaximumPageSize: aws.Int64(1),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- TagFilter: &swf.TagFilter{
- Tag: aws.String("Tag"), // Required
- },
- TypeFilter: &swf.WorkflowTypeFilter{
- Name: aws.String("Name"), // Required
- Version: aws.String("VersionOptional"),
- },
- }
- resp, err := svc.ListOpenWorkflowExecutions(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 ExampleSWF_ListWorkflowTypes() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.ListWorkflowTypesInput{
- Domain: aws.String("DomainName"), // Required
- RegistrationStatus: aws.String("RegistrationStatus"), // Required
- MaximumPageSize: aws.Int64(1),
- Name: aws.String("Name"),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- }
- resp, err := svc.ListWorkflowTypes(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 ExampleSWF_PollForActivityTask() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.PollForActivityTaskInput{
- Domain: aws.String("DomainName"), // Required
- TaskList: &swf.TaskList{ // Required
- Name: aws.String("Name"), // Required
- },
- Identity: aws.String("Identity"),
- }
- resp, err := svc.PollForActivityTask(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 ExampleSWF_PollForDecisionTask() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.PollForDecisionTaskInput{
- Domain: aws.String("DomainName"), // Required
- TaskList: &swf.TaskList{ // Required
- Name: aws.String("Name"), // Required
- },
- Identity: aws.String("Identity"),
- MaximumPageSize: aws.Int64(1),
- NextPageToken: aws.String("PageToken"),
- ReverseOrder: aws.Bool(true),
- }
- resp, err := svc.PollForDecisionTask(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 ExampleSWF_RecordActivityTaskHeartbeat() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RecordActivityTaskHeartbeatInput{
- TaskToken: aws.String("TaskToken"), // Required
- Details: aws.String("LimitedData"),
- }
- resp, err := svc.RecordActivityTaskHeartbeat(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 ExampleSWF_RegisterActivityType() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RegisterActivityTypeInput{
- Domain: aws.String("DomainName"), // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- DefaultTaskHeartbeatTimeout: aws.String("DurationInSecondsOptional"),
- DefaultTaskList: &swf.TaskList{
- Name: aws.String("Name"), // Required
- },
- DefaultTaskPriority: aws.String("TaskPriority"),
- DefaultTaskScheduleToCloseTimeout: aws.String("DurationInSecondsOptional"),
- DefaultTaskScheduleToStartTimeout: aws.String("DurationInSecondsOptional"),
- DefaultTaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- Description: aws.String("Description"),
- }
- resp, err := svc.RegisterActivityType(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 ExampleSWF_RegisterDomain() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RegisterDomainInput{
- Name: aws.String("DomainName"), // Required
- WorkflowExecutionRetentionPeriodInDays: aws.String("DurationInDays"), // Required
- Description: aws.String("Description"),
- }
- resp, err := svc.RegisterDomain(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 ExampleSWF_RegisterWorkflowType() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RegisterWorkflowTypeInput{
- Domain: aws.String("DomainName"), // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- DefaultChildPolicy: aws.String("ChildPolicy"),
- DefaultExecutionStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- DefaultLambdaRole: aws.String("Arn"),
- DefaultTaskList: &swf.TaskList{
- Name: aws.String("Name"), // Required
- },
- DefaultTaskPriority: aws.String("TaskPriority"),
- DefaultTaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- Description: aws.String("Description"),
- }
- resp, err := svc.RegisterWorkflowType(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 ExampleSWF_RequestCancelWorkflowExecution() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RequestCancelWorkflowExecutionInput{
- Domain: aws.String("DomainName"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- RunId: aws.String("RunIdOptional"),
- }
- resp, err := svc.RequestCancelWorkflowExecution(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 ExampleSWF_RespondActivityTaskCanceled() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RespondActivityTaskCanceledInput{
- TaskToken: aws.String("TaskToken"), // Required
- Details: aws.String("Data"),
- }
- resp, err := svc.RespondActivityTaskCanceled(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 ExampleSWF_RespondActivityTaskCompleted() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RespondActivityTaskCompletedInput{
- TaskToken: aws.String("TaskToken"), // Required
- Result: aws.String("Data"),
- }
- resp, err := svc.RespondActivityTaskCompleted(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 ExampleSWF_RespondActivityTaskFailed() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RespondActivityTaskFailedInput{
- TaskToken: aws.String("TaskToken"), // Required
- Details: aws.String("Data"),
- Reason: aws.String("FailureReason"),
- }
- resp, err := svc.RespondActivityTaskFailed(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 ExampleSWF_RespondDecisionTaskCompleted() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.RespondDecisionTaskCompletedInput{
- TaskToken: aws.String("TaskToken"), // Required
- Decisions: []*swf.Decision{
- { // Required
- DecisionType: aws.String("DecisionType"), // Required
- CancelTimerDecisionAttributes: &swf.CancelTimerDecisionAttributes{
- TimerId: aws.String("TimerId"), // Required
- },
- CancelWorkflowExecutionDecisionAttributes: &swf.CancelWorkflowExecutionDecisionAttributes{
- Details: aws.String("Data"),
- },
- CompleteWorkflowExecutionDecisionAttributes: &swf.CompleteWorkflowExecutionDecisionAttributes{
- Result: aws.String("Data"),
- },
- ContinueAsNewWorkflowExecutionDecisionAttributes: &swf.ContinueAsNewWorkflowExecutionDecisionAttributes{
- ChildPolicy: aws.String("ChildPolicy"),
- ExecutionStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- Input: aws.String("Data"),
- LambdaRole: aws.String("Arn"),
- TagList: []*string{
- aws.String("Tag"), // Required
- // More values...
- },
- TaskList: &swf.TaskList{
- Name: aws.String("Name"), // Required
- },
- TaskPriority: aws.String("TaskPriority"),
- TaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- WorkflowTypeVersion: aws.String("Version"),
- },
- FailWorkflowExecutionDecisionAttributes: &swf.FailWorkflowExecutionDecisionAttributes{
- Details: aws.String("Data"),
- Reason: aws.String("FailureReason"),
- },
- RecordMarkerDecisionAttributes: &swf.RecordMarkerDecisionAttributes{
- MarkerName: aws.String("MarkerName"), // Required
- Details: aws.String("Data"),
- },
- RequestCancelActivityTaskDecisionAttributes: &swf.RequestCancelActivityTaskDecisionAttributes{
- ActivityId: aws.String("ActivityId"), // Required
- },
- RequestCancelExternalWorkflowExecutionDecisionAttributes: &swf.RequestCancelExternalWorkflowExecutionDecisionAttributes{
- WorkflowId: aws.String("WorkflowId"), // Required
- Control: aws.String("Data"),
- RunId: aws.String("RunIdOptional"),
- },
- ScheduleActivityTaskDecisionAttributes: &swf.ScheduleActivityTaskDecisionAttributes{
- ActivityId: aws.String("ActivityId"), // Required
- ActivityType: &swf.ActivityType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- Control: aws.String("Data"),
- HeartbeatTimeout: aws.String("DurationInSecondsOptional"),
- Input: aws.String("Data"),
- ScheduleToCloseTimeout: aws.String("DurationInSecondsOptional"),
- ScheduleToStartTimeout: aws.String("DurationInSecondsOptional"),
- StartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- TaskList: &swf.TaskList{
- Name: aws.String("Name"), // Required
- },
- TaskPriority: aws.String("TaskPriority"),
- },
- ScheduleLambdaFunctionDecisionAttributes: &swf.ScheduleLambdaFunctionDecisionAttributes{
- Id: aws.String("FunctionId"), // Required
- Name: aws.String("FunctionName"), // Required
- Input: aws.String("FunctionInput"),
- StartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- },
- SignalExternalWorkflowExecutionDecisionAttributes: &swf.SignalExternalWorkflowExecutionDecisionAttributes{
- SignalName: aws.String("SignalName"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- Control: aws.String("Data"),
- Input: aws.String("Data"),
- RunId: aws.String("RunIdOptional"),
- },
- StartChildWorkflowExecutionDecisionAttributes: &swf.StartChildWorkflowExecutionDecisionAttributes{
- WorkflowId: aws.String("WorkflowId"), // Required
- WorkflowType: &swf.WorkflowType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- ChildPolicy: aws.String("ChildPolicy"),
- Control: aws.String("Data"),
- ExecutionStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- Input: aws.String("Data"),
- LambdaRole: aws.String("Arn"),
- TagList: []*string{
- aws.String("Tag"), // Required
- // More values...
- },
- TaskList: &swf.TaskList{
- Name: aws.String("Name"), // Required
- },
- TaskPriority: aws.String("TaskPriority"),
- TaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- },
- StartTimerDecisionAttributes: &swf.StartTimerDecisionAttributes{
- StartToFireTimeout: aws.String("DurationInSeconds"), // Required
- TimerId: aws.String("TimerId"), // Required
- Control: aws.String("Data"),
- },
- },
- // More values...
- },
- ExecutionContext: aws.String("Data"),
- }
- resp, err := svc.RespondDecisionTaskCompleted(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 ExampleSWF_SignalWorkflowExecution() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.SignalWorkflowExecutionInput{
- Domain: aws.String("DomainName"), // Required
- SignalName: aws.String("SignalName"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- Input: aws.String("Data"),
- RunId: aws.String("RunIdOptional"),
- }
- resp, err := svc.SignalWorkflowExecution(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 ExampleSWF_StartWorkflowExecution() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.StartWorkflowExecutionInput{
- Domain: aws.String("DomainName"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- WorkflowType: &swf.WorkflowType{ // Required
- Name: aws.String("Name"), // Required
- Version: aws.String("Version"), // Required
- },
- ChildPolicy: aws.String("ChildPolicy"),
- ExecutionStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- Input: aws.String("Data"),
- LambdaRole: aws.String("Arn"),
- TagList: []*string{
- aws.String("Tag"), // Required
- // More values...
- },
- TaskList: &swf.TaskList{
- Name: aws.String("Name"), // Required
- },
- TaskPriority: aws.String("TaskPriority"),
- TaskStartToCloseTimeout: aws.String("DurationInSecondsOptional"),
- }
- resp, err := svc.StartWorkflowExecution(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 ExampleSWF_TerminateWorkflowExecution() {
- sess, err := session.NewSession()
- if err != nil {
- fmt.Println("failed to create session,", err)
- return
- }
- svc := swf.New(sess)
- params := &swf.TerminateWorkflowExecutionInput{
- Domain: aws.String("DomainName"), // Required
- WorkflowId: aws.String("WorkflowId"), // Required
- ChildPolicy: aws.String("ChildPolicy"),
- Details: aws.String("Data"),
- Reason: aws.String("TerminateReason"),
- RunId: aws.String("RunIdOptional"),
- }
- resp, err := svc.TerminateWorkflowExecution(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)
- }
|