class Contentful::Management::Webhook
Resource
class for Webhook
. @see _ www.contentful.com/developers/documentation/content-management-api/http/#resources-webhooks
Public Class Methods
Creates a webhook.
@param [Contentful::Management::Client] client @param [String] space_id @param [Hash] attributes @see _ README for full attribute list for each resource.
@return [Contentful::Management::Webhook]
# File lib/contentful/management/webhook.rb, line 41 def self.create(client, space_id, attributes = {}) super(client, space_id, nil, attributes) end
@private
# File lib/contentful/management/webhook.rb, line 28 def self.create_attributes(_client, attributes) keys = %i[httpBasicUsername httpBasicPassword url name headers topics filters transformation] attributes.select { |key, _value| keys.include? key } end
@private
# File lib/contentful/management/webhook.rb, line 23 def self.endpoint 'webhook_definitions' end
Finds a webhook by ID.
@param [Contentful::Management::Client] client @param [String] space_id @param [String] webhook_id
@return [Contentful::Management::Webhook]
# File lib/contentful/management/webhook.rb, line 52 def self.find(client, space_id, webhook_id) super(client, space_id, nil, webhook_id) end
Public Instance Methods
Allows manipulation of webhook call details in context of the current webhook Allows listing all webhook call details for the webhook and finding one by ID. @see _ README for details.
@return [Contentful::Management::WebhookWebhookCallMethodsFactory]
# File lib/contentful/management/webhook.rb, line 61 def webhook_calls WebhookWebhookCallMethodsFactory.new(self) end
Allows manipulation of webhook health details in context of the current webhook Allows listing webhook health details for the webhook. @see _ README for details.
@return [Contentful::Management::WebhookWebhookHealthMethodsFactory]
# File lib/contentful/management/webhook.rb, line 70 def webhook_health WebhookWebhookHealthMethodsFactory.new(self) end
Protected Instance Methods
# File lib/contentful/management/webhook.rb, line 76 def query_attributes(attributes) self.class.create_attributes( nil, { url: url, name: name, topics: topics, headers: headers, httpBasicUsername: http_basic_username, filters: filters, transformation: transformation }.merge(attributes) ) end