Class: Nombaone::Resources::WebhookEndpointDeliveries

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/nombaone/resources/webhook_endpoints.rb,
sig/nombaone/resources.rbs

Overview

Deliveries under a webhook endpoint: inspect and replay (nombaone.webhook_endpoints.deliveries).

Instance Method Summary collapse

Methods inherited from BaseResource

#encode, #initialize, #request, #request_page

Constructor Details

This class inherits a constructor from Nombaone::Resources::BaseResource

Instance Method Details

#list(endpoint_id, status: OMIT, event_type: OMIT, endpoint: OMIT, limit: OMIT, cursor: OMIT, request_options: {}) ⇒ Page<NombaObject>

List an endpoint's deliveries, newest first.

Parameters:

  • endpoint_id (String)

    nbo…whk

  • status (String) (defaults to: OMIT)

    "pending", "succeeded", "failed", "dead".

  • event_type (String) (defaults to: OMIT)

    filter by catalog event type.

  • endpoint (String) (defaults to: OMIT)

    filter by endpoint reference.

  • limit (Integer) (defaults to: OMIT)

    page size, 1–100 (API default 20).

  • cursor (String) (defaults to: OMIT)

    opaque cursor from a previous page.

  • request_options (Hash) (defaults to: {})

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/nombaone/resources/webhook_endpoints.rb', line 18

def list(endpoint_id, status: OMIT, event_type: OMIT, endpoint: OMIT, limit: OMIT,
         cursor: OMIT, request_options: {})
  request_page("/webhooks/#{encode(endpoint_id)}/deliveries",
               query: {
                 status: status,
                 event_type: event_type,
                 endpoint: endpoint,
                 limit: limit,
                 cursor: cursor,
               },
               options: request_options)
end

#replay(endpoint_id, delivery_id, request_options: {}) ⇒ NombaObject

Redeliver a past delivery. The original event id is kept, so a receiver that dedupes on event.event.id correctly treats it as already-seen.

Parameters:

  • endpoint_id (String)

    nbo…whk

  • delivery_id (String)

    nbo…whd

  • request_options (Hash) (defaults to: {})

Returns:



50
51
52
53
# File 'lib/nombaone/resources/webhook_endpoints.rb', line 50

def replay(endpoint_id, delivery_id, request_options: {})
  request(:post, "/webhooks/#{encode(endpoint_id)}/deliveries/#{encode(delivery_id)}/replay",
          body: {}, options: request_options)
end

#retrieve(endpoint_id, delivery_id, request_options: {}) ⇒ NombaObject

Retrieve one delivery.

Parameters:

  • endpoint_id (String)

    nbo…whk

  • delivery_id (String)

    nbo…whd

  • request_options (Hash) (defaults to: {})

Returns:



37
38
39
40
# File 'lib/nombaone/resources/webhook_endpoints.rb', line 37

def retrieve(endpoint_id, delivery_id, request_options: {})
  request(:get, "/webhooks/#{encode(endpoint_id)}/deliveries/#{encode(delivery_id)}",
          options: request_options)
end