telnyx 5.167.0 → 5.168.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.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +4 -0
  5. data/lib/telnyx/models/ai/assistant_a2_a_agent.rb +195 -0
  6. data/lib/telnyx/models/ai/assistant_create_params.rb +16 -1
  7. data/lib/telnyx/models/ai/assistant_update_params.rb +17 -1
  8. data/lib/telnyx/models/ai/assistants/update_assistant.rb +17 -1
  9. data/lib/telnyx/models/ai/chat_completion_request.rb +125 -48
  10. data/lib/telnyx/models/ai/inference_embedding.rb +16 -1
  11. data/lib/telnyx/models/ai/telephony_settings.rb +15 -1
  12. data/lib/telnyx/models/compute/func_retrieve_logs_params.rb +66 -0
  13. data/lib/telnyx/models/compute/func_retrieve_logs_response.rb +161 -0
  14. data/lib/telnyx/models/compute/func_retrieve_metric_aggregates_params.rb +69 -0
  15. data/lib/telnyx/models/compute/func_retrieve_metric_aggregates_response.rb +137 -0
  16. data/lib/telnyx/models/compute/func_retrieve_revisions_params.rb +34 -0
  17. data/lib/telnyx/models/compute/func_retrieve_revisions_response.rb +101 -0
  18. data/lib/telnyx/models/compute/func_retrieve_ship_inspection_params.rb +22 -0
  19. data/lib/telnyx/models/compute/func_retrieve_ship_inspection_response.rb +94 -0
  20. data/lib/telnyx/models/compute/functions_observability_pagination_meta.rb +35 -0
  21. data/lib/telnyx/models/compute/logs_meta.rb +23 -0
  22. data/lib/telnyx/models/credential_connection.rb +4 -1
  23. data/lib/telnyx/models/email_inboxes/email_message.rb +12 -1
  24. data/lib/telnyx/models/email_message_batch_params.rb +4 -1
  25. data/lib/telnyx/models/email_message_batch_response.rb +1 -0
  26. data/lib/telnyx/models/fqdn_connection.rb +5 -2
  27. data/lib/telnyx/models/fqdn_connections/fqdn_authentication.rb +9 -2
  28. data/lib/telnyx/models/messaging_inbound_message_payload.rb +210 -67
  29. data/lib/telnyx/models/messaging_messaging_profile.rb +11 -1
  30. data/lib/telnyx/models/messaging_profile_create_params.rb +11 -1
  31. data/lib/telnyx/models/messaging_profile_features.rb +26 -0
  32. data/lib/telnyx/models/messaging_profile_update_params.rb +11 -1
  33. data/lib/telnyx/models/uac_connection.rb +4 -1
  34. data/lib/telnyx/models/uac_external_settings.rb +6 -2
  35. data/lib/telnyx/models/unsafe_unwrap_webhook_event.rb +5 -1
  36. data/lib/telnyx/models/unwrap_webhook_event.rb +5 -1
  37. data/lib/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rb +104 -1
  38. data/lib/telnyx/models/whatsapp/phone_number_get_response.rb +103 -1
  39. data/lib/telnyx/models/whatsapp/phone_number_list_response.rb +103 -1
  40. data/lib/telnyx/models/whatsapp/phone_number_retrieve_phone_number_params.rb +22 -0
  41. data/lib/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rb +207 -0
  42. data/lib/telnyx/models/whatsapp_account_update.rb +112 -0
  43. data/lib/telnyx/models/whatsapp_message_echo.rb +340 -0
  44. data/lib/telnyx/models/x402/credit_account/payment_list_params.rb +34 -0
  45. data/lib/telnyx/models/x402/credit_account/payment_retrieve_params.rb +24 -0
  46. data/lib/telnyx/models/x402/credit_account/payment_retrieve_response.rb +21 -0
  47. data/lib/telnyx/models/x402/credit_account/x402_transaction_record.rb +113 -0
  48. data/lib/telnyx/models.rb +8 -0
  49. data/lib/telnyx/resources/ai/assistants/versions.rb +3 -1
  50. data/lib/telnyx/resources/ai/assistants.rb +6 -2
  51. data/lib/telnyx/resources/ai/openai/chat.rb +2 -8
  52. data/lib/telnyx/resources/compute/funcs.rb +141 -0
  53. data/lib/telnyx/resources/compute.rb +18 -0
  54. data/lib/telnyx/resources/email_messages.rb +4 -2
  55. data/lib/telnyx/resources/messaging_profiles.rb +6 -2
  56. data/lib/telnyx/resources/webhooks.rb +2 -2
  57. data/lib/telnyx/resources/whatsapp/phone_numbers.rb +22 -0
  58. data/lib/telnyx/resources/x402/credit_account/payments.rb +71 -0
  59. data/lib/telnyx/resources/x402/credit_account.rb +8 -2
  60. data/lib/telnyx/version.rb +1 -1
  61. data/lib/telnyx.rb +23 -0
  62. data/rbi/telnyx/client.rbi +3 -0
  63. data/rbi/telnyx/models/ai/assistant_a2_a_agent.rbi +345 -0
  64. data/rbi/telnyx/models/ai/assistant_create_params.rbi +29 -0
  65. data/rbi/telnyx/models/ai/assistant_update_params.rbi +31 -0
  66. data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +31 -0
  67. data/rbi/telnyx/models/ai/chat_completion_request.rbi +224 -92
  68. data/rbi/telnyx/models/ai/inference_embedding.rbi +29 -0
  69. data/rbi/telnyx/models/ai/telephony_settings.rbi +23 -0
  70. data/rbi/telnyx/models/compute/func_retrieve_logs_params.rbi +130 -0
  71. data/rbi/telnyx/models/compute/func_retrieve_logs_response.rbi +410 -0
  72. data/rbi/telnyx/models/compute/func_retrieve_metric_aggregates_params.rbi +102 -0
  73. data/rbi/telnyx/models/compute/func_retrieve_metric_aggregates_response.rbi +231 -0
  74. data/rbi/telnyx/models/compute/func_retrieve_revisions_params.rbi +59 -0
  75. data/rbi/telnyx/models/compute/func_retrieve_revisions_response.rbi +213 -0
  76. data/rbi/telnyx/models/compute/func_retrieve_ship_inspection_params.rbi +40 -0
  77. data/rbi/telnyx/models/compute/func_retrieve_ship_inspection_response.rbi +252 -0
  78. data/rbi/telnyx/models/compute/functions_observability_pagination_meta.rbi +70 -0
  79. data/rbi/telnyx/models/compute/logs_meta.rbi +38 -0
  80. data/rbi/telnyx/models/credential_connection.rbi +8 -2
  81. data/rbi/telnyx/models/email_inboxes/email_message.rbi +22 -3
  82. data/rbi/telnyx/models/email_message_batch_params.rbi +6 -0
  83. data/rbi/telnyx/models/email_message_batch_response.rbi +5 -0
  84. data/rbi/telnyx/models/fqdn_connection.rbi +8 -2
  85. data/rbi/telnyx/models/fqdn_connections/fqdn_authentication.rbi +8 -2
  86. data/rbi/telnyx/models/messaging_inbound_message_payload.rbi +450 -193
  87. data/rbi/telnyx/models/messaging_messaging_profile.rbi +19 -0
  88. data/rbi/telnyx/models/messaging_profile_create_params.rbi +19 -0
  89. data/rbi/telnyx/models/messaging_profile_features.rbi +43 -0
  90. data/rbi/telnyx/models/messaging_profile_update_params.rbi +19 -0
  91. data/rbi/telnyx/models/uac_connection.rbi +8 -2
  92. data/rbi/telnyx/models/uac_external_settings.rbi +10 -2
  93. data/rbi/telnyx/models/unsafe_unwrap_webhook_event.rbi +3 -1
  94. data/rbi/telnyx/models/unwrap_webhook_event.rbi +3 -1
  95. data/rbi/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbi +213 -0
  96. data/rbi/telnyx/models/whatsapp/phone_number_get_response.rbi +213 -0
  97. data/rbi/telnyx/models/whatsapp/phone_number_list_response.rbi +213 -0
  98. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_phone_number_params.rbi +40 -0
  99. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbi +401 -0
  100. data/rbi/telnyx/models/whatsapp_account_update.rbi +236 -0
  101. data/rbi/telnyx/models/whatsapp_message_echo.rbi +611 -0
  102. data/rbi/telnyx/models/x402/credit_account/payment_list_params.rbi +64 -0
  103. data/rbi/telnyx/models/x402/credit_account/payment_retrieve_params.rbi +42 -0
  104. data/rbi/telnyx/models/x402/credit_account/payment_retrieve_response.rbi +53 -0
  105. data/rbi/telnyx/models/x402/credit_account/x402_transaction_record.rbi +219 -0
  106. data/rbi/telnyx/models.rbi +8 -0
  107. data/rbi/telnyx/resources/ai/assistants/versions.rbi +12 -0
  108. data/rbi/telnyx/resources/ai/assistants.rbi +21 -0
  109. data/rbi/telnyx/resources/ai/openai/chat.rbi +9 -13
  110. data/rbi/telnyx/resources/compute/funcs.rbi +111 -0
  111. data/rbi/telnyx/resources/compute.rbi +15 -0
  112. data/rbi/telnyx/resources/email_messages.rbi +6 -2
  113. data/rbi/telnyx/resources/messaging_profiles.rbi +10 -0
  114. data/rbi/telnyx/resources/webhooks.rbi +6 -2
  115. data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +18 -0
  116. data/rbi/telnyx/resources/x402/credit_account/payments.rbi +60 -0
  117. data/rbi/telnyx/resources/x402/credit_account.rbi +5 -0
  118. data/sig/telnyx/client.rbs +2 -0
  119. data/sig/telnyx/models/ai/assistant_a2_a_agent.rbs +140 -0
  120. data/sig/telnyx/models/ai/assistant_create_params.rbs +9 -0
  121. data/sig/telnyx/models/ai/assistant_update_params.rbs +9 -0
  122. data/sig/telnyx/models/ai/assistants/update_assistant.rbs +9 -0
  123. data/sig/telnyx/models/ai/chat_completion_request.rbs +86 -44
  124. data/sig/telnyx/models/ai/inference_embedding.rbs +9 -0
  125. data/sig/telnyx/models/ai/telephony_settings.rbs +7 -0
  126. data/sig/telnyx/models/compute/func_retrieve_logs_params.rbs +69 -0
  127. data/sig/telnyx/models/compute/func_retrieve_logs_response.rbs +210 -0
  128. data/sig/telnyx/models/compute/func_retrieve_metric_aggregates_params.rbs +66 -0
  129. data/sig/telnyx/models/compute/func_retrieve_metric_aggregates_response.rbs +149 -0
  130. data/sig/telnyx/models/compute/func_retrieve_revisions_params.rbs +38 -0
  131. data/sig/telnyx/models/compute/func_retrieve_revisions_response.rbs +131 -0
  132. data/sig/telnyx/models/compute/func_retrieve_ship_inspection_params.rbs +22 -0
  133. data/sig/telnyx/models/compute/func_retrieve_ship_inspection_response.rbs +117 -0
  134. data/sig/telnyx/models/compute/functions_observability_pagination_meta.rbs +45 -0
  135. data/sig/telnyx/models/compute/logs_meta.rbs +21 -0
  136. data/sig/telnyx/models/email_inboxes/email_message.rbs +12 -3
  137. data/sig/telnyx/models/email_message_batch_response.rbs +2 -0
  138. data/sig/telnyx/models/messaging_inbound_message_payload.rbs +207 -95
  139. data/sig/telnyx/models/messaging_messaging_profile.rbs +5 -0
  140. data/sig/telnyx/models/messaging_profile_create_params.rbs +5 -0
  141. data/sig/telnyx/models/messaging_profile_features.rbs +15 -0
  142. data/sig/telnyx/models/messaging_profile_update_params.rbs +5 -0
  143. data/sig/telnyx/models/unsafe_unwrap_webhook_event.rbs +2 -0
  144. data/sig/telnyx/models/unwrap_webhook_event.rbs +2 -0
  145. data/sig/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbs +90 -0
  146. data/sig/telnyx/models/whatsapp/phone_number_get_response.rbs +90 -0
  147. data/sig/telnyx/models/whatsapp/phone_number_list_response.rbs +90 -0
  148. data/sig/telnyx/models/whatsapp/phone_number_retrieve_phone_number_params.rbs +25 -0
  149. data/sig/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbs +201 -0
  150. data/sig/telnyx/models/whatsapp_account_update.rbs +107 -0
  151. data/sig/telnyx/models/whatsapp_message_echo.rbs +291 -0
  152. data/sig/telnyx/models/x402/credit_account/payment_list_params.rbs +36 -0
  153. data/sig/telnyx/models/x402/credit_account/payment_retrieve_params.rbs +27 -0
  154. data/sig/telnyx/models/x402/credit_account/payment_retrieve_response.rbs +26 -0
  155. data/sig/telnyx/models/x402/credit_account/x402_transaction_record.rbs +104 -0
  156. data/sig/telnyx/models.rbs +8 -0
  157. data/sig/telnyx/resources/ai/assistants/versions.rbs +1 -0
  158. data/sig/telnyx/resources/ai/assistants.rbs +2 -0
  159. data/sig/telnyx/resources/ai/openai/chat.rbs +1 -4
  160. data/sig/telnyx/resources/compute/funcs.rbs +41 -0
  161. data/sig/telnyx/resources/compute.rbs +9 -0
  162. data/sig/telnyx/resources/messaging_profiles.rbs +2 -0
  163. data/sig/telnyx/resources/webhooks.rbs +6 -2
  164. data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +5 -0
  165. data/sig/telnyx/resources/x402/credit_account/payments.rbs +22 -0
  166. data/sig/telnyx/resources/x402/credit_account.rbs +2 -0
  167. metadata +71 -2
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Whatsapp
6
+ # @see Telnyx::Resources::Whatsapp::PhoneNumbers#retrieve_phone_number
7
+ class PhoneNumberRetrievePhoneNumberParams < Telnyx::Internal::Type::BaseModel
8
+ extend Telnyx::Internal::Type::RequestParameters::Converter
9
+ include Telnyx::Internal::Type::RequestParameters
10
+
11
+ # @!attribute phone_number
12
+ #
13
+ # @return [String]
14
+ required :phone_number, String
15
+
16
+ # @!method initialize(phone_number:, request_options: {})
17
+ # @param phone_number [String]
18
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,207 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module Whatsapp
6
+ # @see Telnyx::Resources::Whatsapp::PhoneNumbers#retrieve_phone_number
7
+ class PhoneNumberRetrievePhoneNumberResponse < Telnyx::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data]
11
+ required :data, -> { Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data }
12
+
13
+ # @!method initialize(data:)
14
+ # @param data [Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data]
15
+
16
+ # @see Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse#data
17
+ class Data < Telnyx::Internal::Type::BaseModel
18
+ # @!attribute calling_enabled
19
+ #
20
+ # @return [Boolean, nil]
21
+ optional :calling_enabled, Telnyx::Internal::Type::Boolean
22
+
23
+ # @!attribute coexistence_state
24
+ # Current lifecycle state for a coexistence number. This is null for a standard
25
+ # Cloud API number.
26
+ #
27
+ # @return [Symbol, Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data::CoexistenceState, nil]
28
+ optional :coexistence_state,
29
+ enum: -> { Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data::CoexistenceState },
30
+ nil?: true
31
+
32
+ # @!attribute created_at
33
+ #
34
+ # @return [Time, nil]
35
+ optional :created_at, Time
36
+
37
+ # @!attribute display_name
38
+ #
39
+ # @return [String, nil]
40
+ optional :display_name, String
41
+
42
+ # @!attribute enabled
43
+ #
44
+ # @return [Boolean, nil]
45
+ optional :enabled, Telnyx::Internal::Type::Boolean
46
+
47
+ # @!attribute is_on_biz_app
48
+ # Indicates whether the number is connected to both the WhatsApp Business app and
49
+ # Cloud API through WhatsApp Coexistence.
50
+ #
51
+ # @return [Boolean, nil]
52
+ optional :is_on_biz_app, Telnyx::Internal::Type::Boolean
53
+
54
+ # @!attribute phone_number
55
+ # Phone number in E164 format
56
+ #
57
+ # @return [String, nil]
58
+ optional :phone_number, String
59
+
60
+ # @!attribute phone_number_id
61
+ # Whatsapp phone number ID
62
+ #
63
+ # @return [String, nil]
64
+ optional :phone_number_id, String
65
+
66
+ # @!attribute quality_rating
67
+ # Whatsapp quality rating
68
+ #
69
+ # @return [String, nil]
70
+ optional :quality_rating, String
71
+
72
+ # @!attribute record_type
73
+ #
74
+ # @return [String, nil]
75
+ optional :record_type, String
76
+
77
+ # @!attribute status
78
+ #
79
+ # @return [String, nil]
80
+ optional :status, String
81
+
82
+ # @!attribute sync_deadline
83
+ # Deadline for initiating the current coexistence synchronization cycle. This is
84
+ # null when no deadline applies.
85
+ #
86
+ # @return [Time, nil]
87
+ optional :sync_deadline, Time, nil?: true
88
+
89
+ # @!attribute sync_progress
90
+ # Synchronization progress. This object is returned only while a coexistence
91
+ # number is synchronizing.
92
+ #
93
+ # @return [Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data::SyncProgress, nil]
94
+ optional :sync_progress,
95
+ -> { Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data::SyncProgress },
96
+ nil?: true
97
+
98
+ # @!attribute user_id
99
+ # User ID
100
+ #
101
+ # @return [String, nil]
102
+ optional :user_id, String
103
+
104
+ # @!attribute waba_id
105
+ # WABA ID of Whatsapp business account
106
+ #
107
+ # @return [String, nil]
108
+ optional :waba_id, String
109
+
110
+ # @!method initialize(calling_enabled: nil, coexistence_state: nil, created_at: nil, display_name: nil, enabled: nil, is_on_biz_app: nil, phone_number: nil, phone_number_id: nil, quality_rating: nil, record_type: nil, status: nil, sync_deadline: nil, sync_progress: nil, user_id: nil, waba_id: nil)
111
+ # Some parameter documentations has been truncated, see
112
+ # {Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data} for
113
+ # more details.
114
+ #
115
+ # @param calling_enabled [Boolean]
116
+ #
117
+ # @param coexistence_state [Symbol, Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data::CoexistenceState, nil] Current lifecycle state for a coexistence number. This is null for a standard Cl
118
+ #
119
+ # @param created_at [Time]
120
+ #
121
+ # @param display_name [String]
122
+ #
123
+ # @param enabled [Boolean]
124
+ #
125
+ # @param is_on_biz_app [Boolean] Indicates whether the number is connected to both the WhatsApp Business app and
126
+ #
127
+ # @param phone_number [String] Phone number in E164 format
128
+ #
129
+ # @param phone_number_id [String] Whatsapp phone number ID
130
+ #
131
+ # @param quality_rating [String] Whatsapp quality rating
132
+ #
133
+ # @param record_type [String]
134
+ #
135
+ # @param status [String]
136
+ #
137
+ # @param sync_deadline [Time, nil] Deadline for initiating the current coexistence synchronization cycle. This is n
138
+ #
139
+ # @param sync_progress [Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data::SyncProgress, nil] Synchronization progress. This object is returned only while a coexistence numbe
140
+ #
141
+ # @param user_id [String] User ID
142
+ #
143
+ # @param waba_id [String] WABA ID of Whatsapp business account
144
+
145
+ # Current lifecycle state for a coexistence number. This is null for a standard
146
+ # Cloud API number.
147
+ #
148
+ # @see Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data#coexistence_state
149
+ module CoexistenceState
150
+ extend Telnyx::Internal::Type::Enum
151
+
152
+ PENDING_ONBOARDING = :pending_onboarding
153
+ SYNC_PENDING = :sync_pending
154
+ SYNCING = :syncing
155
+ SYNC_COMPLETE = :sync_complete
156
+ ACTIVE = :active
157
+ HISTORY_DECLINED = :history_declined
158
+ SYNC_DEADLINE_EXPIRED = :sync_deadline_expired
159
+ OFFBOARDED = :offboarded
160
+ DISCONNECTED = :disconnected
161
+
162
+ # @!method self.values
163
+ # @return [Array<Symbol>]
164
+ end
165
+
166
+ # @see Telnyx::Models::Whatsapp::PhoneNumberRetrievePhoneNumberResponse::Data#sync_progress
167
+ class SyncProgress < Telnyx::Internal::Type::BaseModel
168
+ # @!attribute contacts_status
169
+ #
170
+ # @return [String, nil]
171
+ optional :contacts_status, String
172
+
173
+ # @!attribute history_chunk_order
174
+ #
175
+ # @return [Integer, nil]
176
+ optional :history_chunk_order, Integer, nil?: true
177
+
178
+ # @!attribute history_phase
179
+ #
180
+ # @return [Integer, nil]
181
+ optional :history_phase, Integer, nil?: true
182
+
183
+ # @!attribute history_progress
184
+ #
185
+ # @return [Integer, nil]
186
+ optional :history_progress, Integer, nil?: true
187
+
188
+ # @!attribute history_status
189
+ #
190
+ # @return [String, nil]
191
+ optional :history_status, String
192
+
193
+ # @!method initialize(contacts_status: nil, history_chunk_order: nil, history_phase: nil, history_progress: nil, history_status: nil)
194
+ # Synchronization progress. This object is returned only while a coexistence
195
+ # number is synchronizing.
196
+ #
197
+ # @param contacts_status [String]
198
+ # @param history_chunk_order [Integer, nil]
199
+ # @param history_phase [Integer, nil]
200
+ # @param history_progress [Integer, nil]
201
+ # @param history_status [String]
202
+ end
203
+ end
204
+ end
205
+ end
206
+ end
207
+ end
@@ -0,0 +1,112 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ class WhatsappAccountUpdate < Telnyx::Internal::Type::BaseModel
6
+ # @!attribute data
7
+ #
8
+ # @return [Telnyx::Models::WhatsappAccountUpdate::Data]
9
+ required :data, -> { Telnyx::WhatsappAccountUpdate::Data }
10
+
11
+ # @!method initialize(data:)
12
+ # @param data [Telnyx::Models::WhatsappAccountUpdate::Data]
13
+
14
+ # @see Telnyx::Models::WhatsappAccountUpdate#data
15
+ class Data < Telnyx::Internal::Type::BaseModel
16
+ # @!attribute id
17
+ #
18
+ # @return [String]
19
+ required :id, String
20
+
21
+ # @!attribute event_type
22
+ #
23
+ # @return [Symbol, Telnyx::Models::WhatsappAccountUpdate::Data::EventType]
24
+ required :event_type, enum: -> { Telnyx::WhatsappAccountUpdate::Data::EventType }
25
+
26
+ # @!attribute occurred_at
27
+ #
28
+ # @return [Time]
29
+ required :occurred_at, Time
30
+
31
+ # @!attribute payload
32
+ #
33
+ # @return [Telnyx::Models::WhatsappAccountUpdate::Data::Payload]
34
+ required :payload, -> { Telnyx::WhatsappAccountUpdate::Data::Payload }
35
+
36
+ # @!attribute record_type
37
+ #
38
+ # @return [Symbol, Telnyx::Models::WhatsappAccountUpdate::Data::RecordType]
39
+ required :record_type, enum: -> { Telnyx::WhatsappAccountUpdate::Data::RecordType }
40
+
41
+ # @!method initialize(id:, event_type:, occurred_at:, payload:, record_type:)
42
+ # @param id [String]
43
+ # @param event_type [Symbol, Telnyx::Models::WhatsappAccountUpdate::Data::EventType]
44
+ # @param occurred_at [Time]
45
+ # @param payload [Telnyx::Models::WhatsappAccountUpdate::Data::Payload]
46
+ # @param record_type [Symbol, Telnyx::Models::WhatsappAccountUpdate::Data::RecordType]
47
+
48
+ # @see Telnyx::Models::WhatsappAccountUpdate::Data#event_type
49
+ module EventType
50
+ extend Telnyx::Internal::Type::Enum
51
+
52
+ WHATSAPP_ACCOUNT_UPDATE = :"whatsapp.account.update"
53
+
54
+ # @!method self.values
55
+ # @return [Array<Symbol>]
56
+ end
57
+
58
+ # @see Telnyx::Models::WhatsappAccountUpdate::Data#payload
59
+ class Payload < Telnyx::Internal::Type::BaseModel
60
+ # @!attribute event
61
+ # Account event reported by Meta. Coexistence lifecycle values include
62
+ # `ACCOUNT_OFFBOARDED`, `ACCOUNT_RECONNECTED`, and `PARTNER_REMOVED`. Preserve
63
+ # unknown values for forward compatibility.
64
+ #
65
+ # @return [String]
66
+ required :event, String
67
+
68
+ # @!attribute record_type
69
+ #
70
+ # @return [Symbol, Telnyx::Models::WhatsappAccountUpdate::Data::Payload::RecordType]
71
+ required :record_type, enum: -> { Telnyx::WhatsappAccountUpdate::Data::Payload::RecordType }
72
+
73
+ # @!attribute waba_id
74
+ # Meta WhatsApp Business Account identifier.
75
+ #
76
+ # @return [String]
77
+ required :waba_id, String
78
+
79
+ # @!method initialize(event:, record_type:, waba_id:)
80
+ # Some parameter documentations has been truncated, see
81
+ # {Telnyx::Models::WhatsappAccountUpdate::Data::Payload} for more details.
82
+ #
83
+ # @param event [String] Account event reported by Meta. Coexistence lifecycle values include `ACCOUNT_OF
84
+ #
85
+ # @param record_type [Symbol, Telnyx::Models::WhatsappAccountUpdate::Data::Payload::RecordType]
86
+ #
87
+ # @param waba_id [String] Meta WhatsApp Business Account identifier.
88
+
89
+ # @see Telnyx::Models::WhatsappAccountUpdate::Data::Payload#record_type
90
+ module RecordType
91
+ extend Telnyx::Internal::Type::Enum
92
+
93
+ WHATSAPP_ACCOUNT = :whatsapp_account
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
98
+ end
99
+
100
+ # @see Telnyx::Models::WhatsappAccountUpdate::Data#record_type
101
+ module RecordType
102
+ extend Telnyx::Internal::Type::Enum
103
+
104
+ EVENT = :event
105
+
106
+ # @!method self.values
107
+ # @return [Array<Symbol>]
108
+ end
109
+ end
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,340 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ class WhatsappMessageEcho < Telnyx::Internal::Type::BaseModel
6
+ # @!attribute data
7
+ #
8
+ # @return [Telnyx::Models::WhatsappMessageEcho::Data]
9
+ required :data, -> { Telnyx::WhatsappMessageEcho::Data }
10
+
11
+ # @!method initialize(data:)
12
+ # @param data [Telnyx::Models::WhatsappMessageEcho::Data]
13
+
14
+ # @see Telnyx::Models::WhatsappMessageEcho#data
15
+ class Data < Telnyx::Internal::Type::BaseModel
16
+ # @!attribute id
17
+ #
18
+ # @return [String]
19
+ required :id, String
20
+
21
+ # @!attribute event_type
22
+ #
23
+ # @return [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::EventType]
24
+ required :event_type, enum: -> { Telnyx::WhatsappMessageEcho::Data::EventType }
25
+
26
+ # @!attribute occurred_at
27
+ #
28
+ # @return [Time]
29
+ required :occurred_at, Time
30
+
31
+ # @!attribute payload
32
+ #
33
+ # @return [Telnyx::Models::WhatsappMessageEcho::Data::Payload]
34
+ required :payload, -> { Telnyx::WhatsappMessageEcho::Data::Payload }
35
+
36
+ # @!attribute record_type
37
+ #
38
+ # @return [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::RecordType]
39
+ required :record_type, enum: -> { Telnyx::WhatsappMessageEcho::Data::RecordType }
40
+
41
+ # @!method initialize(id:, event_type:, occurred_at:, payload:, record_type:)
42
+ # @param id [String]
43
+ # @param event_type [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::EventType]
44
+ # @param occurred_at [Time]
45
+ # @param payload [Telnyx::Models::WhatsappMessageEcho::Data::Payload]
46
+ # @param record_type [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::RecordType]
47
+
48
+ # @see Telnyx::Models::WhatsappMessageEcho::Data#event_type
49
+ module EventType
50
+ extend Telnyx::Internal::Type::Enum
51
+
52
+ MESSAGE_ECHO = :"message.echo"
53
+
54
+ # @!method self.values
55
+ # @return [Array<Symbol>]
56
+ end
57
+
58
+ # @see Telnyx::Models::WhatsappMessageEcho::Data#payload
59
+ class Payload < Telnyx::Internal::Type::BaseModel
60
+ # @!attribute id
61
+ # Telnyx identifier for the mirrored message.
62
+ #
63
+ # @return [String]
64
+ required :id, String
65
+
66
+ # @!attribute body
67
+ # Mirrored WhatsApp message content. The content property matches the value of
68
+ # `type`.
69
+ #
70
+ # @return [Telnyx::Models::WhatsappMessageEcho::Data::Payload::Body]
71
+ required :body, -> { Telnyx::WhatsappMessageEcho::Data::Payload::Body }
72
+
73
+ # @!attribute cost
74
+ # No charge is created for a Business app message echo.
75
+ #
76
+ # @return [Telnyx::Models::WhatsappMessageEcho::Data::Payload::Cost]
77
+ required :cost, -> { Telnyx::WhatsappMessageEcho::Data::Payload::Cost }
78
+
79
+ # @!attribute direction
80
+ # Indicates that the business sent the message to the WhatsApp user.
81
+ #
82
+ # @return [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::Direction]
83
+ required :direction, enum: -> { Telnyx::WhatsappMessageEcho::Data::Payload::Direction }
84
+
85
+ # @!attribute errors
86
+ #
87
+ # @return [Array<Telnyx::Models::MessagingError0b38e7044b>]
88
+ required :errors, -> { Telnyx::Internal::Type::ArrayOf[Telnyx::MessagingError0b38e7044b] }
89
+
90
+ # @!attribute from
91
+ #
92
+ # @return [Telnyx::Models::WhatsappMessageEcho::Data::Payload::From]
93
+ required :from, -> { Telnyx::WhatsappMessageEcho::Data::Payload::From }
94
+
95
+ # @!attribute messaging_profile_id
96
+ #
97
+ # @return [String]
98
+ required :messaging_profile_id, String
99
+
100
+ # @!attribute organization_id
101
+ #
102
+ # @return [String]
103
+ required :organization_id, String
104
+
105
+ # @!attribute origin
106
+ # Identifies the WhatsApp Business app as the source of the message.
107
+ #
108
+ # @return [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::Origin]
109
+ required :origin, enum: -> { Telnyx::WhatsappMessageEcho::Data::Payload::Origin }
110
+
111
+ # @!attribute record_type
112
+ #
113
+ # @return [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::RecordType]
114
+ required :record_type, enum: -> { Telnyx::WhatsappMessageEcho::Data::Payload::RecordType }
115
+
116
+ # @!attribute to
117
+ # WhatsApp user who received the Business app message.
118
+ #
119
+ # @return [String]
120
+ required :to, String
121
+
122
+ # @!attribute type
123
+ #
124
+ # @return [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::Type]
125
+ required :type, enum: -> { Telnyx::WhatsappMessageEcho::Data::Payload::Type }
126
+
127
+ # @!attribute received_at
128
+ #
129
+ # @return [Time, nil]
130
+ optional :received_at, Time
131
+
132
+ # @!attribute tags
133
+ #
134
+ # @return [Array<String>, nil]
135
+ optional :tags, Telnyx::Internal::Type::ArrayOf[String]
136
+
137
+ # @!attribute webhook_failover_url
138
+ #
139
+ # @return [String, nil]
140
+ optional :webhook_failover_url, String, nil?: true
141
+
142
+ # @!attribute webhook_url
143
+ #
144
+ # @return [String, nil]
145
+ optional :webhook_url, String, nil?: true
146
+
147
+ # @!method initialize(id:, body:, cost:, direction:, errors:, from:, messaging_profile_id:, organization_id:, origin:, record_type:, to:, type:, received_at: nil, tags: nil, webhook_failover_url: nil, webhook_url: nil)
148
+ # Some parameter documentations has been truncated, see
149
+ # {Telnyx::Models::WhatsappMessageEcho::Data::Payload} for more details.
150
+ #
151
+ # @param id [String] Telnyx identifier for the mirrored message.
152
+ #
153
+ # @param body [Telnyx::Models::WhatsappMessageEcho::Data::Payload::Body] Mirrored WhatsApp message content. The content property matches the value of `ty
154
+ #
155
+ # @param cost [Telnyx::Models::WhatsappMessageEcho::Data::Payload::Cost] No charge is created for a Business app message echo.
156
+ #
157
+ # @param direction [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::Direction] Indicates that the business sent the message to the WhatsApp user.
158
+ #
159
+ # @param errors [Array<Telnyx::Models::MessagingError0b38e7044b>]
160
+ #
161
+ # @param from [Telnyx::Models::WhatsappMessageEcho::Data::Payload::From]
162
+ #
163
+ # @param messaging_profile_id [String]
164
+ #
165
+ # @param organization_id [String]
166
+ #
167
+ # @param origin [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::Origin] Identifies the WhatsApp Business app as the source of the message.
168
+ #
169
+ # @param record_type [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::RecordType]
170
+ #
171
+ # @param to [String] WhatsApp user who received the Business app message.
172
+ #
173
+ # @param type [Symbol, Telnyx::Models::WhatsappMessageEcho::Data::Payload::Type]
174
+ #
175
+ # @param received_at [Time]
176
+ #
177
+ # @param tags [Array<String>]
178
+ #
179
+ # @param webhook_failover_url [String, nil]
180
+ #
181
+ # @param webhook_url [String, nil]
182
+
183
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#body
184
+ class Body < Telnyx::Internal::Type::BaseModel
185
+ # @!attribute id
186
+ # Telnyx identifier for the mirrored message.
187
+ #
188
+ # @return [String]
189
+ required :id, String
190
+
191
+ # @!attribute foreign_id
192
+ # Meta WhatsApp message identifier, also known as a wamid.
193
+ #
194
+ # @return [String]
195
+ required :foreign_id, String
196
+
197
+ # @!attribute timestamp
198
+ # Unix timestamp supplied by Meta.
199
+ #
200
+ # @return [String]
201
+ required :timestamp, String
202
+
203
+ # @!attribute type
204
+ # WhatsApp message content type.
205
+ #
206
+ # @return [String]
207
+ required :type, String
208
+
209
+ # @!attribute from
210
+ # WhatsApp user who received the message.
211
+ #
212
+ # @return [String, nil]
213
+ optional :from, String
214
+
215
+ # @!attribute from_user_id
216
+ # Opaque recipient identifier when Meta does not supply a phone number.
217
+ #
218
+ # @return [String, nil]
219
+ optional :from_user_id, String
220
+
221
+ # @!method initialize(id:, foreign_id:, timestamp:, type:, from: nil, from_user_id: nil)
222
+ # Mirrored WhatsApp message content. The content property matches the value of
223
+ # `type`.
224
+ #
225
+ # @param id [String] Telnyx identifier for the mirrored message.
226
+ #
227
+ # @param foreign_id [String] Meta WhatsApp message identifier, also known as a wamid.
228
+ #
229
+ # @param timestamp [String] Unix timestamp supplied by Meta.
230
+ #
231
+ # @param type [String] WhatsApp message content type.
232
+ #
233
+ # @param from [String] WhatsApp user who received the message.
234
+ #
235
+ # @param from_user_id [String] Opaque recipient identifier when Meta does not supply a phone number.
236
+ end
237
+
238
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#cost
239
+ class Cost < Telnyx::Internal::Type::BaseModel
240
+ # @!attribute amount
241
+ #
242
+ # @return [String, nil]
243
+ optional :amount, String, nil?: true
244
+
245
+ # @!attribute currency
246
+ #
247
+ # @return [String, nil]
248
+ optional :currency, String, nil?: true
249
+
250
+ # @!method initialize(amount: nil, currency: nil)
251
+ # No charge is created for a Business app message echo.
252
+ #
253
+ # @param amount [String, nil]
254
+ # @param currency [String, nil]
255
+ end
256
+
257
+ # Indicates that the business sent the message to the WhatsApp user.
258
+ #
259
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#direction
260
+ module Direction
261
+ extend Telnyx::Internal::Type::Enum
262
+
263
+ OUTBOUND = :outbound
264
+
265
+ # @!method self.values
266
+ # @return [Array<Symbol>]
267
+ end
268
+
269
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#from
270
+ class From < Telnyx::Internal::Type::BaseModel
271
+ # @!attribute phone_number
272
+ # Coexistence-enabled business phone number in E.164 format.
273
+ #
274
+ # @return [String]
275
+ required :phone_number, String
276
+
277
+ # @!attribute carrier
278
+ #
279
+ # @return [String, nil]
280
+ optional :carrier, String
281
+
282
+ # @!attribute line_type
283
+ #
284
+ # @return [String, nil]
285
+ optional :line_type, String
286
+
287
+ # @!method initialize(phone_number:, carrier: nil, line_type: nil)
288
+ # @param phone_number [String] Coexistence-enabled business phone number in E.164 format.
289
+ #
290
+ # @param carrier [String]
291
+ #
292
+ # @param line_type [String]
293
+ end
294
+
295
+ # Identifies the WhatsApp Business app as the source of the message.
296
+ #
297
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#origin
298
+ module Origin
299
+ extend Telnyx::Internal::Type::Enum
300
+
301
+ WHATSAPP_BUSINESS_APP = :whatsapp_business_app
302
+
303
+ # @!method self.values
304
+ # @return [Array<Symbol>]
305
+ end
306
+
307
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#record_type
308
+ module RecordType
309
+ extend Telnyx::Internal::Type::Enum
310
+
311
+ MESSAGE = :message
312
+
313
+ # @!method self.values
314
+ # @return [Array<Symbol>]
315
+ end
316
+
317
+ # @see Telnyx::Models::WhatsappMessageEcho::Data::Payload#type
318
+ module Type
319
+ extend Telnyx::Internal::Type::Enum
320
+
321
+ WHATSAPP = :WHATSAPP
322
+
323
+ # @!method self.values
324
+ # @return [Array<Symbol>]
325
+ end
326
+ end
327
+
328
+ # @see Telnyx::Models::WhatsappMessageEcho::Data#record_type
329
+ module RecordType
330
+ extend Telnyx::Internal::Type::Enum
331
+
332
+ EVENT = :event
333
+
334
+ # @!method self.values
335
+ # @return [Array<Symbol>]
336
+ end
337
+ end
338
+ end
339
+ end
340
+ end