Sha256: b529daabc8f56aec0fe1a348f031b879199d276c670cb63f48c2fd829af88842
Contents?: true
Size: 1.22 KB
Versions: 17
Compression:
Stored size: 1.22 KB
Contents
require 'pact_broker/api/resources/base_resource' require 'pact_broker/api/decorators/pact_webhooks_status_decorator' module PactBroker module Api module Resources class PactWebhooksStatus < BaseResource def allowed_methods ["GET", "OPTIONS"] end def content_types_provided [["application/hal+json", :to_json]] end def resource_exists? consumer && provider end def to_json decorator_for(latest_triggered_webhooks).to_json(user_options: decorator_context(identifier_from_path)) end def policy_name :'webhooks::webhooks' end private def latest_triggered_webhooks @latest_triggered_webhooks ||= webhook_service.find_latest_triggered_webhooks_for_pact(pact) end def pact @pact ||= pact_service.find_latest_pact(pact_params) end def webhooks @webhooks ||= webhook_service.find_by_consumer_and_provider(consumer, provider) end def decorator_for latest_triggered_webhooks PactBroker::Api::Decorators::PactWebhooksStatusDecorator.new(latest_triggered_webhooks) end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems