zernio-sdk 0.0.744 → 0.0.746
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 +4 -0
- data/docs/SendInboxMessageRequestInteractiveAction.md +2 -0
- data/docs/SendInboxMessageRequestInteractiveActionOneOf10.md +20 -0
- data/docs/SendInboxMessageRequestInteractiveActionOneOf10Parameters.md +24 -0
- data/docs/WebhookEventsApi.md +69 -0
- data/docs/WebhookPayloadMessageMetadata.md +4 -2
- data/docs/WebhookPayloadWhatsAppAccountNameStatusUpdated.md +26 -0
- data/docs/WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md +24 -0
- data/lib/zernio-sdk/api/webhook_events_api.rb +66 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive.rb +3 -3
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action.rb +1 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of10.rb +215 -0
- data/lib/zernio-sdk/models/send_inbox_message_request_interactive_action_one_of10_parameters.rb +201 -0
- data/lib/zernio-sdk/models/webhook_payload_message_metadata.rb +13 -3
- 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 +4 -0
- data/openapi.yaml +124 -10
- data/spec/models/create_webhook_settings_request_spec.rb +1 -1
- data/spec/models/send_inbox_message_request_interactive_action_one_of10_parameters_spec.rb +54 -0
- data/spec/models/send_inbox_message_request_interactive_action_one_of10_spec.rb +46 -0
- data/spec/models/send_inbox_message_request_interactive_spec.rb +1 -1
- data/spec/models/update_webhook_settings_request_spec.rb +1 -1
- data/spec/models/webhook_payload_message_metadata_spec.rb +6 -0
- 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
- metadata +17 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0926e92bfbf9148fa1fc5bf81a3a73ef738c1a51e0c8fc9046973ab42bd79605'
|
|
4
|
+
data.tar.gz: 76772e3855fc4c88aa50afdc57295fb549c9aae50206e8bd9393e68b994727c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1318fdeba0d5e01d28921c69d3799e1cd1aaecf7f073e0c8de4f74718e056824b3415303f8c4600bb52a72ca45033b765b506cc397b421646eb7e44926639456
|
|
7
|
+
data.tar.gz: 0057bb9300c2aa8ed370fe2f0573ab9a0128e110eaf9ec5759d06229be822cde08d157936287791f0ef253f6ca808732048431b990280558bfbd990e1d5f3fe8
|
data/README.md
CHANGED
|
@@ -1913,6 +1913,8 @@ Class | Method | HTTP request | Description
|
|
|
1913
1913
|
- [Zernio::SendInboxMessageRequestInteractiveAction](docs/SendInboxMessageRequestInteractiveAction.md)
|
|
1914
1914
|
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf](docs/SendInboxMessageRequestInteractiveActionOneOf.md)
|
|
1915
1915
|
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf1](docs/SendInboxMessageRequestInteractiveActionOneOf1.md)
|
|
1916
|
+
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf10](docs/SendInboxMessageRequestInteractiveActionOneOf10.md)
|
|
1917
|
+
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf10Parameters](docs/SendInboxMessageRequestInteractiveActionOneOf10Parameters.md)
|
|
1916
1918
|
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf1Parameters](docs/SendInboxMessageRequestInteractiveActionOneOf1Parameters.md)
|
|
1917
1919
|
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf2](docs/SendInboxMessageRequestInteractiveActionOneOf2.md)
|
|
1918
1920
|
- [Zernio::SendInboxMessageRequestInteractiveActionOneOf2Parameters](docs/SendInboxMessageRequestInteractiveActionOneOf2Parameters.md)
|
|
@@ -2307,6 +2309,8 @@ Class | Method | HTTP request | Description
|
|
|
2307
2309
|
- [Zernio::WebhookPayloadReviewNewAccount](docs/WebhookPayloadReviewNewAccount.md)
|
|
2308
2310
|
- [Zernio::WebhookPayloadReviewUpdated](docs/WebhookPayloadReviewUpdated.md)
|
|
2309
2311
|
- [Zernio::WebhookPayloadTest](docs/WebhookPayloadTest.md)
|
|
2312
|
+
- [Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdated](docs/WebhookPayloadWhatsAppAccountNameStatusUpdated.md)
|
|
2313
|
+
- [Zernio::WebhookPayloadWhatsAppAccountNameStatusUpdatedName](docs/WebhookPayloadWhatsAppAccountNameStatusUpdatedName.md)
|
|
2310
2314
|
- [Zernio::WebhookPayloadWhatsAppTemplateCategoryUpdated](docs/WebhookPayloadWhatsAppTemplateCategoryUpdated.md)
|
|
2311
2315
|
- [Zernio::WebhookPayloadWhatsAppTemplateCategoryUpdatedTemplate](docs/WebhookPayloadWhatsAppTemplateCategoryUpdatedTemplate.md)
|
|
2312
2316
|
- [Zernio::WebhookPayloadWhatsAppTemplateStatusUpdated](docs/WebhookPayloadWhatsAppTemplateStatusUpdated.md)
|
|
@@ -16,6 +16,7 @@ Zernio::SendInboxMessageRequestInteractiveAction.openapi_one_of
|
|
|
16
16
|
# [
|
|
17
17
|
# :'SendInboxMessageRequestInteractiveActionOneOf',
|
|
18
18
|
# :'SendInboxMessageRequestInteractiveActionOneOf1',
|
|
19
|
+
# :'SendInboxMessageRequestInteractiveActionOneOf10',
|
|
19
20
|
# :'SendInboxMessageRequestInteractiveActionOneOf2',
|
|
20
21
|
# :'SendInboxMessageRequestInteractiveActionOneOf3',
|
|
21
22
|
# :'SendInboxMessageRequestInteractiveActionOneOf4',
|
|
@@ -53,6 +54,7 @@ Zernio::SendInboxMessageRequestInteractiveAction.build(data_that_doesnt_match)
|
|
|
53
54
|
|
|
54
55
|
- `SendInboxMessageRequestInteractiveActionOneOf`
|
|
55
56
|
- `SendInboxMessageRequestInteractiveActionOneOf1`
|
|
57
|
+
- `SendInboxMessageRequestInteractiveActionOneOf10`
|
|
56
58
|
- `SendInboxMessageRequestInteractiveActionOneOf2`
|
|
57
59
|
- `SendInboxMessageRequestInteractiveActionOneOf3`
|
|
58
60
|
- `SendInboxMessageRequestInteractiveActionOneOf4`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Zernio::SendInboxMessageRequestInteractiveActionOneOf10
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **name** | **String** | | |
|
|
8
|
+
| **parameters** | [**SendInboxMessageRequestInteractiveActionOneOf10Parameters**](SendInboxMessageRequestInteractiveActionOneOf10Parameters.md) | | |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'zernio-sdk'
|
|
14
|
+
|
|
15
|
+
instance = Zernio::SendInboxMessageRequestInteractiveActionOneOf10.new(
|
|
16
|
+
name: null,
|
|
17
|
+
parameters: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Zernio::SendInboxMessageRequestInteractiveActionOneOf10Parameters
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **country** | **String** | ISO 3166-1 alpha-2 country code Meta should localize the address form for (e.g. IN). Required: Meta rejects the send without it. | |
|
|
8
|
+
| **values** | **Hash<String, Object>** | Optional pre-filled address field values. | [optional] |
|
|
9
|
+
| **saved_addresses** | **Array<Hash<String, Object>>** | Optional list of the recipient's previously saved addresses to offer as quick picks. | [optional] |
|
|
10
|
+
| **validation_errors** | **Hash<String, String>** | Optional per-field error messages to show when re-prompting after a failed validation. | [optional] |
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
require 'zernio-sdk'
|
|
16
|
+
|
|
17
|
+
instance = Zernio::SendInboxMessageRequestInteractiveActionOneOf10Parameters.new(
|
|
18
|
+
country: null,
|
|
19
|
+
values: null,
|
|
20
|
+
saved_addresses: null,
|
|
21
|
+
validation_errors: null
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
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)
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
| **postback_payload** | **String** | Payload from a postback button tap (Facebook/Instagram Messenger). | [optional] |
|
|
10
10
|
| **postback_title** | **String** | Title of the tapped postback button (Facebook/Instagram Messenger). | [optional] |
|
|
11
11
|
| **callback_data** | **String** | Callback data from an inline keyboard button tap (Telegram). | [optional] |
|
|
12
|
-
| **interactive_type** | **String** | WhatsApp only. Which kind of interactive reply the user sent: `button_reply` (tap on an interactive button), `list_reply` (tap on a list row), or `nfm_reply` (a WhatsApp Flow submission). | [optional] |
|
|
12
|
+
| **interactive_type** | **String** | WhatsApp only. Which kind of interactive reply the user sent: `button_reply` (tap on an interactive button), `list_reply` (tap on a list row), or `nfm_reply` (a WhatsApp Flow submission or an `address_message` submission, see `nfmReplyName`). | [optional] |
|
|
13
13
|
| **interactive_id** | **String** | WhatsApp only. The `id` of the tapped button or list row, matching the `id` you supplied when the message was sent. Not set for Flow responses. | [optional] |
|
|
14
14
|
| **button_payload** | **String** | WhatsApp only. Payload attached to a tapped template button. Template buttons emit a plain `button` webhook (not an interactive reply), so `interactiveType` is empty while this field is populated. | [optional] |
|
|
15
15
|
| **flow_response_json** | **String** | WhatsApp only. Raw `nfm_reply.response_json` string returned by a Flow submission. Useful if you need the exact wire payload; for typed access use `flowResponseData` instead. | [optional] |
|
|
16
|
-
| **flow_response_data** | **Hash<String, Object>** | WhatsApp only. Parsed Flow response JSON. Populated when `flowResponseJson` is valid JSON; otherwise omitted. Keys and value types depend on the specific Flow that was submitted. | [optional] |
|
|
16
|
+
| **flow_response_data** | **Hash<String, Object>** | WhatsApp only. Parsed Flow response JSON. Populated when `flowResponseJson` is valid JSON; otherwise omitted. Keys and value types depend on the specific Flow that was submitted. An `address_message` submission (`nfmReplyName: address_message`) carries the address fields (`name`, `address`, `city`, `state`, `in_pin_code`, ...), either at the top level or nested under `values`; read both. | [optional] |
|
|
17
|
+
| **nfm_reply_name** | **String** | WhatsApp only. `nfm_reply.name` as Meta sent it, e.g. `flow` or `address_message`. Address submissions share the `nfm_reply` envelope with Flow submissions and are otherwise indistinguishable in `flowResponseData`; use this field to tell them apart. | [optional] |
|
|
17
18
|
| **order** | [**WebhookPayloadMessageMetadataOrder**](WebhookPayloadMessageMetadataOrder.md) | | [optional] |
|
|
18
19
|
| **referred_product** | [**WebhookPayloadMessageMetadataReferredProduct**](WebhookPayloadMessageMetadataReferredProduct.md) | | [optional] |
|
|
19
20
|
| **contacts** | **Array<Hash<String, Object>>** | WhatsApp only. Contact cards the user shared, forwarded verbatim from Meta. Read `contactsOrigin` before treating any number here as the sender's own. | [optional] |
|
|
@@ -40,6 +41,7 @@ instance = Zernio::WebhookPayloadMessageMetadata.new(
|
|
|
40
41
|
button_payload: null,
|
|
41
42
|
flow_response_json: null,
|
|
42
43
|
flow_response_data: null,
|
|
44
|
+
nfm_reply_name: null,
|
|
43
45
|
order: null,
|
|
44
46
|
referred_product: null,
|
|
45
47
|
contacts: null,
|
|
@@ -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
|
+
|
|
@@ -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]
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# WhatsApp-only. Rich interactive payload for list messages, CTA URL buttons, Flow prompts, location requests, voice-call buttons, and commerce messages (single product, product list, catalog, and carousel). When set, takes priority over `buttons` and `quickReplies`. The shape mirrors Meta's Cloud API `interactive` object
|
|
17
|
+
# WhatsApp-only. Rich interactive payload for list messages, CTA URL buttons, Flow prompts, location requests, voice-call buttons, and commerce messages (single product, product list, catalog, and carousel). When set, takes priority over `buttons` and `quickReplies`. The shape mirrors Meta's Cloud API `interactive` object for the types in the enum below. Use `buttons` / `quickReplies` for simple button replies (WhatsApp's `interactive.type: \"button\"`): the abstraction caps at 3 buttons and handles the auto-conversion for you. Use this field only for the types listed in the enum below. All interactive messages are session messages: they can only be sent inside the 24-hour customer service window opened by the user's last inbound message. Commerce types (`product`, `product_list`, `catalog_message`, and product carousels) require a Meta catalog connected to the WhatsApp Business Account in Commerce Manager. Media carousels (image/video cards) do not need a catalog. For `product`, `body` is optional (WhatsApp renders the product card itself) and `header` is not allowed (the product image is the header). For `product_list`, a `header` with `type: \"text\"` is required. For `carousel`, top-level `header`/`footer` are not supported; media goes on each card instead. For `voice_call`, the message renders WhatsApp's native call button; tapping it starts a voice call to your business number. Requires WhatsApp Business Calling to be enabled on the sending number. The optional `parameters.payload` string is echoed back on the `calls` webhook (as `cta_payload`) for attribution. For `location_request_message`, `action` may be omitted (we default it to `{ \"name\": \"send_location\" }`). WhatsApp renders a localized \"Send location\" button; the user's reply arrives as a regular location message in the conversation. For `request_contact_info`, `action` may be omitted (we default it to `{ \"name\": \"request_contact_info\" }`). WhatsApp renders a localized share button that cannot be relabelled, so put the reason for asking in `body.text`: this is a consent prompt, and a bare request converts badly. The reply arrives as an inbound `contacts` message with `metadata.contactsOrigin` set to `contact_request`, and we fold the shared number back into the contact automatically. A `contacts` message with origin `other` is a card the user picked from their address book and is NOT proof of their own number. For `catalog_message`, `action` may also be omitted (we default it to `{ \"name\": \"catalog_message\" }`). For `address_message`, `parameters.country` is required (Meta rejects the whole send without it); everything else in `parameters` (`values`, `saved_addresses`, `validation_errors`) is forwarded to Meta as-is. This is Meta's native structured shipping-address capture, generally available in India as of 2026-08; check Meta's documentation for current country availability before relying on it elsewhere. The submitted address arrives as an `nfm_reply` on the `message.received` webhook, same as a Flow submission, but with `metadata.nfmReplyName` set to `address_message` so you can tell the two apart. Tap events come back via the `message.received` webhook with `metadata.interactiveType` set to `list_reply` or `nfm_reply`. Carts submitted from commerce messages arrive as `metadata.order`; product inquiries arrive as `metadata.referredProduct`.
|
|
18
18
|
class SendInboxMessageRequestInteractive < ApiModelBase
|
|
19
19
|
# Which interactive layout to render.
|
|
20
20
|
attr_accessor :type
|
|
@@ -143,7 +143,7 @@ module Zernio
|
|
|
143
143
|
def valid?
|
|
144
144
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
145
145
|
return false if @type.nil?
|
|
146
|
-
type_validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "request_contact_info", "voice_call", "product", "product_list", "catalog_message", "carousel"])
|
|
146
|
+
type_validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "request_contact_info", "voice_call", "product", "product_list", "catalog_message", "carousel", "address_message"])
|
|
147
147
|
return false unless type_validator.valid?(@type)
|
|
148
148
|
true
|
|
149
149
|
end
|
|
@@ -151,7 +151,7 @@ module Zernio
|
|
|
151
151
|
# Custom attribute writer method checking allowed values (enum).
|
|
152
152
|
# @param [Object] type Object to be assigned
|
|
153
153
|
def type=(type)
|
|
154
|
-
validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "request_contact_info", "voice_call", "product", "product_list", "catalog_message", "carousel"])
|
|
154
|
+
validator = EnumAttributeValidator.new('String', ["list", "cta_url", "flow", "location_request_message", "request_contact_info", "voice_call", "product", "product_list", "catalog_message", "carousel", "address_message"])
|
|
155
155
|
unless validator.valid?(type)
|
|
156
156
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
157
157
|
end
|
|
@@ -21,6 +21,7 @@ module Zernio
|
|
|
21
21
|
[
|
|
22
22
|
:'SendInboxMessageRequestInteractiveActionOneOf',
|
|
23
23
|
:'SendInboxMessageRequestInteractiveActionOneOf1',
|
|
24
|
+
:'SendInboxMessageRequestInteractiveActionOneOf10',
|
|
24
25
|
:'SendInboxMessageRequestInteractiveActionOneOf2',
|
|
25
26
|
:'SendInboxMessageRequestInteractiveActionOneOf3',
|
|
26
27
|
:'SendInboxMessageRequestInteractiveActionOneOf4',
|
|
@@ -0,0 +1,215 @@
|
|
|
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
|
+
# Address-request action. `type` on the parent must be `address_message`. Renders Meta's native structured address form in-chat (generally available in India as of 2026-08; check Meta's documentation for current country availability).
|
|
18
|
+
class SendInboxMessageRequestInteractiveActionOneOf10 < ApiModelBase
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
attr_accessor :parameters
|
|
22
|
+
|
|
23
|
+
class EnumAttributeValidator
|
|
24
|
+
attr_reader :datatype
|
|
25
|
+
attr_reader :allowable_values
|
|
26
|
+
|
|
27
|
+
def initialize(datatype, allowable_values)
|
|
28
|
+
@allowable_values = allowable_values.map do |value|
|
|
29
|
+
case datatype.to_s
|
|
30
|
+
when /Integer/i
|
|
31
|
+
value.to_i
|
|
32
|
+
when /Float/i
|
|
33
|
+
value.to_f
|
|
34
|
+
else
|
|
35
|
+
value
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def valid?(value)
|
|
41
|
+
!value || allowable_values.include?(value)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
46
|
+
def self.attribute_map
|
|
47
|
+
{
|
|
48
|
+
:'name' => :'name',
|
|
49
|
+
:'parameters' => :'parameters'
|
|
50
|
+
}
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Returns attribute mapping this model knows about
|
|
54
|
+
def self.acceptable_attribute_map
|
|
55
|
+
attribute_map
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Returns all the JSON keys this model knows about
|
|
59
|
+
def self.acceptable_attributes
|
|
60
|
+
acceptable_attribute_map.values
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute type mapping.
|
|
64
|
+
def self.openapi_types
|
|
65
|
+
{
|
|
66
|
+
:'name' => :'String',
|
|
67
|
+
:'parameters' => :'SendInboxMessageRequestInteractiveActionOneOf10Parameters'
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# List of attributes with nullable: true
|
|
72
|
+
def self.openapi_nullable
|
|
73
|
+
Set.new([
|
|
74
|
+
])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Initializes the object
|
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
79
|
+
def initialize(attributes = {})
|
|
80
|
+
if (!attributes.is_a?(Hash))
|
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::SendInboxMessageRequestInteractiveActionOneOf10` initialize method"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
85
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
86
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
87
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
88
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::SendInboxMessageRequestInteractiveActionOneOf10`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
89
|
+
end
|
|
90
|
+
h[k.to_sym] = v
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'name')
|
|
94
|
+
self.name = attributes[:'name']
|
|
95
|
+
else
|
|
96
|
+
self.name = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'parameters')
|
|
100
|
+
self.parameters = attributes[:'parameters']
|
|
101
|
+
else
|
|
102
|
+
self.parameters = nil
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
107
|
+
# @return Array for valid properties with the reasons
|
|
108
|
+
def list_invalid_properties
|
|
109
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
110
|
+
invalid_properties = Array.new
|
|
111
|
+
if @name.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @parameters.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "parameters", parameters cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
invalid_properties
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Check to see if the all the properties in the model are valid
|
|
123
|
+
# @return true if the model is valid
|
|
124
|
+
def valid?
|
|
125
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
126
|
+
return false if @name.nil?
|
|
127
|
+
name_validator = EnumAttributeValidator.new('String', ["address_message"])
|
|
128
|
+
return false unless name_validator.valid?(@name)
|
|
129
|
+
return false if @parameters.nil?
|
|
130
|
+
true
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
134
|
+
# @param [Object] name Object to be assigned
|
|
135
|
+
def name=(name)
|
|
136
|
+
validator = EnumAttributeValidator.new('String', ["address_message"])
|
|
137
|
+
unless validator.valid?(name)
|
|
138
|
+
fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
|
|
139
|
+
end
|
|
140
|
+
@name = name
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Custom attribute writer method with validation
|
|
144
|
+
# @param [Object] parameters Value to be assigned
|
|
145
|
+
def parameters=(parameters)
|
|
146
|
+
if parameters.nil?
|
|
147
|
+
fail ArgumentError, 'parameters cannot be nil'
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
@parameters = parameters
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Checks equality by comparing each attribute.
|
|
154
|
+
# @param [Object] Object to be compared
|
|
155
|
+
def ==(o)
|
|
156
|
+
return true if self.equal?(o)
|
|
157
|
+
self.class == o.class &&
|
|
158
|
+
name == o.name &&
|
|
159
|
+
parameters == o.parameters
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# @see the `==` method
|
|
163
|
+
# @param [Object] Object to be compared
|
|
164
|
+
def eql?(o)
|
|
165
|
+
self == o
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Calculates hash code according to all attributes.
|
|
169
|
+
# @return [Integer] Hash code
|
|
170
|
+
def hash
|
|
171
|
+
[name, parameters].hash
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Builds the object from hash
|
|
175
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
176
|
+
# @return [Object] Returns the model itself
|
|
177
|
+
def self.build_from_hash(attributes)
|
|
178
|
+
return nil unless attributes.is_a?(Hash)
|
|
179
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
180
|
+
transformed_hash = {}
|
|
181
|
+
openapi_types.each_pair do |key, type|
|
|
182
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
183
|
+
transformed_hash["#{key}"] = nil
|
|
184
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
185
|
+
# check to ensure the input is an array given that the attribute
|
|
186
|
+
# is documented as an array but the input is not
|
|
187
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
188
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
189
|
+
end
|
|
190
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
191
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
new(transformed_hash)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Returns the object in the form of hash
|
|
198
|
+
# @return [Hash] Returns the object in the form of hash
|
|
199
|
+
def to_hash
|
|
200
|
+
hash = {}
|
|
201
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
202
|
+
value = self.send(attr)
|
|
203
|
+
if value.nil?
|
|
204
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
205
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
hash[param] = _to_hash(value)
|
|
209
|
+
end
|
|
210
|
+
hash
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
end
|