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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/knockapi/internal/transport/pooled_net_requester.rb +30 -24
  5. data/lib/knockapi/internal/util.rb +5 -5
  6. data/lib/knockapi/models/identify_user_request.rb +2 -2
  7. data/lib/knockapi/models/inline_identify_user_request.rb +2 -2
  8. data/lib/knockapi/models/inline_object_request.rb +2 -2
  9. data/lib/knockapi/models/message.rb +94 -3
  10. data/lib/knockapi/models/messages/batch_archive_response.rb +1 -1
  11. data/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb +1 -1
  12. data/lib/knockapi/models/messages/batch_mark_as_read_response.rb +1 -1
  13. data/lib/knockapi/models/messages/batch_mark_as_seen_response.rb +1 -1
  14. data/lib/knockapi/models/messages/batch_mark_as_unread_response.rb +1 -1
  15. data/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb +1 -1
  16. data/lib/knockapi/models/messages/batch_unarchive_response.rb +1 -1
  17. data/lib/knockapi/models/object_set_params.rb +2 -2
  18. data/lib/knockapi/models/objects/bulk_set_params.rb +2 -2
  19. data/lib/knockapi/models/recipients/channel_data.rb +133 -11
  20. data/lib/knockapi/models/recipients/channel_data_request.rb +36 -10
  21. data/lib/knockapi/models/recipients/inline_channel_data_request.rb +34 -8
  22. data/lib/knockapi/models/recipients/preference_set.rb +130 -3
  23. data/lib/knockapi/models/recipients/preference_set_request.rb +136 -3
  24. data/lib/knockapi/models/tenant_request.rb +2 -2
  25. data/lib/knockapi/models/tenant_set_params.rb +2 -2
  26. data/lib/knockapi/models/users/guide_get_channel_response.rb +270 -34
  27. data/lib/knockapi/resources/messages/batch.rb +7 -7
  28. data/lib/knockapi/resources/objects.rb +7 -3
  29. data/lib/knockapi/resources/tenants.rb +1 -1
  30. data/lib/knockapi/resources/users.rb +7 -3
  31. data/lib/knockapi/version.rb +1 -1
  32. data/lib/knockapi.rb +0 -2
  33. data/rbi/knockapi/models/identify_user_request.rbi +9 -9
  34. data/rbi/knockapi/models/inline_identify_user_request.rbi +9 -9
  35. data/rbi/knockapi/models/inline_object_request.rbi +9 -9
  36. data/rbi/knockapi/models/message.rbi +123 -2
  37. data/rbi/knockapi/models/messages/batch_archive_response.rbi +1 -1
  38. data/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi +1 -1
  39. data/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi +1 -1
  40. data/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi +1 -1
  41. data/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi +1 -1
  42. data/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi +1 -1
  43. data/rbi/knockapi/models/messages/batch_unarchive_response.rbi +1 -1
  44. data/rbi/knockapi/models/object_set_params.rbi +12 -12
  45. data/rbi/knockapi/models/objects/bulk_set_params.rbi +9 -9
  46. data/rbi/knockapi/models/recipients/channel_data.rbi +250 -12
  47. data/rbi/knockapi/models/recipients/channel_data_request.rbi +68 -14
  48. data/rbi/knockapi/models/recipients/inline_channel_data_request.rbi +57 -5
  49. data/rbi/knockapi/models/recipients/preference_set.rbi +279 -0
  50. data/rbi/knockapi/models/recipients/preference_set_request.rbi +299 -0
  51. data/rbi/knockapi/models/tenant_request.rbi +9 -9
  52. data/rbi/knockapi/models/tenant_set_params.rbi +9 -9
  53. data/rbi/knockapi/models/users/guide_get_channel_response.rbi +532 -70
  54. data/rbi/knockapi/resources/messages/batch.rbi +7 -7
  55. data/rbi/knockapi/resources/objects.rbi +22 -6
  56. data/rbi/knockapi/resources/tenants.rbi +3 -3
  57. data/rbi/knockapi/resources/users.rbi +22 -6
  58. data/sig/knockapi/models/message.rbs +79 -0
  59. data/sig/knockapi/models/messages/batch_archive_response.rbs +1 -1
  60. data/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs +1 -2
  61. data/sig/knockapi/models/messages/batch_mark_as_read_response.rbs +1 -1
  62. data/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs +1 -1
  63. data/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs +1 -1
  64. data/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs +1 -1
  65. data/sig/knockapi/models/messages/batch_unarchive_response.rbs +1 -1
  66. data/sig/knockapi/models/recipients/channel_data.rbs +97 -7
  67. data/sig/knockapi/models/recipients/channel_data_request.rbs +27 -5
  68. data/sig/knockapi/models/recipients/inline_channel_data_request.rbs +27 -5
  69. data/sig/knockapi/models/recipients/preference_set.rbs +87 -0
  70. data/sig/knockapi/models/recipients/preference_set_request.rbs +87 -0
  71. data/sig/knockapi/models/users/guide_get_channel_response.rbs +294 -31
  72. data/sig/knockapi/resources/objects.rbs +2 -0
  73. data/sig/knockapi/resources/users.rbs +2 -0
  74. metadata +2 -8
  75. data/lib/knockapi/models/recipients/one_signal_channel_data.rb +0 -20
  76. data/lib/knockapi/models/recipients/push_channel_data.rb +0 -20
  77. data/rbi/knockapi/models/recipients/one_signal_channel_data.rbi +0 -33
  78. data/rbi/knockapi/models/recipients/push_channel_data.rbi +0 -33
  79. data/sig/knockapi/models/recipients/one_signal_channel_data.rbs +0 -15
  80. data/sig/knockapi/models/recipients/push_channel_data.rbs +0 -15
