late-sdk 0.0.745 → 0.0.747
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/GMBReviewsApi.md +1 -1
- data/docs/WebhookEventsApi.md +69 -0
- data/docs/WebhookPayloadWhatsAppAccountNameStatusUpdated.md +26 -0
- data/docs/WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md +24 -0
- data/lib/zernio-sdk/api/gmb_reviews_api.rb +2 -2
- data/lib/zernio-sdk/api/webhook_events_api.rb +66 -0
- data/lib/zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated.rb +295 -0
- data/lib/zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated_name.rb +228 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +2 -0
- data/openapi.yaml +81 -5
- data/spec/api/gmb_reviews_api_spec.rb +1 -1
- data/spec/models/create_webhook_settings_request_spec.rb +1 -1
- data/spec/models/update_webhook_settings_request_spec.rb +1 -1
- data/spec/models/webhook_payload_whats_app_account_name_status_updated_name_spec.rb +58 -0
- data/spec/models/webhook_payload_whats_app_account_name_status_updated_spec.rb +64 -0
- data/spec/models/webhook_spec.rb +1 -1
- data/zernio-sdk-0.0.747.gem +0 -0
- metadata +10 -2
- data/zernio-sdk-0.0.745.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d3249f55f4982b8d9f1c58f1a865de2af97f0fe9a97409b8a44b6253fc6f66d
|
|
4
|
+
data.tar.gz: 00f3ddaebdc1ed912f42caa5fd250ff36ef14e7d402095293dc3f6efc918b8f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a297c58b4de81889f966959c71a61d0968538a03e3e8160054a1db726d56dbbd53097f9b9f1fbd3348f6c1e6734796c972a2b96ed7c8ade546cec865819a9ef2
|
|
7
|
+
data.tar.gz: 61ff8275dbfd7c6cd59bd4ce109bee7942d94cfdd27978c4089c5f133834042926c2e170329fe23f7a0b8b3e4dac385c64b5596938e780b7346e7fdd43393919
|
data/README.md
CHANGED
|
@@ -2309,6 +2309,8 @@ Class | Method | HTTP request | Description
|
|
|
2309
2309
|
- [Zernio::WebhookPayloadReviewNewAccount](docs/WebhookPayloadReviewNewAccount.md)
|
|
2310
2310
|
- [Zernio::WebhookPayloadReviewUpdated](docs/WebhookPayloadReviewUpdated.md)
|
|
2311
2311
|
- [Zernio::WebhookPayloadTest](docs/WebhookPayloadTest.md)
|
|
2312
|
+
- [Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated](docs/WebhookPayloadWhatsAppAccountNameStatusUpdated.md)
|
|
2313
|
+
- [Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName](docs/WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md)
|
|
2312
2314
|
- [Zernio::WebhookPayloadWhatsAppTemplateCategoryUpdated](docs/WebhookPayloadWhatsAppTemplateCategoryUpdated.md)
|
|
2313
2315
|
- [Zernio::WebhookPayloadWhatsAppTemplateCategoryUpdatedTemplate](docs/WebhookPayloadWhatsAppTemplateCategoryUpdatedTemplate.md)
|
|
2314
2316
|
- [Zernio::WebhookPayloadWhatsAppTemplateStatusUpdated](docs/WebhookPayloadWhatsAppTemplateStatusUpdated.md)
|
data/docs/GMBReviewsApi.md
CHANGED
|
@@ -235,7 +235,7 @@ end
|
|
|
235
235
|
|
|
236
236
|
Reply to a review
|
|
237
237
|
|
|
238
|
-
Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side).
|
|
238
|
+
Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side). Google keeps no history, so an automated retry silently replaces a reply someone edited by hand in the Google Business Profile UI. Read the review before retrying if a human may have answered it.
|
|
239
239
|
|
|
240
240
|
### Examples
|
|
241
241
|
|
data/docs/WebhookEventsApi.md
CHANGED
|
@@ -42,6 +42,7 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
42
42
|
| [**on_verification_approved**](WebhookEventsApi.md#on_verification_approved) | **POST** /verification.approved | Verification approved event |
|
|
43
43
|
| [**on_verification_failed**](WebhookEventsApi.md#on_verification_failed) | **POST** /verification.failed | Verification failed event |
|
|
44
44
|
| [**on_webhook_test**](WebhookEventsApi.md#on_webhook_test) | **POST** /webhook.test | Webhook test event |
|
|
45
|
+
| [**on_whats_app_account_name_status_updated**](WebhookEventsApi.md#on_whats_app_account_name_status_updated) | **POST** /whatsapp.account.name_status_updated | WhatsApp display-name review outcome event |
|
|
45
46
|
| [**on_whats_app_automatic_event**](WebhookEventsApi.md#on_whats_app_automatic_event) | **POST** /whatsapp.automatic_event | WhatsApp automatic event detected |
|
|
46
47
|
| [**on_whats_app_number_action_required**](WebhookEventsApi.md#on_whats_app_number_action_required) | **POST** /whatsapp.number.action_required | WhatsApp number action required event |
|
|
47
48
|
| [**on_whats_app_number_activated**](WebhookEventsApi.md#on_whats_app_number_activated) | **POST** /whatsapp.number.activated | WhatsApp number activated event |
|
|
@@ -2639,6 +2640,74 @@ nil (empty response body)
|
|
|
2639
2640
|
- **Accept**: Not defined
|
|
2640
2641
|
|
|
2641
2642
|
|
|
2643
|
+
## on_whats_app_account_name_status_updated
|
|
2644
|
+
|
|
2645
|
+
> on_whats_app_account_name_status_updated(webhook_payload_whats_app_account_name_status_updated)
|
|
2646
|
+
|
|
2647
|
+
WhatsApp display-name review outcome event
|
|
2648
|
+
|
|
2649
|
+
Fired when Meta finishes reviewing a WhatsApp Business display-name change. Forwarded from Meta's `phone_number_name_update` webhook field on the WhatsApp Business Account. Fires only on a review outcome (`name.status` APPROVED, DECLINED, or PENDING_REVIEW); a name applied without review reports `name_status: AVAILABLE_WITHOUT_REVIEW` on the phone node instead and produces no event here. `decision` REJECTED maps to DECLINED and DEFERRED maps to PENDING_REVIEW, matching the `name_status` vocabulary returned by `GET /v1/whatsapp/number-info`. Delivery is at-least-once; dedupe on `(account.accountId, name.status, name.requestedName)`.
|
|
2650
|
+
|
|
2651
|
+
### Examples
|
|
2652
|
+
|
|
2653
|
+
```ruby
|
|
2654
|
+
require 'time'
|
|
2655
|
+
require 'zernio-sdk'
|
|
2656
|
+
# setup authorization
|
|
2657
|
+
Zernio.configure do |config|
|
|
2658
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
2659
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
2660
|
+
end
|
|
2661
|
+
|
|
2662
|
+
api_instance = Zernio::WebhookEventsApi.new
|
|
2663
|
+
webhook_payload_whats_app_account_name_status_updated = # WebhookPayloadWhatsAppAccountNameStatusUpdated |
|
|
2664
|
+
|
|
2665
|
+
begin
|
|
2666
|
+
# WhatsApp display-name review outcome event
|
|
2667
|
+
api_instance.on_whats_app_account_name_status_updated(webhook_payload_whats_app_account_name_status_updated)
|
|
2668
|
+
rescue Zernio::ApiError => e
|
|
2669
|
+
puts "Error when calling WebhookEventsApi->on_whats_app_account_name_status_updated: #{e}"
|
|
2670
|
+
end
|
|
2671
|
+
```
|
|
2672
|
+
|
|
2673
|
+
#### Using the on_whats_app_account_name_status_updated_with_http_info variant
|
|
2674
|
+
|
|
2675
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
2676
|
+
|
|
2677
|
+
> <Array(nil, Integer, Hash)> on_whats_app_account_name_status_updated_with_http_info(webhook_payload_whats_app_account_name_status_updated)
|
|
2678
|
+
|
|
2679
|
+
```ruby
|
|
2680
|
+
begin
|
|
2681
|
+
# WhatsApp display-name review outcome event
|
|
2682
|
+
data, status_code, headers = api_instance.on_whats_app_account_name_status_updated_with_http_info(webhook_payload_whats_app_account_name_status_updated)
|
|
2683
|
+
p status_code # => 2xx
|
|
2684
|
+
p headers # => { ... }
|
|
2685
|
+
p data # => nil
|
|
2686
|
+
rescue Zernio::ApiError => e
|
|
2687
|
+
puts "Error when calling WebhookEventsApi->on_whats_app_account_name_status_updated_with_http_info: #{e}"
|
|
2688
|
+
end
|
|
2689
|
+
```
|
|
2690
|
+
|
|
2691
|
+
### Parameters
|
|
2692
|
+
|
|
2693
|
+
| Name | Type | Description | Notes |
|
|
2694
|
+
| ---- | ---- | ----------- | ----- |
|
|
2695
|
+
| **webhook_payload_whats_app_account_name_status_updated** | [**WebhookPayloadWhatsAppAccountNameStatusUpdated**](WebhookPayloadWhatsAppAccountNameStatusUpdated.md) | | |
|
|
2696
|
+
|
|
2697
|
+
### Return type
|
|
2698
|
+
|
|
2699
|
+
nil (empty response body)
|
|
2700
|
+
|
|
2701
|
+
### Authorization
|
|
2702
|
+
|
|
2703
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
2704
|
+
|
|
2705
|
+
### HTTP request headers
|
|
2706
|
+
|
|
2707
|
+
- **Content-Type**: application/json
|
|
2708
|
+
- **Accept**: Not defined
|
|
2709
|
+
|
|
2710
|
+
|
|
2642
2711
|
## on_whats_app_automatic_event
|
|
2643
2712
|
|
|
2644
2713
|
> on_whats_app_automatic_event(on_whats_app_automatic_event_request)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **id** | **String** | Stable webhook event ID | |
|
|
8
|
+
| **event** | **String** | | |
|
|
9
|
+
| **account** | [**WebhookPayloadWhatsAppTemplateStatusUpdatedAccount**](WebhookPayloadWhatsAppTemplateStatusUpdatedAccount.md) | | |
|
|
10
|
+
| **name** | [**WebhookPayloadWhatsAppAccountNameStatusUpdatedName**](WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md) | | |
|
|
11
|
+
| **timestamp** | **Time** | UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt. | |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'zernio-sdk'
|
|
17
|
+
|
|
18
|
+
instance = Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated.new(
|
|
19
|
+
id: null,
|
|
20
|
+
event: null,
|
|
21
|
+
account: null,
|
|
22
|
+
name: null,
|
|
23
|
+
timestamp: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **status** | **String** | Normalized from Meta's `decision` (REJECTED -> DECLINED, DEFERRED -> PENDING_REVIEW; the review is still open on DEFERRED, not a rejection). | |
|
|
8
|
+
| **requested_name** | **String** | The display name Meta reviewed. Null if Meta did not send one. | |
|
|
9
|
+
| **rejection_reason** | **String** | Meta's free-form decline reason. Null on approval, or when Meta sends the literal string \"NONE\". | |
|
|
10
|
+
| **display_phone_number** | **String** | The phone number this review is for, as Meta reported it. | |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName.new(
|
|
18
|
+
status: null,
|
|
19
|
+
requested_name: null,
|
|
20
|
+
rejection_reason: null,
|
|
21
|
+
display_phone_number: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
@@ -243,7 +243,7 @@ module Zernio
|
|
|
243
243
|
end
|
|
244
244
|
|
|
245
245
|
# Reply to a review
|
|
246
|
-
# Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side).
|
|
246
|
+
# Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side). Google keeps no history, so an automated retry silently replaces a reply someone edited by hand in the Google Business Profile UI. Read the review before retrying if a human may have answered it.
|
|
247
247
|
# @param account_id [String] The Zernio account ID (from /v1/accounts)
|
|
248
248
|
# @param review_id [String] The review ID portion (e.g. \"AIe9_BGx1234567890\"), not the full resource name
|
|
249
249
|
# @param reply_to_google_business_review_request [ReplyToGoogleBusinessReviewRequest]
|
|
@@ -255,7 +255,7 @@ module Zernio
|
|
|
255
255
|
end
|
|
256
256
|
|
|
257
257
|
# Reply to a review
|
|
258
|
-
# Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side).
|
|
258
|
+
# Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side). Google keeps no history, so an automated retry silently replaces a reply someone edited by hand in the Google Business Profile UI. Read the review before retrying if a human may have answered it.
|
|
259
259
|
# @param account_id [String] The Zernio account ID (from /v1/accounts)
|
|
260
260
|
# @param review_id [String] The review ID portion (e.g. \"AIe9_BGx1234567890\"), not the full resource name
|
|
261
261
|
# @param reply_to_google_business_review_request [ReplyToGoogleBusinessReviewRequest]
|
|
@@ -2527,6 +2527,72 @@ module Zernio
|
|
|
2527
2527
|
return data, status_code, headers
|
|
2528
2528
|
end
|
|
2529
2529
|
|
|
2530
|
+
# WhatsApp display-name review outcome event
|
|
2531
|
+
# Fired when Meta finishes reviewing a WhatsApp Business display-name change. Forwarded from Meta's `phone_number_name_update` webhook field on the WhatsApp Business Account. Fires only on a review outcome (`name.status` APPROVED, DECLINED, or PENDING_REVIEW); a name applied without review reports `name_status: AVAILABLE_WITHOUT_REVIEW` on the phone node instead and produces no event here. `decision` REJECTED maps to DECLINED and DEFERRED maps to PENDING_REVIEW, matching the `name_status` vocabulary returned by `GET /v1/whatsapp/number-info`. Delivery is at-least-once; dedupe on `(account.accountId, name.status, name.requestedName)`.
|
|
2532
|
+
# @param webhook_payload_whats_app_account_name_status_updated [WebhookPayloadWhatsAppAccountNameStatusUpdated]
|
|
2533
|
+
# @param [Hash] opts the optional parameters
|
|
2534
|
+
# @return [nil]
|
|
2535
|
+
def on_whats_app_account_name_status_updated(webhook_payload_whats_app_account_name_status_updated, opts = {})
|
|
2536
|
+
on_whats_app_account_name_status_updated_with_http_info(webhook_payload_whats_app_account_name_status_updated, opts)
|
|
2537
|
+
nil
|
|
2538
|
+
end
|
|
2539
|
+
|
|
2540
|
+
# WhatsApp display-name review outcome event
|
|
2541
|
+
# Fired when Meta finishes reviewing a WhatsApp Business display-name change. Forwarded from Meta's `phone_number_name_update` webhook field on the WhatsApp Business Account. Fires only on a review outcome (`name.status` APPROVED, DECLINED, or PENDING_REVIEW); a name applied without review reports `name_status: AVAILABLE_WITHOUT_REVIEW` on the phone node instead and produces no event here. `decision` REJECTED maps to DECLINED and DEFERRED maps to PENDING_REVIEW, matching the `name_status` vocabulary returned by `GET /v1/whatsapp/number-info`. Delivery is at-least-once; dedupe on `(account.accountId, name.status, name.requestedName)`.
|
|
2542
|
+
# @param webhook_payload_whats_app_account_name_status_updated [WebhookPayloadWhatsAppAccountNameStatusUpdated]
|
|
2543
|
+
# @param [Hash] opts the optional parameters
|
|
2544
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
2545
|
+
def on_whats_app_account_name_status_updated_with_http_info(webhook_payload_whats_app_account_name_status_updated, opts = {})
|
|
2546
|
+
if @api_client.config.debugging
|
|
2547
|
+
@api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_whats_app_account_name_status_updated ...'
|
|
2548
|
+
end
|
|
2549
|
+
# verify the required parameter 'webhook_payload_whats_app_account_name_status_updated' is set
|
|
2550
|
+
if @api_client.config.client_side_validation && webhook_payload_whats_app_account_name_status_updated.nil?
|
|
2551
|
+
fail ArgumentError, "Missing the required parameter 'webhook_payload_whats_app_account_name_status_updated' when calling WebhookEventsApi.on_whats_app_account_name_status_updated"
|
|
2552
|
+
end
|
|
2553
|
+
# resource path
|
|
2554
|
+
local_var_path = '/whatsapp.account.name_status_updated'
|
|
2555
|
+
|
|
2556
|
+
# query parameters
|
|
2557
|
+
query_params = opts[:query_params] || {}
|
|
2558
|
+
|
|
2559
|
+
# header parameters
|
|
2560
|
+
header_params = opts[:header_params] || {}
|
|
2561
|
+
# HTTP header 'Content-Type'
|
|
2562
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
2563
|
+
if !content_type.nil?
|
|
2564
|
+
header_params['Content-Type'] = content_type
|
|
2565
|
+
end
|
|
2566
|
+
|
|
2567
|
+
# form parameters
|
|
2568
|
+
form_params = opts[:form_params] || {}
|
|
2569
|
+
|
|
2570
|
+
# http body (model)
|
|
2571
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_whats_app_account_name_status_updated)
|
|
2572
|
+
|
|
2573
|
+
# return_type
|
|
2574
|
+
return_type = opts[:debug_return_type]
|
|
2575
|
+
|
|
2576
|
+
# auth_names
|
|
2577
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
2578
|
+
|
|
2579
|
+
new_options = opts.merge(
|
|
2580
|
+
:operation => :"WebhookEventsApi.on_whats_app_account_name_status_updated",
|
|
2581
|
+
:header_params => header_params,
|
|
2582
|
+
:query_params => query_params,
|
|
2583
|
+
:form_params => form_params,
|
|
2584
|
+
:body => post_body,
|
|
2585
|
+
:auth_names => auth_names,
|
|
2586
|
+
:return_type => return_type
|
|
2587
|
+
)
|
|
2588
|
+
|
|
2589
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
2590
|
+
if @api_client.config.debugging
|
|
2591
|
+
@api_client.config.logger.debug "API called: WebhookEventsApi#on_whats_app_account_name_status_updated\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
2592
|
+
end
|
|
2593
|
+
return data, status_code, headers
|
|
2594
|
+
end
|
|
2595
|
+
|
|
2530
2596
|
# WhatsApp automatic event detected
|
|
2531
2597
|
# Fired when Meta's automatic event identification (opt-in during Embedded Signup; not available for EU/UK/JP businesses) detects a lead or purchase in a Click-to-WhatsApp conversation. Branch on `eventName` (`LeadSubmitted` | `Purchase`). Carries the `ctwa_clid` even on coexistence numbers where the inbound referral omits it (this webhook is the only surface that delivers it there); the clid is also written back onto the conversation, so POST /v1/whatsapp/conversions becomes usable for the thread.
|
|
2532
2598
|
# @param on_whats_app_automatic_event_request [OnWhatsAppAutomaticEventRequest]
|
|
@@ -0,0 +1,295 @@
|
|
|
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
|
+
# Webhook payload for the `whatsapp.account.name_status_updated` event. Fired when Meta finishes reviewing a WhatsApp display-name change on a connected number. Maps Meta's `phone_number_name_update` WABA webhook field onto our event envelope. Fires only for a review outcome (APPROVED, DECLINED, PENDING_REVIEW); a name applied without review reports `name_status: AVAILABLE_WITHOUT_REVIEW` on the phone node instead, and Meta never sends this webhook field for that case.
|
|
18
|
+
class WebhookPayloadWhatsAppAccountNameStatusUpdated < ApiModelBase
|
|
19
|
+
# Stable webhook event ID
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
attr_accessor :event
|
|
23
|
+
|
|
24
|
+
attr_accessor :account
|
|
25
|
+
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
# UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
|
|
29
|
+
attr_accessor :timestamp
|
|
30
|
+
|
|
31
|
+
class EnumAttributeValidator
|
|
32
|
+
attr_reader :datatype
|
|
33
|
+
attr_reader :allowable_values
|
|
34
|
+
|
|
35
|
+
def initialize(datatype, allowable_values)
|
|
36
|
+
@allowable_values = allowable_values.map do |value|
|
|
37
|
+
case datatype.to_s
|
|
38
|
+
when /Integer/i
|
|
39
|
+
value.to_i
|
|
40
|
+
when /Float/i
|
|
41
|
+
value.to_f
|
|
42
|
+
else
|
|
43
|
+
value
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def valid?(value)
|
|
49
|
+
!value || allowable_values.include?(value)
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
54
|
+
def self.attribute_map
|
|
55
|
+
{
|
|
56
|
+
:'id' => :'id',
|
|
57
|
+
:'event' => :'event',
|
|
58
|
+
:'account' => :'account',
|
|
59
|
+
:'name' => :'name',
|
|
60
|
+
:'timestamp' => :'timestamp'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Returns attribute mapping this model knows about
|
|
65
|
+
def self.acceptable_attribute_map
|
|
66
|
+
attribute_map
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Returns all the JSON keys this model knows about
|
|
70
|
+
def self.acceptable_attributes
|
|
71
|
+
acceptable_attribute_map.values
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Attribute type mapping.
|
|
75
|
+
def self.openapi_types
|
|
76
|
+
{
|
|
77
|
+
:'id' => :'String',
|
|
78
|
+
:'event' => :'String',
|
|
79
|
+
:'account' => :'WebhookPayloadWhatsAppTemplateStatusUpdatedAccount',
|
|
80
|
+
:'name' => :'WebhookPayloadWhatsAppAccountNameStatusUpdatedName',
|
|
81
|
+
:'timestamp' => :'Time'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# List of attributes with nullable: true
|
|
86
|
+
def self.openapi_nullable
|
|
87
|
+
Set.new([
|
|
88
|
+
])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
def initialize(attributes = {})
|
|
94
|
+
if (!attributes.is_a?(Hash))
|
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated` initialize method"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
99
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
100
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
101
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
102
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
103
|
+
end
|
|
104
|
+
h[k.to_sym] = v
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'id')
|
|
108
|
+
self.id = attributes[:'id']
|
|
109
|
+
else
|
|
110
|
+
self.id = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'event')
|
|
114
|
+
self.event = attributes[:'event']
|
|
115
|
+
else
|
|
116
|
+
self.event = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'account')
|
|
120
|
+
self.account = attributes[:'account']
|
|
121
|
+
else
|
|
122
|
+
self.account = nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'name')
|
|
126
|
+
self.name = attributes[:'name']
|
|
127
|
+
else
|
|
128
|
+
self.name = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'timestamp')
|
|
132
|
+
self.timestamp = attributes[:'timestamp']
|
|
133
|
+
else
|
|
134
|
+
self.timestamp = nil
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
139
|
+
# @return Array for valid properties with the reasons
|
|
140
|
+
def list_invalid_properties
|
|
141
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
142
|
+
invalid_properties = Array.new
|
|
143
|
+
if @id.nil?
|
|
144
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if @event.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "event", event cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @account.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "account", account cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if @name.nil?
|
|
156
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @timestamp.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "timestamp", timestamp cannot be nil.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
invalid_properties
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Check to see if the all the properties in the model are valid
|
|
167
|
+
# @return true if the model is valid
|
|
168
|
+
def valid?
|
|
169
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
170
|
+
return false if @id.nil?
|
|
171
|
+
return false if @event.nil?
|
|
172
|
+
event_validator = EnumAttributeValidator.new('String', ["whatsapp.account.name_status_updated"])
|
|
173
|
+
return false unless event_validator.valid?(@event)
|
|
174
|
+
return false if @account.nil?
|
|
175
|
+
return false if @name.nil?
|
|
176
|
+
return false if @timestamp.nil?
|
|
177
|
+
true
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Custom attribute writer method with validation
|
|
181
|
+
# @param [Object] id Value to be assigned
|
|
182
|
+
def id=(id)
|
|
183
|
+
if id.nil?
|
|
184
|
+
fail ArgumentError, 'id cannot be nil'
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
@id = id
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
191
|
+
# @param [Object] event Object to be assigned
|
|
192
|
+
def event=(event)
|
|
193
|
+
validator = EnumAttributeValidator.new('String', ["whatsapp.account.name_status_updated"])
|
|
194
|
+
unless validator.valid?(event)
|
|
195
|
+
fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
|
|
196
|
+
end
|
|
197
|
+
@event = event
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Custom attribute writer method with validation
|
|
201
|
+
# @param [Object] account Value to be assigned
|
|
202
|
+
def account=(account)
|
|
203
|
+
if account.nil?
|
|
204
|
+
fail ArgumentError, 'account cannot be nil'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
@account = account
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Custom attribute writer method with validation
|
|
211
|
+
# @param [Object] name Value to be assigned
|
|
212
|
+
def name=(name)
|
|
213
|
+
if name.nil?
|
|
214
|
+
fail ArgumentError, 'name cannot be nil'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@name = name
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method with validation
|
|
221
|
+
# @param [Object] timestamp Value to be assigned
|
|
222
|
+
def timestamp=(timestamp)
|
|
223
|
+
if timestamp.nil?
|
|
224
|
+
fail ArgumentError, 'timestamp cannot be nil'
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@timestamp = timestamp
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Checks equality by comparing each attribute.
|
|
231
|
+
# @param [Object] Object to be compared
|
|
232
|
+
def ==(o)
|
|
233
|
+
return true if self.equal?(o)
|
|
234
|
+
self.class == o.class &&
|
|
235
|
+
id == o.id &&
|
|
236
|
+
event == o.event &&
|
|
237
|
+
account == o.account &&
|
|
238
|
+
name == o.name &&
|
|
239
|
+
timestamp == o.timestamp
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# @see the `==` method
|
|
243
|
+
# @param [Object] Object to be compared
|
|
244
|
+
def eql?(o)
|
|
245
|
+
self == o
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Calculates hash code according to all attributes.
|
|
249
|
+
# @return [Integer] Hash code
|
|
250
|
+
def hash
|
|
251
|
+
[id, event, account, name, timestamp].hash
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Builds the object from hash
|
|
255
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
256
|
+
# @return [Object] Returns the model itself
|
|
257
|
+
def self.build_from_hash(attributes)
|
|
258
|
+
return nil unless attributes.is_a?(Hash)
|
|
259
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
260
|
+
transformed_hash = {}
|
|
261
|
+
openapi_types.each_pair do |key, type|
|
|
262
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
263
|
+
transformed_hash["#{key}"] = nil
|
|
264
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
265
|
+
# check to ensure the input is an array given that the attribute
|
|
266
|
+
# is documented as an array but the input is not
|
|
267
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
268
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
269
|
+
end
|
|
270
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
271
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
new(transformed_hash)
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Returns the object in the form of hash
|
|
278
|
+
# @return [Hash] Returns the object in the form of hash
|
|
279
|
+
def to_hash
|
|
280
|
+
hash = {}
|
|
281
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
282
|
+
value = self.send(attr)
|
|
283
|
+
if value.nil?
|
|
284
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
285
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
hash[param] = _to_hash(value)
|
|
289
|
+
end
|
|
290
|
+
hash
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
end
|
|
@@ -0,0 +1,228 @@
|
|
|
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 WebhookPayloadWhatsAppAccountNameStatusUpdatedName < ApiModelBase
|
|
18
|
+
# Normalized from Meta's `decision` (REJECTED -> DECLINED, DEFERRED -> PENDING_REVIEW; the review is still open on DEFERRED, not a rejection).
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
|
|
21
|
+
# The display name Meta reviewed. Null if Meta did not send one.
|
|
22
|
+
attr_accessor :requested_name
|
|
23
|
+
|
|
24
|
+
# Meta's free-form decline reason. Null on approval, or when Meta sends the literal string \"NONE\".
|
|
25
|
+
attr_accessor :rejection_reason
|
|
26
|
+
|
|
27
|
+
# The phone number this review is for, as Meta reported it.
|
|
28
|
+
attr_accessor :display_phone_number
|
|
29
|
+
|
|
30
|
+
class EnumAttributeValidator
|
|
31
|
+
attr_reader :datatype
|
|
32
|
+
attr_reader :allowable_values
|
|
33
|
+
|
|
34
|
+
def initialize(datatype, allowable_values)
|
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
|
36
|
+
case datatype.to_s
|
|
37
|
+
when /Integer/i
|
|
38
|
+
value.to_i
|
|
39
|
+
when /Float/i
|
|
40
|
+
value.to_f
|
|
41
|
+
else
|
|
42
|
+
value
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def valid?(value)
|
|
48
|
+
!value || allowable_values.include?(value)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
53
|
+
def self.attribute_map
|
|
54
|
+
{
|
|
55
|
+
:'status' => :'status',
|
|
56
|
+
:'requested_name' => :'requestedName',
|
|
57
|
+
:'rejection_reason' => :'rejectionReason',
|
|
58
|
+
:'display_phone_number' => :'displayPhoneNumber'
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns attribute mapping this model knows about
|
|
63
|
+
def self.acceptable_attribute_map
|
|
64
|
+
attribute_map
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Returns all the JSON keys this model knows about
|
|
68
|
+
def self.acceptable_attributes
|
|
69
|
+
acceptable_attribute_map.values
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Attribute type mapping.
|
|
73
|
+
def self.openapi_types
|
|
74
|
+
{
|
|
75
|
+
:'status' => :'String',
|
|
76
|
+
:'requested_name' => :'String',
|
|
77
|
+
:'rejection_reason' => :'String',
|
|
78
|
+
:'display_phone_number' => :'String'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List of attributes with nullable: true
|
|
83
|
+
def self.openapi_nullable
|
|
84
|
+
Set.new([
|
|
85
|
+
:'requested_name',
|
|
86
|
+
:'rejection_reason',
|
|
87
|
+
:'display_phone_number'
|
|
88
|
+
])
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Initializes the object
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
def initialize(attributes = {})
|
|
94
|
+
if (!attributes.is_a?(Hash))
|
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName` initialize method"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
99
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
100
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
101
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
102
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
103
|
+
end
|
|
104
|
+
h[k.to_sym] = v
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'status')
|
|
108
|
+
self.status = attributes[:'status']
|
|
109
|
+
else
|
|
110
|
+
self.status = nil
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'requested_name')
|
|
114
|
+
self.requested_name = attributes[:'requested_name']
|
|
115
|
+
else
|
|
116
|
+
self.requested_name = nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'rejection_reason')
|
|
120
|
+
self.rejection_reason = attributes[:'rejection_reason']
|
|
121
|
+
else
|
|
122
|
+
self.rejection_reason = nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'display_phone_number')
|
|
126
|
+
self.display_phone_number = attributes[:'display_phone_number']
|
|
127
|
+
else
|
|
128
|
+
self.display_phone_number = nil
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
133
|
+
# @return Array for valid properties with the reasons
|
|
134
|
+
def list_invalid_properties
|
|
135
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
136
|
+
invalid_properties = Array.new
|
|
137
|
+
if @status.nil?
|
|
138
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
invalid_properties
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Check to see if the all the properties in the model are valid
|
|
145
|
+
# @return true if the model is valid
|
|
146
|
+
def valid?
|
|
147
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
148
|
+
return false if @status.nil?
|
|
149
|
+
status_validator = EnumAttributeValidator.new('String', ["APPROVED", "DECLINED", "PENDING_REVIEW"])
|
|
150
|
+
return false unless status_validator.valid?(@status)
|
|
151
|
+
true
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
155
|
+
# @param [Object] status Object to be assigned
|
|
156
|
+
def status=(status)
|
|
157
|
+
validator = EnumAttributeValidator.new('String', ["APPROVED", "DECLINED", "PENDING_REVIEW"])
|
|
158
|
+
unless validator.valid?(status)
|
|
159
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
160
|
+
end
|
|
161
|
+
@status = status
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Checks equality by comparing each attribute.
|
|
165
|
+
# @param [Object] Object to be compared
|
|
166
|
+
def ==(o)
|
|
167
|
+
return true if self.equal?(o)
|
|
168
|
+
self.class == o.class &&
|
|
169
|
+
status == o.status &&
|
|
170
|
+
requested_name == o.requested_name &&
|
|
171
|
+
rejection_reason == o.rejection_reason &&
|
|
172
|
+
display_phone_number == o.display_phone_number
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# @see the `==` method
|
|
176
|
+
# @param [Object] Object to be compared
|
|
177
|
+
def eql?(o)
|
|
178
|
+
self == o
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Calculates hash code according to all attributes.
|
|
182
|
+
# @return [Integer] Hash code
|
|
183
|
+
def hash
|
|
184
|
+
[status, requested_name, rejection_reason, display_phone_number].hash
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Builds the object from hash
|
|
188
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
189
|
+
# @return [Object] Returns the model itself
|
|
190
|
+
def self.build_from_hash(attributes)
|
|
191
|
+
return nil unless attributes.is_a?(Hash)
|
|
192
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
193
|
+
transformed_hash = {}
|
|
194
|
+
openapi_types.each_pair do |key, type|
|
|
195
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
196
|
+
transformed_hash["#{key}"] = nil
|
|
197
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
198
|
+
# check to ensure the input is an array given that the attribute
|
|
199
|
+
# is documented as an array but the input is not
|
|
200
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
201
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
202
|
+
end
|
|
203
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
204
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
new(transformed_hash)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Returns the object in the form of hash
|
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
|
212
|
+
def to_hash
|
|
213
|
+
hash = {}
|
|
214
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
215
|
+
value = self.send(attr)
|
|
216
|
+
if value.nil?
|
|
217
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
218
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
hash[param] = _to_hash(value)
|
|
222
|
+
end
|
|
223
|
+
hash
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1665,6 +1665,8 @@ require 'zernio-sdk/models/webhook_payload_review_new'
|
|
|
1665
1665
|
require 'zernio-sdk/models/webhook_payload_review_new_account'
|
|
1666
1666
|
require 'zernio-sdk/models/webhook_payload_review_updated'
|
|
1667
1667
|
require 'zernio-sdk/models/webhook_payload_test'
|
|
1668
|
+
require 'zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated'
|
|
1669
|
+
require 'zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated_name'
|
|
1668
1670
|
require 'zernio-sdk/models/webhook_payload_whats_app_template_category_updated'
|
|
1669
1671
|
require 'zernio-sdk/models/webhook_payload_whats_app_template_category_updated_template'
|
|
1670
1672
|
require 'zernio-sdk/models/webhook_payload_whats_app_template_status_updated'
|
data/openapi.yaml
CHANGED
|
@@ -176,6 +176,7 @@ x-documentation:
|
|
|
176
176
|
- `ad.status_changed` - Ad, ad set, or campaign changed status on the ad platform (Meta: `in_process_ad_objects` entry/exit and `with_issues_ad_objects` violations)
|
|
177
177
|
- `whatsapp.template.status_updated` - WhatsApp Business template completed (re)review by Meta. `template.status` carries the new state (APPROVED, REJECTED, PENDING, PAUSED, DISABLED, IN_APPEAL, PENDING_DELETION); `template.reason` is Meta's free-form reason or "NONE".
|
|
178
178
|
- `whatsapp.template.category_updated` - Meta reclassified a WhatsApp Business template's category (drives tariff and marketing opt-out applicability). `template.changeType` is `scheduled` (24h advance notice) or `applied`; `template.category` is always the category right now.
|
|
179
|
+
- `whatsapp.account.name_status_updated` - Meta finished reviewing a WhatsApp display-name change. `name.status` carries the outcome (APPROVED, DECLINED, PENDING_REVIEW). Fires only on a review outcome; a name applied without review (`name_status: AVAILABLE_WITHOUT_REVIEW`) produces no event.
|
|
179
180
|
- `call.received` - An inbound call (phone/PSTN or WhatsApp) reached one of your numbers and was routed to its destination
|
|
180
181
|
- `call.ended` - A call ended; carries duration, end reason, cost breakdown, and the recording when enabled
|
|
181
182
|
- `call.failed` - A call failed with a hard error before or during bridging
|
|
@@ -429,10 +430,10 @@ tags:
|
|
|
429
430
|
- name: Webhooks
|
|
430
431
|
description: |
|
|
431
432
|
Configure webhooks for real-time notifications. Webhooks can be created from the dashboard (Settings → Webhooks) or via this API.
|
|
432
|
-
Events: post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed, webhook.test.
|
|
433
|
+
Events: post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed, webhook.test.
|
|
433
434
|
Security: optional HMAC-SHA256 signature in X-Zernio-Signature header. Configure a secret key to enable verification. Custom headers supported.
|
|
434
435
|
|
|
435
|
-
Resource groups. Every event belongs to one group: post.* to publishing, message.*, reaction.*, conversation.*, call.* and whatsapp.automatic_event to messages, comment.* and review.* to engagement, lead.* to contacts, ad.* to ads, account.* and whatsapp.
|
|
436
|
+
Resource groups. Every event belongs to one group: post.* to publishing, message.*, reaction.*, conversation.*, call.* and whatsapp.automatic_event to messages, comment.* and review.* to engagement, lead.* to contacts, ad.* to ads, account.*, whatsapp.template.* and whatsapp.account.* to accounts, whatsapp.number.* and verification.* to telephony, webhook.test to webhooks. Two independent controls use that mapping. (1) A restricted (zrk_) API key can only subscribe to, test-fire, redeliver, or read delivery logs for events in the groups it holds, so it can never create a subscription broader than itself. (2) Each subscription carries its own `disabledResourceGroups` denylist: events in a disabled group are dropped before delivery to that endpoint, on live delivery and on every replay path, no matter which key or session created the subscription. Changing that denylist applies to every event emitted after the change; events already queued when it landed can still be delivered for up to five minutes after they were enqueued, because the delivery worker trusts a five-minute enqueue-time snapshot before re-checking. Absent or empty on a subscription means it receives everything it subscribes to, which is the behavior of every subscription created before the field existed.
|
|
436
437
|
- name: Webhook Events
|
|
437
438
|
description: |
|
|
438
439
|
Incoming webhook deliveries sent by Zernio to your configured endpoint URL.
|
|
@@ -2399,7 +2400,7 @@ components:
|
|
|
2399
2400
|
type: array
|
|
2400
2401
|
items:
|
|
2401
2402
|
type: string
|
|
2402
|
-
enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
|
|
2403
|
+
enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
|
|
2403
2404
|
description: Events subscribed to
|
|
2404
2405
|
isActive:
|
|
2405
2406
|
type: boolean
|
|
@@ -4601,6 +4602,54 @@ components:
|
|
|
4601
4602
|
type: string
|
|
4602
4603
|
format: date-time
|
|
4603
4604
|
description: 'UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.'
|
|
4605
|
+
WebhookPayloadWhatsAppAccountNameStatusUpdated:
|
|
4606
|
+
type: object
|
|
4607
|
+
description: |
|
|
4608
|
+
Webhook payload for the `whatsapp.account.name_status_updated` event.
|
|
4609
|
+
Fired when Meta finishes reviewing a WhatsApp display-name change on a
|
|
4610
|
+
connected number. Maps Meta's `phone_number_name_update` WABA webhook
|
|
4611
|
+
field onto our event envelope. Fires only for a review outcome
|
|
4612
|
+
(APPROVED, DECLINED, PENDING_REVIEW); a name applied without review
|
|
4613
|
+
reports `name_status: AVAILABLE_WITHOUT_REVIEW` on the phone node
|
|
4614
|
+
instead, and Meta never sends this webhook field for that case.
|
|
4615
|
+
required: [id, event, account, name, timestamp]
|
|
4616
|
+
properties:
|
|
4617
|
+
id:
|
|
4618
|
+
type: string
|
|
4619
|
+
description: Stable webhook event ID
|
|
4620
|
+
event:
|
|
4621
|
+
type: string
|
|
4622
|
+
enum: [whatsapp.account.name_status_updated]
|
|
4623
|
+
account:
|
|
4624
|
+
type: object
|
|
4625
|
+
required: [accountId, profileId, platform, username]
|
|
4626
|
+
properties:
|
|
4627
|
+
accountId: { type: string }
|
|
4628
|
+
profileId: { type: string }
|
|
4629
|
+
platform: { type: string, enum: [whatsapp] }
|
|
4630
|
+
username: { type: string }
|
|
4631
|
+
displayName: { type: string }
|
|
4632
|
+
name:
|
|
4633
|
+
type: object
|
|
4634
|
+
required: [status, requestedName, rejectionReason, displayPhoneNumber]
|
|
4635
|
+
properties:
|
|
4636
|
+
status:
|
|
4637
|
+
type: string
|
|
4638
|
+
enum: [APPROVED, DECLINED, PENDING_REVIEW]
|
|
4639
|
+
description: 'Normalized from Meta''s `decision` (REJECTED -> DECLINED, DEFERRED -> PENDING_REVIEW; the review is still open on DEFERRED, not a rejection).'
|
|
4640
|
+
requestedName:
|
|
4641
|
+
type: [string, "null"]
|
|
4642
|
+
description: The display name Meta reviewed. Null if Meta did not send one.
|
|
4643
|
+
rejectionReason:
|
|
4644
|
+
type: [string, "null"]
|
|
4645
|
+
description: 'Meta''s free-form decline reason. Null on approval, or when Meta sends the literal string "NONE".'
|
|
4646
|
+
displayPhoneNumber:
|
|
4647
|
+
type: [string, "null"]
|
|
4648
|
+
description: 'The phone number this review is for, as Meta reported it.'
|
|
4649
|
+
timestamp:
|
|
4650
|
+
type: string
|
|
4651
|
+
format: date-time
|
|
4652
|
+
description: 'UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.'
|
|
4604
4653
|
WebhookPayloadTest:
|
|
4605
4654
|
type: object
|
|
4606
4655
|
description: Webhook payload for test deliveries
|
|
@@ -9589,6 +9638,31 @@ webhooks:
|
|
|
9589
9638
|
responses:
|
|
9590
9639
|
'200':
|
|
9591
9640
|
description: Webhook received successfully
|
|
9641
|
+
whatsapp.account.name_status_updated:
|
|
9642
|
+
post:
|
|
9643
|
+
operationId: onWhatsAppAccountNameStatusUpdated
|
|
9644
|
+
summary: WhatsApp display-name review outcome event
|
|
9645
|
+
description: |
|
|
9646
|
+
Fired when Meta finishes reviewing a WhatsApp Business display-name
|
|
9647
|
+
change. Forwarded from Meta's `phone_number_name_update` webhook
|
|
9648
|
+
field on the WhatsApp Business Account. Fires only on a review
|
|
9649
|
+
outcome (`name.status` APPROVED, DECLINED, or PENDING_REVIEW); a name
|
|
9650
|
+
applied without review reports `name_status:
|
|
9651
|
+
AVAILABLE_WITHOUT_REVIEW` on the phone node instead and produces no
|
|
9652
|
+
event here. `decision` REJECTED maps to DECLINED and DEFERRED maps to
|
|
9653
|
+
PENDING_REVIEW, matching the `name_status` vocabulary returned by
|
|
9654
|
+
`GET /v1/whatsapp/number-info`. Delivery is at-least-once; dedupe on
|
|
9655
|
+
`(account.accountId, name.status, name.requestedName)`.
|
|
9656
|
+
tags: [Webhook Events]
|
|
9657
|
+
requestBody:
|
|
9658
|
+
required: true
|
|
9659
|
+
content:
|
|
9660
|
+
application/json:
|
|
9661
|
+
schema:
|
|
9662
|
+
$ref: '#/components/schemas/WebhookPayloadWhatsAppAccountNameStatusUpdated'
|
|
9663
|
+
responses:
|
|
9664
|
+
'200':
|
|
9665
|
+
description: Webhook received successfully
|
|
9592
9666
|
whatsapp.automatic_event:
|
|
9593
9667
|
post:
|
|
9594
9668
|
operationId: onWhatsAppAutomaticEvent
|
|
@@ -19681,6 +19755,8 @@ paths:
|
|
|
19681
19755
|
Posts (or updates) the business owner reply to a Google Business review.
|
|
19682
19756
|
The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations).
|
|
19683
19757
|
Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side).
|
|
19758
|
+
Google keeps no history, so an automated retry silently replaces a reply someone edited by hand in the Google Business Profile UI.
|
|
19759
|
+
Read the review before retrying if a human may have answered it.
|
|
19684
19760
|
parameters:
|
|
19685
19761
|
- name: accountId
|
|
19686
19762
|
in: path
|
|
@@ -24485,7 +24561,7 @@ paths:
|
|
|
24485
24561
|
minItems: 1
|
|
24486
24562
|
items:
|
|
24487
24563
|
type: string
|
|
24488
|
-
enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
|
|
24564
|
+
enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
|
|
24489
24565
|
description: Events to subscribe to (at least one required)
|
|
24490
24566
|
isActive:
|
|
24491
24567
|
type: boolean
|
|
@@ -24604,7 +24680,7 @@ paths:
|
|
|
24604
24680
|
minItems: 1
|
|
24605
24681
|
items:
|
|
24606
24682
|
type: string
|
|
24607
|
-
enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
|
|
24683
|
+
enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
|
|
24608
24684
|
description: Events to subscribe to. Must contain at least one event if provided.
|
|
24609
24685
|
isActive:
|
|
24610
24686
|
type: boolean
|
|
@@ -75,7 +75,7 @@ describe 'GMBReviewsApi' do
|
|
|
75
75
|
|
|
76
76
|
# unit tests for reply_to_google_business_review
|
|
77
77
|
# Reply to a review
|
|
78
|
-
# Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side).
|
|
78
|
+
# Posts (or updates) the business owner reply to a Google Business review. The reply is associated with the account's currently selected location (set via /v1/accounts/{accountId}/gmb-locations). Calling this endpoint a second time on the same review overwrites the previous reply (PUT semantics on Google's side). Google keeps no history, so an automated retry silently replaces a reply someone edited by hand in the Google Business Profile UI. Read the review before retrying if a human may have answered it.
|
|
79
79
|
# @param account_id The Zernio account ID (from /v1/accounts)
|
|
80
80
|
# @param review_id The review ID portion (e.g. \"AIe9_BGx1234567890\"), not the full resource name
|
|
81
81
|
# @param reply_to_google_business_review_request
|
|
@@ -48,7 +48,7 @@ describe Zernio::CreateWebhookSettingsRequest do
|
|
|
48
48
|
describe 'test attribute "events"' do
|
|
49
49
|
it 'should work' do
|
|
50
50
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
51
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
52
52
|
# validator.allowable_values.each do |value|
|
|
53
53
|
# expect { instance.events = value }.not_to raise_error
|
|
54
54
|
# end
|
|
@@ -54,7 +54,7 @@ describe Zernio::UpdateWebhookSettingsRequest do
|
|
|
54
54
|
describe 'test attribute "events"' do
|
|
55
55
|
it 'should work' do
|
|
56
56
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
57
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
58
58
|
# validator.allowable_values.each do |value|
|
|
59
59
|
# expect { instance.events = value }.not_to raise_error
|
|
60
60
|
# end
|
|
@@ -0,0 +1,58 @@
|
|
|
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::WebhookPayloadWhatsAppAccountNameStatusUpdatedName
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName do
|
|
21
|
+
#let(:instance) { Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of WebhookPayloadWhatsAppAccountNameStatusUpdatedName' do
|
|
24
|
+
it 'should create an instance of WebhookPayloadWhatsAppAccountNameStatusUpdatedName' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "status"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["APPROVED", "DECLINED", "PENDING_REVIEW"])
|
|
34
|
+
# validator.allowable_values.each do |value|
|
|
35
|
+
# expect { instance.status = value }.not_to raise_error
|
|
36
|
+
# end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "requested_name"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "rejection_reason"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "display_phone_number"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
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::WebhookPayloadWhatsAppAccountNameStatusUpdated
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated do
|
|
21
|
+
#let(:instance) { Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of WebhookPayloadWhatsAppAccountNameStatusUpdated' do
|
|
24
|
+
it 'should create an instance of WebhookPayloadWhatsAppAccountNameStatusUpdated' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "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"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["whatsapp.account.name_status_updated"])
|
|
40
|
+
# validator.allowable_values.each do |value|
|
|
41
|
+
# expect { instance.event = value }.not_to raise_error
|
|
42
|
+
# end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "account"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "name"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "timestamp"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
end
|
data/spec/models/webhook_spec.rb
CHANGED
|
@@ -54,7 +54,7 @@ describe Zernio::Webhook do
|
|
|
54
54
|
describe 'test attribute "events"' do
|
|
55
55
|
it 'should work' do
|
|
56
56
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
57
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
|
|
58
58
|
# validator.allowable_values.each do |value|
|
|
59
59
|
# expect { instance.events = value }.not_to raise_error
|
|
60
60
|
# end
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: late-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.747
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI-Generator
|
|
@@ -1773,6 +1773,8 @@ files:
|
|
|
1773
1773
|
- docs/WebhookPayloadReviewNewAccount.md
|
|
1774
1774
|
- docs/WebhookPayloadReviewUpdated.md
|
|
1775
1775
|
- docs/WebhookPayloadTest.md
|
|
1776
|
+
- docs/WebhookPayloadWhatsAppAccountNameStatusUpdated.md
|
|
1777
|
+
- docs/WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md
|
|
1776
1778
|
- docs/WebhookPayloadWhatsAppTemplateCategoryUpdated.md
|
|
1777
1779
|
- docs/WebhookPayloadWhatsAppTemplateCategoryUpdatedTemplate.md
|
|
1778
1780
|
- docs/WebhookPayloadWhatsAppTemplateStatusUpdated.md
|
|
@@ -3568,6 +3570,8 @@ files:
|
|
|
3568
3570
|
- lib/zernio-sdk/models/webhook_payload_review_new_account.rb
|
|
3569
3571
|
- lib/zernio-sdk/models/webhook_payload_review_updated.rb
|
|
3570
3572
|
- lib/zernio-sdk/models/webhook_payload_test.rb
|
|
3573
|
+
- lib/zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated.rb
|
|
3574
|
+
- lib/zernio-sdk/models/webhook_payload_whats_app_account_name_status_updated_name.rb
|
|
3571
3575
|
- lib/zernio-sdk/models/webhook_payload_whats_app_template_category_updated.rb
|
|
3572
3576
|
- lib/zernio-sdk/models/webhook_payload_whats_app_template_category_updated_template.rb
|
|
3573
3577
|
- lib/zernio-sdk/models/webhook_payload_whats_app_template_status_updated.rb
|
|
@@ -5348,6 +5352,8 @@ files:
|
|
|
5348
5352
|
- spec/models/webhook_payload_review_new_spec.rb
|
|
5349
5353
|
- spec/models/webhook_payload_review_updated_spec.rb
|
|
5350
5354
|
- spec/models/webhook_payload_test_spec.rb
|
|
5355
|
+
- spec/models/webhook_payload_whats_app_account_name_status_updated_name_spec.rb
|
|
5356
|
+
- spec/models/webhook_payload_whats_app_account_name_status_updated_spec.rb
|
|
5351
5357
|
- spec/models/webhook_payload_whats_app_template_category_updated_spec.rb
|
|
5352
5358
|
- spec/models/webhook_payload_whats_app_template_category_updated_template_spec.rb
|
|
5353
5359
|
- spec/models/webhook_payload_whats_app_template_status_updated_account_spec.rb
|
|
@@ -5416,7 +5422,7 @@ files:
|
|
|
5416
5422
|
- spec/models/you_tube_video_retention_response_retention_curve_inner_spec.rb
|
|
5417
5423
|
- spec/models/you_tube_video_retention_response_spec.rb
|
|
5418
5424
|
- spec/spec_helper.rb
|
|
5419
|
-
- zernio-sdk-0.0.
|
|
5425
|
+
- zernio-sdk-0.0.747.gem
|
|
5420
5426
|
- zernio-sdk.gemspec
|
|
5421
5427
|
homepage: https://openapi-generator.tech
|
|
5422
5428
|
licenses:
|
|
@@ -5760,6 +5766,7 @@ test_files:
|
|
|
5760
5766
|
- spec/models/share_sms_registration200_response_spec.rb
|
|
5761
5767
|
- spec/models/create_phone_number_port_in_request_spec.rb
|
|
5762
5768
|
- spec/models/profile_spec.rb
|
|
5769
|
+
- spec/models/webhook_payload_whats_app_account_name_status_updated_name_spec.rb
|
|
5763
5770
|
- spec/models/trigger_workflow_request_spec.rb
|
|
5764
5771
|
- spec/models/update_ad_status_request_spec.rb
|
|
5765
5772
|
- spec/models/get_value_rule_set200_response_spec.rb
|
|
@@ -6944,6 +6951,7 @@ test_files:
|
|
|
6944
6951
|
- spec/models/rf_prediction_spec.rb
|
|
6945
6952
|
- spec/models/list_ad_keywords200_response_spec.rb
|
|
6946
6953
|
- spec/models/list_ad_accounts200_response_accounts_inner_spec.rb
|
|
6954
|
+
- spec/models/webhook_payload_whats_app_account_name_status_updated_spec.rb
|
|
6947
6955
|
- spec/models/get_linked_in_post_analytics400_response_spec.rb
|
|
6948
6956
|
- spec/models/check_phone_number_availability200_response_area_options_inner_spec.rb
|
|
6949
6957
|
- spec/models/get_linked_in_post_analytics200_response_spec.rb
|
data/zernio-sdk-0.0.745.gem
DELETED
|
Binary file
|