class_docstr: Encapsulates a single alert and handles serializing to Dynamo and merging.
class_docstr_tok: ["Encapsulates","a","single","alert","and","handles","serializing","to","Dynamo","and","merging","."]
docstr: Convert the alert into a dictionary ready to send to an output.
  
  (!) This method is deprecated. Going forward, try to use the method:
  
      streamalert.alert_processor.helpers.compose_alert
  
  Returns:
      dict: An alert dictionary for sending to outputs.
          The result is JSON-compatible, backwards-compatible (existing keys are not changed),
          and Athena-compatible (empty strings are used instead of None for top-level values).
docstr_tok: ["Convert","the","alert","into","a","dictionary","ready","to","send","to","an","output",".","(","!",")","This","method","is","deprecated",".","Going","forward",",","try","to","use","the","method",":","streamalert.alert_processor.helpers.compose_alert","Returns",":","dict",":","An","alert","dictionary","for","sending","to","outputs",".","The","result","is","JSON-compatible",",","backwards-compatible","(","existing","keys","are","not","changed",")",",","and","Athena-compatible","(","empty","strings","are","used","instead","of","None","for","top-level","values",")","."]
code: def output_dict(self):
      """Convert the alert into a dictionary ready to send to an output.
  
      (!) This method is deprecated. Going forward, try to use the method:
  
          streamalert.alert_processor.helpers.compose_alert
  
      Returns:
          dict: An alert dictionary for sending to outputs.
              The result is JSON-compatible, backwards-compatible (existing keys are not changed),
              and Athena-compatible (empty strings are used instead of None for top-level values).
      """
      # As a general rule, new keys may be added but existing keys should not be changed.
      # This way, output consumers looking for specific alert keys will still find them.
      # For example, historical search in Athena may break if these keys are renamed.
      return {
          "cluster": self.cluster or "",
          "context": self.context or {},
          "created": self.created.strftime(self.DATETIME_FORMAT),
          "id": self.alert_id,
          "log_source": self.log_source or "",
          "log_type": self.log_type or "",
          "outputs": sorted(
              self.outputs
          ),  # List instead of set for JSON-compatibility
          "publishers": self.publishers or {},
          "record": self.record,
          "rule_description": self.rule_description or "",
          "rule_name": self.rule_name or "",
          "source_entity": self.source_entity or "",
          "source_service": self.source_service or "",
          "staged": self.staged,
      }
  
imports: from datetime import datetime, timedelta
  import json
  import uuid
  from streamalert.shared import resources, utils
label_desc: Use image node_id 10 for calling the Alert obj's underlying member method code with example usage: obj.output_dict() and returns: dict