o ckF[.@sdZGdddeZdS)z/ Helper class for creating decision responses. c@seZdZdZddZ       dddZddZdd d Zdd d Zdd dZ dddZ       dddZ dddZ ddZ   d ddZ  dddZ       dddZdS)!Layer1Decisionsz Use this object to build a list of decisions for a decision response. Each method call will add append a new decision. Retrieve the list of decisions from the _data attribute. cCs g|_dSN)_data)selfr;/usr/lib/python3/dist-packages/boto/swf/layer1_decisions.py__init__ s zLayer1Decisions.__init__Nc Csi} d| d<i} | d<|| d<||d| d<|dur!d|i| d <|dur)|| d <|dur1|| d <|dur9|| d <|durA|| d <| durI| | d<| durQ| | d<|j| dS)a Schedules an activity task. :type activity_id: string :param activity_id: The activityId of the type of the activity being scheduled. :type activity_type_name: string :param activity_type_name: The name of the type of the activity being scheduled. :type activity_type_version: string :param activity_type_version: The version of the type of the activity being scheduled. :type task_list: string :param task_list: If set, specifies the name of the task list in which to schedule the activity task. If not specified, the defaultTaskList registered with the activity type will be used. Note: a task list for this activity task must be specified either as a default for the activity type or through this field. If neither this field is set nor a default task list was specified at registration time then a fault will be returned. ScheduleActivityTask decisionType&scheduleActivityTaskDecisionAttributes activityIdnameversion activityTypeNr taskListcontrolheartbeatTimeoutscheduleToCloseTimeoutscheduleToStartTimeoutstartToCloseTimeoutinputrappend) r activity_idactivity_type_nameactivity_type_version task_listrheartbeat_timeoutschedule_to_close_timeoutschedule_to_start_timeoutstart_to_close_timeoutroattrsrrrschedule_activity_tasks,#   z&Layer1Decisions.schedule_activity_taskcC0i}d|d<i}|d<||d<|j|dS)a Attempts to cancel a previously scheduled activity task. If the activity task was scheduled but has not been assigned to a worker, then it will be canceled. If the activity task was already assigned to a worker, then the worker will be informed that cancellation has been requested in the response to RecordActivityTaskHeartbeat. RequestCancelActivityTaskr +requestCancelActivityTaskDecisionAttributesr Nr)rrr!r"rrrrequest_cancel_activity_taskKs   z,Layer1Decisions.request_cancel_activity_taskcCs@i}d|d<i}|d<||d<|dur||d<|j|dS)a Records a MarkerRecorded event in the history. Markers can be used for adding custom information in the history for instance to let deciders know that they do not need to look at the history beyond the marker event. RecordMarkerr recordMarkerDecisionAttributes markerNameNdetailsr)r marker_namer+r!r"rrr record_markerZs zLayer1Decisions.record_markercC8i}d|d<i}|d<|dur||d<|j|dS)zu Closes the workflow execution and records a WorkflowExecutionCompleted event in the history CompleteWorkflowExecutionr +completeWorkflowExecutionDecisionAttributesNresultr)rr1r!r"rrrcomplete_workflow_executioni  z+Layer1Decisions.complete_workflow_executioncCsHi}d|d<i}|d<|dur||d<|dur||d<|j|dS)zs Closes the workflow execution and records a WorkflowExecutionFailed event in the history. FailWorkflowExecutionr 'failWorkflowExecutionDecisionAttributesNreasonr+r)rr6r+r!r"rrrfail_workflow_executionus z'Layer1Decisions.fail_workflow_executioncCr.)zu Closes the workflow execution and records a WorkflowExecutionCanceled event in the history. CancelWorkflowExecutionr *cancelWorkflowExecutionsDecisionAttributesNr+r)rr+r!r"rrrcancel_workflow_executionsr3z*Layer1Decisions.cancel_workflow_executionsc Csi}d|d<i} |d<|dur|| d<|dur|| d<|dur$|| d<|dur,|| d<|dur6d |i| d <|dur>|| d <|durF|| d <|j|dS) z Closes the workflow execution and starts a new workflow execution of the same type using the same workflow id and a unique run Id. A WorkflowExecutionContinuedAsNew event is recorded in the history. ContinueAsNewWorkflowExecutionr 0continueAsNewWorkflowExecutionDecisionAttributesN childPolicyexecutionStartToCloseTimeoutrtagListr rtaskStartToCloseTimeoutworkflowTypeVersionr) r child_policy execution_start_to_close_timeoutrtag_listrr workflow_type_versionr!r"rrr"continue_as_new_workflow_executions$   z2Layer1Decisions.continue_as_new_workflow_executioncCsHi}d|d<i}|d<||d<||d<|dur||d<|j|dS)z Starts a timer for this workflow execution and records a TimerStarted event in the history. This timer will fire after the specified delay and record a TimerFired event. StartTimerr startTimerDecisionAttributesstartToFireTimeouttimerIdNrr)rstart_to_fire_timeouttimer_idrr!r"rrr start_timers  zLayer1Decisions.start_timercCr$)zn Cancels a previously started timer and records a TimerCanceled event in the history. CancelTimerr cancelTimerDecisionAttributesrJNr)rrLr!r"rrr cancel_timers  zLayer1Decisions.cancel_timercCshi}d|d<i}|d<||d<||d<|dur||d<|dur$||d<|dur,||d <|j|dS) z Requests a signal to be delivered to the specified external workflow execution and records a SignalExternalWorkflowExecutionInitiated event in the history. SignalExternalWorkflowExecutionr 1signalExternalWorkflowExecutionDecisionAttributes workflowId signalNameNrunIdrrr)r workflow_id signal_namerun_idrrr!r"rrr"signal_external_workflow_executions  z2Layer1Decisions.signal_external_workflow_executioncCsPi}d|d<i}|d<||d<|dur||d<|dur ||d<|j|dS)z Requests that a request be made to cancel the specified external workflow execution and records a RequestCancelExternalWorkflowExecutionInitiated event in the history. &RequestCancelExternalWorkflowExecutionr 8requestCancelExternalWorkflowExecutionDecisionAttributesrSNrrUr)rrVrrXr!r"rrr*request_cancel_external_workflow_executions  z:Layer1Decisions.request_cancel_external_workflow_executionc Csi} d| d<i} | d<||d| d<|| d<|dur|| d<|dur'|| d <|dur/|| d <|dur7|| d <|dur?|| d <| durId | i| d<| durQ| | d<|j| dS)z Requests that a child workflow execution be started and records a StartChildWorkflowExecutionInitiated event in the history. The child workflow execution is a separate workflow execution with its own history. StartChildWorkflowExecutionr -startChildWorkflowExecutionDecisionAttributesr workflowTyperSNr=rr>rr?r rr@r) rworkflow_type_namerErVrBrrCrrDrtask_start_to_close_timeoutr!r"rrrstart_child_workflow_executions,   z.Layer1Decisions.start_child_workflow_execution)NNNNNNNr)NN)NNN)__name__ __module__ __qualname____doc__rr#r'r-r2r7r:rFrMrPrYr\rbrrrrrsT ;     #   rN)rfobjectrrrrrs