zernio-sdk 0.0.806 → 0.0.807
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/docs/RedeliverWebhookEventRequest.md +20 -0
- data/docs/WebhooksApi.md +70 -0
- data/lib/zernio-sdk/api/webhooks_api.rb +68 -0
- data/lib/zernio-sdk/models/redeliver_webhook_event_request.rb +210 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +1 -0
- data/openapi.yaml +72 -0
- data/spec/api/webhooks_api_spec.rb +12 -0
- data/spec/models/redeliver_webhook_event_request_spec.rb +42 -0
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0957d46aef50176f650d15e9dafcd06f9e69993e05e93a0517e7b69d670af9f9'
|
|
4
|
+
data.tar.gz: f2dbb363ac46d9a2a6690390dd92badab898760d34772133cfc492484b0379a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b383d3f69556ad3483c9c31c4bac127d1a820a3b8601de68674ad6cba64956e052b7812d1ed13904f8bdc3400cd7891cac95010b79eb419b55ff8b2f7128da82
|
|
7
|
+
data.tar.gz: 2ed440f19d876f1ce8faa9975926819e53bdbf356d0152239490ba59f74c5846acb4c016746e964c5905d0e15f9253fd99dbaaf3020ffc4eb47a16b38c1715f4
|
data/README.md
CHANGED
|
@@ -568,6 +568,7 @@ Class | Method | HTTP request | Description
|
|
|
568
568
|
*Zernio::WebhooksApi* | [**delete_webhook_settings**](docs/WebhooksApi.md#delete_webhook_settings) | **DELETE** /v1/webhooks/settings | Delete webhook
|
|
569
569
|
*Zernio::WebhooksApi* | [**get_webhook_logs**](docs/WebhooksApi.md#get_webhook_logs) | **GET** /v1/webhooks/logs | List webhook delivery logs
|
|
570
570
|
*Zernio::WebhooksApi* | [**get_webhook_settings**](docs/WebhooksApi.md#get_webhook_settings) | **GET** /v1/webhooks/settings | List webhooks
|
|
571
|
+
*Zernio::WebhooksApi* | [**redeliver_webhook_event**](docs/WebhooksApi.md#redeliver_webhook_event) | **POST** /v1/webhooks/logs/redeliver | Redeliver a webhook event
|
|
571
572
|
*Zernio::WebhooksApi* | [**test_webhook**](docs/WebhooksApi.md#test_webhook) | **POST** /v1/webhooks/test | Send test webhook
|
|
572
573
|
*Zernio::WebhooksApi* | [**update_webhook_settings**](docs/WebhooksApi.md#update_webhook_settings) | **PUT** /v1/webhooks/settings | Update webhook
|
|
573
574
|
*Zernio::WhatsAppApi* | [**add_whats_app_group_participants**](docs/WhatsAppApi.md#add_whats_app_group_participants) | **POST** /v1/whatsapp/wa-groups/{groupId}/participants | Add participants
|
|
@@ -1827,6 +1828,7 @@ Class | Method | HTTP request | Description
|
|
|
1827
1828
|
- [Zernio::RecyclingState](docs/RecyclingState.md)
|
|
1828
1829
|
- [Zernio::RedditPlatformData](docs/RedditPlatformData.md)
|
|
1829
1830
|
- [Zernio::RedditPost](docs/RedditPost.md)
|
|
1831
|
+
- [Zernio::RedeliverWebhookEventRequest](docs/RedeliverWebhookEventRequest.md)
|
|
1830
1832
|
- [Zernio::RegisterWhatsAppNumber200Response](docs/RegisterWhatsAppNumber200Response.md)
|
|
1831
1833
|
- [Zernio::RegisterWhatsAppNumberRequest](docs/RegisterWhatsAppNumberRequest.md)
|
|
1832
1834
|
- [Zernio::RejectWhatsAppGroupJoinRequestsRequest](docs/RejectWhatsAppGroupJoinRequestsRequest.md)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::RedeliverWebhookEventRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **webhook_id** | **String** | ID of the webhook subscription that delivered the event | |
|
|
8
|
+
| **event_id** | **String** | Stable event ID of the delivery to replay | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::RedeliverWebhookEventRequest.new(
|
|
16
|
+
webhook_id: null,
|
|
17
|
+
event_id: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/WebhooksApi.md
CHANGED
|
@@ -8,6 +8,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
8
8
|
| [**delete_webhook_settings**](WebhooksApi.md#delete_webhook_settings) | **DELETE** /v1/webhooks/settings | Delete webhook |
|
|
9
9
|
| [**get_webhook_logs**](WebhooksApi.md#get_webhook_logs) | **GET** /v1/webhooks/logs | List webhook delivery logs |
|
|
10
10
|
| [**get_webhook_settings**](WebhooksApi.md#get_webhook_settings) | **GET** /v1/webhooks/settings | List webhooks |
|
|
11
|
+
| [**redeliver_webhook_event**](WebhooksApi.md#redeliver_webhook_event) | **POST** /v1/webhooks/logs/redeliver | Redeliver a webhook event |
|
|
11
12
|
| [**test_webhook**](WebhooksApi.md#test_webhook) | **POST** /v1/webhooks/test | Send test webhook |
|
|
12
13
|
| [**update_webhook_settings**](WebhooksApi.md#update_webhook_settings) | **PUT** /v1/webhooks/settings | Update webhook |
|
|
13
14
|
|
|
@@ -297,6 +298,75 @@ This endpoint does not need any parameter.
|
|
|
297
298
|
- **Accept**: application/json
|
|
298
299
|
|
|
299
300
|
|
|
301
|
+
## redeliver_webhook_event
|
|
302
|
+
|
|
303
|
+
> <UnpublishPost200Response> redeliver_webhook_event(redeliver_webhook_event_request)
|
|
304
|
+
|
|
305
|
+
Redeliver a webhook event
|
|
306
|
+
|
|
307
|
+
Replay a past delivery: the original payload is re-sent, byte for byte, to the subscription's current URL. The original event ID is preserved so your endpoint can dedupe, and the replay is recorded as a fresh attempt, so it shows up in `GET /v1/webhooks/logs` next to the delivery it replays. Both `webhookId` and `eventId` come from a row of `GET /v1/webhooks/logs`. Because the stored payload is replayed as-is, a redelivery reflects the event as it was emitted, not the current state of the resource. Only deliveries inside the 30-day log retention window can be replayed; past that the payload is gone and the request fails with a 500. Replays run the same resource-group checks as live delivery, against both the key's groups and the subscription's `disabledResourceGroups`.
|
|
308
|
+
|
|
309
|
+
### Examples
|
|
310
|
+
|
|
311
|
+
```ruby
|
|
312
|
+
require 'time'
|
|
313
|
+
require 'zernio-sdk'
|
|
314
|
+
# setup authorization
|
|
315
|
+
Zernio.configure do |config|
|
|
316
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
317
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
api_instance = Zernio::WebhooksApi.new
|
|
321
|
+
redeliver_webhook_event_request = Zernio::RedeliverWebhookEventRequest.new({webhook_id: 'webhook_id_example', event_id: 'event_id_example'}) # RedeliverWebhookEventRequest |
|
|
322
|
+
|
|
323
|
+
begin
|
|
324
|
+
# Redeliver a webhook event
|
|
325
|
+
result = api_instance.redeliver_webhook_event(redeliver_webhook_event_request)
|
|
326
|
+
p result
|
|
327
|
+
rescue Zernio::ApiError => e
|
|
328
|
+
puts "Error when calling WebhooksApi->redeliver_webhook_event: #{e}"
|
|
329
|
+
end
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### Using the redeliver_webhook_event_with_http_info variant
|
|
333
|
+
|
|
334
|
+
This returns an Array which contains the response data, status code and headers.
|
|
335
|
+
|
|
336
|
+
> <Array(<UnpublishPost200Response>, Integer, Hash)> redeliver_webhook_event_with_http_info(redeliver_webhook_event_request)
|
|
337
|
+
|
|
338
|
+
```ruby
|
|
339
|
+
begin
|
|
340
|
+
# Redeliver a webhook event
|
|
341
|
+
data, status_code, headers = api_instance.redeliver_webhook_event_with_http_info(redeliver_webhook_event_request)
|
|
342
|
+
p status_code # => 2xx
|
|
343
|
+
p headers # => { ... }
|
|
344
|
+
p data # => <UnpublishPost200Response>
|
|
345
|
+
rescue Zernio::ApiError => e
|
|
346
|
+
puts "Error when calling WebhooksApi->redeliver_webhook_event_with_http_info: #{e}"
|
|
347
|
+
end
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Parameters
|
|
351
|
+
|
|
352
|
+
| Name | Type | Description | Notes |
|
|
353
|
+
| ---- | ---- | ----------- | ----- |
|
|
354
|
+
| **redeliver_webhook_event_request** | [**RedeliverWebhookEventRequest**](RedeliverWebhookEventRequest.md) | | |
|
|
355
|
+
|
|
356
|
+
### Return type
|
|
357
|
+
|
|
358
|
+
[**UnpublishPost200Response**](UnpublishPost200Response.md)
|
|
359
|
+
|
|
360
|
+
### Authorization
|
|
361
|
+
|
|
362
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
363
|
+
|
|
364
|
+
### HTTP request headers
|
|
365
|
+
|
|
366
|
+
- **Content-Type**: application/json
|
|
367
|
+
- **Accept**: application/json
|
|
368
|
+
|
|
369
|
+
|
|
300
370
|
## test_webhook
|
|
301
371
|
|
|
302
372
|
> <UnpublishPost200Response> test_webhook(test_webhook_request)
|
|
@@ -332,6 +332,74 @@ module Zernio
|
|
|
332
332
|
return data, status_code, headers
|
|
333
333
|
end
|
|
334
334
|
|
|
335
|
+
# Redeliver a webhook event
|
|
336
|
+
# Replay a past delivery: the original payload is re-sent, byte for byte, to the subscription's current URL. The original event ID is preserved so your endpoint can dedupe, and the replay is recorded as a fresh attempt, so it shows up in `GET /v1/webhooks/logs` next to the delivery it replays. Both `webhookId` and `eventId` come from a row of `GET /v1/webhooks/logs`. Because the stored payload is replayed as-is, a redelivery reflects the event as it was emitted, not the current state of the resource. Only deliveries inside the 30-day log retention window can be replayed; past that the payload is gone and the request fails with a 500. Replays run the same resource-group checks as live delivery, against both the key's groups and the subscription's `disabledResourceGroups`.
|
|
337
|
+
# @param redeliver_webhook_event_request [RedeliverWebhookEventRequest]
|
|
338
|
+
# @param [Hash] opts the optional parameters
|
|
339
|
+
# @return [UnpublishPost200Response]
|
|
340
|
+
def redeliver_webhook_event(redeliver_webhook_event_request, opts = {})
|
|
341
|
+
data, _status_code, _headers = redeliver_webhook_event_with_http_info(redeliver_webhook_event_request, opts)
|
|
342
|
+
data
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Redeliver a webhook event
|
|
346
|
+
# Replay a past delivery: the original payload is re-sent, byte for byte, to the subscription's current URL. The original event ID is preserved so your endpoint can dedupe, and the replay is recorded as a fresh attempt, so it shows up in `GET /v1/webhooks/logs` next to the delivery it replays. Both `webhookId` and `eventId` come from a row of `GET /v1/webhooks/logs`. Because the stored payload is replayed as-is, a redelivery reflects the event as it was emitted, not the current state of the resource. Only deliveries inside the 30-day log retention window can be replayed; past that the payload is gone and the request fails with a 500. Replays run the same resource-group checks as live delivery, against both the key's groups and the subscription's `disabledResourceGroups`.
|
|
347
|
+
# @param redeliver_webhook_event_request [RedeliverWebhookEventRequest]
|
|
348
|
+
# @param [Hash] opts the optional parameters
|
|
349
|
+
# @return [Array<(UnpublishPost200Response, Integer, Hash)>] UnpublishPost200Response data, response status code and response headers
|
|
350
|
+
def redeliver_webhook_event_with_http_info(redeliver_webhook_event_request, opts = {})
|
|
351
|
+
if @api_client.config.debugging
|
|
352
|
+
@api_client.config.logger.debug 'Calling API: WebhooksApi.redeliver_webhook_event ...'
|
|
353
|
+
end
|
|
354
|
+
# verify the required parameter 'redeliver_webhook_event_request' is set
|
|
355
|
+
if @api_client.config.client_side_validation && redeliver_webhook_event_request.nil?
|
|
356
|
+
fail ArgumentError, "Missing the required parameter 'redeliver_webhook_event_request' when calling WebhooksApi.redeliver_webhook_event"
|
|
357
|
+
end
|
|
358
|
+
# resource path
|
|
359
|
+
local_var_path = '/v1/webhooks/logs/redeliver'
|
|
360
|
+
|
|
361
|
+
# query parameters
|
|
362
|
+
query_params = opts[:query_params] || {}
|
|
363
|
+
|
|
364
|
+
# header parameters
|
|
365
|
+
header_params = opts[:header_params] || {}
|
|
366
|
+
# HTTP header 'Accept' (if needed)
|
|
367
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
368
|
+
# HTTP header 'Content-Type'
|
|
369
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
370
|
+
if !content_type.nil?
|
|
371
|
+
header_params['Content-Type'] = content_type
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
# form parameters
|
|
375
|
+
form_params = opts[:form_params] || {}
|
|
376
|
+
|
|
377
|
+
# http body (model)
|
|
378
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(redeliver_webhook_event_request)
|
|
379
|
+
|
|
380
|
+
# return_type
|
|
381
|
+
return_type = opts[:debug_return_type] || 'UnpublishPost200Response'
|
|
382
|
+
|
|
383
|
+
# auth_names
|
|
384
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
385
|
+
|
|
386
|
+
new_options = opts.merge(
|
|
387
|
+
:operation => :"WebhooksApi.redeliver_webhook_event",
|
|
388
|
+
:header_params => header_params,
|
|
389
|
+
:query_params => query_params,
|
|
390
|
+
:form_params => form_params,
|
|
391
|
+
:body => post_body,
|
|
392
|
+
:auth_names => auth_names,
|
|
393
|
+
:return_type => return_type
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
397
|
+
if @api_client.config.debugging
|
|
398
|
+
@api_client.config.logger.debug "API called: WebhooksApi#redeliver_webhook_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
399
|
+
end
|
|
400
|
+
return data, status_code, headers
|
|
401
|
+
end
|
|
402
|
+
|
|
335
403
|
# Send test webhook
|
|
336
404
|
# Send a test webhook to verify your endpoint is configured correctly. The test payload includes event: \"webhook.test\" to distinguish it from real events. `webhook.test` belongs to the `webhooks` resource group, so a key with that group disabled is rejected with 403, as is a test fire on a subscription that lists `webhooks` in its own `disabledResourceGroups` (a 403, not a reported delivery failure). Replays of real events (redelivery, dead-letter requeue) run the same checks as live delivery, against both the key's groups and the subscription's.
|
|
337
405
|
# @param test_webhook_request [TestWebhookRequest]
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class RedeliverWebhookEventRequest < ApiModelBase
|
|
18
|
+
# ID of the webhook subscription that delivered the event
|
|
19
|
+
attr_accessor :webhook_id
|
|
20
|
+
|
|
21
|
+
# Stable event ID of the delivery to replay
|
|
22
|
+
attr_accessor :event_id
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'webhook_id' => :'webhookId',
|
|
28
|
+
:'event_id' => :'eventId'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'webhook_id' => :'String',
|
|
46
|
+
:'event_id' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::RedeliverWebhookEventRequest` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::RedeliverWebhookEventRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'webhook_id')
|
|
73
|
+
self.webhook_id = attributes[:'webhook_id']
|
|
74
|
+
else
|
|
75
|
+
self.webhook_id = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'event_id')
|
|
79
|
+
self.event_id = attributes[:'event_id']
|
|
80
|
+
else
|
|
81
|
+
self.event_id = nil
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @webhook_id.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "webhook_id", webhook_id cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if @webhook_id.to_s.length < 1
|
|
95
|
+
invalid_properties.push('invalid value for "webhook_id", the character length must be greater than or equal to 1.')
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if @event_id.nil?
|
|
99
|
+
invalid_properties.push('invalid value for "event_id", event_id cannot be nil.')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if @event_id.to_s.length < 1
|
|
103
|
+
invalid_properties.push('invalid value for "event_id", the character length must be greater than or equal to 1.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
return false if @webhook_id.nil?
|
|
114
|
+
return false if @webhook_id.to_s.length < 1
|
|
115
|
+
return false if @event_id.nil?
|
|
116
|
+
return false if @event_id.to_s.length < 1
|
|
117
|
+
true
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Custom attribute writer method with validation
|
|
121
|
+
# @param [Object] webhook_id Value to be assigned
|
|
122
|
+
def webhook_id=(webhook_id)
|
|
123
|
+
if webhook_id.nil?
|
|
124
|
+
fail ArgumentError, 'webhook_id cannot be nil'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if webhook_id.to_s.length < 1
|
|
128
|
+
fail ArgumentError, 'invalid value for "webhook_id", the character length must be greater than or equal to 1.'
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
@webhook_id = webhook_id
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method with validation
|
|
135
|
+
# @param [Object] event_id Value to be assigned
|
|
136
|
+
def event_id=(event_id)
|
|
137
|
+
if event_id.nil?
|
|
138
|
+
fail ArgumentError, 'event_id cannot be nil'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if event_id.to_s.length < 1
|
|
142
|
+
fail ArgumentError, 'invalid value for "event_id", the character length must be greater than or equal to 1.'
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
@event_id = event_id
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Checks equality by comparing each attribute.
|
|
149
|
+
# @param [Object] Object to be compared
|
|
150
|
+
def ==(o)
|
|
151
|
+
return true if self.equal?(o)
|
|
152
|
+
self.class == o.class &&
|
|
153
|
+
webhook_id == o.webhook_id &&
|
|
154
|
+
event_id == o.event_id
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# @see the `==` method
|
|
158
|
+
# @param [Object] Object to be compared
|
|
159
|
+
def eql?(o)
|
|
160
|
+
self == o
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Calculates hash code according to all attributes.
|
|
164
|
+
# @return [Integer] Hash code
|
|
165
|
+
def hash
|
|
166
|
+
[webhook_id, event_id].hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Builds the object from hash
|
|
170
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
171
|
+
# @return [Object] Returns the model itself
|
|
172
|
+
def self.build_from_hash(attributes)
|
|
173
|
+
return nil unless attributes.is_a?(Hash)
|
|
174
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
175
|
+
transformed_hash = {}
|
|
176
|
+
openapi_types.each_pair do |key, type|
|
|
177
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = nil
|
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
180
|
+
# check to ensure the input is an array given that the attribute
|
|
181
|
+
# is documented as an array but the input is not
|
|
182
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
183
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
184
|
+
end
|
|
185
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
186
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
new(transformed_hash)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the object in the form of hash
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_hash
|
|
195
|
+
hash = {}
|
|
196
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
197
|
+
value = self.send(attr)
|
|
198
|
+
if value.nil?
|
|
199
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
200
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
hash[param] = _to_hash(value)
|
|
204
|
+
end
|
|
205
|
+
hash
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1169,6 +1169,7 @@ require 'zernio-sdk/models/recycling_config'
|
|
|
1169
1169
|
require 'zernio-sdk/models/recycling_state'
|
|
1170
1170
|
require 'zernio-sdk/models/reddit_platform_data'
|
|
1171
1171
|
require 'zernio-sdk/models/reddit_post'
|
|
1172
|
+
require 'zernio-sdk/models/redeliver_webhook_event_request'
|
|
1172
1173
|
require 'zernio-sdk/models/register_whats_app_number200_response'
|
|
1173
1174
|
require 'zernio-sdk/models/register_whats_app_number_request'
|
|
1174
1175
|
require 'zernio-sdk/models/reject_whats_app_group_join_requests_request'
|
data/openapi.yaml
CHANGED
|
@@ -25509,6 +25509,78 @@ paths:
|
|
|
25509
25509
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
25510
25510
|
'403': { $ref: '#/components/responses/ResourceGroupForbidden' }
|
|
25511
25511
|
|
|
25512
|
+
/v1/webhooks/logs/redeliver:
|
|
25513
|
+
post:
|
|
25514
|
+
x-resource-group: "webhooks"
|
|
25515
|
+
operationId: redeliverWebhookEvent
|
|
25516
|
+
tags: [Webhooks]
|
|
25517
|
+
summary: Redeliver a webhook event
|
|
25518
|
+
description: |
|
|
25519
|
+
Replay a past delivery: the original payload is re-sent, byte for byte, to the
|
|
25520
|
+
subscription's current URL. The original event ID is preserved so your endpoint can
|
|
25521
|
+
dedupe, and the replay is recorded as a fresh attempt, so it shows up in
|
|
25522
|
+
`GET /v1/webhooks/logs` next to the delivery it replays.
|
|
25523
|
+
|
|
25524
|
+
Both `webhookId` and `eventId` come from a row of `GET /v1/webhooks/logs`. Because
|
|
25525
|
+
the stored payload is replayed as-is, a redelivery reflects the event as it was
|
|
25526
|
+
emitted, not the current state of the resource.
|
|
25527
|
+
|
|
25528
|
+
Only deliveries inside the 30-day log retention window can be replayed; past that
|
|
25529
|
+
the payload is gone and the request fails with a 500. Replays run the same
|
|
25530
|
+
resource-group checks as live delivery, against both the key's groups and the
|
|
25531
|
+
subscription's `disabledResourceGroups`.
|
|
25532
|
+
security:
|
|
25533
|
+
- bearerAuth: []
|
|
25534
|
+
requestBody:
|
|
25535
|
+
required: true
|
|
25536
|
+
content:
|
|
25537
|
+
application/json:
|
|
25538
|
+
schema:
|
|
25539
|
+
type: object
|
|
25540
|
+
required:
|
|
25541
|
+
- webhookId
|
|
25542
|
+
- eventId
|
|
25543
|
+
properties:
|
|
25544
|
+
webhookId:
|
|
25545
|
+
type: string
|
|
25546
|
+
minLength: 1
|
|
25547
|
+
description: ID of the webhook subscription that delivered the event
|
|
25548
|
+
eventId:
|
|
25549
|
+
type: string
|
|
25550
|
+
minLength: 1
|
|
25551
|
+
description: Stable event ID of the delivery to replay
|
|
25552
|
+
example:
|
|
25553
|
+
webhookId: "507f1f77bcf86cd799439011"
|
|
25554
|
+
eventId: "evt_9f2c1b7a4d8e"
|
|
25555
|
+
responses:
|
|
25556
|
+
'200':
|
|
25557
|
+
description: Event re-delivered successfully
|
|
25558
|
+
content:
|
|
25559
|
+
application/json:
|
|
25560
|
+
schema:
|
|
25561
|
+
type: object
|
|
25562
|
+
properties:
|
|
25563
|
+
success: { type: boolean }
|
|
25564
|
+
message: { type: string }
|
|
25565
|
+
example:
|
|
25566
|
+
success: true
|
|
25567
|
+
message: "Webhook re-delivered"
|
|
25568
|
+
'400': { description: 'webhookId or eventId missing or empty' }
|
|
25569
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
25570
|
+
'403': { $ref: '#/components/responses/ResourceGroupForbidden' }
|
|
25571
|
+
'500': { description: 'Webhook no longer exists, has no URL configured, or the original payload is outside the 30-day retention window' }
|
|
25572
|
+
'502':
|
|
25573
|
+
description: |
|
|
25574
|
+
Re-delivery was attempted but your endpoint errored again. The attempt is still
|
|
25575
|
+
logged; `message` describes the failure.
|
|
25576
|
+
content:
|
|
25577
|
+
application/json:
|
|
25578
|
+
schema:
|
|
25579
|
+
type: object
|
|
25580
|
+
properties:
|
|
25581
|
+
success: { type: boolean }
|
|
25582
|
+
message: { type: string }
|
|
25583
|
+
|
|
25512
25584
|
/v1/webhooks/test:
|
|
25513
25585
|
post:
|
|
25514
25586
|
x-resource-group: "webhooks"
|
|
@@ -84,6 +84,18 @@ describe 'WebhooksApi' do
|
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
86
|
|
|
87
|
+
# unit tests for redeliver_webhook_event
|
|
88
|
+
# Redeliver a webhook event
|
|
89
|
+
# Replay a past delivery: the original payload is re-sent, byte for byte, to the subscription's current URL. The original event ID is preserved so your endpoint can dedupe, and the replay is recorded as a fresh attempt, so it shows up in `GET /v1/webhooks/logs` next to the delivery it replays. Both `webhookId` and `eventId` come from a row of `GET /v1/webhooks/logs`. Because the stored payload is replayed as-is, a redelivery reflects the event as it was emitted, not the current state of the resource. Only deliveries inside the 30-day log retention window can be replayed; past that the payload is gone and the request fails with a 500. Replays run the same resource-group checks as live delivery, against both the key's groups and the subscription's `disabledResourceGroups`.
|
|
90
|
+
# @param redeliver_webhook_event_request
|
|
91
|
+
# @param [Hash] opts the optional parameters
|
|
92
|
+
# @return [UnpublishPost200Response]
|
|
93
|
+
describe 'redeliver_webhook_event test' do
|
|
94
|
+
it 'should work' do
|
|
95
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
87
99
|
# unit tests for test_webhook
|
|
88
100
|
# Send test webhook
|
|
89
101
|
# Send a test webhook to verify your endpoint is configured correctly. The test payload includes event: \"webhook.test\" to distinguish it from real events. `webhook.test` belongs to the `webhooks` resource group, so a key with that group disabled is rejected with 403, as is a test fire on a subscription that lists `webhooks` in its own `disabledResourceGroups` (a 403, not a reported delivery failure). Replays of real events (redelivery, dead-letter requeue) run the same checks as live delivery, against both the key's groups and the subscription's.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::RedeliverWebhookEventRequest
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::RedeliverWebhookEventRequest do
|
|
21
|
+
#let(:instance) { Zernio::RedeliverWebhookEventRequest.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of RedeliverWebhookEventRequest' do
|
|
24
|
+
it 'should create an instance of RedeliverWebhookEventRequest' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::RedeliverWebhookEventRequest)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "webhook_id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "event_id"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zernio-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.807
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
@@ -1265,6 +1265,7 @@ files:
|
|
|
1265
1265
|
- docs/RedditPlatformData.md
|
|
1266
1266
|
- docs/RedditPost.md
|
|
1267
1267
|
- docs/RedditSearchApi.md
|
|
1268
|
+
- docs/RedeliverWebhookEventRequest.md
|
|
1268
1269
|
- docs/RegisterWhatsAppNumber200Response.md
|
|
1269
1270
|
- docs/RegisterWhatsAppNumberRequest.md
|
|
1270
1271
|
- docs/RejectWhatsAppGroupJoinRequestsRequest.md
|
|
@@ -3117,6 +3118,7 @@ files:
|
|
|
3117
3118
|
- lib/zernio-sdk/models/recycling_state.rb
|
|
3118
3119
|
- lib/zernio-sdk/models/reddit_platform_data.rb
|
|
3119
3120
|
- lib/zernio-sdk/models/reddit_post.rb
|
|
3121
|
+
- lib/zernio-sdk/models/redeliver_webhook_event_request.rb
|
|
3120
3122
|
- lib/zernio-sdk/models/register_whats_app_number200_response.rb
|
|
3121
3123
|
- lib/zernio-sdk/models/register_whats_app_number_request.rb
|
|
3122
3124
|
- lib/zernio-sdk/models/reject_whats_app_group_join_requests_request.rb
|
|
@@ -4944,6 +4946,7 @@ files:
|
|
|
4944
4946
|
- spec/models/recycling_state_spec.rb
|
|
4945
4947
|
- spec/models/reddit_platform_data_spec.rb
|
|
4946
4948
|
- spec/models/reddit_post_spec.rb
|
|
4949
|
+
- spec/models/redeliver_webhook_event_request_spec.rb
|
|
4947
4950
|
- spec/models/register_whats_app_number200_response_spec.rb
|
|
4948
4951
|
- spec/models/register_whats_app_number_request_spec.rb
|
|
4949
4952
|
- spec/models/reject_whats_app_group_join_requests_request_spec.rb
|
|
@@ -7287,6 +7290,7 @@ test_files:
|
|
|
7287
7290
|
- spec/models/gbp_free_form_service_item_label_spec.rb
|
|
7288
7291
|
- spec/models/generate_keyword_ideas200_response_paging_spec.rb
|
|
7289
7292
|
- spec/models/create_inbox_conversation_request_spec.rb
|
|
7293
|
+
- spec/models/redeliver_webhook_event_request_spec.rb
|
|
7290
7294
|
- spec/models/ctwa_ad_request_body_welcome_message_spec.rb
|
|
7291
7295
|
- spec/models/send_inbox_message_request_interactive_action_one_of_spec.rb
|
|
7292
7296
|
- spec/models/edit_inbox_comment_request_spec.rb
|