Class: BaseCradle::WebhookEndpoint

Inherits:
ApiObject
  • Object
show all
Defined in:
lib/basecradle/webhooks.rb

Overview

An inbound webhook URL on a timeline. Endpoints belong to the timeline, not a user, so there is no user block. Verbs update this object from the full endpoint the API returns (live objects).

Instance Method Summary collapse

Methods inherited from ApiObject

#==, #[], attribute, #hash, #initialize, #inspect, #to_h

Constructor Details

This class inherits a constructor from BaseCradle::ApiObject

Instance Method Details

#disableObject

Soft-stop: refuse inbound deliveries (410 Gone) until re-enabled. The endpoint and its event history are kept; reversible via enable.



36
37
38
# File 'lib/basecradle/webhooks.rb', line 36

def disable
  adopt(require_client.request("DELETE", enablement_path))
end

#enableObject

Re-enable a disabled endpoint — inbound deliveries are accepted again.



41
42
43
# File 'lib/basecradle/webhooks.rb', line 41

def enable
  adopt(require_client.request("POST", enablement_path))
end

#rotateObject

Regenerate the ingest URL. The old URL dies immediately; the uuid is unchanged. Use this when an ingest URL leaks. Recorded events are preserved.



47
48
49
# File 'lib/basecradle/webhooks.rb', line 47

def rotate
  adopt(require_client.request("POST", "/webhook_endpoints/#{content.uuid}/rotation"))
end