Class: Contentful::Management::WebhookHealth

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::Refresher, Resource::SystemProperties
Defined in:
lib/contentful/management/webhook_health.rb

Overview

Resource class for WebhookHealth.

See Also:

  • https://www.contentful.com/developers/docs/references/content-management-api/#/reference/webhook-calls/webhook-health

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #properties, #raw_object, #request

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource::Refresher

#reload

Methods included from Resource

#array?, #default_locale, #environment_id, #fields, #nested_locale_fields?, #resource?, #save, #sys

Class Method Details

.allObject

Not supported



31
32
33
# File 'lib/contentful/management/webhook_health.rb', line 31

def self.all(*)
  fail 'Not supported'
end

.createObject

Not supported



26
27
28
# File 'lib/contentful/management/webhook_health.rb', line 26

def self.create(*)
  fail 'Not supported'
end

.find(client, space_id, webhook_id) ⇒ Contentful::Management::WebhookHealth

Gets a webhook’s health details by ID

Parameters:

Returns:



21
22
23
# File 'lib/contentful/management/webhook_health.rb', line 21

def self.find(client, space_id, webhook_id)
  ClientWebhookHealthMethodsFactory.new(client, space_id).find(webhook_id)
end

Instance Method Details

#destroyObject

Not supported



49
50
51
# File 'lib/contentful/management/webhook_health.rb', line 49

def destroy
  fail 'Not supported'
end

#errors?Boolean

Returns wether or not there was an error on the webhook calls on the last 30 days.

Returns:

  • (Boolean)


69
70
71
# File 'lib/contentful/management/webhook_health.rb', line 69

def errors?
  total != healthy
end

#healthyObject

Returns the amount of healthy calls made by the webhook.



64
65
66
# File 'lib/contentful/management/webhook_health.rb', line 64

def healthy
  calls['healthy']
end

#healthy?Boolean

Returns whether or not all the webhook calls on the last 30 days were successful.

Returns:

  • (Boolean)


74
75
76
# File 'lib/contentful/management/webhook_health.rb', line 74

def healthy?
  total == healthy
end

#totalObject

Returns the total calls made by the webhook.



59
60
61
# File 'lib/contentful/management/webhook_health.rb', line 59

def total
  calls['total']
end

#updateObject

Not supported



54
55
56
# File 'lib/contentful/management/webhook_health.rb', line 54

def update(*)
  fail 'Not supported'
end