@@ -30,6 +30,23 @@ module Knockapi
30
30
  # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil]
31
31
  optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true
32
32
 
33
+ # @!attribute channels
34
+ # Channel preferences.
35
+ #
36
+ # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Channel::PreferenceSetChannelSetting}, nil]
37
+ optional :channels,
38
+ -> {
39
+ Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSetRequest::Channel]
40
+ },
41
+ nil?: true
42
+
43
+ # @!attribute commercial_subscribed
44
+ # Whether the recipient is subscribed to commercial communications. When false,
45
+ # the recipient will not receive commercial workflow notifications.
46
+ #
47
+ # @return [Boolean, nil]
48
+ optional :commercial_subscribed, Knockapi::Internal::Type::Boolean, nil?: true
49
+
33
50
  # @!attribute workflows
34
51
  # An object where the key is the workflow key and the values are the preference
35
52
  # settings for that workflow.
@@ -41,7 +58,7 @@ module Knockapi
41
58
  },
42
59
  nil?: true
43
60
 
44
- # @!method initialize(_persistence_strategy: nil, categories: nil, channel_types: nil, workflows: nil)
61
+ # @!method initialize(_persistence_strategy: nil, categories: nil, channel_types: nil, channels: nil, commercial_subscribed: nil, workflows: nil)
45
62
  # Some parameter documentations has been truncated, see
46
63
  # {Knockapi::Models::Recipients::PreferenceSetRequest} for more details.
47
64
  #
@@ -53,6 +70,10 @@ module Knockapi
53
70
  #
54
71
  # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
55
72
  #
73
+ # @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Channel::PreferenceSetChannelSetting}, nil] Channel preferences.
74
+ #
75
+ # @param commercial_subscribed [Boolean, nil] Whether the recipient is subscribed to commercial communications. When false, th
76
+ #
56
77
  # @param workflows [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject}, nil] An object where the key is the workflow key and the values are the preference se
57
78
 
58
79
  # Controls how the preference set is persisted. 'replace' will completely replace
@@ -85,25 +106,95 @@ module Knockapi
85
106
  # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil]
86
107
  optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true
87
108
 
