docstr: Provides a pre-configured template that reflects incoming payload from a service
  
  Args:
      service (str): The service for the payload template
  
  Returns:
      dict: Template of the payload for the given service
docstr_tok: ["Provides","a","pre-configured","template","that","reflects","incoming","payload","from","a","service","Args",":","service","(","str",")",":","The","service","for","the","payload","template","Returns",":","dict",":","Template","of","the","payload","for","the","given","service"]
code: def _apply_service_template(self, data):
      """Provides a pre-configured template that reflects incoming payload from a service
  
      Args:
          service (str): The service for the payload template
  
      Returns:
          dict: Template of the payload for the given service
      """
      if self.service == "s3":
          # Assign the s3 mock for this data
          self._setup_s3_mock(data)
          return {
              "eventVersion": "2.0",
              "eventTime": "1970-01-01T00:00:00.000Z",
              "requestParameters": {"sourceIPAddress": "127.0.0.1"},
              "s3": {
                  "configurationId": ",,,",
                  "object": {
                      "eTag": "...",
                      "sequencer": "...",
                      "key": "test_object_key",
                      "size": len(data),
                  },
                  "bucket": {
                      "arn": "arn:aws:s3:::{}".format(self.source),
                      "name": self.source,
                      "ownerIdentity": {"principalId": "EXAMPLE"},
                  },
                  "s3SchemaVersion": "1.0",
              },
              "responseElements": {
                  "x-amz-id-2": ("EXAMPLE123/foo/bar"),
                  "x-amz-request-id": "...",
              },
              "awsRegion": "us-east-1",
              "eventName": "ObjectCreated:Put",
              "userIdentity": {"principalId": "EXAMPLE"},
              "eventSource": "aws:s3",
          }
  
      if self.service == "kinesis":
          if self.compress:
              data = zlib.compress(data)
  
          kinesis_data = base64.b64encode(
              data.encode() if isinstance(data, str) else data
          )
  
          return {
              "eventID": "...",
              "eventVersion": "1.0",
              "kinesis": {
                  "approximateArrivalTimestamp": 1428537600,
                  "partitionKey": "partitionKey-3",
                  "data": kinesis_data,
                  "kinesisSchemaVersion": "1.0",
                  "sequenceNumber": ",,,",
              },
              "invokeIdentityArn": "arn:aws:iam::EXAMPLE",
              "eventName": "aws:kinesis:record",
              "eventSourceARN": "arn:aws:kinesis:us-east-1:123456789012:stream/{}".format(
                  self.source
              ),
              "eventSource": "aws:kinesis",
              "awsRegion": "us-east-1",
          }
  
      if self.service == "sns":
          return {
              "EventVersion": "1.0",
              "EventSubscriptionArn": "arn:aws:sns:us-east-1:123456789012:{}".format(
                  self.source
              ),
              "EventSource": "aws:sns",
              "Sns": {
                  "SignatureVersion": "1",
                  "Timestamp": "1970-01-01T00:00:00.000Z",
                  "Signature": "EXAMPLE",
                  "SigningCertUrl": "EXAMPLE",
                  "MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e",
                  "Message": data,
                  "MessageAttributes": {
                      "Test": {"Type": "String", "Value": "TestString"}
                  },
                  "Type": "Notification",
                  "UnsubscribeUrl": "...",
                  "TopicArn": "arn:aws:sns:us-east-1:123456789012:{}".format(
                      self.source
                  ),
                  "Subject": "...",
              },
          }
  
      if self.service == "streamalert_app":
          return {"streamalert_app": self.source, "logs": [data]}
  
imports: import base64
  import json
  import re
  import time
  import zlib
  from mock import patch
  from streamalert.classifier.parsers import ParserBase
  from streamalert.shared import rule
  from streamalert.shared.logger import get_logger
  from streamalert_cli.test.mocks import LookupTableMocks, ThreatIntelMocks
label_desc: Use image node_id 23 for calling the TestEvent obj's underlying member method code with example usage: obj._apply_service_template(data) and returns: dict, dict, dict, dict