class_docstr: Provides convenience methods for accessing and modifying the rules table.
class_docstr_tok: ["Provides","convenience","methods","for","accessing","and","modifying","the","rules","table","."]
docstr: Generate a DynamoDB record with this rule information
  
  Args:
      rule_name (string): Name of rule for this record
      skip_staging (bool): [optional] Argument that dictates if this rule
          should skip the staging phase.
          An initial deployment of rule info will skip the staging state
          as to avoid taking rules out of production unexpectedly. This
          argument can also be used to during the deploy process to
          immediately put new rules into production.
docstr_tok: ["Generate","a","DynamoDB","record","with","this","rule","information","Args",":","rule_name","(","string",")",":","Name","of","rule","for","this","record","skip_staging","(","bool",")",":","[","optional","]","Argument","that","dictates","if","this","rule","should","skip","the","staging","phase",".","An","initial","deployment","of","rule","info","will","skip","the","staging","state","as","to","avoid","taking","rules","out","of","production","unexpectedly",".","This","argument","can","also","be","used","to","during","the","deploy","process","to","immediately","put","new","rules","into","production","."]
code: def _dynamo_record(rule_name, skip_staging=False):
      """Generate a DynamoDB record with this rule information
  
      Args:
          rule_name (string): Name of rule for this record
          skip_staging (bool): [optional] Argument that dictates if this rule
              should skip the staging phase.
              An initial deployment of rule info will skip the staging state
              as to avoid taking rules out of production unexpectedly. This
              argument can also be used to during the deploy process to
              immediately put new rules into production.
      """
      item = {"RuleName": rule_name, "Staged": not skip_staging}
  
      # We may want to skip staging if the database is empty (ie: newly created)
      # or if the user is manually bypassing staging for this rule
      if skip_staging:
          return item
  
      staged_at, staged_until = RuleTable._staged_window()
      item.update({"StagedAt": staged_at, "StagedUntil": staged_until})
  
      return item
  
imports: from datetime import datetime, timedelta
  import boto3
  from streamalert.shared.helpers.dynamodb import ignore_conditional_failure
  from streamalert.shared.importer import import_folders
  from streamalert.shared.logger import get_logger
  from streamalert.shared.rule import Rule
label_desc: Use image node_id 8 for calling the RuleTable obj's underlying member method code with example usage: obj._dynamo_record(rule_name, skip_staging) and returns: item, item