109
+ # @!attribute channels
110
+ # Channel preferences.
111
+ #
112
+ # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting}, nil]
113
+ optional :channels,
114
+ -> do
115
+ Knockapi::Internal::Type::HashOf[
116
+ union: Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::Channel
117
+ ]
118
+ end,
119
+ nil?: true
120
+
88
121
  # @!attribute conditions
89
122
  # A list of conditions to apply to a channel type.
90
123
  #
91
124
  # @return [Array<Knockapi::Models::Condition>, nil]
92
125
  optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true
93
126
 
94
- # @!method initialize(channel_types: nil, conditions: nil)
127
+ # @!method initialize(channel_types: nil, channels: nil, conditions: nil)
95
128
  # The settings object for a workflow or category, where you can specify channel
96
129
  # types or conditions.
97
130
  #
98
131
  # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
99
132
  #
133
+ # @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting}, nil] Channel preferences.
134
+ #
100
135
  # @param conditions [Array<Knockapi::Models::Condition>, nil] A list of conditions to apply to a channel type.
136
+
137
+ # Whether the specific channel (by channel_id) is enabled for the preference set,
138
+ # or a settings object with conditions.
139
+ module Channel
140
+ extend Knockapi::Internal::Type::Union
141
+
142
+ variant Knockapi::Internal::Type::Boolean
143
+
144
+ # A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
145
+ variant -> { Knockapi::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting }
146
+
147
+ class PreferenceSetChannelSetting < Knockapi::Internal::Type::BaseModel
148
+ # @!attribute conditions
149
+ # A list of conditions to apply to a specific channel.
150
+ #
151
+ # @return [Array<Knockapi::Models::Condition>]
152
+ required :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }
153
+
154
+ # @!method initialize(conditions:)
155
+ # A set of settings for a specific channel. Currently, this can only be a list of
156
+ # conditions to apply.
157
+ #
158
+ # @param conditions [Array<Knockapi::Models::Condition>] A list of conditions to apply to a specific channel.
159
+ end
160
+
161
+ # @!method self.variants
162
+ # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting)]
163
+ end
101
164
  end
102
165
 
103
166
  # @!method self.variants
104
167
  # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Category::PreferenceSetWorkflowCategorySettingObject)]
105
168
  end
106
169
 
170
+ # Whether the specific channel (by channel_id) is enabled for the preference set,
171
+ # or a settings object with conditions.
172
+ module Channel
173
+ extend Knockapi::Internal::Type::Union
174
+
175
+ variant Knockapi::Internal::Type::Boolean
176
+
177
+ # A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
178
+ variant -> { Knockapi::Recipients::PreferenceSetRequest::Channel::PreferenceSetChannelSetting }
179
+
180
+ class PreferenceSetChannelSetting < Knockapi::Internal::Type::BaseModel
181
+ # @!attribute conditions
182
+ # A list of conditions to apply to a specific channel.
183
+ #
184
+ # @return [Array<Knockapi::Models::Condition>]
185
+ required :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }
186
+
187
+ # @!method initialize(conditions:)
188
+ # A set of settings for a specific channel. Currently, this can only be a list of
189
+ # conditions to apply.
190
+ #
191
+ # @param conditions [Array<Knockapi::Models::Condition>] A list of conditions to apply to a specific channel.
192
+ end
193
+
194
+ # @!method self.variants
195
+ # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Channel::PreferenceSetChannelSetting)]
196
+ end
197
+
107
198
  # Workflow or category preferences within a preference set
108
199
  module Workflow
109
200
  extend Knockapi::Internal::Type::Union
@@ -120,19 +211,61 @@ module Knockapi
120
211
  # @return [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil]
121
212
  optional :channel_types, -> { Knockapi::Recipients::PreferenceSetChannelTypes }, nil?: true
122
213
 
214
+ # @!attribute channels
215
+ # Channel preferences.
216
+ #
217
+ # @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting}, nil]
218
+ optional :channels,
219
+ -> do
220
+ Knockapi::Internal::Type::HashOf[
221
+ union: Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel
222
+ ]
223
+ end,
224
+ nil?: true
225
+
123
226
  # @!attribute conditions
