# Path: botoflow/decisions/decision_bases.py
# class ActivityDecisionBase(DecisionBase):
#     """Base for Activity decisions
#     """
# 
#     def __init__(self, decision_id):
#         """
#         :param str decision_id: Decision ID
#         """
#         super(ActivityDecisionBase, self).__init__()
#         self.decision_id = decision_id
# 
#     def __repr__(self):
#         return "<%s decision activity_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id, self.decision)
# 
# class WorkflowDecisionBase(DecisionBase):
#     """Workflow decision base"""
# 
#     def __init__(self):
#         super(WorkflowDecisionBase, self).__init__()
# 
#     def __repr__(self):
#         return "<%s decision details=%s>" % (
#             self.__class__.__name__, self.decision)
# 
# class TimerDecisionBase(DecisionBase):
#     """Timer decisions base
#     """
# 
#     def __init__(self, decision_id):
#         """
#         :param str decision_id: Decision ID
#         """
#         super(TimerDecisionBase, self).__init__()
#         self.decision_id = decision_id
# 
#     def __repr__(self):
#         return "<%s decision timer_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id, self.decision)
# 
# class RecordMarkerDecisionBase(DecisionBase):
#     """Record marker decision base"""
# 
#     def __init__(self, decision_id):
#         """
#         :param str decision_id: Decision ID
#         """
#         super(RecordMarkerDecisionBase, self).__init__()
#         self.decision_id = decision_id
# 
#     def __repr__(self):
#         return "<%s decision marker_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id, self.decision)
# 
# class RequestCancelExternalWorkflowDecisionBase(DecisionBase):
#     """Base for requesting a cancellation of external workflow
#     """
# 
#     def __init__(self, workflow_id, run_id):
#         """
#         :param str workflow_id: Workflow ID
#         :param str run_id: Run ID
#         """
#         super(RequestCancelExternalWorkflowDecisionBase, self).__init__()
#         self.decision_id = (workflow_id, run_id)
# 
#     def __repr__(self):
#         return "<%s decision workflow_id=%s run_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id[0],
#             self.decision_id[1], self.decision)
# 
# class SignalExternalWorkflowExecutionDecisionBase(DecisionBase):
#     """Signalling for external workflow
#     """
# 
#     def __init__(self, workflow_id, run_id, signal_name):
#         """
#         :param str workflow_id: Workflow ID
#         :param str run_id: Run ID
#         :param str signal_name: name of the signal to execute
#         """
#         super(SignalExternalWorkflowExecutionDecisionBase, self).__init__()
#         self.decision_id = (workflow_id, run_id, signal_name)
# 
#     def __repr__(self):
#         return ("<%s decision workflow_id=%s run_id=%s signal_name "
#                 "%s details=%s>" % (
#                     self.__class__.__name__, self.decision_id[0],
#                     self.decision_id[1], self.decision_id[2], self.decision))
# 
# class StartChildWorkflowExecutionDecisionBase(DecisionBase):
#     """Starting child workflow base
#     """
# 
#     def __init__(self, workflow_type_name, workflow_type_version, workflow_id):
#         """
#         :param str workflow_type_name: Workflow type name
#         :param str workflow_type_version: version of the workflow
#         :param str workflow_id: Workflow ID
#         """
#         super(StartChildWorkflowExecutionDecisionBase, self).__init__()
#         self.decision_id = (workflow_type_name, workflow_type_version,
#                             workflow_id)
# 
#     def __repr__(self):
#         return ("<%s decision workflow_type_name=%s, "
#                 "workflow_type_version=%s, workflow_id=%s details=%s>" % (
#                     self.__class__.__name__, self.decision_id[0],
#                     self.decision_id[1], self.decision_id[2], self.decision))


from .decision_bases import (ActivityDecisionBase, WorkflowDecisionBase,
                             TimerDecisionBase, RecordMarkerDecisionBase,
                             RequestCancelExternalWorkflowDecisionBase,
                             SignalExternalWorkflowExecutionDecisionBase,
                             StartChildWorkflowExecutionDecisionBase)
        if task_priority is not None:
            attrs['taskPriority'] = task_priority
        if input is not None:
            attrs['input'] = input


class SignalExternalWorkflowExecution(SignalExternalWorkflowExecutionDecisionBase):

    # noinspection PyShadowingBuiltins
    def __init__(self, workflow_id, run_id, signal_name,
                 control=None, input=None):
        """
        requests a signal to be delivered to the specified external workflow
        execution and records a SignalExternalWorkflowExecutionInitiated
        event in the history.
        """
        super(SignalExternalWorkflowExecution, self).__init__(workflow_id,
                                                              run_id, signal_name)
        self.decision['decisionType'] = 'SignalExternalWorkflowExecution'
        attrs = self.decision['signalExternalEorkflowExecutionDecisionAttributes'] = {}
        attrs['workflowId'] = workflow_id
        attrs['signalName'] = signal_name
        if run_id is not None:
            attrs['runId'] = run_id
        if control is not None:
            attrs['control'] = control
        if input is not None:
            attrs['input'] = input



