wavix-ruby-sdk 1.5.0 → 2.0.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/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 +20 -0
- data/lib/wavix/types/whats_app_message_error_action.rb +14 -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 +6 -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 +99 -0
- data/reference.md +1 -1
- metadata +101 -2
|
@@ -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
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.sender.quality_changed`. Meta changed the quality rating of one of your senders. Posted to
|
|
6
|
+
# your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppSenderQualityChangedEvent < 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.restricted`. One of your senders reached its messaging limit. It can't start new
|
|
6
|
+
# conversations until the 24-hour window resets. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppSenderRestrictedEvent < 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.updated`. The status of one of your senders changed to a value that has no event
|
|
6
|
+
# type of its own, such as `pending` or `deleted`. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppSenderUpdatedEvent < 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,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event Wavix posts to your webhook of the `senders` group: a change to the status or quality rating of one of your
|
|
6
|
+
# senders, or a test event. The `type` field decides the shape of `data`. Wavix can add event types, so ignore a
|
|
7
|
+
# `type` you don't recognize.
|
|
8
|
+
class WhatsAppSendersGroupEvent < Internal::Types::Model
|
|
9
|
+
extend Wavix::Internal::Types::Union
|
|
10
|
+
|
|
11
|
+
discriminant :type
|
|
12
|
+
|
|
13
|
+
member -> { Wavix::Types::WhatsAppSenderConnectedEvent }, key: "WHATSAPP_SENDER_CONNECTED"
|
|
14
|
+
|
|
15
|
+
member -> { Wavix::Types::WhatsAppSenderRestrictedEvent }, key: "WHATSAPP_SENDER_RESTRICTED"
|
|
16
|
+
|
|
17
|
+
member -> { Wavix::Types::WhatsAppSenderFlaggedEvent }, key: "WHATSAPP_SENDER_FLAGGED"
|
|
18
|
+
|
|
19
|
+
member -> { Wavix::Types::WhatsAppSenderBannedEvent }, key: "WHATSAPP_SENDER_BANNED"
|
|
20
|
+
|
|
21
|
+
member -> { Wavix::Types::WhatsAppSenderDisconnectedEvent }, key: "WHATSAPP_SENDER_DISCONNECTED"
|
|
22
|
+
|
|
23
|
+
member -> { Wavix::Types::WhatsAppSenderQualityChangedEvent }, key: "WHATSAPP_SENDER_QUALITY_CHANGED"
|
|
24
|
+
|
|
25
|
+
member -> { Wavix::Types::WhatsAppSenderUpdatedEvent }, key: "WHATSAPP_SENDER_UPDATED"
|
|
26
|
+
|
|
27
|
+
member -> { Wavix::Types::WhatsAppWebhookTestEvent }, key: "TEST"
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event of type `whatsapp.template.approved`. The provider approved one of your templates, so you can send it.
|
|
6
|
+
# Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppTemplateApprovedEvent < 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::WhatsAppTemplateEventData }, 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.template.category_changed`. Meta moved one of your templates to another category, which
|
|
6
|
+
# changes the rate of each message sent with it. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppTemplateCategoryChangedEvent < 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::WhatsAppTemplateEventData }, 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.template.disabled`. One of your templates is disabled and can't be sent. Posted to your
|
|
6
|
+
# webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppTemplateDisabledEvent < 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::WhatsAppTemplateEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Data of a template event. It carries the template's status, category, and quality rating after the change, and the
|
|
6
|
+
# previous value of the attribute that changed.
|
|
7
|
+
class WhatsAppTemplateEventData < Internal::Types::Model
|
|
8
|
+
field :template_uuid, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :language, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :status, -> { Wavix::Types::WhatsAppTemplateEventDataStatus }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :category, -> { Wavix::Types::WhatsAppTemplateEventDataCategory }, optional: false, nullable: false
|
|
17
|
+
|
|
18
|
+
field :quality_rating, -> { Wavix::Types::WhatsAppTemplateEventDataQualityRating }, optional: false, nullable: true
|
|
19
|
+
|
|
20
|
+
field :previous_attributes, -> { Wavix::Types::WhatsAppTemplatePreviousAttributes }, optional: false, nullable: false
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
module WhatsAppTemplateEventDataStatus
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
DRAFT = "draft"
|
|
9
|
+
PENDING = "pending"
|
|
10
|
+
APPROVED = "approved"
|
|
11
|
+
REJECTED = "rejected"
|
|
12
|
+
PAUSED = "paused"
|
|
13
|
+
FLAGGED = "flagged"
|
|
14
|
+
DISABLED = "disabled"
|
|
15
|
+
IN_APPEAL = "in_appeal"
|
|
16
|
+
PENDING_DELETION = "pending_deletion"
|
|
17
|
+
DELETED = "deleted"
|
|
18
|
+
UNKNOWN = "unknown"
|
|
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.template.flagged`. Meta flagged one of your templates because of negative feedback. It can
|
|
6
|
+
# still be sent. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppTemplateFlaggedEvent < 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::WhatsAppTemplateEventData }, 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 of type `whatsapp.template.paused`. The provider paused one of your templates. Posted to your webhook and
|
|
6
|
+
# returned by [List WhatsApp events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
7
|
+
class WhatsAppTemplatePausedEvent < 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::WhatsAppTemplateEventData }, 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
|
+
# Value that the changed attribute of a template had before the change. It holds only that attribute — `category`
|
|
6
|
+
# for `whatsapp.template.category_changed`, `quality_rating` for `whatsapp.template.quality_changed`, and `status`
|
|
7
|
+
# for the status events, such as `whatsapp.template.approved`.
|
|
8
|
+
class WhatsAppTemplatePreviousAttributes < Internal::Types::Model
|
|
9
|
+
field :status, -> { Wavix::Types::WhatsAppTemplatePreviousAttributesStatus }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :category, -> { Wavix::Types::WhatsAppTemplatePreviousAttributesCategory }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :quality_rating, -> { Wavix::Types::WhatsAppTemplatePreviousAttributesQualityRating }, optional: true, 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
|
+
module WhatsAppTemplatePreviousAttributesCategory
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
MARKETING = "marketing"
|
|
9
|
+
AUTHENTICATION = "authentication"
|
|
10
|
+
UTILITY = "utility"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
module WhatsAppTemplatePreviousAttributesQualityRating
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
HIGH = "high"
|
|
9
|
+
MEDIUM = "medium"
|
|
10
|
+
LOW = "low"
|
|
11
|
+
UNKNOWN = "unknown"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
module WhatsAppTemplatePreviousAttributesStatus
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
DRAFT = "draft"
|
|
9
|
+
PENDING = "pending"
|
|
10
|
+
APPROVED = "approved"
|
|
11
|
+
REJECTED = "rejected"
|
|
12
|
+
PAUSED = "paused"
|
|
13
|
+
FLAGGED = "flagged"
|
|
14
|
+
DISABLED = "disabled"
|
|
15
|
+
IN_APPEAL = "in_appeal"
|
|
16
|
+
PENDING_DELETION = "pending_deletion"
|
|
17
|
+
DELETED = "deleted"
|
|
18
|
+
UNKNOWN = "unknown"
|
|
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.template.quality_changed`. Meta changed the quality rating of one of your templates.
|
|
6
|
+
# Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppTemplateQualityChangedEvent < 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::WhatsAppTemplateEventData }, 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 of type `whatsapp.template.rejected`. The provider rejected one of your templates. Posted to your webhook
|
|
6
|
+
# and returned by [List WhatsApp events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
7
|
+
class WhatsAppTemplateRejectedEvent < 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::WhatsAppTemplateEventData }, 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.template.updated`. The status of one of your templates changed to a value that has no
|
|
6
|
+
# event type of its own, such as `pending` or `deleted`. Posted to your webhook and returned by [List WhatsApp
|
|
7
|
+
# events](https://docs.wavix.com/api-reference/whatsapp/list-whatsapp-events).
|
|
8
|
+
class WhatsAppTemplateUpdatedEvent < 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::WhatsAppTemplateEventData }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event Wavix posts to your webhook of the `templates` group: a change to the status, category, or quality rating of
|
|
6
|
+
# one of your templates, or a test event. The `type` field decides the shape of `data`. Wavix can add event types,
|
|
7
|
+
# so ignore a `type` you don't recognize.
|
|
8
|
+
class WhatsAppTemplatesGroupEvent < Internal::Types::Model
|
|
9
|
+
extend Wavix::Internal::Types::Union
|
|
10
|
+
|
|
11
|
+
discriminant :type
|
|
12
|
+
|
|
13
|
+
member -> { Wavix::Types::WhatsAppTemplateApprovedEvent }, key: "WHATSAPP_TEMPLATE_APPROVED"
|
|
14
|
+
|
|
15
|
+
member -> { Wavix::Types::WhatsAppTemplateRejectedEvent }, key: "WHATSAPP_TEMPLATE_REJECTED"
|
|
16
|
+
|
|
17
|
+
member -> { Wavix::Types::WhatsAppTemplatePausedEvent }, key: "WHATSAPP_TEMPLATE_PAUSED"
|
|
18
|
+
|
|
19
|
+
member -> { Wavix::Types::WhatsAppTemplateDisabledEvent }, key: "WHATSAPP_TEMPLATE_DISABLED"
|
|
20
|
+
|
|
21
|
+
member -> { Wavix::Types::WhatsAppTemplateFlaggedEvent }, key: "WHATSAPP_TEMPLATE_FLAGGED"
|
|
22
|
+
|
|
23
|
+
member -> { Wavix::Types::WhatsAppTemplateCategoryChangedEvent }, key: "WHATSAPP_TEMPLATE_CATEGORY_CHANGED"
|
|
24
|
+
|
|
25
|
+
member -> { Wavix::Types::WhatsAppTemplateQualityChangedEvent }, key: "WHATSAPP_TEMPLATE_QUALITY_CHANGED"
|
|
26
|
+
|
|
27
|
+
member -> { Wavix::Types::WhatsAppTemplateUpdatedEvent }, key: "WHATSAPP_TEMPLATE_UPDATED"
|
|
28
|
+
|
|
29
|
+
member -> { Wavix::Types::WhatsAppWebhookTestEvent }, key: "TEST"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A WhatsApp webhook of your account, returned when you create, list, or retrieve a webhook.
|
|
6
|
+
class WhatsAppWebhook < Internal::Types::Model
|
|
7
|
+
field :uuid, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :group, -> { Wavix::Types::WhatsAppWebhookGroup }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
14
|
+
|
|
15
|
+
field :enabled_events, -> { Internal::Types::Array[Wavix::Types::WhatsAppEventType] }, optional: true, nullable: false
|
|
16
|
+
|
|
17
|
+
field :created_at, -> { String }, optional: false, nullable: false
|
|
18
|
+
|
|
19
|
+
field :secret, -> { String }, optional: true, nullable: false
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Body of the request that creates a WhatsApp webhook.
|
|
6
|
+
class WhatsAppWebhookCreateRequest < Internal::Types::Model
|
|
7
|
+
field :url, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :group, -> { Wavix::Types::WhatsAppWebhookGroup }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# The WhatsApp webhooks of your account, returned when you list them.
|
|
6
|
+
class WhatsAppWebhookListResponse < Internal::Types::Model
|
|
7
|
+
field :webhooks, -> { Internal::Types::Array[Wavix::Types::WhatsAppWebhook] }, optional: false, nullable: false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# A single WhatsApp webhook, returned when you create or retrieve a webhook.
|
|
6
|
+
class WhatsAppWebhookResponse < Internal::Types::Model
|
|
7
|
+
field :webhook, -> { Wavix::Types::WhatsAppWebhook }, optional: false, nullable: false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Event that Wavix posts to a WhatsApp webhook when you send a test event to it. It never appears in the event list.
|
|
6
|
+
class WhatsAppWebhookTestEvent < Internal::Types::Model
|
|
7
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :timestamp, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :data, -> { Wavix::Types::WhatsAppWebhookTestEventData }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Data of a `test` event. It names the webhook the event was sent to.
|
|
6
|
+
class WhatsAppWebhookTestEventData < Internal::Types::Model
|
|
7
|
+
field :webhook_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# The outcome of a WhatsApp webhook test event, returned when you send one.
|
|
6
|
+
class WhatsAppWebhookTestResponse < Internal::Types::Model
|
|
7
|
+
field :test, -> { Wavix::Types::WhatsAppWebhookTestResult }, optional: false, nullable: false
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Outcome of one test event sent to a WhatsApp webhook.
|
|
6
|
+
class WhatsAppWebhookTestResult < Internal::Types::Model
|
|
7
|
+
field :outcome, -> { Wavix::Types::WhatsAppWebhookTestResultOutcome }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :status_code, -> { Integer }, optional: false, nullable: true
|
|
10
|
+
|
|
11
|
+
field :duration_ms, -> { Integer }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
module WhatsAppWebhookTestResultOutcome
|
|
6
|
+
extend Wavix::Internal::Types::Enum
|
|
7
|
+
|
|
8
|
+
DELIVERED = "delivered"
|
|
9
|
+
HTTP_ERROR = "http_error"
|
|
10
|
+
TIMEOUT = "timeout"
|
|
11
|
+
CONNECTION_ERROR = "connection_error"
|
|
12
|
+
TLS_ERROR = "tls_error"
|
|
13
|
+
BLOCKED = "blocked"
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Wavix
|
|
4
|
+
module Types
|
|
5
|
+
# Fields to update on a WhatsApp webhook. Consumed by [Update a WhatsApp
|
|
6
|
+
# webhook](https://docs.wavix.com/api-reference/whatsapp/update-a-whatsapp-webhook). Specify at least one field;
|
|
7
|
+
# fields you omit keep their values.
|
|
8
|
+
class WhatsAppWebhookUpdateRequest < Internal::Types::Model
|
|
9
|
+
field :url, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :enabled, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/wavix/version.rb
CHANGED