# 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)
class RecordMarker(RecordMarkerDecisionBase):
    def __init__(self, marker_name, details=None):
        """
        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.
        """
        super(RecordMarker, self).__init__(marker_name)
        self.decision['decisionType'] = 'RecordMarker'
        attrs = self.decision['recordMarkerDecisionAttributes'] = {}
        attrs['markerName'] = marker_name
        if details is not None:
            attrs['details'] = details


class RequestCancelActivityTask(ActivityDecisionBase):
    def __init__(self, activity_id):
        """
        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.
        """
        super(RequestCancelActivityTask, self).__init__(activity_id)
        self.decision['decisionType'] = 'RequestCancelActivityTask'
        attrs = self.decision['requestCancelActivityTaskDecisionAttributes'] = {}
        attrs['activityId'] = activity_id



# 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)

class RecordMarker(RecordMarkerDecisionBase):
    def __init__(self, marker_name, details=None):
        """
        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.
        """
        super(RecordMarker, self).__init__(marker_name)
        self.decision['decisionType'] = 'RecordMarker'
        attrs = self.decision['recordMarkerDecisionAttributes'] = {}
        attrs['markerName'] = marker_name
        if details is not None:
            attrs['details'] = details


class RequestCancelActivityTask(ActivityDecisionBase):
    def __init__(self, activity_id):
        """
        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.
        """
        super(RequestCancelActivityTask, self).__init__(activity_id)
        self.decision['decisionType'] = 'RequestCancelActivityTask'
        attrs = self.decision['requestCancelActivityTaskDecisionAttributes'] = {}
        attrs['activityId'] = activity_id



class RequestCancelExternalWorkflowExecution(RequestCancelExternalWorkflowDecisionBase):