Class: Cloudflare::RealtimeKit::Webhook
- Inherits:
-
Cloudflare::Resource
- Object
- Cloudflare::Resource
- Cloudflare::RealtimeKit::Webhook
- Defined in:
- lib/cloudflare/realtime_kit/webhook.rb
Overview
An HTTP endpoint that receives platform events. Each webhook subscribes to a list of event types and is invoked when matching events fire.
Webhook.create(
app_id: "app-1",
name: "Recording finished",
url: "https://example.com/hooks/realtimekit",
events: [ "recording.finished", "session.ended" ]
)
webhook.update(enabled: false)
webhook.replace(name: "...", url: "...", events: [ ... ]) # PUT
webhook.destroy
Constant Summary
Constants inherited from Cloudflare::Resource
Cloudflare::Resource::ENVELOPE_KEYS
Instance Attribute Summary
Attributes inherited from Cloudflare::Resource
Instance Method Summary collapse
-
#replace(**attrs) ⇒ Object
PUT /webhooks/Cloudflare::Resource#id — replace every field (vs PATCH
update).
Methods inherited from Cloudflare::Resource
#==, #[], all, attribute, attributes, #attributes, collection_path, configured_api_token, create, #destroy, find, has_many, has_one, #hash, #id, #initialize, member_path, read_only, read_only?, #reload, request, scope_params, scope_required, #set_attrs_from_response, #to_h, to_wire_keys, unwrap_envelope, #update, wire_kwarg, wire_name_for_request, wire_name_for_response
Constructor Details
This class inherits a constructor from Cloudflare::Resource
Instance Method Details
#replace(**attrs) ⇒ Object
PUT /webhooks/Cloudflare::Resource#id — replace every field (vs PATCH update).
29 30 31 32 33 |
# File 'lib/cloudflare/realtime_kit/webhook.rb', line 29 def replace(**attrs) response = request(:put, member_path, body: self.class.to_wire_keys(attrs)) set_attrs_from_response(response) self end |