Sha256: 5b7d7d5d4867c6e1e261a9d21d2c00b2ef3b3546075c71d7021e0793a752b7e0

Contents?: true

Size: 1021 Bytes

Versions: 3

Compression:

Stored size: 1021 Bytes

Contents

require_relative 'base_decorator'
require 'pact_broker/api/decorators/webhook_decorator'

module PactBroker
  module Api
    module Decorators
      class WebhooksDecorator < BaseDecorator


        link :self do | context |
          {
            title: context[:resource_title],
            href: context[:resource_url]
          }
        end

        link :'pb:create' do | context |
          {
            title: "POST to create a webhook",
            href: context[:resource_url]
          }
        end

        links :'pb:webhooks' do | context |
          represented.entries.collect do | webhook |
            {
              title: "Webhook",
              name: webhook.display_description,
              href: webhook_url(webhook.uuid, context[:base_url])
            }
          end
        end

        curies do | context |
          [{
            name: :pb,
            href: context[:base_url] + '/doc/webhooks-{rel}',
            templated: true
          }]
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pact_broker-2.34.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.33.0 lib/pact_broker/api/decorators/webhooks_decorator.rb
pact_broker-2.32.0 lib/pact_broker/api/decorators/webhooks_decorator.rb