knockapi 1.1.0 → 1.2.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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/knockapi/internal/type/array_of.rb +8 -0
  5. data/lib/knockapi/internal/type/base_model.rb +7 -0
  6. data/lib/knockapi/internal/type/boolean.rb +8 -0
  7. data/lib/knockapi/internal/type/enum.rb +12 -0
  8. data/lib/knockapi/internal/type/file_input.rb +7 -0
  9. data/lib/knockapi/internal/type/hash_of.rb +8 -0
  10. data/lib/knockapi/internal/type/union.rb +12 -0
  11. data/lib/knockapi/internal/type/unknown.rb +8 -0
  12. data/lib/knockapi/internal/util.rb +45 -0
  13. data/lib/knockapi/internal.rb +3 -0
  14. data/lib/knockapi/models/inline_tenant_request.rb +0 -4
  15. data/lib/knockapi/models/message_delivery_log.rb +0 -8
  16. data/lib/knockapi/models/message_get_content_response.rb +0 -21
  17. data/lib/knockapi/models/message_list_params.rb +5 -2
  18. data/lib/knockapi/models/messages/batch_get_content_response.rb +0 -21
  19. data/lib/knockapi/models/object_list_messages_params.rb +5 -2
  20. data/lib/knockapi/models/recipient.rb +0 -4
  21. data/lib/knockapi/models/recipient_reference.rb +0 -4
  22. data/lib/knockapi/models/recipient_request.rb +0 -4
  23. data/lib/knockapi/models/recipients/channel_data.rb +0 -12
  24. data/lib/knockapi/models/recipients/channel_data_request.rb +0 -12
  25. data/lib/knockapi/models/recipients/discord_channel_data.rb +0 -9
  26. data/lib/knockapi/models/recipients/inline_channel_data_request.rb +0 -12
  27. data/lib/knockapi/models/recipients/ms_teams_channel_data.rb +0 -9
  28. data/lib/knockapi/models/recipients/preference_set.rb +0 -18
  29. data/lib/knockapi/models/recipients/preference_set_channel_types.rb +0 -24
  30. data/lib/knockapi/models/recipients/preference_set_request.rb +0 -18
  31. data/lib/knockapi/models/recipients/slack_channel_data.rb +0 -9
  32. data/lib/knockapi/models/user_list_messages_params.rb +5 -2
  33. data/lib/knockapi/models/users/feed_list_items_response.rb +0 -9
  34. data/lib/knockapi/models.rb +30 -19
  35. data/lib/knockapi/version.rb +1 -1
  36. data/rbi/knockapi/internal/type/array_of.rbi +6 -0
  37. data/rbi/knockapi/internal/type/base_model.rbi +5 -0
  38. data/rbi/knockapi/internal/type/boolean.rbi +6 -0
  39. data/rbi/knockapi/internal/type/enum.rbi +5 -0
  40. data/rbi/knockapi/internal/type/file_input.rbi +5 -0
  41. data/rbi/knockapi/internal/type/hash_of.rbi +6 -0
  42. data/rbi/knockapi/internal/type/union.rbi +5 -0
  43. data/rbi/knockapi/internal/type/unknown.rbi +6 -0
  44. data/rbi/knockapi/internal/util.rbi +34 -0
  45. data/rbi/knockapi/internal.rbi +3 -0
  46. data/rbi/knockapi/models/activity.rbi +4 -4
  47. data/rbi/knockapi/models/message.rbi +4 -20
  48. data/rbi/knockapi/models/message_delivery_log.rbi +24 -8
  49. data/rbi/knockapi/models/message_event.rbi +2 -5
  50. data/rbi/knockapi/models/message_get_content_response.rbi +4 -25
  51. data/rbi/knockapi/models/message_list_params.rbi +19 -4
  52. data/rbi/knockapi/models/messages/batch_get_content_response.rbi +4 -22
  53. data/rbi/knockapi/models/object_list_messages_params.rbi +19 -4
  54. data/rbi/knockapi/models/recipients/channel_data.rbi +2 -17
  55. data/rbi/knockapi/models/recipients/preference_set.rbi +4 -16
  56. data/rbi/knockapi/models/recipients/subscription.rbi +2 -2
  57. data/rbi/knockapi/models/schedule.rbi +4 -4
  58. data/rbi/knockapi/models/user_list_messages_params.rbi +19 -4
  59. data/rbi/knockapi/models/users/feed_list_items_response.rbi +4 -10
  60. data/sig/knockapi/internal/type/array_of.rbs +3 -0
  61. data/sig/knockapi/internal/type/base_model.rbs +2 -0
  62. data/sig/knockapi/internal/type/boolean.rbs +3 -0
  63. data/sig/knockapi/internal/type/enum.rbs +2 -0
  64. data/sig/knockapi/internal/type/file_input.rbs +2 -0
  65. data/sig/knockapi/internal/type/hash_of.rbs +3 -0
  66. data/sig/knockapi/internal/type/union.rbs +2 -0
  67. data/sig/knockapi/internal/type/unknown.rbs +3 -0
  68. data/sig/knockapi/internal/util.rbs +12 -0
  69. data/sig/knockapi/internal.rbs +2 -0
  70. data/sig/knockapi/models/message_list_params.rbs +13 -3
  71. data/sig/knockapi/models/object_list_messages_params.rbs +13 -3
  72. data/sig/knockapi/models/user_list_messages_params.rbs +13 -3
  73. metadata +2 -2