124
227
  # A list of conditions to apply to a channel type.
125
228
  #
126
229
  # @return [Array<Knockapi::Models::Condition>, nil]
127
230
  optional :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }, nil?: true
128
231
 
129
- # @!method initialize(channel_types: nil, conditions: nil)
232
+ # @!method initialize(channel_types: nil, channels: nil, conditions: nil)
130
233
  # The settings object for a workflow or category, where you can specify channel
131
234
  # types or conditions.
132
235
  #
133
236
  # @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
134
237
  #
238
+ # @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting}, nil] Channel preferences.
239
+ #
135
240
  # @param conditions [Array<Knockapi::Models::Condition>, nil] A list of conditions to apply to a channel type.
241
+
242
+ # Whether the specific channel (by channel_id) is enabled for the preference set,
243
+ # or a settings object with conditions.
244
+ module Channel
245
+ extend Knockapi::Internal::Type::Union
246
+
247
+ variant Knockapi::Internal::Type::Boolean
248
+
249
+ # A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
250
+ variant -> { Knockapi::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting }
251
+
252
+ class PreferenceSetChannelSetting < Knockapi::Internal::Type::BaseModel
253
+ # @!attribute conditions
254
+ # A list of conditions to apply to a specific channel.
255
+ #
256
+ # @return [Array<Knockapi::Models::Condition>]
257
+ required :conditions, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Condition] }
258
+
259
+ # @!method initialize(conditions:)
260
+ # A set of settings for a specific channel. Currently, this can only be a list of
261
+ # conditions to apply.
262
+ #
263
+ # @param conditions [Array<Knockapi::Models::Condition>] A list of conditions to apply to a specific channel.
264
+ end
265
+
266
+ # @!method self.variants
267
+ # @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetRequest::Workflow::PreferenceSetWorkflowCategorySettingObject::Channel::PreferenceSetChannelSetting)]
268
+ end
136
269
  end
137
270
 
138
271
  # @!method self.variants
@@ -12,7 +12,7 @@ module Knockapi
12
12
  # @!attribute channel_data
13
13
  # A request to set channel data for a type of channel inline.
14
14
  #
15
- # @return [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwsSnsPushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil]
15
+ # @return [Hash{Symbol=>Knockapi::Models::Recipients::InlineChannelDataRequestItem::PushChannelDataTokensOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwssnsPushChannelDataTargetArNsOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil]
16
16
  optional :channel_data,
17
17
  -> {
18
18
  Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
@@ -44,7 +44,7 @@ module Knockapi
44
44
  #
45
45
  # @param id [String] The unique identifier for the tenant.
46
46
  #
47
- # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwsSnsPushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
47
+ # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::InlineChannelDataRequestItem::PushChannelDataTokensOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwssnsPushChannelDataTargetArNsOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
48
48
  #
49
49
  # @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
50
50
  #
@@ -10,7 +10,7 @@ module Knockapi
10
10
  # @!attribute channel_data
11
11
  # A request to set channel data for a type of channel inline.
12
12
  #
13
- # @return [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwsSnsPushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil]
13
+ # @return [Hash{Symbol=>Knockapi::Models::Recipients::InlineChannelDataRequestItem::PushChannelDataTokensOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwssnsPushChannelDataTargetArNsOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil]
14
14
  optional :channel_data,
15
15
  -> {
16
16
  Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
@@ -24,7 +24,7 @@ module Knockapi
24
24
  optional :settings, -> { Knockapi::TenantSetParams::Settings }
25
25
 
26
26
  # @!method initialize(channel_data: nil, settings: nil, request_options: {})
27
- # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelData, Knockapi::Models::Recipients::OneSignalChannelData, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwsSnsPushChannelData, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
27
+ # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::InlineChannelDataRequestItem::PushChannelDataTokensOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::AwssnsPushChannelDataTargetArNsOnly, Knockapi::Models::Recipients::InlineChannelDataRequestItem::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
28
28
  #
29
29
  # @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set.
30
30
  #
@@ -5,81 +5,317 @@ module Knockapi
5
5
  module Users
6
6
  # @see Knockapi::Resources::Users::Guides#get_channel
7
7
  class GuideGetChannelResponse < Knockapi::Internal::Type::BaseModel
8
- # @!attribute guides
8
+ # @!attribute entries
9
9
  # A list of guides.
10
10
  #
11
- # @return [Array<Knockapi::Models::Users::GuideGetChannelResponse::Guide>]
12
- required :guides,
13
- -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Users::GuideGetChannelResponse::Guide] }
11
+ # @return [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry>]
12
+ required :entries,
13
+ -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Users::GuideGetChannelResponse::Entry] }
14
14
 
