zavudev 0.19.0 → 0.20.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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/zavudev/models/function_create_params.rb +36 -4
  5. data/lib/zavudev/models/function_create_response.rb +4 -2
  6. data/lib/zavudev/models/function_deploy_params.rb +31 -3
  7. data/lib/zavudev/models/function_deploy_response.rb +20 -3
  8. data/lib/zavudev/models/function_get_deployment_response.rb +20 -3
  9. data/lib/zavudev/models/function_retrieve_response.rb +4 -2
  10. data/lib/zavudev/models/function_update_params.rb +41 -3
  11. data/lib/zavudev/models/function_update_response.rb +4 -2
  12. data/lib/zavudev/models/invitation.rb +101 -8
  13. data/lib/zavudev/models/invitation_create_params.rb +34 -8
  14. data/lib/zavudev/models/invitation_list_params.rb +14 -0
  15. data/lib/zavudev/models/message.rb +14 -0
  16. data/lib/zavudev/models/message_type.rb +16 -0
  17. data/lib/zavudev/models/phone_number_pricing.rb +7 -2
  18. data/lib/zavudev/models/phone_number_search_available_params.rb +13 -1
  19. data/lib/zavudev/models/sender.rb +12 -1
  20. data/lib/zavudev/models/sender_create_params.rb +72 -4
  21. data/lib/zavudev/models/sender_update_params.rb +65 -1
  22. data/lib/zavudev/models/sender_webhook.rb +47 -1
  23. data/lib/zavudev/models/senders/agent/agent_tool.rb +19 -1
  24. data/lib/zavudev/models/senders/agent/tool_create_params.rb +7 -2
  25. data/lib/zavudev/models/senders/agent/tool_test_response.rb +90 -5
  26. data/lib/zavudev/models/senders/agent.rb +198 -1
  27. data/lib/zavudev/models/senders/agent_create_params.rb +188 -1
  28. data/lib/zavudev/models/senders/agent_execution.rb +26 -1
  29. data/lib/zavudev/models/senders/agent_update_params.rb +188 -1
  30. data/lib/zavudev/models/template.rb +1 -0
  31. data/lib/zavudev/models/template_create_params.rb +19 -9
  32. data/lib/zavudev/models/webhook_event.rb +31 -1
  33. data/lib/zavudev/resources/broadcasts.rb +20 -4
  34. data/lib/zavudev/resources/functions.rb +35 -10
  35. data/lib/zavudev/resources/invitations.rb +19 -6
  36. data/lib/zavudev/resources/messages.rb +13 -4
  37. data/lib/zavudev/resources/number_10dlc/brands.rb +5 -1
  38. data/lib/zavudev/resources/number_10dlc/campaigns.rb +6 -1
  39. data/lib/zavudev/resources/phone_numbers.rb +12 -3
  40. data/lib/zavudev/resources/senders/agent/executions.rb +5 -0
  41. data/lib/zavudev/resources/senders/agent/tools.rb +14 -2
  42. data/lib/zavudev/resources/senders/agent.rb +18 -2
  43. data/lib/zavudev/resources/senders.rb +15 -3
  44. data/lib/zavudev/version.rb +1 -1
  45. data/rbi/zavudev/models/function_create_params.rbi +50 -2
  46. data/rbi/zavudev/models/function_create_response.rbi +6 -2
  47. data/rbi/zavudev/models/function_deploy_params.rbi +42 -2
  48. data/rbi/zavudev/models/function_deploy_response.rbi +20 -0
  49. data/rbi/zavudev/models/function_get_deployment_response.rbi +20 -0
  50. data/rbi/zavudev/models/function_retrieve_response.rbi +6 -2
  51. data/rbi/zavudev/models/function_update_params.rbi +57 -2
  52. data/rbi/zavudev/models/function_update_response.rbi +6 -2
  53. data/rbi/zavudev/models/invitation.rbi +162 -8
  54. data/rbi/zavudev/models/invitation_create_params.rbi +54 -10
  55. data/rbi/zavudev/models/invitation_list_params.rbi +17 -0
  56. data/rbi/zavudev/models/message.rbi +28 -0
  57. data/rbi/zavudev/models/message_type.rbi +18 -0
  58. data/rbi/zavudev/models/phone_number_pricing.rbi +6 -2
  59. data/rbi/zavudev/models/phone_number_search_available_params.rbi +13 -0
  60. data/rbi/zavudev/models/sender.rbi +17 -0
  61. data/rbi/zavudev/models/sender_create_params.rbi +136 -4
  62. data/rbi/zavudev/models/sender_update_params.rbi +124 -0
  63. data/rbi/zavudev/models/sender_webhook.rbi +69 -0
  64. data/rbi/zavudev/models/senders/agent/agent_tool.rbi +26 -3
  65. data/rbi/zavudev/models/senders/agent/tool_create_params.rbi +6 -2
  66. data/rbi/zavudev/models/senders/agent/tool_test_response.rbi +130 -5
  67. data/rbi/zavudev/models/senders/agent.rbi +320 -3
  68. data/rbi/zavudev/models/senders/agent_create_params.rbi +304 -0
  69. data/rbi/zavudev/models/senders/agent_execution.rbi +31 -3
  70. data/rbi/zavudev/models/senders/agent_update_params.rbi +304 -0
  71. data/rbi/zavudev/models/template.rbi +5 -0
  72. data/rbi/zavudev/models/template_create_params.rbi +27 -6
  73. data/rbi/zavudev/models/webhook_event.rbi +35 -1
  74. data/rbi/zavudev/resources/broadcasts.rbi +20 -4
  75. data/rbi/zavudev/resources/functions.rbi +62 -6
  76. data/rbi/zavudev/resources/invitations.rbi +37 -8
  77. data/rbi/zavudev/resources/messages.rbi +12 -3
  78. data/rbi/zavudev/resources/number_10dlc/brands.rbi +5 -1
  79. data/rbi/zavudev/resources/number_10dlc/campaigns.rbi +6 -1
  80. data/rbi/zavudev/resources/phone_numbers.rbi +10 -2
  81. data/rbi/zavudev/resources/senders/agent/executions.rbi +5 -0
  82. data/rbi/zavudev/resources/senders/agent/tools.rbi +13 -2
  83. data/rbi/zavudev/resources/senders/agent.rbi +16 -0
  84. data/rbi/zavudev/resources/senders.rbi +56 -2
  85. data/sig/zavudev/models/function_create_params.rbs +14 -0
  86. data/sig/zavudev/models/function_deploy_params.rbs +14 -0
  87. data/sig/zavudev/models/function_deploy_response.rbs +5 -0
  88. data/sig/zavudev/models/function_get_deployment_response.rbs +5 -0
  89. data/sig/zavudev/models/function_update_params.rbs +21 -0
  90. data/sig/zavudev/models/invitation.rbs +58 -2
  91. data/sig/zavudev/models/invitation_create_params.rbs +2 -1
  92. data/sig/zavudev/models/invitation_list_params.rbs +3 -1
  93. data/sig/zavudev/models/message_type.rbs +4 -0
  94. data/sig/zavudev/models/phone_number_search_available_params.rbs +7 -0
  95. data/sig/zavudev/models/sender.rbs +7 -0
  96. data/sig/zavudev/models/sender_create_params.rbs +35 -0
  97. data/sig/zavudev/models/sender_update_params.rbs +35 -0
  98. data/sig/zavudev/models/sender_webhook.rbs +17 -0
  99. data/sig/zavudev/models/senders/agent/agent_tool.rbs +10 -3
  100. data/sig/zavudev/models/senders/agent/tool_test_response.rbs +68 -4
  101. data/sig/zavudev/models/senders/agent.rbs +161 -3
  102. data/sig/zavudev/models/senders/agent_create_params.rbs +152 -1
  103. data/sig/zavudev/models/senders/agent_execution.rbs +13 -3
  104. data/sig/zavudev/models/senders/agent_update_params.rbs +152 -1
  105. data/sig/zavudev/models/template.rbs +2 -1
  106. data/sig/zavudev/models/template_create_params.rbs +9 -6
  107. data/sig/zavudev/models/webhook_event.rbs +10 -0
  108. data/sig/zavudev/resources/functions.rbs +7 -0
  109. data/sig/zavudev/resources/phone_numbers.rbs +1 -0
  110. data/sig/zavudev/resources/senders/agent.rbs +2 -0
  111. data/sig/zavudev/resources/senders.rbs +6 -0
  112. metadata +2 -2
