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



33
34
35
# File 'lib/contentful/management/webhook_health.rb', line 33

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

.createObject

Not supported



28
29
30
# File 'lib/contentful/management/webhook_health.rb', line 28

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:



23
24
25
# File 'lib/contentful/management/webhook_health.rb', line 23

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

Instance Method Details

#destroyObject

Not supported



51
52
53
# File 'lib/contentful/management/webhook_health.rb', line 51

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)


71
72
73
# File 'lib/contentful/management/webhook_health.rb', line 71

def errors?
  total != healthy
end

#healthyObject

Returns the amount of healthy calls made by the webhook.



66
67
68
# File 'lib/contentful/management/webhook_health.rb', line 66

def healthy
  calls['healthy']
end

#healthy?Boolean

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

Returns:

  • (Boolean)


76
77
78
# File 'lib/contentful/management/webhook_health.rb', line 76

def healthy?
  total == healthy
end

#totalObject

Returns the total calls made by the webhook.



61
62
63
# File 'lib/contentful/management/webhook_health.rb', line 61

def total
  calls['total']
end

#updateObject

Not supported



56
57
58
# File 'lib/contentful/management/webhook_health.rb', line 56

def update(*)
  fail 'Not supported'
end