15
- # @!attribute recipient
16
- # The recipient of the guide.
15
+ # @!attribute guide_group_display_logs
16
+ # A map of guide group keys to their last display timestamps.
17
17
  #
18
- # @return [Knockapi::Models::Users::GuideGetChannelResponse::Recipient, nil]
19
- optional :recipient, -> { Knockapi::Models::Users::GuideGetChannelResponse::Recipient }, nil?: true
18
+ # @return [Hash{Symbol=>Time}]
19
+ required :guide_group_display_logs, Knockapi::Internal::Type::HashOf[Time]
20
20
 
21
- # @!method initialize(guides:, recipient: nil)
21
+ # @!attribute guide_groups
22
+ # A list of guide groups with their display sequences and intervals.
23
+ #
24
+ # @return [Array<Knockapi::Models::Users::GuideGetChannelResponse::GuideGroup>]
25
+ required :guide_groups,
26
+ -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Users::GuideGetChannelResponse::GuideGroup] }
27
+
28
+ # @!method initialize(entries:, guide_group_display_logs:, guide_groups:)
22
29
  # A response for a list of guides.
23
30
  #
24
- # @param guides [Array<Knockapi::Models::Users::GuideGetChannelResponse::Guide>] A list of guides.
31
+ # @param entries [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry>] A list of guides.
32
+ #
33
+ # @param guide_group_display_logs [Hash{Symbol=>Time}] A map of guide group keys to their last display timestamps.
25
34
  #
26
- # @param recipient [Knockapi::Models::Users::GuideGetChannelResponse::Recipient, nil] The recipient of the guide.
35
+ # @param guide_groups [Array<Knockapi::Models::Users::GuideGetChannelResponse::GuideGroup>] A list of guide groups with their display sequences and intervals.
27
36
 
28
- class Guide < Knockapi::Internal::Type::BaseModel
37
+ class Entry < Knockapi::Internal::Type::BaseModel
29
38
  # @!attribute id
30
39
  # The unique identifier for the guide.
31
40
  #
32
41
  # @return [String, nil]
33
42
  optional :id, String
34
43
 
44
+ # @!attribute _typename
45
+ # The typename of the schema.
46
+ #
47
+ # @return [String, nil]
48
+ optional :_typename, String, api_name: :__typename
49
+
50
+ # @!attribute activation_url_patterns
51
+ # A list of URL Patterns to evaluate user's current location to activate the
52
+ # guide, if matched
53
+ #
54
+ # @return [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry::ActivationURLPattern>, nil]
55
+ optional :activation_url_patterns,
56
+ -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Users::GuideGetChannelResponse::Entry::ActivationURLPattern] }
57
+
58
+ # @!attribute activation_url_rules
59
+ # A list of URL rules to evaluate user's current location to activate the guide,
60
+ # if matched
61
+ #
62
+ # @return [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry::ActivationURLRule>, nil]
63
+ optional :activation_url_rules,
64
+ -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Users::GuideGetChannelResponse::Entry::ActivationURLRule] }
65
+
35
66
  # @!attribute active
36
67
  # Whether the guide is active.
37
68
  #
38
69
  # @return [Boolean, nil]