@@ -20,6 +20,11 @@ module Zavudev
20
20
  attr_accessor :expires_at
21
21
 
22
22
  # Current status of the partner invitation.
23
+ #
24
+ # `failed` means the client started the connection and it did not finish (they
25
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
26
+ # invitation is still usable: the same link can be retried, and it moves back to
27
+ # `in_progress` when the client tries again.
23
28
  sig { returns(Zavudev::Invitation::Status::TaggedSymbol) }
24
29
  attr_accessor :status
25
30
 
@@ -42,8 +47,23 @@ module Zavudev
42
47
  sig { returns(T.nilable(Time)) }
43
48
  attr_accessor :completed_at
44
49
 
45
- # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
46
- # embedded signup).
50
+ # The account the client linked, populated once the invitation is `completed`.
51
+ # Null before that. Use it to show the partner what was connected without fetching
52
+ # the sender.
53
+ sig { returns(T.nilable(Zavudev::Invitation::ConnectedAccount)) }
54
+ attr_reader :connected_account
55
+
56
+ sig do
57
+ params(
58
+ connected_account:
59
+ T.nilable(Zavudev::Invitation::ConnectedAccount::OrHash)
60
+ ).void
61
+ end
62
+ attr_writer :connected_account
63
+
64
+ # Which Meta channel the client connects: `whatsapp_waba` (official WhatsApp Cloud
65
+ # API via embedded signup) or `messenger` (a Facebook Page's Messenger inbox,
66
+ # including Marketplace chats).
47
67
  sig do