@@ -79,15 +79,6 @@ module Knockapi
79
79
 
80
80
  # @!method self.variants
81
81
  # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject)]
82
-
83
- define_sorbet_constant!(:Variants) do
84
- T.type_alias do
85
- T.any(
86
- T::Boolean,
87
- Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject
88
- )
89
- end
90
- end
91
82
  end
92
83
 
93
84
  # Workflow or category preferences within a preference set
@@ -125,15 +116,6 @@ module Knockapi
125
116
 
126
117
  # @!method self.variants
127
118
  # @return [Array(Boolean, Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject)]
128
-
129
- define_sorbet_constant!(:Variants) do
130
- T.type_alias do
131
- T.any(
132
- T::Boolean,
133
- Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject
134
- )
135
- end
136
- end
137
119
  end
138
120
  end
139
121
  end
@@ -80,15 +80,6 @@ module Knockapi
80
80
 
81
81
  # @!method self.variants
82
82
  # @return [Array(Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection, Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection)]
83
-
84
- define_sorbet_constant!(:Variants) do
85
- T.type_alias do
86
- T.any(
87
- Knockapi::Recipients::SlackChannelData::Connection::SlackTokenConnection,
88
- Knockapi::Recipients::SlackChannelData::Connection::SlackIncomingWebhookConnection
89
- )
90
- end
91
- end
92
83
  end
93
84
 
94
85
  # @see Knockapi::Recipients::SlackChannelData#token
@@ -138,10 +138,13 @@ module Knockapi
138
138
  extend Knockapi::Internal::Type::Enum
139
139
 
140
140
  SEEN = :seen
141
+ UNSEEN = :unseen
141
142
  READ = :read
142
- INTERACTED = :interacted
143
- LINK_CLICKED = :link_clicked
143
+ UNREAD = :unread
144
144
  ARCHIVED = :archived
145
+ UNARCHIVED = :unarchived
146
+ LINK_CLICKED = :link_clicked
147
+ INTERACTED = :interacted
145
148
 
146
149
  # @!method self.values
147
150
  # @return [Array<Symbol>]
@@ -288,15 +288,6 @@ module Knockapi
288
288
 
289
289
  # @!method self.variants
290
290
  # @return [Array(Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock, Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock)]
291
-
292
- define_sorbet_constant!(:Variants) do
293
- T.type_alias do
294
- T.any(
295
- Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedContentBlock,
296
- Knockapi::Models::Users::FeedListItemsResponse::Block::MessageInAppFeedButtonSetBlock
297
- )
298
- end
299
- end
300
291
  end
301
292
 
302
293
  # @see Knockapi::Models::Users::FeedListItemsResponse#source
@@ -5,29 +5,40 @@ module Knockapi
5
5
  cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, Knockapi::Internal::AnyHash) } }
6
6
  end
7
7
 
8
- [
9
- *Knockapi::Internal::Type::Enum.included_modules,
10
- *Knockapi::Internal::Type::Union.included_modules
11
- ].each do |cls|
12
- cls.constants.each do |name|
13
- case cls.const_get(name)
14
- in true | false
15
- cls.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, cls) } }
16
- cls.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
17
- in Integer
18
- cls.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, cls) } }
19
- cls.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
20
- in Float
21
- cls.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, cls) } }
22
- cls.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
23
- in Symbol
24
- cls.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, cls) } }
25
- cls.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
26
- else
8
+ Knockapi::Internal::Util.walk_namespaces(Knockapi::Models).each do |mod|
9
+ case mod
10
+ in Knockapi::Internal::Type::Enum | Knockapi::Internal::Type::Union
11
+ mod.constants.each do |name|
12
+ case mod.const_get(name)
13
+ in true | false
14
+ mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
15
+ mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
16
+ in Integer
17
+ mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
18
+ mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
19
+ in Float
20
+ mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
21
+ mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
22
+ in Symbol
23
+ mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
24
+ mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
25
+ else
26
+ end
27
27
  end
