code: def _convert_event_api(lambda_logical_id, event_properties):
          
          path = event_properties.get(SamApiProvider._EVENT_PATH)
          method = event_properties.get(SamApiProvider._EVENT_METHOD)
  
          # An API Event, can have RestApiId property which designates the resource that owns this API. If omitted,
          # the API is owned by Implicit API resource. This could either be a direct resource logical ID or a
          # "Ref" of the logicalID
          api_resource_id = event_properties.get("RestApiId", SamApiProvider._IMPLICIT_API_RESOURCE_ID)
          if isinstance(api_resource_id, dict) and "Ref" in api_resource_id:
              api_resource_id = api_resource_id["Ref"]
  
          # This is still a dictionary. Something wrong with the template
          if isinstance(api_resource_id, dict):
              LOG.debug("Invalid RestApiId property of event %s", event_properties)
              raise InvalidSamDocumentException("RestApiId property of resource with logicalId '{}' is invalid. "
                                                "It should either be a LogicalId string or a Ref of a Logical Id string"
                                                .format(lambda_logical_id))
  
          return api_resource_id, Api(path=path, method=method, function_name=lambda_logical_id)
docs: Converts a AWS::Serverless::Function's Event Property to an Api configuration usable by the provider.
  
          :param str lambda_logical_id: Logical Id of the AWS::Serverless::Function
          :param dict event_properties: Dictionary of the Event's Property
          :return tuple: tuple of API resource name and Api namedTuple