knockapi 1.18.0 → 1.19.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 +23 -0
- data/README.md +1 -1
- data/lib/knockapi/client.rb +12 -0
- data/lib/knockapi/internal/transport/base_client.rb +7 -1
- data/lib/knockapi/internal/transport/pooled_net_requester.rb +6 -2
- 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 +11 -3
- data/lib/knockapi/models/object_set_params.rb +11 -3
- data/lib/knockapi/models/objects/bulk_set_params.rb +11 -3
- data/lib/knockapi/models/recipients/aws_sns_push_channel_data_devices_only.rb +63 -0
- data/lib/knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only.rb +25 -0
- data/lib/knockapi/models/recipients/channel_data.rb +4 -17
- data/lib/knockapi/models/recipients/channel_data_request.rb +8 -162
- data/lib/knockapi/models/recipients/inline_channel_data_request.rb +6 -160
- data/lib/knockapi/models/recipients/one_signal_channel_data_player_ids_only.rb +20 -0
- data/lib/knockapi/models/recipients/preference_set.rb +12 -54
- data/lib/knockapi/models/recipients/preference_set_channel_setting.rb +21 -0
- data/lib/knockapi/models/recipients/preference_set_request.rb +12 -54
- data/lib/knockapi/models/recipients/push_channel_data_devices_only.rb +60 -0
- data/lib/knockapi/models/recipients/push_channel_data_tokens_only.rb +20 -0
- data/lib/knockapi/models/tenant_request.rb +11 -3
- data/lib/knockapi/models/tenant_set_params.rb +11 -3
- data/lib/knockapi/models/users/feed_list_items_params.rb +15 -1
- data/lib/knockapi/resources/objects.rb +6 -4
- data/lib/knockapi/resources/tenants.rb +4 -2
- data/lib/knockapi/resources/users/feeds.rb +6 -1
- data/lib/knockapi/resources/users.rb +3 -3
- data/lib/knockapi/version.rb +1 -1
- data/lib/knockapi.rb +7 -0
- data/manifest.yaml +1 -0
- data/rbi/knockapi/client.rbi +7 -0
- data/rbi/knockapi/internal/transport/base_client.rbi +5 -0
- data/rbi/knockapi/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/knockapi/internal/type/base_model.rbi +8 -4
- data/rbi/knockapi/models/identify_user_request.rbi +15 -15
- data/rbi/knockapi/models/inline_identify_user_request.rbi +15 -15
- data/rbi/knockapi/models/inline_object_request.rbi +23 -15
- data/rbi/knockapi/models/object_set_params.rbi +28 -20
- data/rbi/knockapi/models/objects/bulk_set_params.rbi +23 -15
- data/rbi/knockapi/models/recipients/aws_sns_push_channel_data_devices_only.rbi +120 -0
- data/rbi/knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only.rbi +35 -0
- data/rbi/knockapi/models/recipients/channel_data.rbi +2 -30
- data/rbi/knockapi/models/recipients/channel_data_request.rbi +20 -326
- data/rbi/knockapi/models/recipients/inline_channel_data_request.rbi +5 -309
- data/rbi/knockapi/models/recipients/one_signal_channel_data_player_ids_only.rbi +33 -0
- data/rbi/knockapi/models/recipients/preference_set.rbi +6 -109
- data/rbi/knockapi/models/recipients/preference_set_channel_setting.rbi +38 -0
- data/rbi/knockapi/models/recipients/preference_set_request.rbi +12 -115
- data/rbi/knockapi/models/recipients/push_channel_data_devices_only.rbi +114 -0
- data/rbi/knockapi/models/recipients/push_channel_data_tokens_only.rbi +33 -0
- data/rbi/knockapi/models/tenant_request.rbi +23 -15
- data/rbi/knockapi/models/tenant_set_params.rbi +23 -15
- data/rbi/knockapi/models/users/feed_list_items_params.rbi +17 -0
- data/rbi/knockapi/resources/objects.rbi +14 -11
- data/rbi/knockapi/resources/tenants.rbi +8 -5
- data/rbi/knockapi/resources/users/feeds.rbi +6 -0
- data/rbi/knockapi/resources/users.rbi +11 -11
- data/sig/knockapi/client.rbs +3 -0
- data/sig/knockapi/internal/transport/base_client.rbs +2 -0
- data/sig/knockapi/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/knockapi/models/inline_object_request.rbs +5 -0
- data/sig/knockapi/models/object_set_params.rbs +5 -0
- data/sig/knockapi/models/objects/bulk_set_params.rbs +5 -0
- data/sig/knockapi/models/recipients/aws_sns_push_channel_data_devices_only.rbs +44 -0
- data/sig/knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only.rbs +16 -0
- data/sig/knockapi/models/recipients/channel_data.rbs +1 -12
- data/sig/knockapi/models/recipients/channel_data_request.rbs +5 -116
- data/sig/knockapi/models/recipients/inline_channel_data_request.rbs +5 -116
- data/sig/knockapi/models/recipients/one_signal_channel_data_player_ids_only.rbs +16 -0
- data/sig/knockapi/models/recipients/preference_set.rbs +3 -44
- data/sig/knockapi/models/recipients/preference_set_channel_setting.rbs +16 -0
- data/sig/knockapi/models/recipients/preference_set_request.rbs +3 -44
- data/sig/knockapi/models/recipients/push_channel_data_devices_only.rbs +40 -0
- data/sig/knockapi/models/recipients/push_channel_data_tokens_only.rbs +15 -0
- data/sig/knockapi/models/tenant_request.rbs +5 -0
- data/sig/knockapi/models/tenant_set_params.rbs +5 -0
- data/sig/knockapi/models/users/feed_list_items_params.rbs +7 -0
- data/sig/knockapi/resources/objects.rbs +1 -0
- data/sig/knockapi/resources/tenants.rbs +1 -0
- data/sig/knockapi/resources/users/feeds.rbs +1 -0
- metadata +20 -2
|
@@ -33,7 +33,7 @@ module Knockapi
|
|
|
33
33
|
# @!attribute channels
|
|
34
34
|
# Channel preferences.
|
|
35
35
|
#
|
|
36
|
-
# @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
36
|
+
# @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil]
|
|
37
37
|
optional :channels,
|
|
38
38
|
-> {
|
|
39
39
|
Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::PreferenceSetRequest::Channel]
|
|
@@ -70,7 +70,7 @@ module Knockapi
|
|
|
70
70
|
#
|
|
71
71
|
# @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
|
|
72
72
|
#
|
|
73
|
-
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
73
|
+
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
|
|
74
74
|
#
|
|
75
75
|
# @param commercial_subscribed [Boolean, nil] Whether the recipient is subscribed to commercial communications. When false, th
|
|
76
76
|
#
|
|
@@ -109,7 +109,7 @@ module Knockapi
|
|
|
109
109
|
# @!attribute channels
|
|
110
110
|
# Channel preferences.
|
|
111
111
|
#
|
|
112
|
-
# @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
112
|
+
# @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil]
|
|
113
113
|
optional :channels,
|
|
114
114
|
-> do
|
|
115
115
|
Knockapi::Internal::Type::HashOf[
|
|
@@ -130,7 +130,7 @@ module Knockapi
|
|
|
130
130
|
#
|
|
131
131
|
# @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
|
|
132
132
|
#
|
|
133
|
-
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
133
|
+
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
|
|
134
134
|
#
|
|
135
135
|
# @param conditions [Array<Knockapi::Models::Condition>, nil] A list of conditions to apply to a channel type.
|
|
136
136
|
|
|
@@ -142,24 +142,10 @@ module Knockapi
|
|
|
142
142
|
variant Knockapi::Internal::Type::Boolean
|
|
143
143
|
|
|
144
144
|
# A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
|
|
145
|
-
variant -> { Knockapi::Recipients::
|
|
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
|
|
145
|
+
variant -> { Knockapi::Recipients::PreferenceSetChannelSetting }
|
|
160
146
|
|
|
161
147
|
# @!method self.variants
|
|
162
|
-
# @return [Array(Boolean, Knockapi::Models::Recipients::
|
|
148
|
+
# @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)]
|
|
163
149
|
end
|
|
164
150
|
end
|
|
165
151
|
|
|
@@ -175,24 +161,10 @@ module Knockapi
|
|
|
175
161
|
variant Knockapi::Internal::Type::Boolean
|
|
176
162
|
|
|
177
163
|
# A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
|
|
178
|
-
variant -> { Knockapi::Recipients::
|
|
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
|
|
164
|
+
variant -> { Knockapi::Recipients::PreferenceSetChannelSetting }
|
|
193
165
|
|
|
194
166
|
# @!method self.variants
|
|
195
|
-
# @return [Array(Boolean, Knockapi::Models::Recipients::
|
|
167
|
+
# @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)]
|
|
196
168
|
end
|
|
197
169
|
|
|
198
170
|
# Workflow or category preferences within a preference set
|
|
@@ -214,7 +186,7 @@ module Knockapi
|
|
|
214
186
|
# @!attribute channels
|
|
215
187
|
# Channel preferences.
|
|
216
188
|
#
|
|
217
|
-
# @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
189
|
+
# @return [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil]
|
|
218
190
|
optional :channels,
|
|
219
191
|
-> do
|
|
220
192
|
Knockapi::Internal::Type::HashOf[
|
|
@@ -235,7 +207,7 @@ module Knockapi
|
|
|
235
207
|
#
|
|
236
208
|
# @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
|
|
237
209
|
#
|
|
238
|
-
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
210
|
+
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
|
|
239
211
|
#
|
|
240
212
|
# @param conditions [Array<Knockapi::Models::Condition>, nil] A list of conditions to apply to a channel type.
|
|
241
213
|
|
|
@@ -247,24 +219,10 @@ module Knockapi
|
|
|
247
219
|
variant Knockapi::Internal::Type::Boolean
|
|
248
220
|
|
|
249
221
|
# A set of settings for a specific channel. Currently, this can only be a list of conditions to apply.
|
|
250
|
-
variant -> { Knockapi::Recipients::
|
|
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
|
|
222
|
+
variant -> { Knockapi::Recipients::PreferenceSetChannelSetting }
|
|
265
223
|
|
|
266
224
|
# @!method self.variants
|
|
267
|
-
# @return [Array(Boolean, Knockapi::Models::Recipients::
|
|
225
|
+
# @return [Array(Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting)]
|
|
268
226
|
end
|
|
269
227
|
end
|
|
270
228
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Knockapi
|
|
4
|
+
module Models
|
|
5
|
+
module Recipients
|
|
6
|
+
class PushChannelDataDevicesOnly < Knockapi::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute devices
|
|
8
|
+
# A list of devices. Each device contains a token, and optionally a locale and
|
|
9
|
+
# timezone.
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<Knockapi::Models::Recipients::PushChannelDataDevicesOnly::Device>]
|
|
12
|
+
required :devices,
|
|
13
|
+
-> { Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::PushChannelDataDevicesOnly::Device] }
|
|
14
|
+
|
|
15
|
+
# @!method initialize(devices:)
|
|
16
|
+
# Some parameter documentations has been truncated, see
|
|
17
|
+
# {Knockapi::Models::Recipients::PushChannelDataDevicesOnly} for more details.
|
|
18
|
+
#
|
|
19
|
+
# Push channel data.
|
|
20
|
+
#
|
|
21
|
+
# @param devices [Array<Knockapi::Models::Recipients::PushChannelDataDevicesOnly::Device>] A list of devices. Each device contains a token, and optionally a locale and tim
|
|
22
|
+
|
|
23
|
+
class Device < Knockapi::Internal::Type::BaseModel
|
|
24
|
+
# @!attribute token
|
|
25
|
+
# The device token to send the push notification to.
|
|
26
|
+
#
|
|
27
|
+
# @return [String]
|
|
28
|
+
required :token, String
|
|
29
|
+
|
|
30
|
+
# @!attribute locale
|
|
31
|
+
# The locale of the object. Used for
|
|
32
|
+
# [message localization](/concepts/translations).
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :locale, String, nil?: true
|
|
36
|
+
|
|
37
|
+
# @!attribute timezone
|
|
38
|
+
# The timezone of the object. Must be a
|
|
39
|
+
# valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
|
40
|
+
# Used
|
|
41
|
+
# for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
|
|
42
|
+
#
|
|
43
|
+
# @return [String, nil]
|
|
44
|
+
optional :timezone, String, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!method initialize(token:, locale: nil, timezone: nil)
|
|
47
|
+
# Some parameter documentations has been truncated, see
|
|
48
|
+
# {Knockapi::Models::Recipients::PushChannelDataDevicesOnly::Device} for more
|
|
49
|
+
# details.
|
|
50
|
+
#
|
|
51
|
+
# @param token [String] The device token to send the push notification to.
|
|
52
|
+
#
|
|
53
|
+
# @param locale [String, nil] The locale of the object. Used for [message localization](/concepts/translations
|
|
54
|
+
#
|
|
55
|
+
# @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Knockapi
|
|
4
|
+
module Models
|
|
5
|
+
module Recipients
|
|
6
|
+
class PushChannelDataTokensOnly < Knockapi::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute tokens
|
|
8
|
+
# A list of push channel tokens.
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<String>]
|
|
11
|
+
required :tokens, Knockapi::Internal::Type::ArrayOf[String]
|
|
12
|
+
|
|
13
|
+
# @!method initialize(tokens:)
|
|
14
|
+
# Push channel data.
|
|
15
|
+
#
|
|
16
|
+
# @param tokens [Array<String>] A list of push channel tokens.
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -12,13 +12,19 @@ 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::
|
|
15
|
+
# @return [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::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]
|
|
19
19
|
},
|
|
20
20
|
nil?: true
|
|
21
21
|
|
|
22
|
+
# @!attribute name
|
|
23
|
+
# An optional name for the tenant.
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :name, String, nil?: true
|
|
27
|
+
|
|
22
28
|
# @!attribute preferences
|
|
23
29
|
# Inline set preferences for a recipient, where the key is the preference set id.
|
|
24
30
|
# Preferences that are set inline will be merged into any existing preferences
|
|
@@ -35,7 +41,7 @@ module Knockapi
|
|
|
35
41
|
# @return [Knockapi::Models::TenantRequest::Settings, nil]
|
|
36
42
|
optional :settings, -> { Knockapi::TenantRequest::Settings }
|
|
37
43
|
|
|
38
|
-
# @!method initialize(id:, channel_data: nil, preferences: nil, settings: nil)
|
|
44
|
+
# @!method initialize(id:, channel_data: nil, name: nil, preferences: nil, settings: nil)
|
|
39
45
|
# Some parameter documentations has been truncated, see
|
|
40
46
|
# {Knockapi::Models::TenantRequest} for more details.
|
|
41
47
|
#
|
|
@@ -44,7 +50,9 @@ module Knockapi
|
|
|
44
50
|
#
|
|
45
51
|
# @param id [String] The unique identifier for the tenant.
|
|
46
52
|
#
|
|
47
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
53
|
+
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::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.
|
|
54
|
+
#
|
|
55
|
+
# @param name [String, nil] An optional name for the tenant.
|
|
48
56
|
#
|
|
49
57
|
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
|
|
50
58
|
#
|
|
@@ -10,21 +10,29 @@ 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::
|
|
13
|
+
# @return [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::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]
|
|
17
17
|
},
|
|
18
18
|
nil?: true
|
|
19
19
|
|
|
20
|
+
# @!attribute name
|
|
21
|
+
# An optional name for the tenant.
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :name, String, nil?: true
|
|
25
|
+
|
|
20
26
|
# @!attribute settings
|
|
21
27
|
# The settings for the tenant. Includes branding and preference set.
|
|
22
28
|
#
|
|
23
29
|
# @return [Knockapi::Models::TenantSetParams::Settings, nil]
|
|
24
30
|
optional :settings, -> { Knockapi::TenantSetParams::Settings }
|
|
25
31
|
|
|
26
|
-
# @!method initialize(channel_data: nil, settings: nil, request_options: {})
|
|
27
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
32
|
+
# @!method initialize(channel_data: nil, name: nil, settings: nil, request_options: {})
|
|
33
|
+
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::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.
|
|
34
|
+
#
|
|
35
|
+
# @param name [String, nil] An optional name for the tenant.
|
|
28
36
|
#
|
|
29
37
|
# @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set.
|
|
30
38
|
#
|
|
@@ -32,6 +32,15 @@ module Knockapi
|
|
|
32
32
|
# @return [Boolean, nil]
|
|
33
33
|
optional :has_tenant, Knockapi::Internal::Type::Boolean
|
|
34
34
|
|
|
35
|
+
# @!attribute locale
|
|
36
|
+
# The locale to render the feed items in. Must be in the IETF 5646 format (e.g.
|
|
37
|
+
# `en-US`). When not provided, will default to the locale that the feed items were
|
|
38
|
+
# rendered in. Only available for enterprise plan customers using custom
|
|
39
|
+
# translations.
|
|
40
|
+
#
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
optional :locale, String
|
|
43
|
+
|
|
35
44
|
# @!attribute page_size
|
|
36
45
|
# The number of items per page (defaults to 50).
|
|
37
46
|
#
|
|
@@ -68,7 +77,10 @@ module Knockapi
|
|
|
68
77
|
# @return [Array<String>, nil]
|
|
69
78
|
optional :workflow_categories, Knockapi::Internal::Type::ArrayOf[String]
|
|
70
79
|
|
|
71
|
-
# @!method initialize(after: nil, archived: nil, before: nil, has_tenant: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {})
|
|
80
|
+
# @!method initialize(after: nil, archived: nil, before: nil, has_tenant: nil, locale: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {})
|
|
81
|
+
# Some parameter documentations has been truncated, see
|
|
82
|
+
# {Knockapi::Models::Users::FeedListItemsParams} for more details.
|
|
83
|
+
#
|
|
72
84
|
# @param after [String] The cursor to fetch entries after.
|
|
73
85
|
#
|
|
74
86
|
# @param archived [Symbol, Knockapi::Models::Users::FeedListItemsParams::Archived] The archived status of the feed items.
|
|
@@ -77,6 +89,8 @@ module Knockapi
|
|
|
77
89
|
#
|
|
78
90
|
# @param has_tenant [Boolean] Whether the feed items have a tenant.
|
|
79
91
|
#
|
|
92
|
+
# @param locale [String] The locale to render the feed items in. Must be in the IETF 5646 format (e.g. `e
|
|
93
|
+
#
|
|
80
94
|
# @param page_size [Integer] The number of items per page (defaults to 50).
|
|
81
95
|
#
|
|
82
96
|
# @param source [String] The workflow key associated with the message in the feed.
|
|
@@ -362,16 +362,18 @@ module Knockapi
|
|
|
362
362
|
# This operation is used to identify objects with their properties, as well as
|
|
363
363
|
# optional preferences and channel data.
|
|
364
364
|
#
|
|
365
|
-
# @overload set(collection, id, channel_data: nil, locale: nil, preferences: nil, timezone: nil, request_options: {})
|
|
365
|
+
# @overload set(collection, id, channel_data: nil, locale: nil, name: nil, preferences: nil, timezone: nil, request_options: {})
|
|
366
366
|
#
|
|
367
367
|
# @param collection [String] The collection this object belongs to.
|
|
368
368
|
#
|
|
369
369
|
# @param id [String] Unique identifier for the object.
|
|
370
370
|
#
|
|
371
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
371
|
+
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}] A request to set channel data for a type of channel inline.
|
|
372
372
|
#
|
|
373
373
|
# @param locale [String, nil] The locale of the object. Used for [message localization](/concepts/translations
|
|
374
374
|
#
|
|
375
|
+
# @param name [String, nil] An optional name for the object.
|
|
376
|
+
#
|
|
375
377
|
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}] Inline set preferences for a recipient, where the key is the preference set id.
|
|
376
378
|
#
|
|
377
379
|
# @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https
|
|
@@ -404,7 +406,7 @@ module Knockapi
|
|
|
404
406
|
#
|
|
405
407
|
# @param channel_id [String] The unique identifier for the channel.
|
|
406
408
|
#
|
|
407
|
-
# @param data [Knockapi::Models::Recipients::
|
|
409
|
+
# @param data [Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] Channel data for a given channel type.
|
|
408
410
|
#
|
|
409
411
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
410
412
|
#
|
|
@@ -448,7 +450,7 @@ module Knockapi
|
|
|
448
450
|
#
|
|
449
451
|
# @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
|
|
450
452
|
#
|
|
451
|
-
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
453
|
+
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
|
|
452
454
|
#
|
|
453
455
|
# @param commercial_subscribed [Boolean, nil] Whether the recipient is subscribed to commercial communications. When false, th
|
|
454
456
|
#
|
|
@@ -80,11 +80,13 @@ module Knockapi
|
|
|
80
80
|
# Sets a tenant within an environment, performing an upsert operation. Any
|
|
81
81
|
# existing properties will be merged with the incoming properties.
|
|
82
82
|
#
|
|
83
|
-
# @overload set(id, channel_data: nil, settings: nil, request_options: {})
|
|
83
|
+
# @overload set(id, channel_data: nil, name: nil, settings: nil, request_options: {})
|
|
84
84
|
#
|
|
85
85
|
# @param id [String] The unique identifier for the tenant.
|
|
86
86
|
#
|
|
87
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
87
|
+
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::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.
|
|
88
|
+
#
|
|
89
|
+
# @param name [String, nil] An optional name for the tenant.
|
|
88
90
|
#
|
|
89
91
|
# @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set.
|
|
90
92
|
#
|
|
@@ -26,6 +26,9 @@ module Knockapi
|
|
|
26
26
|
)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# Some parameter documentations has been truncated, see
|
|
30
|
+
# {Knockapi::Models::Users::FeedListItemsParams} for more details.
|
|
31
|
+
#
|
|
29
32
|
# Returns a paginated list of feed items for a user in reverse chronological
|
|
30
33
|
# order, including metadata about the feed. If the user has not yet been
|
|
31
34
|
# identified within Knock, an empty feed will be returned.
|
|
@@ -41,7 +44,7 @@ module Knockapi
|
|
|
41
44
|
# - This endpoint’s rate limit is always scoped per-user and per-environment. This
|
|
42
45
|
# is true even for requests made without a signed user token.
|
|
43
46
|
#
|
|
44
|
-
# @overload list_items(user_id, id, after: nil, archived: nil, before: nil, has_tenant: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {})
|
|
47
|
+
# @overload list_items(user_id, id, after: nil, archived: nil, before: nil, has_tenant: nil, locale: nil, page_size: nil, source: nil, status: nil, tenant: nil, trigger_data: nil, workflow_categories: nil, request_options: {})
|
|
45
48
|
#
|
|
46
49
|
# @param user_id [String] The unique identifier of the user.
|
|
47
50
|
#
|
|
@@ -55,6 +58,8 @@ module Knockapi
|
|
|
55
58
|
#
|
|
56
59
|
# @param has_tenant [Boolean] Whether the feed items have a tenant.
|
|
57
60
|
#
|
|
61
|
+
# @param locale [String] The locale to render the feed items in. Must be in the IETF 5646 format (e.g. `e
|
|
62
|
+
#
|
|
58
63
|
# @param page_size [Integer] The number of items per page (defaults to 50).
|
|
59
64
|
#
|
|
60
65
|
# @param source [String] The workflow key associated with the message in the feed.
|
|
@@ -25,7 +25,7 @@ module Knockapi
|
|
|
25
25
|
#
|
|
26
26
|
# @param avatar [String, nil] A URL for the avatar of the user.
|
|
27
27
|
#
|
|
28
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
28
|
+
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::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.
|
|
29
29
|
#
|
|
30
30
|
# @param created_at [Time, nil] The creation date of the user from your system.
|
|
31
31
|
#
|
|
@@ -354,7 +354,7 @@ module Knockapi
|
|
|
354
354
|
#
|
|
355
355
|
# @param channel_id [String] The unique identifier for the channel.
|
|
356
356
|
#
|
|
357
|
-
# @param data [Knockapi::Models::Recipients::
|
|
357
|
+
# @param data [Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] Channel data for a given channel type.
|
|
358
358
|
#
|
|
359
359
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
360
360
|
#
|
|
@@ -392,7 +392,7 @@ module Knockapi
|
|
|
392
392
|
#
|
|
393
393
|
# @param channel_types [Knockapi::Models::Recipients::PreferenceSetChannelTypes, nil] Channel type preferences.
|
|
394
394
|
#
|
|
395
|
-
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::
|
|
395
|
+
# @param channels [Hash{Symbol=>Boolean, Knockapi::Models::Recipients::PreferenceSetChannelSetting}, nil] Channel preferences.
|
|
396
396
|
#
|
|
397
397
|
# @param commercial_subscribed [Boolean, nil] Whether the recipient is subscribed to commercial communications. When false, th
|
|
398
398
|
#
|
data/lib/knockapi/version.rb
CHANGED
data/lib/knockapi.rb
CHANGED
|
@@ -9,6 +9,7 @@ require "erb"
|
|
|
9
9
|
require "etc"
|
|
10
10
|
require "json"
|
|
11
11
|
require "net/http"
|
|
12
|
+
require "openssl"
|
|
12
13
|
require "pathname"
|
|
13
14
|
require "rbconfig"
|
|
14
15
|
require "securerandom"
|
|
@@ -147,13 +148,19 @@ require_relative "knockapi/models/providers/slack_revoke_access_response"
|
|
|
147
148
|
require_relative "knockapi/models/recipient"
|
|
148
149
|
require_relative "knockapi/models/recipient_reference"
|
|
149
150
|
require_relative "knockapi/models/recipient_request"
|
|
151
|
+
require_relative "knockapi/models/recipients/aws_sns_push_channel_data_devices_only"
|
|
152
|
+
require_relative "knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only"
|
|
150
153
|
require_relative "knockapi/models/recipients/discord_channel_data"
|
|
151
154
|
require_relative "knockapi/models/recipients/inline_channel_data_request"
|
|
152
155
|
require_relative "knockapi/models/recipients/inline_preference_set_request"
|
|
153
156
|
require_relative "knockapi/models/recipients/ms_teams_channel_data"
|
|
157
|
+
require_relative "knockapi/models/recipients/one_signal_channel_data_player_ids_only"
|
|
154
158
|
require_relative "knockapi/models/recipients/preference_set"
|
|
159
|
+
require_relative "knockapi/models/recipients/preference_set_channel_setting"
|
|
155
160
|
require_relative "knockapi/models/recipients/preference_set_channel_types"
|
|
156
161
|
require_relative "knockapi/models/recipients/preference_set_channel_type_setting"
|
|
162
|
+
require_relative "knockapi/models/recipients/push_channel_data_devices_only"
|
|
163
|
+
require_relative "knockapi/models/recipients/push_channel_data_tokens_only"
|
|
157
164
|
require_relative "knockapi/models/recipients/channel_data"
|
|
158
165
|
require_relative "knockapi/models/recipients/slack_channel_data"
|
|
159
166
|
require_relative "knockapi/models/recipients/subscription"
|
data/manifest.yaml
CHANGED
data/rbi/knockapi/client.rbi
CHANGED
|
@@ -13,6 +13,10 @@ module Knockapi
|
|
|
13
13
|
sig { returns(String) }
|
|
14
14
|
attr_reader :api_key
|
|
15
15
|
|
|
16
|
+
# The slug of an existing branch
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :branch
|
|
19
|
+
|
|
16
20
|
sig { returns(Knockapi::Resources::Recipients) }
|
|
17
21
|
attr_reader :recipients
|
|
18
22
|
|
|
@@ -58,6 +62,7 @@ module Knockapi
|
|
|
58
62
|
sig do
|
|
59
63
|
params(
|
|
60
64
|
api_key: T.nilable(String),
|
|
65
|
+
branch: T.nilable(String),
|
|
61
66
|
base_url: T.nilable(String),
|
|
62
67
|
max_retries: Integer,
|
|
63
68
|
timeout: Float,
|
|
@@ -69,6 +74,8 @@ module Knockapi
|
|
|
69
74
|
def self.new(
|
|
70
75
|
# Defaults to `ENV["KNOCK_API_KEY"]`
|
|
71
76
|
api_key: ENV["KNOCK_API_KEY"],
|
|
77
|
+
# The slug of an existing branch Defaults to `ENV["KNOCK_BRANCH"]`
|
|
78
|
+
branch: ENV["KNOCK_BRANCH"],
|
|
72
79
|
# Override the default base URL for the API, e.g.,
|
|
73
80
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["KNOCK_BASE_URL"]`
|
|
74
81
|
base_url: ENV["KNOCK_BASE_URL"],
|
|
@@ -26,8 +26,12 @@ module Knockapi
|
|
|
26
26
|
|
|
27
27
|
class << self
|
|
28
28
|
# @api private
|
|
29
|
-
sig
|
|
30
|
-
|
|
29
|
+
sig do
|
|
30
|
+
params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
|
|
31
|
+
Net::HTTP
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def connect(cert_store:, url:)
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
# @api private
|
|
@@ -31,7 +31,7 @@ module Knockapi
|
|
|
31
31
|
#
|
|
32
32
|
# Assumes superclass fields are totally defined before fields are accessed /
|
|
33
33
|
# defined on subclasses.
|
|
34
|
-
sig { params(child:
|
|
34
|
+
sig { params(child: Knockapi::Internal::Type::BaseModel).void }
|
|
35
35
|
def inherited(child)
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -274,9 +274,13 @@ module Knockapi
|
|
|
274
274
|
|
|
275
275
|
# Create a new instance of a model.
|
|
276
276
|
sig do
|
|
277
|
-
params(
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
params(
|
|
278
|
+
data:
|
|
279
|
+
T.any(
|
|
280
|
+
T::Hash[Symbol, T.anything],
|
|
281
|
+
Knockapi::Internal::Type::BaseModel
|
|
282
|
+
)
|
|
283
|
+
).returns(T.attached_class)
|
|
280
284
|
end
|
|
281
285
|
def self.new(data = {})
|
|
282
286
|
end
|
|
@@ -19,11 +19,11 @@ module Knockapi
|
|
|
19
19
|
T::Hash[
|
|
20
20
|
Symbol,
|
|
21
21
|
T.any(
|
|
22
|
-
Knockapi::Recipients::
|
|
23
|
-
Knockapi::Recipients::
|
|
24
|
-
Knockapi::Recipients::
|
|
25
|
-
Knockapi::Recipients::
|
|
26
|
-
Knockapi::Recipients::
|
|
22
|
+
Knockapi::Recipients::PushChannelDataTokensOnly,
|
|
23
|
+
Knockapi::Recipients::PushChannelDataDevicesOnly,
|
|
24
|
+
Knockapi::Recipients::AwsSnsPushChannelDataTargetArnsOnly,
|
|
25
|
+
Knockapi::Recipients::AwsSnsPushChannelDataDevicesOnly,
|
|
26
|
+
Knockapi::Recipients::OneSignalChannelDataPlayerIDsOnly,
|
|
27
27
|
Knockapi::Recipients::SlackChannelData,
|
|
28
28
|
Knockapi::Recipients::MsTeamsChannelData,
|
|
29
29
|
Knockapi::Recipients::DiscordChannelData
|
|
@@ -83,11 +83,11 @@ module Knockapi
|
|
|
83
83
|
T::Hash[
|
|
84
84
|
Symbol,
|
|
85
85
|
T.any(
|
|
86
|
-
Knockapi::Recipients::
|
|
87
|
-
Knockapi::Recipients::
|
|
88
|
-
Knockapi::Recipients::
|
|
89
|
-
Knockapi::Recipients::
|
|
90
|
-
Knockapi::Recipients::
|
|
86
|
+
Knockapi::Recipients::PushChannelDataTokensOnly::OrHash,
|
|
87
|
+
Knockapi::Recipients::PushChannelDataDevicesOnly::OrHash,
|
|
88
|
+
Knockapi::Recipients::AwsSnsPushChannelDataTargetArnsOnly::OrHash,
|
|
89
|
+
Knockapi::Recipients::AwsSnsPushChannelDataDevicesOnly::OrHash,
|
|
90
|
+
Knockapi::Recipients::OneSignalChannelDataPlayerIDsOnly::OrHash,
|
|
91
91
|
Knockapi::Recipients::SlackChannelData::OrHash,
|
|
92
92
|
Knockapi::Recipients::MsTeamsChannelData::OrHash,
|
|
93
93
|
Knockapi::Recipients::DiscordChannelData::OrHash
|
|
@@ -146,11 +146,11 @@ module Knockapi
|
|
|
146
146
|
T::Hash[
|
|
147
147
|
Symbol,
|
|
148
148
|
T.any(
|
|
149
|
-
Knockapi::Recipients::
|
|
150
|
-
Knockapi::Recipients::
|
|
151
|
-
Knockapi::Recipients::
|
|
152
|
-
Knockapi::Recipients::
|
|
153
|
-
Knockapi::Recipients::
|
|
149
|
+
Knockapi::Recipients::PushChannelDataTokensOnly,
|
|
150
|
+
Knockapi::Recipients::PushChannelDataDevicesOnly,
|
|
151
|
+
Knockapi::Recipients::AwsSnsPushChannelDataTargetArnsOnly,
|
|
152
|
+
Knockapi::Recipients::AwsSnsPushChannelDataDevicesOnly,
|
|
153
|
+
Knockapi::Recipients::OneSignalChannelDataPlayerIDsOnly,
|
|
154
154
|
Knockapi::Recipients::SlackChannelData,
|
|
155
155
|
Knockapi::Recipients::MsTeamsChannelData,
|
|
156
156
|
Knockapi::Recipients::DiscordChannelData
|