28
+ else
28
29
  end
29
30
  end
30
31
 
32
+ Knockapi::Internal::Util.walk_namespaces(Knockapi::Models)
33
+ .lazy
34
+ .grep(Knockapi::Internal::Type::Union)
35
+ .each do |mod|
36
+ const = :Variants
37
+ next if mod.sorbet_constant_defined?(const)
38
+
39
+ mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
40
+ end
41
+
31
42
  Activity = Knockapi::Models::Activity
32
43
 
33
44
  AudienceAddMembersParams = Knockapi::Models::AudienceAddMembersParams
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Knockapi
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -8,6 +8,7 @@ module Knockapi
8
8
  # Array of items of a given type.
9
9
  class ArrayOf
10
10
  include Knockapi::Internal::Type::Converter
11
+ include Knockapi::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -63,6 +64,11 @@ module Knockapi
63
64
  def dump(value, state:)
64
65
  end
65
66
 
67
+ # @api private
68
+ sig { returns(T.anything) }
69
+ def to_sorbet_type
70
+ end
71
+
66
72
  # @api private
67
73
  sig { returns(Elem) }
68
74
  protected def item_type
@@ -197,6 +197,11 @@ module Knockapi
197
197
  end
198
198
  def dump(value, state:)
199
199
  end
200
+
201
+ # @api private
202
+ sig { returns(T.anything) }
203
+ def to_sorbet_type
204
+ end
200
205
  end
201
206
 
202
207
  class << self
@@ -8,6 +8,7 @@ module Knockapi
8
8
  # Ruby has no Boolean class; this is something for models to refer to.
9
9
  class Boolean
10
10
  extend Knockapi::Internal::Type::Converter
11
+ extend Knockapi::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -43,6 +44,11 @@ module Knockapi
43
44
  end
44
45
  def dump(value, state:)
45
46
  end
47
+
48
+ # @api private
49
+ sig { returns(T.anything) }
50
+ def to_sorbet_type
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -67,6 +67,11 @@ module Knockapi
67
67
  def dump(value, state:)
68
68
  end
69
69
 
70
+ # @api private
71
+ sig { returns(T.anything) }
72
+ def to_sorbet_type
73
+ end
74
+
70
75
  # @api private
71
76
  sig { params(depth: Integer).returns(String) }
72
77
  def inspect(depth: 0)
@@ -47,6 +47,11 @@ module Knockapi
47
47
  end
48
48
  def dump(value, state:)
49
49
  end
50
+
51
+ # @api private
52
+ sig { returns(T.anything) }
53
+ def to_sorbet_type
54
+ end
50
55
  end
51
56
  end
52
57
  end
@@ -8,6 +8,7 @@ module Knockapi
8
8
  # Hash of items of a given type.
9
9
  class HashOf
10
10
  include Knockapi::Internal::Type::Converter
11
+ include Knockapi::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -63,6 +64,11 @@ module Knockapi
63
64
  def dump(value, state:)
64
65
  end
65
66
 
67
+ # @api private
68
+ sig { returns(T.anything) }
69
+ def to_sorbet_type
70
+ end
71
+
66
72
  # @api private
67
73
  sig { returns(Elem) }
68
74
  protected def item_type
@@ -101,6 +101,11 @@ module Knockapi
101
101
  def dump(value, state:)
102
102
  end
103
103
 
104
+ # @api private
105
+ sig { returns(T.anything) }
106
+ def to_sorbet_type
107
+ end
108
+
104
109
  # @api private
105
110
  sig { params(depth: Integer).returns(String) }
106
111
  def inspect(depth: 0)
@@ -8,6 +8,7 @@ module Knockapi
8
8
  # When we don't know what to expect for the value.
9
9
  class Unknown
10
10
  extend Knockapi::Internal::Type::Converter
11
+ extend Knockapi::Internal::Util::SorbetRuntimeSupport
11
12
 
