wavix-ruby-sdk 1.4.0 → 1.6.0
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/.fern/metadata.json +3 -3
- data/.fern/replay.lock +13 -1
- data/lib/wavix/client.rb +1 -1
- data/lib/wavix/types/transcript_turn.rb +2 -0
- data/lib/wavix/types/whats_app_contact_marketing_preference_event_data.rb +13 -0
- data/lib/wavix/types/whats_app_contact_marketing_resumed_event.rb +16 -0
- data/lib/wavix/types/whats_app_contact_marketing_stopped_event.rb +16 -0
- data/lib/wavix/types/whats_app_event.rb +18 -0
- data/lib/wavix/types/whats_app_event_list_response.rb +15 -0
- data/lib/wavix/types/whats_app_event_type.rb +32 -0
- data/lib/wavix/types/whats_app_inbound_audio_content.rb +11 -0
- data/lib/wavix/types/whats_app_inbound_button_reply.rb +12 -0
- data/lib/wavix/types/whats_app_inbound_button_reply_content.rb +11 -0
- data/lib/wavix/types/whats_app_inbound_contact_card.rb +14 -0
- data/lib/wavix/types/whats_app_inbound_contacts_content.rb +11 -0
- data/lib/wavix/types/whats_app_inbound_content.rb +51 -0
- data/lib/wavix/types/whats_app_inbound_context.rb +10 -0
- data/lib/wavix/types/whats_app_inbound_document_content.rb +10 -0
- data/lib/wavix/types/whats_app_inbound_flow_response_content.rb +11 -0
- data/lib/wavix/types/whats_app_inbound_image_content.rb +10 -0
- data/lib/wavix/types/whats_app_inbound_list_reply.rb +14 -0
- data/lib/wavix/types/whats_app_inbound_list_reply_content.rb +11 -0
- data/lib/wavix/types/whats_app_inbound_location.rb +16 -0
- data/lib/wavix/types/whats_app_inbound_location_content.rb +10 -0
- data/lib/wavix/types/whats_app_inbound_media.rb +19 -0
- data/lib/wavix/types/whats_app_inbound_message_content.rb +20 -0
- data/lib/wavix/types/whats_app_inbound_message_content_type.rb +23 -0
- data/lib/wavix/types/whats_app_inbound_reaction.rb +12 -0
- data/lib/wavix/types/whats_app_inbound_reaction_content.rb +11 -0
- data/lib/wavix/types/whats_app_inbound_referral.rb +21 -0
- data/lib/wavix/types/whats_app_inbound_referral_source_type.rb +12 -0
- data/lib/wavix/types/whats_app_inbound_sticker_content.rb +10 -0
- data/lib/wavix/types/whats_app_inbound_text_content.rb +10 -0
- data/lib/wavix/types/whats_app_inbound_video_content.rb +10 -0
- data/lib/wavix/types/whats_app_message.rb +2 -0
- data/lib/wavix/types/whats_app_message_delivered_event.rb +16 -0
- data/lib/wavix/types/whats_app_message_error.rb +16 -0
- data/lib/wavix/types/whats_app_message_error_code.rb +23 -0
- data/lib/wavix/types/whats_app_message_failed_event.rb +15 -0
- data/lib/wavix/types/whats_app_message_failed_event_data.rb +20 -0
- data/lib/wavix/types/whats_app_message_failed_event_data_status.rb +13 -0
- data/lib/wavix/types/whats_app_message_list_item.rb +4 -0
- data/lib/wavix/types/whats_app_message_list_item_status.rb +1 -0
- data/lib/wavix/types/whats_app_message_read_event.rb +16 -0
- data/lib/wavix/types/whats_app_message_received_event.rb +15 -0
- data/lib/wavix/types/whats_app_message_received_event_data.rb +25 -0
- data/lib/wavix/types/whats_app_message_send_request.rb +5 -2
- data/lib/wavix/types/whats_app_message_sent_event.rb +16 -0
- data/lib/wavix/types/whats_app_message_status.rb +1 -0
- data/lib/wavix/types/whats_app_message_status_event_data.rb +17 -0
- data/lib/wavix/types/whats_app_messages_group_event.rb +30 -0
- data/lib/wavix/types/whats_app_problem.rb +2 -0
- data/lib/wavix/types/whats_app_send_audio_content.rb +11 -0
- data/lib/wavix/types/whats_app_send_buttons.rb +18 -0
- data/lib/wavix/types/whats_app_send_buttons_content.rb +11 -0
- data/lib/wavix/types/whats_app_send_content.rb +36 -0
- data/lib/wavix/types/whats_app_send_document_content.rb +11 -0
- data/lib/wavix/types/whats_app_send_image_content.rb +11 -0
- data/lib/wavix/types/whats_app_send_list.rb +20 -0
- data/lib/wavix/types/whats_app_send_list_content.rb +11 -0
- data/lib/wavix/types/whats_app_send_list_row.rb +15 -0
- data/lib/wavix/types/whats_app_send_list_section.rb +13 -0
- data/lib/wavix/types/whats_app_send_media.rb +15 -0
- data/lib/wavix/types/whats_app_send_reply_button.rb +13 -0
- data/lib/wavix/types/whats_app_send_text_content.rb +11 -0
- data/lib/wavix/types/whats_app_send_video_content.rb +11 -0
- data/lib/wavix/types/whats_app_sender_banned_event.rb +15 -0
- data/lib/wavix/types/whats_app_sender_connected_event.rb +16 -0
- data/lib/wavix/types/whats_app_sender_disconnected_event.rb +16 -0
- data/lib/wavix/types/whats_app_sender_event_data.rb +17 -0
- data/lib/wavix/types/whats_app_sender_event_data_quality_rating.rb +14 -0
- data/lib/wavix/types/whats_app_sender_event_data_status.rb +21 -0
- data/lib/wavix/types/whats_app_sender_flagged_event.rb +16 -0
- data/lib/wavix/types/whats_app_sender_previous_attributes.rb +13 -0
- data/lib/wavix/types/whats_app_sender_previous_attributes_quality_rating.rb +14 -0
- data/lib/wavix/types/whats_app_sender_previous_attributes_status.rb +21 -0
- data/lib/wavix/types/whats_app_sender_quality_changed_event.rb +16 -0
- data/lib/wavix/types/whats_app_sender_restricted_event.rb +16 -0
- data/lib/wavix/types/whats_app_sender_updated_event.rb +16 -0
- data/lib/wavix/types/whats_app_senders_group_event.rb +30 -0
- data/lib/wavix/types/whats_app_template_approved_event.rb +16 -0
- data/lib/wavix/types/whats_app_template_category_changed_event.rb +16 -0
- data/lib/wavix/types/whats_app_template_disabled_event.rb +16 -0
- data/lib/wavix/types/whats_app_template_event_data.rb +23 -0
- data/lib/wavix/types/whats_app_template_event_data_category.rb +13 -0
- data/lib/wavix/types/whats_app_template_event_data_quality_rating.rb +14 -0
- data/lib/wavix/types/whats_app_template_event_data_status.rb +21 -0
- data/lib/wavix/types/whats_app_template_flagged_event.rb +16 -0
- data/lib/wavix/types/whats_app_template_paused_event.rb +15 -0
- data/lib/wavix/types/whats_app_template_previous_attributes.rb +16 -0
- data/lib/wavix/types/whats_app_template_previous_attributes_category.rb +13 -0
- data/lib/wavix/types/whats_app_template_previous_attributes_quality_rating.rb +14 -0
- data/lib/wavix/types/whats_app_template_previous_attributes_status.rb +21 -0
- data/lib/wavix/types/whats_app_template_quality_changed_event.rb +16 -0
- data/lib/wavix/types/whats_app_template_rejected_event.rb +15 -0
- data/lib/wavix/types/whats_app_template_updated_event.rb +16 -0
- data/lib/wavix/types/whats_app_templates_group_event.rb +32 -0
- data/lib/wavix/types/whats_app_webhook.rb +22 -0
- data/lib/wavix/types/whats_app_webhook_create_request.rb +12 -0
- data/lib/wavix/types/whats_app_webhook_group.rb +13 -0
- data/lib/wavix/types/whats_app_webhook_list_response.rb +10 -0
- data/lib/wavix/types/whats_app_webhook_response.rb +10 -0
- data/lib/wavix/types/whats_app_webhook_test_event.rb +14 -0
- data/lib/wavix/types/whats_app_webhook_test_event_data.rb +10 -0
- data/lib/wavix/types/whats_app_webhook_test_response.rb +10 -0
- data/lib/wavix/types/whats_app_webhook_test_result.rb +14 -0
- data/lib/wavix/types/whats_app_webhook_test_result_outcome.rb +16 -0
- data/lib/wavix/types/whats_app_webhook_update_request.rb +14 -0
- data/lib/wavix/version.rb +1 -1
- data/lib/wavix.rb +98 -0
- data/reference.md +1 -1
- metadata +100 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event that tells you a message you sent wasn't delivered. Posted to your webhook and returned by [List WhatsApp
|
|
6
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
7
|
+
class WhatsAppMessageFailedEvent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :data, -> { Wavix::Types::WhatsAppMessageFailedEventData }, optional: false, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Data of a `whatsapp.message.failed` event. It identifies the message and says why it wasn't delivered.
|
|
6
|
+
class WhatsAppMessageFailedEventData < Internal::Types::Model
|
|
7
|
+
field :message_uuid, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :from, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :to, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :template, -> { Wavix::Types::WhatsAppMessageTemplate }, optional: false, nullable: true
|
|
14
|
+
|
|
15
|
+
field :status, -> { Wavix::Types::WhatsAppMessageFailedEventDataStatus }, optional: false, nullable: false
|
|
16
|
+
|
|
17
|
+
field :error, -> { Wavix::Types::WhatsAppMessageError }, optional: false, nullable: false
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -18,6 +18,10 @@ module Wavix
|
|
|
18
18
|
field :country, -> { String }, optional: false, nullable: true
|
|
19
19
|
|
|
20
20
|
field :created_at, -> { String }, optional: false, nullable: false
|
|
21
|
+
|
|
22
|
+
field :content, -> { Wavix::Types::WhatsAppInboundMessageContent }, optional: true, nullable: false
|
|
23
|
+
|
|
24
|
+
field :service_window_open_until, -> { String }, optional: true, nullable: false
|
|
21
25
|
end
|
|
22
26
|
end
|
|
23
27
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.message.read`. The recipient opened a message you sent. WhatsApp reports it only when the
|
|
6
|
+
# recipient has read receipts turned on. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppMessageReadEvent < Internal::Types::Model
|
|
9
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :data, -> { Wavix::Types::WhatsAppMessageStatusEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event that tells you one of your senders received a message. Posted to your webhook and returned by [List WhatsApp
|
|
6
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
7
|
+
class WhatsAppMessageReceivedEvent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :data, -> { Wavix::Types::WhatsAppMessageReceivedEventData }, optional: false, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Data of a `whatsapp.message.received` event. It carries the received message, its phone numbers, and what you need
|
|
6
|
+
# to reply.
|
|
7
|
+
class WhatsAppMessageReceivedEventData < Internal::Types::Model
|
|
8
|
+
field :message_uuid, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :from, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :to, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :profile_name, -> { String }, optional: false, nullable: true
|
|
15
|
+
|
|
16
|
+
field :content, -> { Wavix::Types::WhatsAppInboundContent }, optional: false, nullable: false
|
|
17
|
+
|
|
18
|
+
field :context, -> { Wavix::Types::WhatsAppInboundContext }, optional: false, nullable: true
|
|
19
|
+
|
|
20
|
+
field :referral, -> { Wavix::Types::WhatsAppInboundReferral }, optional: false, nullable: true
|
|
21
|
+
|
|
22
|
+
field :service_window_open_until, -> { String }, optional: false, nullable: false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Wavix
|
|
4
4
|
module Types
|
|
5
|
-
# Attributes of a WhatsApp
|
|
5
|
+
# Attributes of a WhatsApp message to send. Send exactly one of `template` and `content`. Use `content` only while
|
|
6
|
+
# the 24-hour service window of the recipient is open. Consumed by `whatsapp_messages_send`.
|
|
6
7
|
class WhatsAppMessageSendRequest < Internal::Types::Model
|
|
7
8
|
field :from, -> { String }, optional: false, nullable: false
|
|
8
9
|
|
|
@@ -10,7 +11,9 @@ module Wavix
|
|
|
10
11
|
|
|
11
12
|
field :idempotency_key, -> { String }, optional: true, nullable: false
|
|
12
13
|
|
|
13
|
-
field :template, -> { Wavix::Types::WhatsAppSendTemplate }, optional:
|
|
14
|
+
field :template, -> { Wavix::Types::WhatsAppSendTemplate }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :content, -> { Wavix::Types::WhatsAppSendContent }, optional: true, nullable: false
|
|
14
17
|
end
|
|
15
18
|
end
|
|
16
19
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.message.sent`. A message you sent has the `sent` status: it isn't delivered yet. Posted to
|
|
6
|
+
# your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppMessageSentEvent < Internal::Types::Model
|
|
9
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :data, -> { Wavix::Types::WhatsAppMessageStatusEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Data of a `whatsapp.message.sent`, `whatsapp.message.delivered`, or `whatsapp.message.read` event. It identifies
|
|
6
|
+
# the message; the event type carries its status.
|
|
7
|
+
class WhatsAppMessageStatusEventData < Internal::Types::Model
|
|
8
|
+
field :message_uuid, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :from, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :to, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :template, -> { Wavix::Types::WhatsAppMessageTemplate }, optional: false, nullable: true
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event Wavix posts to your webhook of the `messages` group: a received message, the status of a message you sent, a
|
|
6
|
+
# contact's marketing preference, or a test event. The `type` field decides the shape of `data`. Wavix can add event
|
|
7
|
+
# types, so ignore a `type` you don't recognize.
|
|
8
|
+
class WhatsAppMessagesGroupEvent < Internal::Types::Model
|
|
9
|
+
extend Wavix::Internal::Types::Union
|
|
10
|
+
|
|
11
|
+
discriminant :type
|
|
12
|
+
|
|
13
|
+
member -> { Wavix::Types::WhatsAppMessageReceivedEvent }, key: "WHATSAPP_MESSAGE_RECEIVED"
|
|
14
|
+
|
|
15
|
+
member -> { Wavix::Types::WhatsAppMessageSentEvent }, key: "WHATSAPP_MESSAGE_SENT"
|
|
16
|
+
|
|
17
|
+
member -> { Wavix::Types::WhatsAppMessageDeliveredEvent }, key: "WHATSAPP_MESSAGE_DELIVERED"
|
|
18
|
+
|
|
19
|
+
member -> { Wavix::Types::WhatsAppMessageReadEvent }, key: "WHATSAPP_MESSAGE_READ"
|
|
20
|
+
|
|
21
|
+
member -> { Wavix::Types::WhatsAppMessageFailedEvent }, key: "WHATSAPP_MESSAGE_FAILED"
|
|
22
|
+
|
|
23
|
+
member -> { Wavix::Types::WhatsAppContactMarketingStoppedEvent }, key: "WHATSAPP_CONTACT_MARKETING_STOPPED"
|
|
24
|
+
|
|
25
|
+
member -> { Wavix::Types::WhatsAppContactMarketingResumedEvent }, key: "WHATSAPP_CONTACT_MARKETING_RESUMED"
|
|
26
|
+
|
|
27
|
+
member -> { Wavix::Types::WhatsAppWebhookTestEvent }, key: "TEST"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -18,6 +18,8 @@ module Wavix
|
|
|
18
18
|
field :error_class, -> { Wavix::Types::WhatsAppProblemErrorClass }, optional: true, nullable: false
|
|
19
19
|
|
|
20
20
|
field :error_code, -> { String }, optional: true, nullable: false
|
|
21
|
+
|
|
22
|
+
field :service_window_closed_at, -> { String }, optional: true, nullable: false
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is an audio file. Consumed in `content` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendAudioContent < Internal::Types::Model
|
|
8
|
+
field :audio, -> { Wavix::Types::WhatsAppSendMedia }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A text with reply buttons. Consumed in `content.buttons` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message). When the recipient taps a button,
|
|
7
|
+
# Wavix sends a `whatsapp.message.received` event with the button's `id` in `content.button_reply`.
|
|
8
|
+
class WhatsAppSendButtons < Internal::Types::Model
|
|
9
|
+
field :header, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :body, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :footer, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :items, -> { Internal::Types::Array[Wavix::Types::WhatsAppSendReplyButton] }, optional: false, nullable: false
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is a text with reply buttons. Consumed in `content` of [Send a
|
|
6
|
+
# WhatsApp message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendButtonsContent < Internal::Types::Model
|
|
8
|
+
field :buttons, -> { Wavix::Types::WhatsAppSendButtons }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message sent without a template, inside the 24-hour service window. Consumed in `content` of [Send a
|
|
6
|
+
# WhatsApp message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message). The `type` field decides
|
|
7
|
+
# which other field holds the content. Possible values:
|
|
8
|
+
#
|
|
9
|
+
# - `text` — Text.
|
|
10
|
+
# - `image` — An image, with an optional caption.
|
|
11
|
+
# - `video` — A video, with an optional caption.
|
|
12
|
+
# - `audio` — An audio file.
|
|
13
|
+
# - `document` — A document, with an optional file name and caption.
|
|
14
|
+
# - `buttons` — A text with up to 3 reply buttons.
|
|
15
|
+
# - `list` — A text with a button that opens a list of up to 10 items.
|
|
16
|
+
class WhatsAppSendContent < Internal::Types::Model
|
|
17
|
+
extend Wavix::Internal::Types::Union
|
|
18
|
+
|
|
19
|
+
discriminant :type
|
|
20
|
+
|
|
21
|
+
member -> { Wavix::Types::WhatsAppSendTextContent }, key: "TEXT"
|
|
22
|
+
|
|
23
|
+
member -> { Wavix::Types::WhatsAppSendImageContent }, key: "IMAGE"
|
|
24
|
+
|
|
25
|
+
member -> { Wavix::Types::WhatsAppSendVideoContent }, key: "VIDEO"
|
|
26
|
+
|
|
27
|
+
member -> { Wavix::Types::WhatsAppSendAudioContent }, key: "AUDIO"
|
|
28
|
+
|
|
29
|
+
member -> { Wavix::Types::WhatsAppSendDocumentContent }, key: "DOCUMENT"
|
|
30
|
+
|
|
31
|
+
member -> { Wavix::Types::WhatsAppSendButtonsContent }, key: "BUTTONS"
|
|
32
|
+
|
|
33
|
+
member -> { Wavix::Types::WhatsAppSendListContent }, key: "LIST"
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is a document. Consumed in `content` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendDocumentContent < Internal::Types::Model
|
|
8
|
+
field :document, -> { Wavix::Types::WhatsAppSendMedia }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is an image. Consumed in `content` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendImageContent < Internal::Types::Model
|
|
8
|
+
field :image, -> { Wavix::Types::WhatsAppSendMedia }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A text with a button that opens a list of items. Consumed in `content.list` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message). When the recipient picks an item,
|
|
7
|
+
# Wavix sends a `whatsapp.message.received` event with the item's `id` in `content.list_reply`.
|
|
8
|
+
class WhatsAppSendList < Internal::Types::Model
|
|
9
|
+
field :header, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :body, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :footer, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :button_text, -> { String }, optional: false, nullable: false
|
|
16
|
+
|
|
17
|
+
field :sections, -> { Internal::Types::Array[Wavix::Types::WhatsAppSendListSection] }, optional: false, nullable: false
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is a text with a list of items to pick from. Consumed in `content` of
|
|
6
|
+
# [Send a WhatsApp message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendListContent < Internal::Types::Model
|
|
8
|
+
field :list, -> { Wavix::Types::WhatsAppSendList }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# An item in a list. Consumed in `content.list.sections.items` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendListRow < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :title, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :description, -> { String }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A group of items in a list. Consumed in `content.list.sections` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendListSection < Internal::Types::Model
|
|
8
|
+
field :title, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :items, -> { Internal::Types::Array[Wavix::Types::WhatsAppSendListRow] }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A media file to send. Consumed in the `image`, `video`, `audio`, or `document` field of `content` of [Send a
|
|
6
|
+
# WhatsApp message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendMedia < Internal::Types::Model
|
|
8
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :caption, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :filename, -> { String }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A reply button. Consumed in `content.buttons.items` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendReplyButton < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :title, -> { String }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is text. Consumed in `content` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendTextContent < Internal::Types::Model
|
|
8
|
+
field :text, -> { String }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Content of a message without a template that is a video. Consumed in `content` of [Send a WhatsApp
|
|
6
|
+
# message](https://docs.wavix.com/api-reference/whatsapp/send-a-whatsapp-message).
|
|
7
|
+
class WhatsAppSendVideoContent < Internal::Types::Model
|
|
8
|
+
field :video, -> { Wavix::Types::WhatsAppSendMedia }, optional: false, nullable: false
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.sender.banned`. The provider banned one of your senders. Posted to your webhook and
|
|
6
|
+
# returned by [List WhatsApp events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
7
|
+
class WhatsAppSenderBannedEvent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :data, -> { Wavix::Types::WhatsAppSenderEventData }, optional: false, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.sender.connected`. One of your senders can send messages within its messaging limit, for
|
|
6
|
+
# example after registration or when a restriction ends. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppSenderConnectedEvent < Internal::Types::Model
|
|
9
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :data, -> { Wavix::Types::WhatsAppSenderEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.sender.disconnected`. One of your senders is disconnected from the provider. Posted to
|
|
6
|
+
# your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppSenderDisconnectedEvent < Internal::Types::Model
|
|
9
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :data, -> { Wavix::Types::WhatsAppSenderEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Data of a sender event. It carries the sender's status and quality rating after the change, and the previous value
|
|
6
|
+
# of the attribute that changed.
|
|
7
|
+
class WhatsAppSenderEventData < Internal::Types::Model
|
|
8
|
+
field :phone_number, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :status, -> { Wavix::Types::WhatsAppSenderEventDataStatus }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :quality_rating, -> { Wavix::Types::WhatsAppSenderEventDataQualityRating }, optional: false, nullable: true
|
|
13
|
+
|
|
14
|
+
field :previous_attributes, -> { Wavix::Types::WhatsAppSenderPreviousAttributes }, optional: false, nullable: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
module WhatsAppSenderEventDataStatus
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
BANNED = "banned"
|
|
9
|
+
CONNECTED = "connected"
|
|
10
|
+
DELETED = "deleted"
|
|
11
|
+
DISCONNECTED = "disconnected"
|
|
12
|
+
FLAGGED = "flagged"
|
|
13
|
+
MIGRATED = "migrated"
|
|
14
|
+
PENDING = "pending"
|
|
15
|
+
RATE_LIMITED = "rate_limited"
|
|
16
|
+
RESTRICTED = "restricted"
|
|
17
|
+
UNKNOWN = "unknown"
|
|
18
|
+
UNVERIFIED = "unverified"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.sender.flagged`. The quality rating of one of your senders dropped to low. Posted to your
|
|
6
|
+
# webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppSenderFlaggedEvent < Internal::Types::Model
|
|
9
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :data, -> { Wavix::Types::WhatsAppSenderEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Value that the changed attribute of a sender had before the change. It holds only that attribute —
|
|
6
|
+
# `quality_rating` for `whatsapp.sender.quality_changed`, and `status` for every other sender event.
|
|
7
|
+
class WhatsAppSenderPreviousAttributes < Internal::Types::Model
|
|
8
|
+
field :status, -> { Wavix::Types::WhatsAppSenderPreviousAttributesStatus }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :quality_rating, -> { Wavix::Types::WhatsAppSenderPreviousAttributesQualityRating }, optional: true, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
module WhatsAppSenderPreviousAttributesStatus
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
BANNED = "banned"
|
|
9
|
+
CONNECTED = "connected"
|
|
10
|
+
DELETED = "deleted"
|
|
11
|
+
DISCONNECTED = "disconnected"
|
|
12
|
+
FLAGGED = "flagged"
|
|
13
|
+
MIGRATED = "migrated"
|
|
14
|
+
PENDING = "pending"
|
|
15
|
+
RATE_LIMITED = "rate_limited"
|
|
16
|
+
RESTRICTED = "restricted"
|
|
17
|
+
UNKNOWN = "unknown"
|
|
18
|
+
UNVERIFIED = "unverified"
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|