48
68
  returns(T.nilable(Zavudev::Invitation::ConnectionType::TaggedSymbol))
49
69
  end
@@ -56,7 +76,19 @@ module Zavudev
56
76
  end
57
77
  attr_writer :connection_type
58
78
 
59
- # ID of a pre-assigned Zavu phone number for WhatsApp registration.
79
+ sig { returns(T.nilable(Time)) }
80
+ attr_accessor :failed_at
81
+
82
+ # Stable code for why the last attempt failed, present when `status` is `failed`.
83
+ # Values include `fb_cancelled` (client closed Meta's dialog), `fb_not_authorized`
84
+ # (permission denied), `signup_abandoned` (started but never finished),
85
+ # `meta_no_pages` (the client administers no Facebook Page), and `internal_error`.
86
+ # Treat unknown codes as a generic failure.
87
+ sig { returns(T.nilable(String)) }
88
+ attr_accessor :failure_reason
89
+
90
+ # ID of a pre-assigned Zavu phone number for WhatsApp registration. Always null
91
+ # for `messenger` invitations.
60
92
  sig { returns(T.nilable(String)) }
61
93
  attr_accessor :phone_number_id
62
94
 
@@ -83,7 +115,11 @@ module Zavudev
83
115
  client_name: T.nilable(String),
84
116
  client_phone: T.nilable(String),
85
117
  completed_at: T.nilable(Time),
118
+ connected_account:
119
+ T.nilable(Zavudev::Invitation::ConnectedAccount::OrHash),
86
120
  connection_type: Zavudev::Invitation::ConnectionType::OrSymbol,
121
+ failed_at: T.nilable(Time),
122
+ failure_reason: T.nilable(String),
87
123
  phone_number_id: T.nilable(String),
88
124
  sender_id: T.nilable(String),
89
125
  started_at: T.nilable(Time),
@@ -97,6 +133,11 @@ module Zavudev
97
133
  created_at:,
98
134
  expires_at:,
99
135
  # Current status of the partner invitation.
136
+ #
137
+ # `failed` means the client started the connection and it did not finish (they
138
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
139
+ # invitation is still usable: the same link can be retried, and it moves back to
140
+ # `in_progress` when the client tries again.
100
141
  status:,
101
142
  updated_at:,
102
143
  # Full URL to share with the client.
@@ -105,10 +146,23 @@ module Zavudev
105
146
  client_name: nil,
106
147
  client_phone: nil,
107
148
  completed_at: nil,
108
- # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
109
- # embedded signup).
149
+ # The account the client linked, populated once the invitation is `completed`.
150
+ # Null before that. Use it to show the partner what was connected without fetching
151
+ # the sender.
152
+ connected_account: nil,
153
+ # Which Meta channel the client connects: `whatsapp_waba` (official WhatsApp Cloud
154
+ # API via embedded signup) or `messenger` (a Facebook Page's Messenger inbox,
155
+ # including Marketplace chats).
110
156
  connection_type: nil,
111
- # ID of a pre-assigned Zavu phone number for WhatsApp registration.
157
+ failed_at: nil,
158
+ # Stable code for why the last attempt failed, present when `status` is `failed`.
159
+ # Values include `fb_cancelled` (client closed Meta's dialog), `fb_not_authorized`
160
+ # (permission denied), `signup_abandoned` (started but never finished),
161
+ # `meta_no_pages` (the client administers no Facebook Page), and `internal_error`.
162
+ # Treat unknown codes as a generic failure.
163
+ failure_reason: nil,
164
+ # ID of a pre-assigned Zavu phone number for WhatsApp registration. Always null
165
+ # for `messenger` invitations.
112
166
  phone_number_id: nil,
113
167
  # ID of the sender created when invitation is completed.
114
168
  sender_id: nil,
@@ -131,7 +185,10 @@ module Zavudev
131
185
  client_name: T.nilable(String),
132
186
  client_phone: T.nilable(String),
133
187
  completed_at: T.nilable(Time),
188
+ connected_account: T.nilable(Zavudev::Invitation::ConnectedAccount),
134
189
  connection_type: Zavudev::Invitation::ConnectionType::TaggedSymbol,
190
+ failed_at: T.nilable(Time),
191
+ failure_reason: T.nilable(String),
135
192
  phone_number_id: T.nilable(String),
136
193
  sender_id: T.nilable(String),
137
194
  started_at: T.nilable(Time),
@@ -143,6 +200,11 @@ module Zavudev
143
200
  end
144
201
 
145
202
  # Current status of the partner invitation.
203
+ #
204
+ # `failed` means the client started the connection and it did not finish (they
205
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
206
+ # invitation is still usable: the same link can be retried, and it moves back to
207
+ # `in_progress` when the client tries again.
146
208
  module Status
147
209
  extend Zavudev::Internal::Type::Enum
148
210
 
@@ -156,6 +218,7 @@ module Zavudev
156
218
  COMPLETED = T.let(:completed, Zavudev::Invitation::Status::TaggedSymbol)
157
219
  EXPIRED = T.let(:expired, Zavudev::Invitation::Status::TaggedSymbol)
158
220
  CANCELLED = T.let(:cancelled, Zavudev::Invitation::Status::TaggedSymbol)
221
+ FAILED = T.let(:failed, Zavudev::Invitation::Status::TaggedSymbol)
159
222
 
160
223
  sig do
161
224
  override.returns(T::Array[Zavudev::Invitation::Status::TaggedSymbol])
@@ -164,8 +227,97 @@ module Zavudev
164
227
  end
165
228
  end
166
229
 
167
- # How the client connects WhatsApp: `whatsapp_waba` (official Cloud API via
168
- # embedded signup).
230
+ class ConnectedAccount < Zavudev::Internal::Type::BaseModel
231
+ OrHash =
232
+ T.type_alias do
233
+ T.any(
234
+ Zavudev::Invitation::ConnectedAccount,
235
+ Zavudev::Internal::AnyHash
236
+ )
237
+ end
238
+
239
+ # Provider-side identifier: the WhatsApp phone number ID, or the Facebook Page ID.
240
+ sig { returns(String) }
241
+ attr_accessor :id
242
+
243
+ sig do
244
+ returns(Zavudev::Invitation::ConnectedAccount::Channel::TaggedSymbol)
245
+ end
246
+ attr_accessor :channel
247
+
248
+ # Display name of the connected account: the WhatsApp verified name, or the
249
+ # Facebook Page name.
250
+ sig { returns(T.nilable(String)) }
251
+ attr_accessor :name
252
+
253
+ # The account the client linked, populated once the invitation is `completed`.
254
+ # Null before that. Use it to show the partner what was connected without fetching
255
+ # the sender.
256
+ sig do
257
+ params(
258
+ id: String,
259
+ channel: Zavudev::Invitation::ConnectedAccount::Channel::OrSymbol,
260
+ name: T.nilable(String)
261
+ ).returns(T.attached_class)
262
+ end
263
+ def self.new(
264
+ # Provider-side identifier: the WhatsApp phone number ID, or the Facebook Page ID.
265
+ id:,
266
+ channel:,
267
+ # Display name of the connected account: the WhatsApp verified name, or the
268
+ # Facebook Page name.
269
+ name: nil
270
+ )
271
+ end
272
+
273
+ sig do
274
+ override.returns(
275
+ {
276
+ id: String,
277
+ channel:
278
+ Zavudev::Invitation::ConnectedAccount::Channel::TaggedSymbol,
279
+ name: T.nilable(String)
280
+ }
281
+ )
282
+ end
283
+ def to_hash
284
+ end
285
+
286
+ module Channel
287
+ extend Zavudev::Internal::Type::Enum
288
+
289
+ TaggedSymbol =
290
+ T.type_alias do
291
+ T.all(Symbol, Zavudev::Invitation::ConnectedAccount::Channel)
292
+ end
293
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
294
+
295
+ WHATSAPP =
296
+ T.let(
297
+ :whatsapp,
298
+ Zavudev::Invitation::ConnectedAccount::Channel::TaggedSymbol
299
+ )
300
+ MESSENGER =
301
+ T.let(
302
+ :messenger,
303
+ Zavudev::Invitation::ConnectedAccount::Channel::TaggedSymbol
304
+ )
305
+
306
+ sig do
307
+ override.returns(
308
+ T::Array[
309
+ Zavudev::Invitation::ConnectedAccount::Channel::TaggedSymbol
310
+ ]
311
+ )
312
+ end
313
+ def self.values
314
+ end
315
+ end
316
+ end
317
+
318
+ # Which Meta channel the client connects: `whatsapp_waba` (official WhatsApp Cloud
319
+ # API via embedded signup) or `messenger` (a Facebook Page's Messenger inbox,
320
+ # including Marketplace chats).
169
321
  module ConnectionType
170
322
  extend Zavudev::Internal::Type::Enum
171
323
 
@@ -178,6 +330,8 @@ module Zavudev
178
330
  :whatsapp_waba,
179
331
  Zavudev::Invitation::ConnectionType::TaggedSymbol
180
332
  )
333
+ MESSENGER =
334
+ T.let(:messenger, Zavudev::Invitation::ConnectionType::TaggedSymbol)
181
335
 
182
336
  sig do
183
337
  override.returns(
@@ -11,7 +11,8 @@ module Zavudev
11
11
  T.any(Zavudev::InvitationCreateParams, Zavudev::Internal::AnyHash)
12
12
  end
13
13
 
14
- # ISO country codes for allowed phone numbers.
14
+ # ISO country codes for allowed phone numbers. Only valid when `connectionType` is
15
+ # `whatsapp_waba` — sending it with `messenger` returns 400.
15
16
  sig { returns(T.nilable(T::Array[String])) }
16
17
  attr_reader :allowed_phone_countries
17
18
 
@@ -39,8 +40,19 @@ module Zavudev
39
40
  sig { params(client_phone: String).void }
40
41
  attr_writer :client_phone
41
42
 
42
- # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
43
- # signup to link an official WhatsApp Business Account.
43
+ # Which Meta channel the client connects, and how.
44
+ #
45
+ # - `whatsapp_waba` (default): Meta's embedded signup links an official WhatsApp
46
+ # Business Account. Accepts `phoneNumberId` and `allowedPhoneCountries`.
47
+ # - `messenger`: the client authorizes with Facebook and picks a Facebook Page
48
+ # they administer. The Page's Messenger inbox — including Marketplace chats — is
49
+ # routed to Zavu. They must be an admin of at least one Page. A Page can only be
50
+ # connected to one Zavu project at a time: if the client picks a Page that
51
+ # another project already connected, the newer connection wins and the older one
52
+ # is disconnected.
53
+ #
54
+ # One invitation connects one channel. To onboard a client on several channels,
55
+ # create one invitation per channel; each completes into its own sender.
44
56
  sig do
45
57
  returns(
46
58
  T.nilable(Zavudev::InvitationCreateParams::ConnectionType::OrSymbol)
@@ -64,7 +76,9 @@ module Zavudev
64
76
  attr_writer :expires_in_days
65
77
 
66
78
  # ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
67
- # the client will use this number instead of their own.
79
+ # the client will use this number instead of their own. Only valid when
80
+ # `connectionType` is `whatsapp_waba` — sending it with `messenger` returns 400,
81
+ # since a Facebook Page has no phone number.
68
82
  sig { returns(T.nilable(String)) }
69
83
  attr_reader :phone_number_id
70
84
 
@@ -85,7 +99,8 @@ module Zavudev
85
99
  ).returns(T.attached_class)
86
100
  end
87
101
  def self.new(
88
- # ISO country codes for allowed phone numbers.
102
+ # ISO country codes for allowed phone numbers. Only valid when `connectionType` is
103
+ # `whatsapp_waba` — sending it with `messenger` returns 400.
89
104
  allowed_phone_countries: nil,
90
105
  # Email of the client being invited.
91
106
  client_email: nil,
@@ -93,13 +108,26 @@ module Zavudev
93
108
  client_name: nil,
94
109
  # Phone number of the client in E.164 format.
95
110
  client_phone: nil,
96
- # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
97
- # signup to link an official WhatsApp Business Account.
111
+ # Which Meta channel the client connects, and how.
112
+ #
113
+ # - `whatsapp_waba` (default): Meta's embedded signup links an official WhatsApp
114
+ # Business Account. Accepts `phoneNumberId` and `allowedPhoneCountries`.
115
+ # - `messenger`: the client authorizes with Facebook and picks a Facebook Page
116
+ # they administer. The Page's Messenger inbox — including Marketplace chats — is
117
+ # routed to Zavu. They must be an admin of at least one Page. A Page can only be
118
+ # connected to one Zavu project at a time: if the client picks a Page that
119
+ # another project already connected, the newer connection wins and the older one
120
+ # is disconnected.
121
+ #
122
+ # One invitation connects one channel. To onboard a client on several channels,
123
+ # create one invitation per channel; each completes into its own sender.
98
124
  connection_type: nil,
99
125
  # Number of days until the invitation expires.
100
126
  expires_in_days: nil,
101
127
  # ID of a Zavu phone number to pre-assign for WhatsApp registration. If provided,
102
- # the client will use this number instead of their own.
128
+ # the client will use this number instead of their own. Only valid when
129
+ # `connectionType` is `whatsapp_waba` — sending it with `messenger` returns 400,
130
+ # since a Facebook Page has no phone number.
103
131
  phone_number_id: nil,
104
132
  request_options: {}
105
133
  )
@@ -123,8 +151,19 @@ module Zavudev
123
151
  def to_hash
124
152
  end
125
153
 
126
- # How the client connects WhatsApp. `whatsapp_waba` (default) runs Meta's embedded
127
- # signup to link an official WhatsApp Business Account.
154
+ # Which Meta channel the client connects, and how.
155
+ #
156
+ # - `whatsapp_waba` (default): Meta's embedded signup links an official WhatsApp
157
+ # Business Account. Accepts `phoneNumberId` and `allowedPhoneCountries`.
158
+ # - `messenger`: the client authorizes with Facebook and picks a Facebook Page
159
+ # they administer. The Page's Messenger inbox — including Marketplace chats — is
160
+ # routed to Zavu. They must be an admin of at least one Page. A Page can only be
161
+ # connected to one Zavu project at a time: if the client picks a Page that
162
+ # another project already connected, the newer connection wins and the older one
163
+ # is disconnected.
164
+ #
165
+ # One invitation connects one channel. To onboard a client on several channels,
166
+ # create one invitation per channel; each completes into its own sender.
128
167
  module ConnectionType
129
168
  extend Zavudev::Internal::Type::Enum
130
169
 
@@ -139,6 +178,11 @@ module Zavudev
139
178
  :whatsapp_waba,
140
179
  Zavudev::InvitationCreateParams::ConnectionType::TaggedSymbol
141
180
  )
181
+ MESSENGER =
182
+ T.let(
183
+ :messenger,
184
+ Zavudev::InvitationCreateParams::ConnectionType::TaggedSymbol
185
+ )
142
186
 
143
187
  sig do
144
188
  override.returns(
@@ -24,6 +24,11 @@ module Zavudev
24
24
  attr_writer :limit
25
25
 
26
26
  # Current status of the partner invitation.
27
+ #
28
+ # `failed` means the client started the connection and it did not finish (they
29
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
30
+ # invitation is still usable: the same link can be retried, and it moves back to
31
+ # `in_progress` when the client tries again.
27
32
  sig do
28
33
  returns(T.nilable(Zavudev::InvitationListParams::Status::OrSymbol))
29
34
  end
@@ -46,6 +51,11 @@ module Zavudev
46
51
  cursor: nil,
47
52
  limit: nil,
48
53
  # Current status of the partner invitation.
54
+ #
55
+ # `failed` means the client started the connection and it did not finish (they
56
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
57
+ # invitation is still usable: the same link can be retried, and it moves back to
58
+ # `in_progress` when the client tries again.
49
59
  status: nil,
50
60
  request_options: {}
51
61
  )
@@ -65,6 +75,11 @@ module Zavudev
65
75
  end
66
76
 
67
77
  # Current status of the partner invitation.
78
+ #
79
+ # `failed` means the client started the connection and it did not finish (they
80
+ # cancelled Meta's dialog, denied a permission, or abandoned the tab). A failed
81
+ # invitation is still usable: the same link can be retried, and it moves back to
82
+ # `in_progress` when the client tries again.
68
83
  module Status
69
84
  extend Zavudev::Internal::Type::Enum
70
85
 
@@ -85,6 +100,8 @@ module Zavudev
85
100
  T.let(:expired, Zavudev::InvitationListParams::Status::TaggedSymbol)
86
101
  CANCELLED =
87
102
  T.let(:cancelled, Zavudev::InvitationListParams::Status::TaggedSymbol)
103
+ FAILED =
104
+ T.let(:failed, Zavudev::InvitationListParams::Status::TaggedSymbol)
88
105
 
89
106
  sig do
90
107
  override.returns(
@@ -18,6 +18,20 @@ module Zavudev
18
18
 
19
19
  # Type of message. Non-text types are supported by WhatsApp and Telegram (varies
20
20
  # by type).
21
+ #
22
+ # `location_request` asks the recipient to share their location and is
23
+ # WhatsApp-only. It takes no `content` object — the prompt goes in `text` (max
24
+ # 1024 characters) and the button label is fixed by WhatsApp. The recipient's
25
+ # answer arrives as an inbound `location` message whose `content.replyToMessageId`
26
+ # is the ID of the request.
27
+ #
28
+ # `request_contact_info` asks the recipient to share their phone number and is
29
+ # WhatsApp-only. Like `location_request` it takes no `content` object — the prompt
30
+ # goes in `text` (max 1024 characters) and WhatsApp renders a fixed **Share
31
+ # Contact Info** button. The answer arrives as an inbound `contact` message. Use
32
+ # it to recover the phone number of a contact who adopted a WhatsApp username and
33
+ # is only known by their business-scoped user ID (BSUID); when they share it, Zavu
34
+ # automatically links the phone number to that contact.
21
35
  sig { returns(Zavudev::MessageType::TaggedSymbol) }
22
36
  attr_accessor :message_type
23
37
 
@@ -131,6 +145,20 @@ module Zavudev
131
145
  created_at:,
132
146
  # Type of message. Non-text types are supported by WhatsApp and Telegram (varies
133
147
  # by type).
148
+ #
149
+ # `location_request` asks the recipient to share their location and is
150
+ # WhatsApp-only. It takes no `content` object — the prompt goes in `text` (max
151
+ # 1024 characters) and the button label is fixed by WhatsApp. The recipient's
152
+ # answer arrives as an inbound `location` message whose `content.replyToMessageId`
153
+ # is the ID of the request.
154
+ #
155
+ # `request_contact_info` asks the recipient to share their phone number and is
156
+ # WhatsApp-only. Like `location_request` it takes no `content` object — the prompt
157
+ # goes in `text` (max 1024 characters) and WhatsApp renders a fixed **Share
158
+ # Contact Info** button. The answer arrives as an inbound `contact` message. Use
159
+ # it to recover the phone number of a contact who adopted a WhatsApp username and
160
+ # is only known by their business-scoped user ID (BSUID); when they share it, Zavu
161
+ # automatically links the phone number to that contact.
134
162
  message_type:,
135
163
  status:,
136
164
  to:,
@@ -4,6 +4,20 @@ module Zavudev
4
4
  module Models
5
5
  # Type of message. Non-text types are supported by WhatsApp and Telegram (varies
6
6
  # by type).
7
+ #
8
+ # `location_request` asks the recipient to share their location and is
9
+ # WhatsApp-only. It takes no `content` object — the prompt goes in `text` (max
10
+ # 1024 characters) and the button label is fixed by WhatsApp. The recipient's
11
+ # answer arrives as an inbound `location` message whose `content.replyToMessageId`
12
+ # is the ID of the request.
13
+ #
14
+ # `request_contact_info` asks the recipient to share their phone number and is
15
+ # WhatsApp-only. Like `location_request` it takes no `content` object — the prompt
16
+ # goes in `text` (max 1024 characters) and WhatsApp renders a fixed **Share
17
+ # Contact Info** button. The answer arrives as an inbound `contact` message. Use
18
+ # it to recover the phone number of a contact who adopted a WhatsApp username and
19
+ # is only known by their business-scoped user ID (BSUID); when they share it, Zavu
20
+ # automatically links the phone number to that contact.
7
21
  module MessageType
8
22
  extend Zavudev::Internal::Type::Enum
9
23
 
@@ -21,6 +35,10 @@ module Zavudev
21
35
  BUTTONS = T.let(:buttons, Zavudev::MessageType::TaggedSymbol)
22
36
  LIST = T.let(:list, Zavudev::MessageType::TaggedSymbol)
23
37
  CTA_URL = T.let(:cta_url, Zavudev::MessageType::TaggedSymbol)
38
+ REQUEST_CONTACT_INFO =
39
+ T.let(:request_contact_info, Zavudev::MessageType::TaggedSymbol)
40
+ LOCATION_REQUEST =
41
+ T.let(:location_request, Zavudev::MessageType::TaggedSymbol)
24
42
  REACTION = T.let(:reaction, Zavudev::MessageType::TaggedSymbol)
25
43
  TEMPLATE = T.let(:template, Zavudev::MessageType::TaggedSymbol)
26
44
 
@@ -8,7 +8,9 @@ module Zavudev
8
8
  T.any(Zavudev::PhoneNumberPricing, Zavudev::Internal::AnyHash)
9
9
  end
10
10
 
11
- # Whether this number qualifies for the free first US number offer.
11
+ # Whether this number qualifies as the plan-included US number on paid plans. The
12
+ # benefit is one per account: it is never offered again once claimed, not even
13
+ # after the number is released.
12
14
  sig { returns(T.nilable(T::Boolean)) }
13
15
  attr_reader :is_free_eligible
14
16
 
@@ -37,7 +39,9 @@ module Zavudev
37
39
  ).returns(T.attached_class)
38
40
  end
39
41
  def self.new(
40
- # Whether this number qualifies for the free first US number offer.
42
+ # Whether this number qualifies as the plan-included US number on paid plans. The
43
+ # benefit is one per account: it is never offered again once claimed, not even
44
+ # after the number is released.
41
45
  is_free_eligible: nil,
42
46
  # Monthly price in USD.
43
47
  monthly_price: nil,
@@ -18,6 +18,14 @@ module Zavudev
18
18
  sig { returns(String) }
19
19
  attr_accessor :country_code
20
20
 
21
+ # Comma-separated capabilities the number must have: `sms`, `voice`, `mms`.
22
+ # Numbers missing any of them are dropped.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :capabilities
25
+
26
+ sig { params(capabilities: String).void }
27
+ attr_writer :capabilities
28
+
21
29
  # Search for numbers containing this string.
22
30
  sig { returns(T.nilable(String)) }
23
31
  attr_reader :contains
@@ -42,6 +50,7 @@ module Zavudev
42
50
  sig do
43
51
  params(
44
52
  country_code: String,
53
+ capabilities: String,
45
54
  contains: String,
46
55
  limit: Integer,
47
56
  type: Zavudev::PhoneNumberType::OrSymbol,
@@ -51,6 +60,9 @@ module Zavudev
51
60
  def self.new(
52
61
  # Two-letter ISO country code.
53
62
  country_code:,
63
+ # Comma-separated capabilities the number must have: `sms`, `voice`, `mms`.
64
+ # Numbers missing any of them are dropped.
65
+ capabilities: nil,
54
66
  # Search for numbers containing this string.
55
67
  contains: nil,
56
68
  # Maximum number of results to return.
@@ -65,6 +77,7 @@ module Zavudev
65
77
  override.returns(
66
78
  {
67
79
  country_code: String,
80
+ capabilities: String,
68
81
  contains: String,
69
82
  limit: Integer,
70
83
  type: Zavudev::PhoneNumberType::OrSymbol,
@@ -16,6 +16,16 @@ module Zavudev
16
16
  sig { returns(String) }
17
17
  attr_accessor :phone_number
18
18
 
19
+ # Channels this sender can actually send on right now, computed from its
20
+ # configuration. Empty means the sender cannot send or receive anything yet: a
21
+ # phoneNumber alone does not enable SMS or voice. Check this rather than inferring
22
+ # capability from phoneNumber or emailAddress.
23
+ sig { returns(T.nilable(T::Array[String])) }
24
+ attr_reader :channels
25
+
26
+ sig { params(channels: T::Array[String]).void }
27
+ attr_writer :channels
28
+
19
29
  sig { returns(T.nilable(Time)) }
20
30
  attr_reader :created_at
21
31
 
@@ -78,6 +88,7 @@ module Zavudev
78
88
  id: String,
79
89
  name: String,
80
90
  phone_number: String,
91
+ channels: T::Array[String],
81
92
  created_at: Time,
82
93
  email_address: String,
83
94
  email_catch_all_enabled: T::Boolean,
@@ -93,6 +104,11 @@ module Zavudev
93
104
  name:,
94
105
  # Phone number in E.164 format.
95
106
  phone_number:,
107
+ # Channels this sender can actually send on right now, computed from its
108
+ # configuration. Empty means the sender cannot send or receive anything yet: a
109
+ # phoneNumber alone does not enable SMS or voice. Check this rather than inferring
110
+ # capability from phoneNumber or emailAddress.
111
+ channels: nil,
96
112
  created_at: nil,
97
113
  # From-address for the email channel, if configured.
98
114
  email_address: nil,
@@ -119,6 +135,7 @@ module Zavudev
119
135
  id: String,
120
136
  name: String,
121
137
  phone_number: String,
138
+ channels: T::Array[String],
122
139
  created_at: Time,
123
140
  email_address: String,
124
141
  email_catch_all_enabled: T::Boolean,