39
70
  optional :active, Knockapi::Internal::Type::Boolean
40
71
 
41
- # @!attribute content
42
- # The content of the guide.
72
+ # @!attribute bypass_global_group_limit
73
+ #
74
+ # @return [Boolean, nil]
75
+ optional :bypass_global_group_limit, Knockapi::Internal::Type::Boolean
76
+
77
+ # @!attribute channel_id
43
78
  #
44
79
  # @return [String, nil]
45
- optional :content, String
80
+ optional :channel_id, String
46
81
 
47
- # @!attribute metadata
48
- # The metadata of the guide.
82
+ # @!attribute inserted_at
49
83
  #
50
- # @return [Hash{Symbol=>Object}, nil]
51
- optional :metadata, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]
84
+ # @return [Time, nil]
85
+ optional :inserted_at, Time
52
86
 
53
- # @!attribute title
54
- # The title of the guide.
87
+ # @!attribute key
88
+ # The key of the guide.
55
89
  #
56
90
  # @return [String, nil]
57
- optional :title, String
91
+ optional :key, String
58
92
 
59
- # @!method initialize(id: nil, active: nil, content: nil, metadata: nil, title: nil)
93
+ # @!attribute semver
94
+ #
95
+ # @return [String, nil]
96
+ optional :semver, String
97
+
98
+ # @!attribute steps
99
+ #
100
+ # @return [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step>, nil]
101
+ optional :steps,
102
+ -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step] }
103
+
104
+ # @!attribute type
105
+ # The type of the guide.
106
+ #
107
+ # @return [String, nil]
108
+ optional :type, String
109
+
110
+ # @!attribute updated_at
111
+ #
112
+ # @return [Time, nil]
113
+ optional :updated_at, Time
114
+
115
+ # @!method initialize(id: nil, _typename: nil, activation_url_patterns: nil, activation_url_rules: nil, active: nil, bypass_global_group_limit: nil, channel_id: nil, inserted_at: nil, key: nil, semver: nil, steps: nil, type: nil, updated_at: nil)
116
+ # Some parameter documentations has been truncated, see
117
+ # {Knockapi::Models::Users::GuideGetChannelResponse::Entry} for more details.
118
+ #
60
119
  # @param id [String] The unique identifier for the guide.
61
120
  #
121
+ # @param _typename [String] The typename of the schema.
122
+ #
123
+ # @param activation_url_patterns [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry::ActivationURLPattern>] A list of URL Patterns to evaluate user's current location to activate the guide
124
+ #
125
+ # @param activation_url_rules [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry::ActivationURLRule>] A list of URL rules to evaluate user's current location to activate the guide, i
126
+ #
62
127
  # @param active [Boolean] Whether the guide is active.
63
128
  #
64
- # @param content [String] The content of the guide.
129
+ # @param bypass_global_group_limit [Boolean]
130
+ #
131
+ # @param channel_id [String]
132
+ #
133
+ # @param inserted_at [Time]
65
134
  #
66
- # @param metadata [Hash{Symbol=>Object}] The metadata of the guide.
135
+ # @param key [String] The key of the guide.
67
136
  #
