class_docstr: Helper mock class to act as the ssm boto3 client
class_docstr_tok: ["Helper","mock","class","to","act","as","the","ssm","boto3","client"]
docstr: Mocked invoke function that returns a reponse mimicking boto3's reponse
  
  Keyword Args:
      FuncitonName (str): The AWS Lambda function name being invoked
      InvocationType (str): Type of invocation (typically 'Event')
      Payload (str): Payload in string or file format to send to lambda
      Qualifier (str): Alias for fully qualified AWS ARN
  
  Returns:
      dict: Response dictionary containing a fake RequestId
docstr_tok: ["Mocked","invoke","function","that","returns","a","reponse","mimicking","boto3","'s","reponse","Keyword","Args",":","FuncitonName","(","str",")",":","The","AWS","Lambda","function","name","being","invoked","InvocationType","(","str",")",":","Type","of","invocation","(","typically","'Event","'",")","Payload","(","str",")",":","Payload","in","string","or","file","format","to","send","to","lambda","Qualifier","(","str",")",":","Alias","for","fully","qualified","AWS","ARN","Returns",":","dict",":","Response","dictionary","containing","a","fake","RequestId"]
code: def invoke(cls, **kwargs):
      """Mocked invoke function that returns a reponse mimicking boto3's reponse
  
      Keyword Args:
          FuncitonName (str): The AWS Lambda function name being invoked
          InvocationType (str): Type of invocation (typically 'Event')
          Payload (str): Payload in string or file format to send to lambda
          Qualifier (str): Alias for fully qualified AWS ARN
  
      Returns:
          dict: Response dictionary containing a fake RequestId
      """
      if cls._raise_exception:
          # Turn of the raise exception boolean so we don't do this next time
          cls._raise_exception = not cls._raise_exception
          err = {
              "Error": {
                  "Code": 400,
                  "Message": "raising test exception",
              }
          }
          raise ClientError(err, "invoke")
  
      req_keywords = {"FunctionName", "InvocationType", "Payload"}
      key_diff = req_keywords.difference(set(kwargs))
      if key_diff:
          message = "required keyword missing: {}".format(
              ", ".join(key_diff)
          )
          err = {"Error": {"Code": 400, "Message": message}}
          raise ClientError(err, "invoke")
  
      if not isinstance(kwargs["Payload"], (str, bytearray)):
          if not hasattr(kwargs["Payload"], "read"):
              err = (
                  "Invalid type for parameter Payload, value: {}, type: {}, "
                  "valid types: <type 'str'>, <type 'bytearray'>, "
                  "file-like object"
              ).format(kwargs["Payload"], type(kwargs["Payload"]))
              raise ParamValidationError(response=err)
  
      return {
          "ResponseMetadata": {
              "RequestId": "9af88643-7b3c-43cd-baae-addb73bb4d27"
          }
      }
  
file_path: streamalert/tests/unit/streamalert/apps/test_helpers.py
imports: import json
  import boto3
  from botocore.exceptions import ClientError, ParamValidationError
label_desc: Use image node_id 1 for calling the MockLambdaClient obj's underlying member method code with example usage: obj.invoke(cls) and returns: dict