# Path: botoflow/decisions/decision_bases.py
# class ActivityDecisionBase(DecisionBase):
#     """Base for Activity decisions
#     """
# 
#     def __init__(self, decision_id):
#         """
#         :param str decision_id: Decision ID
#         """
#         super(ActivityDecisionBase, self).__init__()
#         self.decision_id = decision_id
# 
#     def __repr__(self):
#         return "<%s decision activity_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id, self.decision)
# 
# class WorkflowDecisionBase(DecisionBase):
#     """Workflow decision base"""
# 
#     def __init__(self):
#         super(WorkflowDecisionBase, self).__init__()
# 
#     def __repr__(self):
#         return "<%s decision details=%s>" % (
#             self.__class__.__name__, self.decision)
# 
# class TimerDecisionBase(DecisionBase):
#     """Timer decisions base
#     """
# 
#     def __init__(self, decision_id):
#         """
#         :param str decision_id: Decision ID
#         """
#         super(TimerDecisionBase, self).__init__()
#         self.decision_id = decision_id
# 
#     def __repr__(self):
#         return "<%s decision timer_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id, self.decision)
# 
# class RecordMarkerDecisionBase(DecisionBase):
#     """Record marker decision base"""
# 
#     def __init__(self, decision_id):
#         """
#         :param str decision_id: Decision ID
#         """
#         super(RecordMarkerDecisionBase, self).__init__()
#         self.decision_id = decision_id
# 
#     def __repr__(self):
#         return "<%s decision marker_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id, self.decision)
# 
# class RequestCancelExternalWorkflowDecisionBase(DecisionBase):
#     """Base for requesting a cancellation of external workflow
#     """
# 
#     def __init__(self, workflow_id, run_id):
#         """
#         :param str workflow_id: Workflow ID
#         :param str run_id: Run ID
#         """
#         super(RequestCancelExternalWorkflowDecisionBase, self).__init__()
#         self.decision_id = (workflow_id, run_id)
# 
#     def __repr__(self):
#         return "<%s decision workflow_id=%s run_id=%s details=%s>" % (
#             self.__class__.__name__, self.decision_id[0],
#             self.decision_id[1], self.decision)
# 
# class SignalExternalWorkflowExecutionDecisionBase(DecisionBase):
#     """Signalling for external workflow
#     """
# 
#     def __init__(self, workflow_id, run_id, signal_name):
#         """
#         :param str workflow_id: Workflow ID
#         :param str run_id: Run ID
#         :param str signal_name: name of the signal to execute
#         """
#         super(SignalExternalWorkflowExecutionDecisionBase, self).__init__()
#         self.decision_id = (workflow_id, run_id, signal_name)
# 
#     def __repr__(self):
#         return ("<%s decision workflow_id=%s run_id=%s signal_name "
#                 "%s details=%s>" % (
#                     self.__class__.__name__, self.decision_id[0],
#                     self.decision_id[1], self.decision_id[2], self.decision))
# 
# class StartChildWorkflowExecutionDecisionBase(DecisionBase):
#     """Starting child workflow base
#     """
# 
#     def __init__(self, workflow_type_name, workflow_type_version, workflow_id):
#         """
#         :param str workflow_type_name: Workflow type name
#         :param str workflow_type_version: version of the workflow
#         :param str workflow_id: Workflow ID
#         """
#         super(StartChildWorkflowExecutionDecisionBase, self).__init__()
#         self.decision_id = (workflow_type_name, workflow_type_version,
#                             workflow_id)
# 
#     def __repr__(self):
#         return ("<%s decision workflow_type_name=%s, "
#                 "workflow_type_version=%s, workflow_id=%s details=%s>" % (
#                     self.__class__.__name__, self.decision_id[0],
#                     self.decision_id[1], self.decision_id[2], self.decision))


# Path: botoflow/decisions/decisions.py
from .decision_bases import (ActivityDecisionBase, WorkflowDecisionBase,
                             TimerDecisionBase, RecordMarkerDecisionBase,
                             RequestCancelExternalWorkflowDecisionBase,
                             SignalExternalWorkflowExecutionDecisionBase,
                             StartChildWorkflowExecutionDecisionBase)

        if task_priority is not None:
            attrs['taskPriority'] = task_priority
        if input is not None:
            attrs['input'] = input


class SignalExternalWorkflowExecution(SignalExternalWorkflowExecutionDecisionBase):

    # noinspection PyShadowingBuiltins
    def __init__(self, workflow_id, run_id, signal_name,
                 control=None, input=None):
        """
        requests a signal to be delivered to the specified external workflow
        execution and records a SignalExternalWorkflowExecutionInitiated
        event in the history.
        """
        super(SignalExternalWorkflowExecution, self).__init__(workflow_id,
                                                              run_id, signal_name)
        self.decision['decisionType'] = 'SignalExternalWorkflowExecution'
        attrs = self.decision['signalExternalEorkflowExecutionDecisionAttributes'] = {}
        attrs['workflowId'] = workflow_id
        attrs['signalName'] = signal_name
        if run_id is not None:
            attrs['runId'] = run_id
        if control is not None:
            attrs['control'] = control
        if input is not None:
            attrs['input'] = input



class StartChildWorkflowExecution(StartChildWorkflowExecutionDecisionBase):