68
- # @param title [String] The title of the guide.
137
+ # @param semver [String]
138
+ #
139
+ # @param steps [Array<Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step>]
140
+ #
141
+ # @param type [String] The type of the guide.
142
+ #
143
+ # @param updated_at [Time]
144
+
145
+ class ActivationURLPattern < Knockapi::Internal::Type::BaseModel
146
+ # @!attribute directive
147
+ # The directive for the URL pattern ('allow' or 'block')
148
+ #
149
+ # @return [String, nil]
150
+ optional :directive, String
151
+
152
+ # @!attribute pathname
153
+ # The pathname pattern to match (supports wildcards like /\*)
154
+ #
155
+ # @return [String, nil]
156
+ optional :pathname, String
157
+
158
+ # @!method initialize(directive: nil, pathname: nil)
159
+ # @param directive [String] The directive for the URL pattern ('allow' or 'block')
160
+ #
161
+ # @param pathname [String] The pathname pattern to match (supports wildcards like /\*)
162
+ end
163
+
164
+ class ActivationURLRule < Knockapi::Internal::Type::BaseModel
165
+ # @!attribute argument
166
+ # The value to compare against
167
+ #
168
+ # @return [String, nil]
169
+ optional :argument, String
170
+
171
+ # @!attribute directive
172
+ # The directive for the URL pattern ('allow' or 'block')
173
+ #
174
+ # @return [String, nil]
175
+ optional :directive, String
176
+
177
+ # @!attribute operator
178
+ # The comparison operator ('contains' or 'equal_to')
179
+ #
180
+ # @return [String, nil]
181
+ optional :operator, String
182
+
183
+ # @!attribute variable
184
+ # The variable to evaluate ('pathname')
185
+ #
186
+ # @return [String, nil]
187
+ optional :variable, String
188
+
189
+ # @!method initialize(argument: nil, directive: nil, operator: nil, variable: nil)
190
+ # @param argument [String] The value to compare against
191
+ #
192
+ # @param directive [String] The directive for the URL pattern ('allow' or 'block')
193
+ #
194
+ # @param operator [String] The comparison operator ('contains' or 'equal_to')
195
+ #
196
+ # @param variable [String] The variable to evaluate ('pathname')
197
+ end
198
+
199
+ class Step < Knockapi::Internal::Type::BaseModel
200
+ # @!attribute content
201
+ #
202
+ # @return [Hash{Symbol=>Object}, nil]
203
+ optional :content, Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown]
204
+
205
+ # @!attribute message
206
+ #
207
+ # @return [Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step::Message, nil]
208
+ optional :message, -> { Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step::Message }
209
+
210
+ # @!attribute ref
211
+ #
212
+ # @return [String, nil]
213
+ optional :ref, String
214
+
215
+ # @!attribute schema_key
216
+ #
217
+ # @return [String, nil]
218
+ optional :schema_key, String
219
+
220
+ # @!attribute schema_semver
221
+ #
222
+ # @return [String, nil]
223
+ optional :schema_semver, String
224
+
225
+ # @!attribute schema_variant_key
226
+ #
227
+ # @return [String, nil]
228
+ optional :schema_variant_key, String
229
+
230
+ # @!method initialize(content: nil, message: nil, ref: nil, schema_key: nil, schema_semver: nil, schema_variant_key: nil)
231
+ # @param content [Hash{Symbol=>Object}]
232
+ # @param message [Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step::Message]
233
+ # @param ref [String]
234
+ # @param schema_key [String]
235
+ # @param schema_semver [String]
236
+ # @param schema_variant_key [String]
237
+
238
+ # @see Knockapi::Models::Users::GuideGetChannelResponse::Entry::Step#message
239
+ class Message < Knockapi::Internal::Type::BaseModel
240
+ # @!attribute id
241
+ #
242
+ # @return [String, nil]
243
+ optional :id, String, nil?: true
244
+
245
+ # @!attribute archived_at
246
+ #
247
+ # @return [Time, nil]
248
+ optional :archived_at, Time, nil?: true
249
+
250
+ # @!attribute interacted_at
251
+ #
252
+ # @return [Time, nil]
253
+ optional :interacted_at, Time, nil?: true
254
+
255
+ # @!attribute link_clicked_at
256
+ #
257
+ # @return [Time, nil]
258
+ optional :link_clicked_at, Time, nil?: true
259
+
260
+ # @!attribute read_at
261
+ #
262
+ # @return [Time, nil]
263
+ optional :read_at, Time, nil?: true
264
+
265
+ # @!attribute seen_at
266
+ #
267
+ # @return [Time, nil]
268
+ optional :seen_at, Time, nil?: true
269
+
270
+ # @!method initialize(id: nil, archived_at: nil, interacted_at: nil, link_clicked_at: nil, read_at: nil, seen_at: nil)
271
+ # @param id [String, nil]
272
+ # @param archived_at [Time, nil]
273
+ # @param interacted_at [Time, nil]
274
+ # @param link_clicked_at [Time, nil]
275
+ # @param read_at [Time, nil]
276
+ # @param seen_at [Time, nil]
277
+ end
278
+ end
69
279
  end