12
13
  abstract!
13
14
 
@@ -43,6 +44,11 @@ module Knockapi
43
44
  end
44
45
  def dump(value, state:)
45
46
  end
47
+
48
+ # @api private
49
+ sig { returns(T.anything) }
50
+ def to_sorbet_type
51
+ end
46
52
  end
47
53
  end
48
54
  end
@@ -11,6 +11,15 @@ module Knockapi
11
11
  def self.monotonic_secs
12
12
  end
13
13
 
14
+ # @api private
15
+ sig do
16
+ params(ns: T.any(Module, T::Class[T.anything])).returns(
17
+ T::Enumerable[T.any(Module, T::Class[T.anything])]
18
+ )
19
+ end
20
+ def self.walk_namespaces(ns)
21
+ end
22
+
14
23
  class << self
15
24
  # @api private
16
25
  sig { returns(String) }
@@ -441,10 +450,35 @@ module Knockapi
441
450
  def const_missing(name)
442
451
  end
443
452
 
453
+ # @api private
454
+ sig { params(name: Symbol).returns(T::Boolean) }
455
+ def sorbet_constant_defined?(name)
456
+ end
457
+
444
458
  # @api private
445
459
  sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void }
446
460
  def define_sorbet_constant!(name, &blk)
447
461
  end
462
+
463
+ # @api private
464
+ sig { returns(T.anything) }
465
+ def to_sorbet_type
466
+ end
467
+
468
+ class << self
469
+ # @api private
470
+ sig do
471
+ params(
472
+ type:
473
+ T.any(
474
+ Knockapi::Internal::Util::SorbetRuntimeSupport,
475
+ T.anything
476
+ )
477
+ ).returns(T.anything)
478
+ end
479
+ def to_sorbet_type(type)
480
+ end
481
+ end
448
482
  end
449
483
  end
450
484
  end
@@ -8,6 +8,9 @@ module Knockapi
8
8
  # this alias might be refined in the future.
9
9
  AnyHash = T.type_alias { T::Hash[Symbol, T.anything] }
10
10
 
11
+ FileInput =
12
+ T.type_alias { T.any(Pathname, StringIO, IO, String, Knockapi::FilePart) }
13
+
11
14
  OMIT = T.let(Object.new.freeze, T.anything)
12
15
  end
13
16
  end
@@ -21,7 +21,7 @@ module Knockapi
21
21
  attr_writer :_typename
22
22
 
23
23
  # A recipient of a notification, which is either a user or an object.
24
- sig { returns(T.nilable(T.any(Knockapi::User, Knockapi::Object))) }
24
+ sig { returns(T.nilable(Knockapi::Recipient::Variants)) }
25
25
  attr_accessor :actor
26
26
 
27
27
  # The workflow trigger `data` payload associated with the activity.
@@ -36,7 +36,7 @@ module Knockapi
36
36
  attr_writer :inserted_at
37
37
 
38
38
  # A recipient of a notification, which is either a user or an object.
39
- sig { returns(T.nilable(T.any(Knockapi::User, Knockapi::Object))) }
39
+ sig { returns(T.nilable(Knockapi::Recipient::Variants)) }
40
40
  attr_reader :recipient
41
41
 
42
42
  sig do
@@ -92,10 +92,10 @@ module Knockapi
92
92
  {
93
93
  id: String,
94
94
  _typename: String,
95
- actor: T.nilable(T.any(Knockapi::User, Knockapi::Object)),
95
+ actor: T.nilable(Knockapi::Recipient::Variants),
96
96
  data: T.nilable(T::Hash[Symbol, T.anything]),
97
97
  inserted_at: Time,
98
- recipient: T.any(Knockapi::User, Knockapi::Object),
98
+ recipient: Knockapi::Recipient::Variants,
99
99
  updated_at: Time
100
100
  }
101
101
  )
@@ -24,13 +24,7 @@ module Knockapi
24
24
  # that can contain up to 10 actors if the message is produced from a
25
25
  # [batch](/designing-workflows/batch-function).
26
26
  sig do
27
- returns(
28
- T.nilable(
29
- T::Array[
30
- T.any(String, Knockapi::RecipientReference::ObjectReference)
31
- ]
32
- )
33
- )
27
+ returns(T.nilable(T::Array[Knockapi::RecipientReference::Variants]))
34
28
  end
35
29
  attr_reader :actors
36
30
 
@@ -111,13 +105,7 @@ module Knockapi
111
105
 
