func ExampleSWF_PollForDecisionTask() { svc := swf.New(nil) params := &swf.PollForDecisionTaskInput{ Domain: aws.String("DomainName"), // Required TaskList: &swf.TaskList{ // Required Name: aws.String("Name"), // Required }, Identity: aws.String("Identity"), MaximumPageSize: aws.Long(1), NextPageToken: aws.String("PageToken"), ReverseOrder: aws.Boolean(true), } resp, err := svc.PollForDecisionTask(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_RegisterWorkflowType() { svc := swf.New(nil) 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"), 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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_CountOpenWorkflowExecutions() { svc := swf.New(nil) 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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_GetWorkflowExecutionHistory() { svc := swf.New(nil) params := &swf.GetWorkflowExecutionHistoryInput{ Domain: aws.String("DomainName"), // Required Execution: &swf.WorkflowExecution{ // Required RunID: aws.String("RunId"), // Required WorkflowID: aws.String("WorkflowId"), // Required }, MaximumPageSize: aws.Long(1), NextPageToken: aws.String("PageToken"), ReverseOrder: aws.Boolean(true), } resp, err := svc.GetWorkflowExecutionHistory(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_ListClosedWorkflowExecutions() { svc := swf.New(nil) 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.Long(1), NextPageToken: aws.String("PageToken"), ReverseOrder: aws.Boolean(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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_DescribeDomain() { svc := swf.New(nil) params := &swf.DescribeDomainInput{ Name: aws.String("DomainName"), // Required } resp, err := svc.DescribeDomain(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_RespondActivityTaskCompleted() { svc := swf.New(nil) params := &swf.RespondActivityTaskCompletedInput{ TaskToken: aws.String("TaskToken"), // Required Result: aws.String("Data"), } resp, err := svc.RespondActivityTaskCompleted(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_RequestCancelWorkflowExecution() { svc := swf.New(nil) params := &swf.RequestCancelWorkflowExecutionInput{ Domain: aws.String("DomainName"), // Required WorkflowID: aws.String("WorkflowId"), // Required RunID: aws.String("RunIdOptional"), } resp, err := svc.RequestCancelWorkflowExecution(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_RegisterDomain() { svc := swf.New(nil) params := &swf.RegisterDomainInput{ Name: aws.String("DomainName"), // Required WorkflowExecutionRetentionPeriodInDays: aws.String("DurationInDays"), // Required Description: aws.String("Description"), } resp, err := svc.RegisterDomain(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_CountPendingActivityTasks() { svc := swf.New(nil) params := &swf.CountPendingActivityTasksInput{ Domain: aws.String("DomainName"), // Required TaskList: &swf.TaskList{ // Required Name: aws.String("Name"), // Required }, } resp, err := svc.CountPendingActivityTasks(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_ListDomains() { svc := swf.New(nil) params := &swf.ListDomainsInput{ RegistrationStatus: aws.String("RegistrationStatus"), // Required MaximumPageSize: aws.Long(1), NextPageToken: aws.String("PageToken"), ReverseOrder: aws.Boolean(true), } resp, err := svc.ListDomains(params) if awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_DeprecateWorkflowType() { svc := swf.New(nil) 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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_TerminateWorkflowExecution() { svc := swf.New(nil) 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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_StartWorkflowExecution() { svc := swf.New(nil) 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"), 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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSWF_RespondDecisionTaskCompleted() { svc := swf.New(nil) params := &swf.RespondDecisionTaskCompletedInput{ TaskToken: aws.String("TaskToken"), // Required Decisions: []*swf.Decision{ &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"), 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"), }, 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"), 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 awserr := aws.Error(err); awserr != nil { // A service error occurred. fmt.Println("Error:", awserr.Code, awserr.Message) } else if err != nil { // A non-service error occurred. panic(err) } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }