Sha256: e1832df38b0a4d3360f9911c5acc640349ac56c72104592600fd87c8049def3e
Contents?: true
Size: 1.04 KB
Versions: 27
Compression:
Stored size: 1.04 KB
Contents
require 'pact_broker/services' require 'pact_broker/api/decorators/webhook_execution_result_decorator' module PactBroker module Api module Resources class WebhookExecution < BaseResource def allowed_methods ["POST"] end def process_post webhook_execution_result = webhook_service.execute_webhook_now webhook response.headers['Content-Type'] = 'application/hal+json;charset=utf-8' response.body = post_response_body webhook_execution_result webhook_execution_result.success? ? true : 500 end def resource_exists? webhook end private def post_response_body webhook_execution_result Decorators::WebhookExecutionResultDecorator.new(webhook_execution_result).to_json(user_options: { base_url: base_url, webhook: webhook }) end def webhook @webhook ||= webhook_service.find_by_uuid uuid end def uuid identifier_from_path[:uuid] end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems