knockapi 1.16.0 → 1.17.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/CHANGELOG.md +26 -0
- data/README.md +1 -1
- data/lib/knockapi/internal/transport/pooled_net_requester.rb +30 -24
- data/lib/knockapi/internal/util.rb +5 -5
- data/lib/knockapi/models/identify_user_request.rb +2 -2
- data/lib/knockapi/models/inline_identify_user_request.rb +2 -2
- data/lib/knockapi/models/inline_object_request.rb +2 -2
- data/lib/knockapi/models/message.rb +94 -3
- data/lib/knockapi/models/messages/batch_archive_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_read_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_seen_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_unread_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_unarchive_response.rb +1 -1
- data/lib/knockapi/models/object_set_params.rb +2 -2
- data/lib/knockapi/models/objects/bulk_set_params.rb +2 -2
- data/lib/knockapi/models/recipients/channel_data.rb +133 -11
- data/lib/knockapi/models/recipients/channel_data_request.rb +36 -10
- data/lib/knockapi/models/recipients/inline_channel_data_request.rb +34 -8
- data/lib/knockapi/models/recipients/preference_set.rb +130 -3
- data/lib/knockapi/models/recipients/preference_set_request.rb +136 -3
- data/lib/knockapi/models/tenant_request.rb +2 -2
- data/lib/knockapi/models/tenant_set_params.rb +2 -2
- data/lib/knockapi/models/users/guide_get_channel_response.rb +270 -34
- data/lib/knockapi/resources/messages/batch.rb +7 -7
- data/lib/knockapi/resources/objects.rb +7 -3
- data/lib/knockapi/resources/tenants.rb +1 -1
- data/lib/knockapi/resources/users.rb +7 -3
- data/lib/knockapi/version.rb +1 -1
- data/lib/knockapi.rb +0 -2
- data/rbi/knockapi/models/identify_user_request.rbi +9 -9
- data/rbi/knockapi/models/inline_identify_user_request.rbi +9 -9
- data/rbi/knockapi/models/inline_object_request.rbi +9 -9
- data/rbi/knockapi/models/message.rbi +123 -2
- data/rbi/knockapi/models/messages/batch_archive_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_unarchive_response.rbi +1 -1
- data/rbi/knockapi/models/object_set_params.rbi +12 -12
- data/rbi/knockapi/models/objects/bulk_set_params.rbi +9 -9
- data/rbi/knockapi/models/recipients/channel_data.rbi +250 -12
- data/rbi/knockapi/models/recipients/channel_data_request.rbi +68 -14
- data/rbi/knockapi/models/recipients/inline_channel_data_request.rbi +57 -5
- data/rbi/knockapi/models/recipients/preference_set.rbi +279 -0
- data/rbi/knockapi/models/recipients/preference_set_request.rbi +299 -0
- data/rbi/knockapi/models/tenant_request.rbi +9 -9
- data/rbi/knockapi/models/tenant_set_params.rbi +9 -9
- data/rbi/knockapi/models/users/guide_get_channel_response.rbi +532 -70
- data/rbi/knockapi/resources/messages/batch.rbi +7 -7
- data/rbi/knockapi/resources/objects.rbi +22 -6
- data/rbi/knockapi/resources/tenants.rbi +3 -3
- data/rbi/knockapi/resources/users.rbi +22 -6
- data/sig/knockapi/models/message.rbs +79 -0
- data/sig/knockapi/models/messages/batch_archive_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs +1 -2
- data/sig/knockapi/models/messages/batch_mark_as_read_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_unarchive_response.rbs +1 -1
- data/sig/knockapi/models/recipients/channel_data.rbs +97 -7
- data/sig/knockapi/models/recipients/channel_data_request.rbs +27 -5
- data/sig/knockapi/models/recipients/inline_channel_data_request.rbs +27 -5
- data/sig/knockapi/models/recipients/preference_set.rbs +87 -0
- data/sig/knockapi/models/recipients/preference_set_request.rbs +87 -0
- data/sig/knockapi/models/users/guide_get_channel_response.rbs +294 -31
- data/sig/knockapi/resources/objects.rbs +2 -0
- data/sig/knockapi/resources/users.rbs +2 -0
- metadata +2 -8
- data/lib/knockapi/models/recipients/one_signal_channel_data.rb +0 -20
- data/lib/knockapi/models/recipients/push_channel_data.rb +0 -20
- data/rbi/knockapi/models/recipients/one_signal_channel_data.rbi +0 -33
- data/rbi/knockapi/models/recipients/push_channel_data.rbi +0 -33
- data/sig/knockapi/models/recipients/one_signal_channel_data.rbs +0 -15
- data/sig/knockapi/models/recipients/push_channel_data.rbs +0 -15
|
@@ -44,6 +44,24 @@ module Knockapi
|
|
|
44
44
|
end
|
|
45
45
|
attr_writer :channel_types
|
|
46
46
|
|
|
47
|
+
# Channel preferences.
|
|
48
|
+
sig do
|
|
49
|
+
returns(
|
|
50
|
+
T.nilable(
|
|
51
|
+
T::Hash[
|
|
52
|
+
Symbol,
|
|
53
|
+
Knockapi::Recipients::PreferenceSet::Channel::Variants
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
attr_accessor :channels
|
|
59
|
+
|
|
60
|
+
# Whether the recipient is subscribed to commercial communications. When false,
|
|
61
|
+
# the recipient will not receive commercial workflow notifications.
|
|
62
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
63
|
+
attr_accessor :commercial_subscribed
|
|
64
|
+
|
|
47
65
|
# An object where the key is the workflow key and the values are the preference
|
|
48
66
|
# settings for that workflow.
|
|
49
67
|
sig do
|
|
@@ -77,6 +95,17 @@ module Knockapi
|
|
|
77
95
|
T.nilable(
|
|
78
96
|
Knockapi::Recipients::PreferenceSetChannelTypes::OrHash
|
|
79
97
|
),
|
|
98
|
+
channels:
|
|
99
|
+
T.nilable(
|
|
100
|
+
T::Hash[
|
|
101
|
+
Symbol,
|
|
102
|
+
T.any(
|
|
103
|
+
T::Boolean,
|
|
104
|
+
Knockapi::Recipients::PreferenceSet::Channel::PreferenceSetChannelSetting::OrHash
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
),
|
|
108
|
+
commercial_subscribed: T.nilable(T::Boolean),
|
|
80
109
|
workflows:
|
|
81
110
|
T.nilable(
|
|
82
111
|
T::Hash[
|
|
@@ -97,6 +126,11 @@ module Knockapi
|
|
|
97
126
|
categories: nil,
|
|
98
127
|
# Channel type preferences.
|
|
99
128
|
channel_types: nil,
|
|
129
|
+
# Channel preferences.
|
|
130
|
+
channels: nil,
|
|
131
|
+
# Whether the recipient is subscribed to commercial communications. When false,
|
|
132
|
+
# the recipient will not receive commercial workflow notifications.
|
|
133
|
+
commercial_subscribed: nil,
|
|
100
134
|
# An object where the key is the workflow key and the values are the preference
|
|
101
135
|
# settings for that workflow.
|
|
102
136
|
workflows: nil
|
|
@@ -116,6 +150,14 @@ module Knockapi
|
|
|
116
150
|
),
|
|
117
151
|
channel_types:
|
|
118
152
|
T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes),
|
|
153
|
+
channels:
|
|
154
|
+
T.nilable(
|
|
155
|
+
T::Hash[
|
|
156
|
+
Symbol,
|
|
157
|
+
Knockapi::Recipients::PreferenceSet::Channel::Variants
|
|
158
|
+
]
|
|
159
|
+
),
|
|
160
|
+
commercial_subscribed: T.nilable(T::Boolean),
|
|
119
161
|
workflows:
|
|
120
162
|
T.nilable(
|
|
121
163
|
T::Hash[
|
|
@@ -168,6 +210,19 @@ module Knockapi
|
|
|
168
210
|
end
|
|
169
211
|
attr_writer :channel_types
|
|
170
212
|
|
|
213
|
+
# Channel preferences.
|
|
214
|
+
sig do
|
|
215
|
+
returns(
|
|
216
|
+
T.nilable(
|
|
217
|
+
T::Hash[
|
|
218
|
+
Symbol,
|
|
219
|
+
Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::Channel::Variants
|
|
220
|
+
]
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
end
|
|
224
|
+
attr_accessor :channels
|
|
225
|
+
|
|
171
226
|
# A list of conditions to apply to a channel type.
|
|
172
227
|
sig { returns(T.nilable(T::Array[Knockapi::Condition])) }
|
|
173
228
|
attr_accessor :conditions
|
|
@@ -180,12 +235,24 @@ module Knockapi
|
|
|
180
235
|
T.nilable(
|
|
181
236
|
Knockapi::Recipients::PreferenceSetChannelTypes::OrHash
|
|
182
237
|
),
|
|
238
|
+
channels:
|
|
239
|
+
T.nilable(
|
|
240
|
+
T::Hash[
|
|
241
|
+
Symbol,
|
|
242
|
+
T.any(
|
|
243
|
+
T::Boolean,
|
|
244
|
+
Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting::OrHash
|
|
245
|
+
)
|
|
246
|
+
]
|
|
247
|
+
),
|
|
183
248
|
conditions: T.nilable(T::Array[Knockapi::Condition::OrHash])
|
|
184
249
|
).returns(T.attached_class)
|
|
185
250
|
end
|
|
186
251
|
def self.new(
|
|
187
252
|
# Channel type preferences.
|
|
188
253
|
channel_types: nil,
|
|
254
|
+
# Channel preferences.
|
|
255
|
+
channels: nil,
|
|
189
256
|
# A list of conditions to apply to a channel type.
|
|
190
257
|
conditions: nil
|
|
191
258
|
)
|
|
@@ -196,12 +263,78 @@ module Knockapi
|
|
|
196
263
|
{
|
|
197
264
|
channel_types:
|
|
198
265
|
T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes),
|
|
266
|
+
channels:
|
|
267
|
+
T.nilable(
|
|
268
|
+
T::Hash[
|
|
269
|
+
Symbol,
|
|
270
|
+
Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::Channel::Variants
|
|
271
|
+
]
|
|
272
|
+
),
|
|
199
273
|
conditions: T.nilable(T::Array[Knockapi::Condition])
|
|
200
274
|
}
|
|
201
275
|
)
|
|
202
276
|
end
|
|
203
277
|
def to_hash
|
|
204
278
|
end
|
|
279
|
+
|
|
280
|
+
# Whether the specific channel (by channel_id) is enabled for the preference set,
|
|
281
|
+
# or a settings object with conditions.
|
|
282
|
+
module Channel
|
|
283
|
+
extend Knockapi::Internal::Type::Union
|
|
284
|
+
|
|
285
|
+
Variants =
|
|
286
|
+
T.type_alias do
|
|
287
|
+
T.any(
|
|
288
|
+
T::Boolean,
|
|
289
|
+
Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting
|
|
290
|
+
)
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
class PreferenceSetChannelSetting < Knockapi::Internal::Type::BaseModel
|
|
294
|
+
OrHash =
|
|
295
|
+
T.type_alias do
|
|
296
|
+
T.any(
|
|
297
|
+
Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting,
|
|
298
|
+
Knockapi::Internal::AnyHash
|
|
299
|
+
)
|
|
300
|
+
end
|
|
301
|
+
|
|
302
|
+
# A list of conditions to apply to a specific channel.
|
|
303
|
+
sig { returns(T::Array[Knockapi::Condition]) }
|
|
304
|
+
attr_accessor :conditions
|
|
305
|
+
|
|
306
|
+
# A set of settings for a specific channel. Currently, this can only be a list of
|
|
307
|
+
# conditions to apply.
|
|
308
|
+
sig do
|
|
309
|
+
params(
|
|
310
|
+
conditions: T::Array[Knockapi::Condition::OrHash]
|
|
311
|
+
).returns(T.attached_class)
|
|
312
|
+
end
|
|
313
|
+
def self.new(
|
|
314
|
+
# A list of conditions to apply to a specific channel.
|
|
315
|
+
conditions:
|
|
316
|
+
)
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
sig do
|
|
320
|
+
override.returns(
|
|
321
|
+
{ conditions: T::Array[Knockapi::Condition] }
|
|
322
|
+
)
|
|
323
|
+
end
|
|
324
|
+
def to_hash
|
|
325
|
+
end
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
sig do
|
|
329
|
+
override.returns(
|
|
330
|
+
T::Array[
|
|
331
|
+
Knockapi::Recipients::PreferenceSet::Category::PreferenceSetWorkflowCategorySettingObject::Channel::Variants
|
|
332
|
+
]
|
|
333
|
+
)
|
|
334
|
+
end
|
|
335
|
+
def self.variants
|
|
336
|
+
end
|
|
337
|
+
end
|
|
205
338
|
end
|
|
206
339
|
|
|
207
340
|
sig do
|
|
@@ -213,6 +346,61 @@ module Knockapi
|
|
|
213
346
|
end
|
|
214
347
|
end
|
|
215
348
|
|
|
349
|
+
# Whether the specific channel (by channel_id) is enabled for the preference set,
|
|
350
|
+
# or a settings object with conditions.
|
|
351
|
+
module Channel
|
|
352
|
+
extend Knockapi::Internal::Type::Union
|
|
353
|
+
|
|
354
|
+
Variants =
|
|
355
|
+
T.type_alias do
|
|
356
|
+
T.any(
|
|
357
|
+
T::Boolean,
|
|
358
|
+
Knockapi::Recipients::PreferenceSet::Channel::PreferenceSetChannelSetting
|
|
359
|
+
)
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
class PreferenceSetChannelSetting < Knockapi::Internal::Type::BaseModel
|
|
363
|
+
OrHash =
|
|
364
|
+
T.type_alias do
|
|
365
|
+
T.any(
|
|
366
|
+
Knockapi::Recipients::PreferenceSet::Channel::PreferenceSetChannelSetting,
|
|
367
|
+
Knockapi::Internal::AnyHash
|
|
368
|
+
)
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
# A list of conditions to apply to a specific channel.
|
|
372
|
+
sig { returns(T::Array[Knockapi::Condition]) }
|
|
373
|
+
attr_accessor :conditions
|
|
374
|
+
|
|
375
|
+
# A set of settings for a specific channel. Currently, this can only be a list of
|
|
376
|
+
# conditions to apply.
|
|
377
|
+
sig do
|
|
378
|
+
params(conditions: T::Array[Knockapi::Condition::OrHash]).returns(
|
|
379
|
+
T.attached_class
|
|
380
|
+
)
|
|
381
|
+
end
|
|
382
|
+
def self.new(
|
|
383
|
+
# A list of conditions to apply to a specific channel.
|
|
384
|
+
conditions:
|
|
385
|
+
)
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
sig do
|
|
389
|
+
override.returns({ conditions: T::Array[Knockapi::Condition] })
|
|
390
|
+
end
|
|
391
|
+
def to_hash
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
sig do
|
|
396
|
+
override.returns(
|
|
397
|
+
T::Array[Knockapi::Recipients::PreferenceSet::Channel::Variants]
|
|
398
|
+
)
|
|
399
|
+
end
|
|
400
|
+
def self.variants
|
|
401
|
+
end
|
|
402
|
+
end
|
|
403
|
+
|
|
216
404
|
# Workflow or category preferences within a preference set
|
|
217
405
|
module Workflow
|
|
218
406
|
extend Knockapi::Internal::Type::Union
|
|
@@ -252,6 +440,19 @@ module Knockapi
|
|
|
252
440
|
end
|
|
253
441
|
attr_writer :channel_types
|
|
254
442
|
|
|
443
|
+
# Channel preferences.
|
|
444
|
+
sig do
|
|
445
|
+
returns(
|
|
446
|
+
T.nilable(
|
|
447
|
+
T::Hash[
|
|
448
|
+
Symbol,
|
|
449
|
+
Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::Variants
|
|
450
|
+
]
|
|
451
|
+
)
|
|
452
|
+
)
|
|
453
|
+
end
|
|
454
|
+
attr_accessor :channels
|
|
455
|
+
|
|
255
456
|
# A list of conditions to apply to a channel type.
|
|
256
457
|
sig { returns(T.nilable(T::Array[Knockapi::Condition])) }
|
|
257
458
|
attr_accessor :conditions
|
|
@@ -264,12 +465,24 @@ module Knockapi
|
|
|
264
465
|
T.nilable(
|
|
265
466
|
Knockapi::Recipients::PreferenceSetChannelTypes::OrHash
|
|
266
467
|
),
|
|
468
|
+
channels:
|
|
469
|
+
T.nilable(
|
|
470
|
+
T::Hash[
|
|
471
|
+
Symbol,
|
|
472
|
+
T.any(
|
|
473
|
+
T::Boolean,
|
|
474
|
+
Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting::OrHash
|
|
475
|
+
)
|
|
476
|
+
]
|
|
477
|
+
),
|
|
267
478
|
conditions: T.nilable(T::Array[Knockapi::Condition::OrHash])
|
|
268
479
|
).returns(T.attached_class)
|
|
269
480
|
end
|
|
270
481
|
def self.new(
|
|
271
482
|
# Channel type preferences.
|
|
272
483
|
channel_types: nil,
|
|
484
|
+
# Channel preferences.
|
|
485
|
+
channels: nil,
|
|
273
486
|
# A list of conditions to apply to a channel type.
|
|
274
487
|
conditions: nil
|
|
275
488
|
)
|
|
@@ -280,12 +493,78 @@ module Knockapi
|
|
|
280
493
|
{
|
|
281
494
|
channel_types:
|
|
282
495
|
T.nilable(Knockapi::Recipients::PreferenceSetChannelTypes),
|
|
496
|
+
channels:
|
|
497
|
+
T.nilable(
|
|
498
|
+
T::Hash[
|
|
499
|
+
Symbol,
|
|
500
|
+
Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::Variants
|
|
501
|
+
]
|
|
502
|
+
),
|
|
283
503
|
conditions: T.nilable(T::Array[Knockapi::Condition])
|
|
284
504
|
}
|
|
285
505
|
)
|
|
286
506
|
end
|
|
287
507
|
def to_hash
|
|
288
508
|
end
|
|
509
|
+
|
|
510
|
+
# Whether the specific channel (by channel_id) is enabled for the preference set,
|
|
511
|
+
# or a settings object with conditions.
|
|
512
|
+
module Channel
|
|
513
|
+
extend Knockapi::Internal::Type::Union
|
|
514
|
+
|
|
515
|
+
Variants =
|
|
516
|
+
T.type_alias do
|
|
517
|
+
T.any(
|
|
518
|
+
T::Boolean,
|
|
519
|
+
Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting
|
|
520
|
+
)
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
class PreferenceSetChannelSetting < Knockapi::Internal::Type::BaseModel
|
|
524
|
+
OrHash =
|
|
525
|
+
T.type_alias do
|
|
526
|
+
T.any(
|
|
527
|
+
Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting,
|
|
528
|
+
Knockapi::Internal::AnyHash
|
|
529
|
+
)
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
# A list of conditions to apply to a specific channel.
|
|
533
|
+
sig { returns(T::Array[Knockapi::Condition]) }
|
|
534
|
+
attr_accessor :conditions
|
|
535
|
+
|
|
536
|
+
# A set of settings for a specific channel. Currently, this can only be a list of
|
|
537
|
+
# conditions to apply.
|
|
538
|
+
sig do
|
|
539
|
+
params(
|
|
540
|
+
conditions: T::Array[Knockapi::Condition::OrHash]
|
|
541
|
+
).returns(T.attached_class)
|
|
542
|
+
end
|
|
543
|
+
def self.new(
|
|
544
|
+
# A list of conditions to apply to a specific channel.
|
|
545
|
+
conditions:
|
|
546
|
+
)
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
sig do
|
|
550
|
+
override.returns(
|
|
551
|
+
{ conditions: T::Array[Knockapi::Condition] }
|
|
552
|
+
)
|
|
553
|
+
end
|
|
554
|
+
def to_hash
|
|
555
|
+
end
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
sig do
|
|
559
|
+
override.returns(
|
|
560
|
+
T::Array[
|
|
561
|
+
Knockapi::Recipients::PreferenceSet::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::Variants
|
|
562
|
+
]
|
|
563
|
+
)
|
|
564
|
+
end
|
|
565
|
+
def self.variants
|
|
566
|
+
end
|
|
567
|
+
end
|
|
289
568
|
end
|
|
290
569
|
|
|
291
570
|
sig do
|