Sha256: 61ec03b74a0f6cdd7fcbcc1fdfbc273d86d4a23d721536d2b33f7163937552ba
Contents?: true
Size: 1.15 KB
Versions: 36
Compression:
Stored size: 1.15 KB
Contents
require "pact_broker/api/resources/base_resource" require "pact_broker/webhooks/triggered_webhook" module PactBroker module Api module Resources class TriggeredWebhookLogs < BaseResource def content_types_provided [["text/plain", :to_text]] end def allowed_methods ["GET", "OPTIONS"] end def resource_exists? !!triggered_webhook end def to_text # Too simple to bother putting into a service if webhook_executions.any? webhook_executions.collect(&:logs).join("\n") else "Webhook has not executed yet. Please retry in a few seconds." end end def policy_name :'webhooks::webhook' end def policy_record triggered_webhook&.webhook end private def webhook_executions @webhook_executions ||= triggered_webhook.webhook_executions end def triggered_webhook @triggered_webhook ||= PactBroker::Webhooks::TriggeredWebhook.find(uuid: identifier_from_path[:uuid]) end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems