def create_request(integration, request, payload)
      event = if integration.gitlab
                create_gitlab_event(request)
              else
                create_github_event(request)
              end
      return event if event.is_a? Array

      return [501, 'Event not yet supported'] if event.nil?

      Request.new(integration, event, payload)
    end
def create_request(integration, request, payload)
      event = if integration.gitlab
                create_gitlab_event(request)
              else
                create_github_event(request)
              end
      return event if event.is_a? Array

      return [501, 'Event not yet supported'] if event.nil?

      Request.new(integration, event, payload)
    end
Creates a new request for the webhook.

 @param integration [Integration] the integration for which the request
                                  was made
 @param request [Sinatra::Request] the request received by the web server
 @param payload [String] the payload that was sent to the endpoint
 @return [Request, Array<Integer, String>] the created request, or an
                                           array containing HTTP status
                                           code and response if the
                                           request was invalid