112
106
  # A reference to a recipient, either a user identifier (string) or an object
113
107
  # reference (ID, collection).
114
- sig do
115
- returns(
116
- T.nilable(
117
- T.any(String, Knockapi::RecipientReference::ObjectReference)
118
- )
119
- )
120
- end
108
+ sig { returns(T.nilable(Knockapi::RecipientReference::Variants)) }
121
109
  attr_reader :recipient
122
110
 
123
111
  sig do
@@ -263,10 +251,7 @@ module Knockapi
263
251
  {
264
252
  id: String,
265
253
  _typename: String,
266
- actors:
267
- T::Array[
268
- T.any(String, Knockapi::RecipientReference::ObjectReference)
269
- ],
254
+ actors: T::Array[Knockapi::RecipientReference::Variants],
270
255
  archived_at: T.nilable(Time),
271
256
  channel_id: String,
272
257
  clicked_at: T.nilable(Time),
@@ -278,8 +263,7 @@ module Knockapi
278
263
  link_clicked_at: T.nilable(Time),
279
264
  metadata: T.nilable(T::Hash[Symbol, T.anything]),
280
265
  read_at: T.nilable(Time),
281
- recipient:
282
- T.any(String, Knockapi::RecipientReference::ObjectReference),
266
+ recipient: Knockapi::RecipientReference::Variants,
283
267
  scheduled_at: T.nilable(Time),
284
268
  seen_at: T.nilable(Time),
285
269
  source: Knockapi::Message::Source,
@@ -103,10 +103,18 @@ module Knockapi
103
103
  end
104
104
 
105
105
  # The body content that was sent with the request.
106
- sig { returns(T.nilable(T.any(String, T::Hash[Symbol, T.anything]))) }
106
+ sig do
107
+ returns(
108
+ T.nilable(Knockapi::MessageDeliveryLog::Request::Body::Variants)
109
+ )
110
+ end
107
111
  attr_reader :body
108
112
 
109
- sig { params(body: T.any(String, T::Hash[Symbol, T.anything])).void }
113
+ sig do
114
+ params(
115
+ body: Knockapi::MessageDeliveryLog::Request::Body::Variants
116
+ ).void
117
+ end
110
118
  attr_writer :body
111
119
 
112
120
  # The headers that were sent with the request.
@@ -151,7 +159,7 @@ module Knockapi
151
159
  # A message delivery log request.
152
160
  sig do
153
161
  params(
154
- body: T.any(String, T::Hash[Symbol, T.anything]),
162
+ body: Knockapi::MessageDeliveryLog::Request::Body::Variants,
155
163
  headers: T.nilable(T::Hash[Symbol, T.anything]),
156
164
  host: String,
157
165
  method_: Knockapi::MessageDeliveryLog::Request::Method::OrSymbol,
@@ -178,7 +186,7 @@ module Knockapi
178
186
  sig do
179
187
  override.returns(
180
188
  {
181
- body: T.any(String, T::Hash[Symbol, T.anything]),
189
+ body: Knockapi::MessageDeliveryLog::Request::Body::Variants,
182
190
  headers: T.nilable(T::Hash[Symbol, T.anything]),
183
191
  host: String,
184
192
  method_:
@@ -272,10 +280,18 @@ module Knockapi
272
280
  end
273
281
 
274
282
  # The body content that was received with the response.
275
- sig { returns(T.nilable(T.any(String, T::Hash[Symbol, T.anything]))) }
283
+ sig do
284
+ returns(
285
+ T.nilable(Knockapi::MessageDeliveryLog::Response::Body::Variants)
286
+ )
287
+ end
276
288
  attr_reader :body
277
289
 
278
- sig { params(body: T.any(String, T::Hash[Symbol, T.anything])).void }
290
+ sig do
291
+ params(
292
+ body: Knockapi::MessageDeliveryLog::Response::Body::Variants
293
+ ).void
294
+ end
279
295
  attr_writer :body
280
296
 
281
297
  # The headers that were received with the response.
@@ -292,7 +308,7 @@ module Knockapi
292
308
  # A message delivery log response.
293
309
  sig do
294
310
  params(
295
- body: T.any(String, T::Hash[Symbol, T.anything]),
311
+ body: Knockapi::MessageDeliveryLog::Response::Body::Variants,
296
312
  headers: T.nilable(T::Hash[Symbol, T.anything]),
297
313
  status: Integer
298
314
  ).returns(T.attached_class)
@@ -310,7 +326,7 @@ module Knockapi
310
326
  sig do
311
327
  override.returns(
312
328
  {
313
- body: T.any(String, T::Hash[Symbol, T.anything]),
329
+ body: Knockapi::MessageDeliveryLog::Response::Body::Variants,
314
330
  headers: T.nilable(T::Hash[Symbol, T.anything]),
315
331
  status: Integer
316
332
  }
@@ -22,9 +22,7 @@ module Knockapi
22
22
 
23
23
  # A reference to a recipient, either a user identifier (string) or an object
24
24
  # reference (ID, collection).
25
- sig do
26
- returns(T.any(String, Knockapi::RecipientReference::ObjectReference))
27
- end
25
+ sig { returns(Knockapi::RecipientReference::Variants) }
28
26
  attr_accessor :recipient
29
27
 
30
28
  # The type of event that occurred.
@@ -74,8 +72,7 @@ module Knockapi
74
72
  id: String,
75
73
  _typename: String,
76
74
  inserted_at: Time,
77
- recipient:
78
- T.any(String, Knockapi::RecipientReference::ObjectReference),
75
+ recipient: Knockapi::RecipientReference::Variants,
79
76
  type: Knockapi::MessageEvent::Type::TaggedSymbol,
80
77
  data: T.nilable(T::Hash[Symbol, T.anything])
81
78
  }
@@ -17,15 +17,7 @@ module Knockapi
17
17
 
18
18
  # Content data specific to the channel type.
19
19
  sig do
20
- returns(
21
- T.any(
22
- Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent,
23
- Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent,
24
- Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent,
25
- Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent,
26
- Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent
27
- )
28
- )
20
+ returns(Knockapi::Models::MessageGetContentResponse::Data::Variants)
29
21
  end
30
22
  attr_accessor :data
31
23
 
@@ -69,14 +61,7 @@ module Knockapi
69
61
  override.returns(
70
62
  {
71
63
  _typename: String,
72
- data:
73
- T.any(
74
- Knockapi::Models::MessageGetContentResponse::Data::MessageEmailContent,
75
- Knockapi::Models::MessageGetContentResponse::Data::MessageSMSContent,
76
- Knockapi::Models::MessageGetContentResponse::Data::MessagePushContent,
77
- Knockapi::Models::MessageGetContentResponse::Data::MessageChatContent,
78
- Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent
79
- ),
64
+ data: Knockapi::Models::MessageGetContentResponse::Data::Variants,
80
65
  inserted_at: Time,
81
66
  message_id: String
82
67
  }
@@ -566,10 +551,7 @@ module Knockapi
566
551
  sig do
567
552
  returns(
568
553
  T::Array[
569
- T.any(
570
- Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock,
571
- Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock
572
- )
554
+ Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::Variants
573
555
  ]
574
556
  )
575
557
  end
@@ -602,10 +584,7 @@ module Knockapi
602
584
  _typename: String,
603
585
  blocks:
604
586
  T::Array[
605
- T.any(
606
- Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedContentBlock,
607
- Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::MessageInAppFeedButtonSetBlock
608
- )
587
+ Knockapi::Models::MessageGetContentResponse::Data::MessageInAppFeedContent::Block::Variants
609
588
  ]
610
589
  }
611
590
  )
@@ -230,14 +230,29 @@ module Knockapi
230
230
  :seen,
231
231
  Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
232
232
  )
233
+ UNSEEN =
234
+ T.let(
235
+ :unseen,
236
+ Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
237
+ )
233
238
  READ =
234
239
  T.let(
235
240
  :read,
236
241
  Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
237
242
  )
238
- INTERACTED =
243
+ UNREAD =
239
244
  T.let(
240
- :interacted,
245
+ :unread,
246
+ Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
247
+ )
248
+ ARCHIVED =
249
+ T.let(
250
+ :archived,
251
+ Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
252
+ )
253
+ UNARCHIVED =
254
+ T.let(
255
+ :unarchived,
241
256
  Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
242
257
  )
243
258
  LINK_CLICKED =
@@ -245,9 +260,9 @@ module Knockapi
245
260
  :link_clicked,
246
261
  Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
247
262
  )
248
- ARCHIVED =
263
+ INTERACTED =
249
264
  T.let(
250
- :archived,
265
+ :interacted,
251
266
  Knockapi::MessageListParams::EngagementStatus::TaggedSymbol
252
267
  )
253
268