70
280
 
71
- # @see Knockapi::Models::Users::GuideGetChannelResponse#recipient
72
- class Recipient < Knockapi::Internal::Type::BaseModel
73
- # @!attribute id
74
- # Unique identifier for the recipient.
281
+ class GuideGroup < Knockapi::Internal::Type::BaseModel
282
+ # @!attribute _typename
75
283
  #
76
284
  # @return [String, nil]
77
- optional :id, String
285
+ optional :_typename, String, api_name: :__typename
286
+
287
+ # @!attribute display_interval
288
+ #
289
+ # @return [Integer, nil]
290
+ optional :display_interval, Integer
78
291
 
79
- # @!method initialize(id: nil)
80
- # The recipient of the guide.
292
+ # @!attribute display_sequence
81
293
  #
82
- # @param id [String] Unique identifier for the recipient.
294
+ # @return [Array<String>, nil]
295
+ optional :display_sequence, Knockapi::Internal::Type::ArrayOf[String]
296
+
297
+ # @!attribute inserted_at
298
+ #
299
+ # @return [Time, nil]
300
+ optional :inserted_at, Time
301
+
302
+ # @!attribute key
303
+ #
304
+ # @return [String, nil]
305
+ optional :key, String
306
+
307
+ # @!attribute updated_at
308
+ #
309
+ # @return [Time, nil]
310
+ optional :updated_at, Time
311
+
312
+ # @!method initialize(_typename: nil, display_interval: nil, display_sequence: nil, inserted_at: nil, key: nil, updated_at: nil)
313
+ # @param _typename [String]
314
+ # @param display_interval [Integer]
315
+ # @param display_sequence [Array<String>]
316
+ # @param inserted_at [Time]
317
+ # @param key [String]
318
+ # @param updated_at [Time]
83
319
  end
84
320
  end
85
321
  end
@@ -22,7 +22,7 @@ module Knockapi
22
22
  method: :post,
23
23
  path: "v1/messages/batch/archived",
24
24
  body: parsed,
25
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
25
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
26
26
  options: options
27
27
  )
28
28
  end
@@ -72,7 +72,7 @@ module Knockapi
72
72
  method: :post,
73
73
  path: "v1/messages/batch/interacted",
74
74
  body: parsed,
75
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
75
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
76
76
  options: options
77
77
  )
78
78
  end
@@ -95,7 +95,7 @@ module Knockapi
95
95
  method: :post,
96
96
  path: "v1/messages/batch/read",
97
97
  body: parsed,
98
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
98
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
99
99
  options: options
100
100
  )
101
101
  end
@@ -119,7 +119,7 @@ module Knockapi
119
119
  method: :post,
120
120
  path: "v1/messages/batch/seen",
121
121
  body: parsed,
122
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
122
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
123
123
  options: options
124
124
  )
125
125
  end
@@ -143,7 +143,7 @@ module Knockapi
143
143
  method: :post,
144
144
  path: "v1/messages/batch/unread",
145
145
  body: parsed,
146
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
146
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
147
147
  options: options
148
148
  )
149
149
  end
@@ -167,7 +167,7 @@ module Knockapi
167
167
  method: :post,
168
168
  path: "v1/messages/batch/unseen",
169
169
  body: parsed,
170
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
170
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
171
171
  options: options
172
172
  )
173
173
  end
@@ -191,7 +191,7 @@ module Knockapi
191
191
  method: :post,
192
192
  path: "v1/messages/batch/unarchived",
193
193
  body: parsed,
194
- model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Message],
194
+ model: Knockapi::Internal::Type::ArrayOf[Knockapi::Message],
195
195
  options: options
196
196
  )
197
197
  end