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 this alert to a complete Dynamo record for the alerts table.
  
  Returns:
      dict: Dynamo-compatible dictionary with all alert fields
docstr_tok: ["Convert","this","alert","to","a","complete","Dynamo","record","for","the","alerts","table",".","Returns",":","dict",":","Dynamo-compatible","dictionary","with","all","alert","fields"]
code: def dynamo_record(self):
      """Convert this alert to a complete Dynamo record for the alerts table.
  
      Returns:
          dict: Dynamo-compatible dictionary with all alert fields
      """
      return {
          "RuleName": self.rule_name,  # Partition Key
          "AlertID": self.alert_id,  # Sort/Range Key
          "Attempts": self.attempts,
          "Cluster": self.cluster,
          "Context": self.context,
          "Created": self.created.strftime(self.DATETIME_FORMAT),
          "Dispatched": self.dispatched.strftime(self.DATETIME_FORMAT),
          "LogSource": self.log_source,
          "LogType": self.log_type,
          "MergeByKeys": self.merge_by_keys,
          "MergeWindowMins": int(
              self.merge_window.total_seconds() / 60
          ),
          "Outputs": self.outputs,
          "OutputsSent": self.outputs_sent
          or None,  # Empty sets not allowed by Dynamo
          "Publishers": self.publishers or None,
          # Compact JSON encoding (no spaces). We have to JSON-encode here
          # (instead of just passing the dict) because Dynamo does not allow empty string values.
          "Record": json.dumps(
              self.record, separators=(",", ":"), default=list
          ),
          "RuleDescription": self.rule_description,
          "SourceEntity": self.source_entity,
          "SourceService": self.source_service,
          "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 8 for calling the Alert obj's underlying member method code with example usage: obj.dynamo_record() and returns: dict