class_docstr: This service helps queries generate dynamic parameters.
class_docstr_tok: ["This","service","helps","queries","generate","dynamic","parameters","."]
code: def generate(self, parameter):
      if parameter == "utcdatehour_minus7day":
          # https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior
          time = self._clock.now - timedelta(days=7)
          return time.strftime("%Y-%m-%d-%H")
  
      if parameter == "utcdatehour_minus1hour":
          time = self._clock.now - timedelta(hours=1)
          return time.strftime("%Y-%m-%d-%H")
  
      if parameter == "utctimestamp_minus1hour":
          time = self._clock.now - timedelta(hours=1)
          return str(round(time.timestamp()))
  
      if parameter == "utcdatehour_minus2hour":
          time = self._clock.now - timedelta(hours=2)
          return time.strftime("%Y-%m-%d-%H")
  
      if parameter == "utcdatehour_minus1day":
          time = self._clock.now - timedelta(days=1)
          return time.strftime("%Y-%m-%d-%H")
  
      if parameter == "utcdatehour_minus2day":
          time = self._clock.now - timedelta(days=2)
          return time.strftime("%Y-%m-%d-%H")
  
      if parameter == "utcdatehour":
          return self._clock.now.strftime("%Y-%m-%d-%H")
  
      if parameter == "utctimestamp":
          return str(round(self._clock.now.timestamp()))
  
      if parameter == "utcisotime":
          return str(round(self._clock.now.timestamp()))
  
      self._logger.error(
          'Parameter generator does not know how to handle "{}"'.format(
              parameter
          )
      )
      return None
  
imports: from datetime import timedelta
  from streamalert.scheduled_queries.support.clock import Clock
label_desc: Use image node_id 2 for calling the QueryParameterGenerator obj's underlying member method code with example usage: obj.generate(parameter) and returns: None, time, time, str, time, time, time, self, str, str