knockapi 1.32.1 → 1.33.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 +20 -0
- data/README.md +1 -1
- data/lib/knockapi/client.rb +13 -0
- data/lib/knockapi/internal/util.rb +31 -0
- data/lib/knockapi/resources/audiences.rb +4 -2
- data/lib/knockapi/resources/bulk_operations.rb +2 -0
- data/lib/knockapi/resources/channels/bulk.rb +2 -0
- data/lib/knockapi/resources/channels.rb +2 -0
- data/lib/knockapi/resources/messages/batch.rb +3 -1
- data/lib/knockapi/resources/messages.rb +10 -4
- data/lib/knockapi/resources/objects/bulk.rb +2 -0
- data/lib/knockapi/resources/objects.rb +11 -4
- data/lib/knockapi/resources/providers/ms_teams.rb +10 -4
- data/lib/knockapi/resources/providers/slack.rb +8 -3
- data/lib/knockapi/resources/providers.rb +4 -0
- data/lib/knockapi/resources/schedules/bulk.rb +2 -0
- data/lib/knockapi/resources/schedules.rb +6 -1
- data/lib/knockapi/resources/tenants/bulk.rb +4 -1
- data/lib/knockapi/resources/tenants.rb +11 -4
- data/lib/knockapi/resources/users/bulk.rb +2 -0
- data/lib/knockapi/resources/users/feeds.rb +4 -1
- data/lib/knockapi/resources/users/guides.rb +4 -1
- data/lib/knockapi/resources/users.rb +18 -5
- data/lib/knockapi/resources/workflows.rb +2 -0
- data/lib/knockapi/version.rb +1 -1
- data/rbi/knockapi/client.rbi +13 -0
- data/rbi/knockapi/internal/util.rbi +20 -0
- data/rbi/knockapi/resources/audiences.rbi +1 -0
- data/rbi/knockapi/resources/bulk_operations.rbi +2 -0
- data/rbi/knockapi/resources/channels/bulk.rbi +2 -0
- data/rbi/knockapi/resources/channels.rbi +2 -0
- data/rbi/knockapi/resources/messages/batch.rbi +1 -0
- data/rbi/knockapi/resources/messages.rbi +2 -0
- data/rbi/knockapi/resources/objects/bulk.rbi +2 -0
- data/rbi/knockapi/resources/objects.rbi +3 -0
- data/rbi/knockapi/resources/providers/ms_teams.rbi +2 -0
- data/rbi/knockapi/resources/providers/slack.rbi +2 -0
- data/rbi/knockapi/resources/providers.rbi +4 -0
- data/rbi/knockapi/resources/schedules/bulk.rbi +2 -0
- data/rbi/knockapi/resources/schedules.rbi +4 -0
- data/rbi/knockapi/resources/tenants/bulk.rbi +2 -0
- data/rbi/knockapi/resources/tenants.rbi +4 -0
- data/rbi/knockapi/resources/users/bulk.rbi +2 -0
- data/rbi/knockapi/resources/users/feeds.rbi +2 -0
- data/rbi/knockapi/resources/users/guides.rbi +2 -0
- data/rbi/knockapi/resources/users.rbi +8 -0
- data/rbi/knockapi/resources/workflows.rbi +2 -0
- data/sig/knockapi/internal/util.rbs +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fdf258bbe7e17f9d95456fd503712fa051dcd85fa28d8dd9e308cc3e33b5ffa3
|
|
4
|
+
data.tar.gz: 435914a90c65531ac4dcafdb5af0ea1ef4ba6febfa948865bb60458c99ae3c9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39584fbdff4b91e0630c6c7d8e05b7ac73c57de5e442945aa31bb3883fa3cfc3b9a705f074ac9cc4cc0e0f464ee6e19b431d6cb81b8e63e0ef332bad4bd808e3
|
|
7
|
+
data.tar.gz: 47c33e8c167fb90c047a78fb3831266fa720f5d96b89763411dd2c75ffd5cfdbe956b6fd10c58af6bee121be65b919ef51c51ab9f55bef584c5927aac854a2bb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.33.0 (2026-03-03)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.32.1...v1.33.0](https://github.com/knocklabs/knock-ruby/compare/v1.32.1...v1.33.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([7ba6675](https://github.com/knocklabs/knock-ruby/commit/7ba667550ffe7a071924b835e6f7bbb735dc93ad))
|
|
10
|
+
* **api:** api update ([9a5227f](https://github.com/knocklabs/knock-ruby/commit/9a5227feaac4df242717be5e3704e4e327783250))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **client:** serialize query parameters properly ([0a76966](https://github.com/knocklabs/knock-ruby/commit/0a7696661973ba7e4f461be1bda646a3654a955a))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Chores
|
|
19
|
+
|
|
20
|
+
* **ci:** add build step ([979140d](https://github.com/knocklabs/knock-ruby/commit/979140db56dabc14ead8dd64cee25c12c38f8c40))
|
|
21
|
+
* **docs:** add missing descriptions ([d1d2610](https://github.com/knocklabs/knock-ruby/commit/d1d26104b361735f37a9739d676e350d088f27b8))
|
|
22
|
+
|
|
3
23
|
## 1.32.1 (2026-02-26)
|
|
4
24
|
|
|
5
25
|
Full Changelog: [v1.32.0...v1.32.1](https://github.com/knocklabs/knock-ruby/compare/v1.32.0...v1.32.1)
|
data/README.md
CHANGED
data/lib/knockapi/client.rb
CHANGED
|
@@ -25,18 +25,26 @@ module Knockapi
|
|
|
25
25
|
# @return [Knockapi::Resources::Recipients]
|
|
26
26
|
attr_reader :recipients
|
|
27
27
|
|
|
28
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
29
|
+
# commonly a recipient of a notification.
|
|
28
30
|
# @return [Knockapi::Resources::Users]
|
|
29
31
|
attr_reader :users
|
|
30
32
|
|
|
33
|
+
# An object represents a resource in your system that you want to map into Knock.
|
|
31
34
|
# @return [Knockapi::Resources::Objects]
|
|
32
35
|
attr_reader :objects
|
|
33
36
|
|
|
37
|
+
# A tenant represents a top-level entity from your system, like a company,
|
|
38
|
+
# organization, account, or workspace.
|
|
34
39
|
# @return [Knockapi::Resources::Tenants]
|
|
35
40
|
attr_reader :tenants
|
|
36
41
|
|
|
42
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
43
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
37
44
|
# @return [Knockapi::Resources::BulkOperations]
|
|
38
45
|
attr_reader :bulk_operations
|
|
39
46
|
|
|
47
|
+
# A message sent to a single recipient on a channel.
|
|
40
48
|
# @return [Knockapi::Resources::Messages]
|
|
41
49
|
attr_reader :messages
|
|
42
50
|
|
|
@@ -46,15 +54,20 @@ module Knockapi
|
|
|
46
54
|
# @return [Knockapi::Resources::Integrations]
|
|
47
55
|
attr_reader :integrations
|
|
48
56
|
|
|
57
|
+
# A workflow is a structured set of steps that is triggered to produce
|
|
58
|
+
# notifications sent over channels.
|
|
49
59
|
# @return [Knockapi::Resources::Workflows]
|
|
50
60
|
attr_reader :workflows
|
|
51
61
|
|
|
62
|
+
# A schedule is a per-recipient, timezone-aware configuration for when to invoke a
|
|
63
|
+
# workflow.
|
|
52
64
|
# @return [Knockapi::Resources::Schedules]
|
|
53
65
|
attr_reader :schedules
|
|
54
66
|
|
|
55
67
|
# @return [Knockapi::Resources::Channels]
|
|
56
68
|
attr_reader :channels
|
|
57
69
|
|
|
70
|
+
# An Audience is a segment of users.
|
|
58
71
|
# @return [Knockapi::Resources::Audiences]
|
|
59
72
|
attr_reader :audiences
|
|
60
73
|
|
|
@@ -490,6 +490,37 @@ module Knockapi
|
|
|
490
490
|
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
|
|
491
491
|
|
|
492
492
|
class << self
|
|
493
|
+
# @api private
|
|
494
|
+
#
|
|
495
|
+
# @param query [Hash{Symbol=>Object}]
|
|
496
|
+
#
|
|
497
|
+
# @return [Hash{Symbol=>Object}]
|
|
498
|
+
def encode_query_params(query)
|
|
499
|
+
out = {}
|
|
500
|
+
query.each { write_query_param_element!(out, _1, _2) }
|
|
501
|
+
out
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
# @api private
|
|
505
|
+
#
|
|
506
|
+
# @param collection [Hash{Symbol=>Object}]
|
|
507
|
+
# @param key [String]
|
|
508
|
+
# @param element [Object]
|
|
509
|
+
#
|
|
510
|
+
# @return [nil]
|
|
511
|
+
private def write_query_param_element!(collection, key, element)
|
|
512
|
+
case element
|
|
513
|
+
in Hash
|
|
514
|
+
element.each do |name, value|
|
|
515
|
+
write_query_param_element!(collection, "#{key}[#{name}]", value)
|
|
516
|
+
end
|
|
517
|
+
in Array
|
|
518
|
+
collection["#{key}[]"] = element.map(&:to_s)
|
|
519
|
+
else
|
|
520
|
+
collection[key] = element.to_s
|
|
521
|
+
end
|
|
522
|
+
end
|
|
523
|
+
|
|
493
524
|
# @api private
|
|
494
525
|
#
|
|
495
526
|
# @param y [Enumerator::Yielder]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# An Audience is a segment of users.
|
|
5
6
|
class Audiences
|
|
6
7
|
# Some parameter documentations has been truncated, see
|
|
7
8
|
# {Knockapi::Models::AudienceAddMembersParams} for more details.
|
|
@@ -22,12 +23,13 @@ module Knockapi
|
|
|
22
23
|
#
|
|
23
24
|
# @see Knockapi::Models::AudienceAddMembersParams
|
|
24
25
|
def add_members(key, params)
|
|
25
|
-
parsed, options = Knockapi::AudienceAddMembersParams.dump_request(params)
|
|
26
26
|
query_params = [:create_audience]
|
|
27
|
+
parsed, options = Knockapi::AudienceAddMembersParams.dump_request(params)
|
|
28
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
27
29
|
@client.request(
|
|
28
30
|
method: :post,
|
|
29
31
|
path: ["v1/audiences/%1$s/members", key],
|
|
30
|
-
query:
|
|
32
|
+
query: query,
|
|
31
33
|
body: parsed.except(*query_params),
|
|
32
34
|
model: NilClass,
|
|
33
35
|
options: options
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
6
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
5
7
|
class BulkOperations
|
|
6
8
|
# Retrieves a bulk operation (if it exists) and displays the current state of it.
|
|
7
9
|
#
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Channels
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Some parameter documentations has been truncated, see
|
|
8
10
|
# {Knockapi::Models::Channels::BulkUpdateMessageStatusParams} for more details.
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Channels
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
# @return [Knockapi::Resources::Channels::Bulk]
|
|
7
9
|
attr_reader :bulk
|
|
8
10
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Messages
|
|
6
|
+
# A message sent to a single recipient on a channel.
|
|
6
7
|
class Batch
|
|
7
8
|
# Marks the given messages as archived. Archived messages are hidden from the
|
|
8
9
|
# default message list in the feed but can still be accessed and unarchived later.
|
|
@@ -40,10 +41,11 @@ module Knockapi
|
|
|
40
41
|
# @see Knockapi::Models::Messages::BatchGetContentParams
|
|
41
42
|
def get_content(params)
|
|
42
43
|
parsed, options = Knockapi::Messages::BatchGetContentParams.dump_request(params)
|
|
44
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
43
45
|
@client.request(
|
|
44
46
|
method: :get,
|
|
45
47
|
path: "v1/messages/batch/content",
|
|
46
|
-
query:
|
|
48
|
+
query: query,
|
|
47
49
|
model: Knockapi::Internal::Type::ArrayOf[Knockapi::Models::Messages::BatchGetContentResponseItem],
|
|
48
50
|
options: options
|
|
49
51
|
)
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A message sent to a single recipient on a channel.
|
|
5
6
|
class Messages
|
|
7
|
+
# A message sent to a single recipient on a channel.
|
|
6
8
|
# @return [Knockapi::Resources::Messages::Batch]
|
|
7
9
|
attr_reader :batch
|
|
8
10
|
|
|
@@ -48,10 +50,11 @@ module Knockapi
|
|
|
48
50
|
# @see Knockapi::Models::MessageListParams
|
|
49
51
|
def list(params = {})
|
|
50
52
|
parsed, options = Knockapi::MessageListParams.dump_request(params)
|
|
53
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
51
54
|
@client.request(
|
|
52
55
|
method: :get,
|
|
53
56
|
path: "v1/messages",
|
|
54
|
-
query:
|
|
57
|
+
query: query,
|
|
55
58
|
page: Knockapi::Internal::ItemsCursor,
|
|
56
59
|
model: Knockapi::Message,
|
|
57
60
|
options: options
|
|
@@ -141,10 +144,11 @@ module Knockapi
|
|
|
141
144
|
# @see Knockapi::Models::MessageListActivitiesParams
|
|
142
145
|
def list_activities(message_id, params = {})
|
|
143
146
|
parsed, options = Knockapi::MessageListActivitiesParams.dump_request(params)
|
|
147
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
144
148
|
@client.request(
|
|
145
149
|
method: :get,
|
|
146
150
|
path: ["v1/messages/%1$s/activities", message_id],
|
|
147
|
-
query:
|
|
151
|
+
query: query,
|
|
148
152
|
page: Knockapi::Internal::ItemsCursor,
|
|
149
153
|
model: Knockapi::Activity,
|
|
150
154
|
options: options
|
|
@@ -170,10 +174,11 @@ module Knockapi
|
|
|
170
174
|
# @see Knockapi::Models::MessageListDeliveryLogsParams
|
|
171
175
|
def list_delivery_logs(message_id, params = {})
|
|
172
176
|
parsed, options = Knockapi::MessageListDeliveryLogsParams.dump_request(params)
|
|
177
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
173
178
|
@client.request(
|
|
174
179
|
method: :get,
|
|
175
180
|
path: ["v1/messages/%1$s/delivery_logs", message_id],
|
|
176
|
-
query:
|
|
181
|
+
query: query,
|
|
177
182
|
page: Knockapi::Internal::ItemsCursor,
|
|
178
183
|
model: Knockapi::MessageDeliveryLog,
|
|
179
184
|
options: options
|
|
@@ -199,10 +204,11 @@ module Knockapi
|
|
|
199
204
|
# @see Knockapi::Models::MessageListEventsParams
|
|
200
205
|
def list_events(message_id, params = {})
|
|
201
206
|
parsed, options = Knockapi::MessageListEventsParams.dump_request(params)
|
|
207
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
202
208
|
@client.request(
|
|
203
209
|
method: :get,
|
|
204
210
|
path: ["v1/messages/%1$s/events", message_id],
|
|
205
|
-
query:
|
|
211
|
+
query: query,
|
|
206
212
|
page: Knockapi::Internal::ItemsCursor,
|
|
207
213
|
model: Knockapi::MessageEvent,
|
|
208
214
|
options: options
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Objects
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Bulk deletes objects from the specified collection.
|
|
8
10
|
#
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# An object represents a resource in your system that you want to map into Knock.
|
|
5
6
|
class Objects
|
|
7
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
8
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
9
|
# @return [Knockapi::Resources::Objects::Bulk]
|
|
7
10
|
attr_reader :bulk
|
|
8
11
|
|
|
@@ -28,10 +31,11 @@ module Knockapi
|
|
|
28
31
|
# @see Knockapi::Models::ObjectListParams
|
|
29
32
|
def list(collection, params = {})
|
|
30
33
|
parsed, options = Knockapi::ObjectListParams.dump_request(params)
|
|
34
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
31
35
|
@client.request(
|
|
32
36
|
method: :get,
|
|
33
37
|
path: ["v1/objects/%1$s", collection],
|
|
34
|
-
query:
|
|
38
|
+
query: query,
|
|
35
39
|
page: Knockapi::Internal::EntriesCursor,
|
|
36
40
|
model: Knockapi::Object,
|
|
37
41
|
options: options
|
|
@@ -244,10 +248,11 @@ module Knockapi
|
|
|
244
248
|
# @see Knockapi::Models::ObjectListMessagesParams
|
|
245
249
|
def list_messages(collection, id, params = {})
|
|
246
250
|
parsed, options = Knockapi::ObjectListMessagesParams.dump_request(params)
|
|
251
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
247
252
|
@client.request(
|
|
248
253
|
method: :get,
|
|
249
254
|
path: ["v1/objects/%1$s/%2$s/messages", collection, id],
|
|
250
|
-
query:
|
|
255
|
+
query: query,
|
|
251
256
|
page: Knockapi::Internal::ItemsCursor,
|
|
252
257
|
model: Knockapi::Message,
|
|
253
258
|
options: options
|
|
@@ -301,10 +306,11 @@ module Knockapi
|
|
|
301
306
|
# @see Knockapi::Models::ObjectListSchedulesParams
|
|
302
307
|
def list_schedules(collection, id, params = {})
|
|
303
308
|
parsed, options = Knockapi::ObjectListSchedulesParams.dump_request(params)
|
|
309
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
304
310
|
@client.request(
|
|
305
311
|
method: :get,
|
|
306
312
|
path: ["v1/objects/%1$s/%2$s/schedules", collection, id],
|
|
307
|
-
query:
|
|
313
|
+
query: query,
|
|
308
314
|
page: Knockapi::Internal::EntriesCursor,
|
|
309
315
|
model: Knockapi::Schedule,
|
|
310
316
|
options: options
|
|
@@ -345,10 +351,11 @@ module Knockapi
|
|
|
345
351
|
# @see Knockapi::Models::ObjectListSubscriptionsParams
|
|
346
352
|
def list_subscriptions(collection, object_id_, params = {})
|
|
347
353
|
parsed, options = Knockapi::ObjectListSubscriptionsParams.dump_request(params)
|
|
354
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
348
355
|
@client.request(
|
|
349
356
|
method: :get,
|
|
350
357
|
path: ["v1/objects/%1$s/%2$s/subscriptions", collection, object_id_],
|
|
351
|
-
query:
|
|
358
|
+
query: query,
|
|
352
359
|
page: Knockapi::Internal::EntriesCursor,
|
|
353
360
|
model: Knockapi::Recipients::Subscription,
|
|
354
361
|
options: options
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Providers
|
|
6
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
7
|
+
# configured via a channel.
|
|
6
8
|
class MsTeams
|
|
7
9
|
# Check if a connection to Microsoft Teams has been authorized for a given
|
|
8
10
|
# Microsoft Teams tenant object.
|
|
@@ -20,10 +22,11 @@ module Knockapi
|
|
|
20
22
|
# @see Knockapi::Models::Providers::MsTeamCheckAuthParams
|
|
21
23
|
def check_auth(channel_id, params)
|
|
22
24
|
parsed, options = Knockapi::Providers::MsTeamCheckAuthParams.dump_request(params)
|
|
25
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
23
26
|
@client.request(
|
|
24
27
|
method: :get,
|
|
25
28
|
path: ["v1/providers/ms-teams/%1$s/auth_check", channel_id],
|
|
26
|
-
query:
|
|
29
|
+
query: query,
|
|
27
30
|
model: Knockapi::Models::Providers::MsTeamCheckAuthResponse,
|
|
28
31
|
options: options
|
|
29
32
|
)
|
|
@@ -49,10 +52,11 @@ module Knockapi
|
|
|
49
52
|
# @see Knockapi::Models::Providers::MsTeamListChannelsParams
|
|
50
53
|
def list_channels(channel_id, params)
|
|
51
54
|
parsed, options = Knockapi::Providers::MsTeamListChannelsParams.dump_request(params)
|
|
55
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
52
56
|
@client.request(
|
|
53
57
|
method: :get,
|
|
54
58
|
path: ["v1/providers/ms-teams/%1$s/channels", channel_id],
|
|
55
|
-
query:
|
|
59
|
+
query: query,
|
|
56
60
|
model: Knockapi::Models::Providers::MsTeamListChannelsResponse,
|
|
57
61
|
options: options
|
|
58
62
|
)
|
|
@@ -76,10 +80,11 @@ module Knockapi
|
|
|
76
80
|
# @see Knockapi::Models::Providers::MsTeamListTeamsParams
|
|
77
81
|
def list_teams(channel_id, params)
|
|
78
82
|
parsed, options = Knockapi::Providers::MsTeamListTeamsParams.dump_request(params)
|
|
83
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
79
84
|
@client.request(
|
|
80
85
|
method: :get,
|
|
81
86
|
path: ["v1/providers/ms-teams/%1$s/teams", channel_id],
|
|
82
|
-
query:
|
|
87
|
+
query: query,
|
|
83
88
|
page: Knockapi::Internal::MsTeamsPagination,
|
|
84
89
|
model: Knockapi::Models::Providers::MsTeamListTeamsResponse,
|
|
85
90
|
options: options
|
|
@@ -101,10 +106,11 @@ module Knockapi
|
|
|
101
106
|
# @see Knockapi::Models::Providers::MsTeamRevokeAccessParams
|
|
102
107
|
def revoke_access(channel_id, params)
|
|
103
108
|
parsed, options = Knockapi::Providers::MsTeamRevokeAccessParams.dump_request(params)
|
|
109
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
104
110
|
@client.request(
|
|
105
111
|
method: :put,
|
|
106
112
|
path: ["v1/providers/ms-teams/%1$s/revoke_access", channel_id],
|
|
107
|
-
query:
|
|
113
|
+
query: query,
|
|
108
114
|
model: Knockapi::Models::Providers::MsTeamRevokeAccessResponse,
|
|
109
115
|
options: options
|
|
110
116
|
)
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Providers
|
|
6
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
7
|
+
# configured via a channel.
|
|
6
8
|
class Slack
|
|
7
9
|
# Check if a Slack channel is authenticated.
|
|
8
10
|
#
|
|
@@ -19,10 +21,11 @@ module Knockapi
|
|
|
19
21
|
# @see Knockapi::Models::Providers::SlackCheckAuthParams
|
|
20
22
|
def check_auth(channel_id, params)
|
|
21
23
|
parsed, options = Knockapi::Providers::SlackCheckAuthParams.dump_request(params)
|
|
24
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
22
25
|
@client.request(
|
|
23
26
|
method: :get,
|
|
24
27
|
path: ["v1/providers/slack/%1$s/auth_check", channel_id],
|
|
25
|
-
query:
|
|
28
|
+
query: query,
|
|
26
29
|
model: Knockapi::Models::Providers::SlackCheckAuthResponse,
|
|
27
30
|
options: options
|
|
28
31
|
)
|
|
@@ -45,10 +48,11 @@ module Knockapi
|
|
|
45
48
|
# @see Knockapi::Models::Providers::SlackListChannelsParams
|
|
46
49
|
def list_channels(channel_id, params)
|
|
47
50
|
parsed, options = Knockapi::Providers::SlackListChannelsParams.dump_request(params)
|
|
51
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
48
52
|
@client.request(
|
|
49
53
|
method: :get,
|
|
50
54
|
path: ["v1/providers/slack/%1$s/channels", channel_id],
|
|
51
|
-
query:
|
|
55
|
+
query: query,
|
|
52
56
|
page: Knockapi::Internal::SlackChannelsCursor,
|
|
53
57
|
model: Knockapi::Models::Providers::SlackListChannelsResponse,
|
|
54
58
|
options: options
|
|
@@ -70,10 +74,11 @@ module Knockapi
|
|
|
70
74
|
# @see Knockapi::Models::Providers::SlackRevokeAccessParams
|
|
71
75
|
def revoke_access(channel_id, params)
|
|
72
76
|
parsed, options = Knockapi::Providers::SlackRevokeAccessParams.dump_request(params)
|
|
77
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
73
78
|
@client.request(
|
|
74
79
|
method: :put,
|
|
75
80
|
path: ["v1/providers/slack/%1$s/revoke_access", channel_id],
|
|
76
|
-
query:
|
|
81
|
+
query: query,
|
|
77
82
|
model: Knockapi::Models::Providers::SlackRevokeAccessResponse,
|
|
78
83
|
options: options
|
|
79
84
|
)
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Providers
|
|
6
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
7
|
+
# configured via a channel.
|
|
6
8
|
# @return [Knockapi::Resources::Providers::Slack]
|
|
7
9
|
attr_reader :slack
|
|
8
10
|
|
|
11
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
12
|
+
# configured via a channel.
|
|
9
13
|
# @return [Knockapi::Resources::Providers::MsTeams]
|
|
10
14
|
attr_reader :ms_teams
|
|
11
15
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Schedules
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Bulk creates up to 1,000 schedules at a time. This endpoint also handles
|
|
8
10
|
# [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients)
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A schedule is a per-recipient, timezone-aware configuration for when to invoke a
|
|
6
|
+
# workflow.
|
|
5
7
|
class Schedules
|
|
8
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
9
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
10
|
# @return [Knockapi::Resources::Schedules::Bulk]
|
|
7
11
|
attr_reader :bulk
|
|
8
12
|
|
|
@@ -114,10 +118,11 @@ module Knockapi
|
|
|
114
118
|
# @see Knockapi::Models::ScheduleListParams
|
|
115
119
|
def list(params)
|
|
116
120
|
parsed, options = Knockapi::ScheduleListParams.dump_request(params)
|
|
121
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
117
122
|
@client.request(
|
|
118
123
|
method: :get,
|
|
119
124
|
path: "v1/schedules",
|
|
120
|
-
query:
|
|
125
|
+
query: query,
|
|
121
126
|
page: Knockapi::Internal::EntriesCursor,
|
|
122
127
|
model: Knockapi::Schedule,
|
|
123
128
|
options: options
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Tenants
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Delete up to 1,000 tenants at a time in a single operation. This operation
|
|
8
10
|
# cannot be undone.
|
|
@@ -18,10 +20,11 @@ module Knockapi
|
|
|
18
20
|
# @see Knockapi::Models::Tenants::BulkDeleteParams
|
|
19
21
|
def delete(params)
|
|
20
22
|
parsed, options = Knockapi::Tenants::BulkDeleteParams.dump_request(params)
|
|
23
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
21
24
|
@client.request(
|
|
22
25
|
method: :post,
|
|
23
26
|
path: "v1/tenants/bulk/delete",
|
|
24
|
-
query:
|
|
27
|
+
query: query,
|
|
25
28
|
model: Knockapi::BulkOperation,
|
|
26
29
|
options: options
|
|
27
30
|
)
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A tenant represents a top-level entity from your system, like a company,
|
|
6
|
+
# organization, account, or workspace.
|
|
5
7
|
class Tenants
|
|
8
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
9
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
10
|
# @return [Knockapi::Resources::Tenants::Bulk]
|
|
7
11
|
attr_reader :bulk
|
|
8
12
|
|
|
@@ -27,10 +31,11 @@ module Knockapi
|
|
|
27
31
|
# @see Knockapi::Models::TenantListParams
|
|
28
32
|
def list(params = {})
|
|
29
33
|
parsed, options = Knockapi::TenantListParams.dump_request(params)
|
|
34
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
30
35
|
@client.request(
|
|
31
36
|
method: :get,
|
|
32
37
|
path: "v1/tenants",
|
|
33
|
-
query:
|
|
38
|
+
query: query,
|
|
34
39
|
page: Knockapi::Internal::EntriesCursor,
|
|
35
40
|
model: Knockapi::Tenant,
|
|
36
41
|
options: options
|
|
@@ -75,10 +80,11 @@ module Knockapi
|
|
|
75
80
|
# @see Knockapi::Models::TenantGetParams
|
|
76
81
|
def get(id, params = {})
|
|
77
82
|
parsed, options = Knockapi::TenantGetParams.dump_request(params)
|
|
83
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
78
84
|
@client.request(
|
|
79
85
|
method: :get,
|
|
80
86
|
path: ["v1/tenants/%1$s", id],
|
|
81
|
-
query:
|
|
87
|
+
query: query,
|
|
82
88
|
model: Knockapi::Tenant,
|
|
83
89
|
options: options
|
|
84
90
|
)
|
|
@@ -108,12 +114,13 @@ module Knockapi
|
|
|
108
114
|
#
|
|
109
115
|
# @see Knockapi::Models::TenantSetParams
|
|
110
116
|
def set(id, params = {})
|
|
111
|
-
parsed, options = Knockapi::TenantSetParams.dump_request(params)
|
|
112
117
|
query_params = [:resolve_full_preference_settings]
|
|
118
|
+
parsed, options = Knockapi::TenantSetParams.dump_request(params)
|
|
119
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed.slice(*query_params))
|
|
113
120
|
@client.request(
|
|
114
121
|
method: :put,
|
|
115
122
|
path: ["v1/tenants/%1$s", id],
|
|
116
|
-
query:
|
|
123
|
+
query: query,
|
|
117
124
|
body: parsed.except(*query_params),
|
|
118
125
|
model: Knockapi::Tenant,
|
|
119
126
|
options: options
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Permanently deletes up to 1,000 users at a time.
|
|
8
10
|
#
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
7
|
+
# commonly a recipient of a notification.
|
|
6
8
|
class Feeds
|
|
7
9
|
# Returns the feed settings for a user.
|
|
8
10
|
#
|
|
@@ -88,10 +90,11 @@ module Knockapi
|
|
|
88
90
|
# @see Knockapi::Models::Users::FeedListItemsParams
|
|
89
91
|
def list_items(user_id, id, params = {})
|
|
90
92
|
parsed, options = Knockapi::Users::FeedListItemsParams.dump_request(params)
|
|
93
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
91
94
|
@client.request(
|
|
92
95
|
method: :get,
|
|
93
96
|
path: ["v1/users/%1$s/feeds/%2$s", user_id, id],
|
|
94
|
-
query:
|
|
97
|
+
query: query,
|
|
95
98
|
page: Knockapi::Internal::EntriesCursor,
|
|
96
99
|
model: Knockapi::Models::Users::FeedListItemsResponse,
|
|
97
100
|
options: options
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
7
|
+
# commonly a recipient of a notification.
|
|
6
8
|
class Guides
|
|
7
9
|
# Returns a list of eligible in-app guides for a specific user and channel.
|
|
8
10
|
#
|
|
@@ -25,10 +27,11 @@ module Knockapi
|
|
|
25
27
|
# @see Knockapi::Models::Users::GuideGetChannelParams
|
|
26
28
|
def get_channel(user_id, channel_id, params = {})
|
|
27
29
|
parsed, options = Knockapi::Users::GuideGetChannelParams.dump_request(params)
|
|
30
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
28
31
|
@client.request(
|
|
29
32
|
method: :get,
|
|
30
33
|
path: ["v1/users/%1$s/guides/%2$s", user_id, channel_id],
|
|
31
|
-
query:
|
|
34
|
+
query: query,
|
|
32
35
|
model: Knockapi::Models::Users::GuideGetChannelResponse,
|
|
33
36
|
options: options
|
|
34
37
|
)
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
6
|
+
# commonly a recipient of a notification.
|
|
5
7
|
class Users
|
|
8
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
9
|
+
# commonly a recipient of a notification.
|
|
6
10
|
# @return [Knockapi::Resources::Users::Feeds]
|
|
7
11
|
attr_reader :feeds
|
|
8
12
|
|
|
13
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
14
|
+
# commonly a recipient of a notification.
|
|
9
15
|
# @return [Knockapi::Resources::Users::Guides]
|
|
10
16
|
attr_reader :guides
|
|
11
17
|
|
|
18
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
19
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
12
20
|
# @return [Knockapi::Resources::Users::Bulk]
|
|
13
21
|
attr_reader :bulk
|
|
14
22
|
|
|
@@ -77,10 +85,11 @@ module Knockapi
|
|
|
77
85
|
# @see Knockapi::Models::UserListParams
|
|
78
86
|
def list(params = {})
|
|
79
87
|
parsed, options = Knockapi::UserListParams.dump_request(params)
|
|
88
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
80
89
|
@client.request(
|
|
81
90
|
method: :get,
|
|
82
91
|
path: "v1/users",
|
|
83
|
-
query:
|
|
92
|
+
query: query,
|
|
84
93
|
page: Knockapi::Internal::EntriesCursor,
|
|
85
94
|
model: Knockapi::User,
|
|
86
95
|
options: options
|
|
@@ -167,10 +176,11 @@ module Knockapi
|
|
|
167
176
|
# @see Knockapi::Models::UserGetPreferencesParams
|
|
168
177
|
def get_preferences(user_id, id, params = {})
|
|
169
178
|
parsed, options = Knockapi::UserGetPreferencesParams.dump_request(params)
|
|
179
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
170
180
|
@client.request(
|
|
171
181
|
method: :get,
|
|
172
182
|
path: ["v1/users/%1$s/preferences/%2$s", user_id, id],
|
|
173
|
-
query:
|
|
183
|
+
query: query,
|
|
174
184
|
model: Knockapi::Recipients::PreferenceSet,
|
|
175
185
|
options: options
|
|
176
186
|
)
|
|
@@ -222,10 +232,11 @@ module Knockapi
|
|
|
222
232
|
# @see Knockapi::Models::UserListMessagesParams
|
|
223
233
|
def list_messages(user_id, params = {})
|
|
224
234
|
parsed, options = Knockapi::UserListMessagesParams.dump_request(params)
|
|
235
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
225
236
|
@client.request(
|
|
226
237
|
method: :get,
|
|
227
238
|
path: ["v1/users/%1$s/messages", user_id],
|
|
228
|
-
query:
|
|
239
|
+
query: query,
|
|
229
240
|
page: Knockapi::Internal::ItemsCursor,
|
|
230
241
|
model: Knockapi::Message,
|
|
231
242
|
options: options
|
|
@@ -275,10 +286,11 @@ module Knockapi
|
|
|
275
286
|
# @see Knockapi::Models::UserListSchedulesParams
|
|
276
287
|
def list_schedules(user_id, params = {})
|
|
277
288
|
parsed, options = Knockapi::UserListSchedulesParams.dump_request(params)
|
|
289
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
278
290
|
@client.request(
|
|
279
291
|
method: :get,
|
|
280
292
|
path: ["v1/users/%1$s/schedules", user_id],
|
|
281
|
-
query:
|
|
293
|
+
query: query,
|
|
282
294
|
page: Knockapi::Internal::EntriesCursor,
|
|
283
295
|
model: Knockapi::Schedule,
|
|
284
296
|
options: options
|
|
@@ -309,10 +321,11 @@ module Knockapi
|
|
|
309
321
|
# @see Knockapi::Models::UserListSubscriptionsParams
|
|
310
322
|
def list_subscriptions(user_id, params = {})
|
|
311
323
|
parsed, options = Knockapi::UserListSubscriptionsParams.dump_request(params)
|
|
324
|
+
query = Knockapi::Internal::Util.encode_query_params(parsed)
|
|
312
325
|
@client.request(
|
|
313
326
|
method: :get,
|
|
314
327
|
path: ["v1/users/%1$s/subscriptions", user_id],
|
|
315
|
-
query:
|
|
328
|
+
query: query,
|
|
316
329
|
page: Knockapi::Internal::EntriesCursor,
|
|
317
330
|
model: Knockapi::Recipients::Subscription,
|
|
318
331
|
options: options
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A workflow is a structured set of steps that is triggered to produce
|
|
6
|
+
# notifications sent over channels.
|
|
5
7
|
class Workflows
|
|
6
8
|
# Some parameter documentations has been truncated, see
|
|
7
9
|
# {Knockapi::Models::WorkflowCancelParams} for more details.
|
data/lib/knockapi/version.rb
CHANGED
data/rbi/knockapi/client.rbi
CHANGED
|
@@ -20,18 +20,26 @@ module Knockapi
|
|
|
20
20
|
sig { returns(Knockapi::Resources::Recipients) }
|
|
21
21
|
attr_reader :recipients
|
|
22
22
|
|
|
23
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
24
|
+
# commonly a recipient of a notification.
|
|
23
25
|
sig { returns(Knockapi::Resources::Users) }
|
|
24
26
|
attr_reader :users
|
|
25
27
|
|
|
28
|
+
# An object represents a resource in your system that you want to map into Knock.
|
|
26
29
|
sig { returns(Knockapi::Resources::Objects) }
|
|
27
30
|
attr_reader :objects
|
|
28
31
|
|
|
32
|
+
# A tenant represents a top-level entity from your system, like a company,
|
|
33
|
+
# organization, account, or workspace.
|
|
29
34
|
sig { returns(Knockapi::Resources::Tenants) }
|
|
30
35
|
attr_reader :tenants
|
|
31
36
|
|
|
37
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
38
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
32
39
|
sig { returns(Knockapi::Resources::BulkOperations) }
|
|
33
40
|
attr_reader :bulk_operations
|
|
34
41
|
|
|
42
|
+
# A message sent to a single recipient on a channel.
|
|
35
43
|
sig { returns(Knockapi::Resources::Messages) }
|
|
36
44
|
attr_reader :messages
|
|
37
45
|
|
|
@@ -41,15 +49,20 @@ module Knockapi
|
|
|
41
49
|
sig { returns(Knockapi::Resources::Integrations) }
|
|
42
50
|
attr_reader :integrations
|
|
43
51
|
|
|
52
|
+
# A workflow is a structured set of steps that is triggered to produce
|
|
53
|
+
# notifications sent over channels.
|
|
44
54
|
sig { returns(Knockapi::Resources::Workflows) }
|
|
45
55
|
attr_reader :workflows
|
|
46
56
|
|
|
57
|
+
# A schedule is a per-recipient, timezone-aware configuration for when to invoke a
|
|
58
|
+
# workflow.
|
|
47
59
|
sig { returns(Knockapi::Resources::Schedules) }
|
|
48
60
|
attr_reader :schedules
|
|
49
61
|
|
|
50
62
|
sig { returns(Knockapi::Resources::Channels) }
|
|
51
63
|
attr_reader :channels
|
|
52
64
|
|
|
65
|
+
# An Audience is a segment of users.
|
|
53
66
|
sig { returns(Knockapi::Resources::Audiences) }
|
|
54
67
|
attr_reader :audiences
|
|
55
68
|
|
|
@@ -301,6 +301,26 @@ module Knockapi
|
|
|
301
301
|
T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
|
|
302
302
|
|
|
303
303
|
class << self
|
|
304
|
+
# @api private
|
|
305
|
+
sig do
|
|
306
|
+
params(query: Knockapi::Internal::AnyHash).returns(
|
|
307
|
+
Knockapi::Internal::AnyHash
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
def encode_query_params(query)
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# @api private
|
|
314
|
+
sig do
|
|
315
|
+
params(
|
|
316
|
+
collection: Knockapi::Internal::AnyHash,
|
|
317
|
+
key: String,
|
|
318
|
+
element: T.anything
|
|
319
|
+
).void
|
|
320
|
+
end
|
|
321
|
+
private def write_query_param_element!(collection, key, element)
|
|
322
|
+
end
|
|
323
|
+
|
|
304
324
|
# @api private
|
|
305
325
|
sig do
|
|
306
326
|
params(
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
6
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
5
7
|
class BulkOperations
|
|
6
8
|
# Retrieves a bulk operation (if it exists) and displays the current state of it.
|
|
7
9
|
sig do
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Channels
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Bulk update the status of messages for a specific channel. The channel is
|
|
8
10
|
# specified by the `channel_id` parameter. The action to perform is specified by
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Channels
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
sig { returns(Knockapi::Resources::Channels::Bulk) }
|
|
7
9
|
attr_reader :bulk
|
|
8
10
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Messages
|
|
6
|
+
# A message sent to a single recipient on a channel.
|
|
6
7
|
class Batch
|
|
7
8
|
# Marks the given messages as archived. Archived messages are hidden from the
|
|
8
9
|
# default message list in the feed but can still be accessed and unarchived later.
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Objects
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Bulk deletes objects from the specified collection.
|
|
8
10
|
sig do
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# An object represents a resource in your system that you want to map into Knock.
|
|
5
6
|
class Objects
|
|
7
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
8
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
9
|
sig { returns(Knockapi::Resources::Objects::Bulk) }
|
|
7
10
|
attr_reader :bulk
|
|
8
11
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Providers
|
|
6
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
7
|
+
# configured via a channel.
|
|
6
8
|
class MsTeams
|
|
7
9
|
# Check if a connection to Microsoft Teams has been authorized for a given
|
|
8
10
|
# Microsoft Teams tenant object.
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Providers
|
|
6
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
7
|
+
# configured via a channel.
|
|
6
8
|
sig { returns(Knockapi::Resources::Providers::Slack) }
|
|
7
9
|
attr_reader :slack
|
|
8
10
|
|
|
11
|
+
# A provider represents a third-party service that Knock integrates with and is
|
|
12
|
+
# configured via a channel.
|
|
9
13
|
sig { returns(Knockapi::Resources::Providers::MsTeams) }
|
|
10
14
|
attr_reader :ms_teams
|
|
11
15
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Schedules
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Bulk creates up to 1,000 schedules at a time. This endpoint also handles
|
|
8
10
|
# [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients)
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A schedule is a per-recipient, timezone-aware configuration for when to invoke a
|
|
6
|
+
# workflow.
|
|
5
7
|
class Schedules
|
|
8
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
9
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
10
|
sig { returns(Knockapi::Resources::Schedules::Bulk) }
|
|
7
11
|
attr_reader :bulk
|
|
8
12
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Tenants
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Delete up to 1,000 tenants at a time in a single operation. This operation
|
|
8
10
|
# cannot be undone.
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A tenant represents a top-level entity from your system, like a company,
|
|
6
|
+
# organization, account, or workspace.
|
|
5
7
|
class Tenants
|
|
8
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
9
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
10
|
sig { returns(Knockapi::Resources::Tenants::Bulk) }
|
|
7
11
|
attr_reader :bulk
|
|
8
12
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
7
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
6
8
|
class Bulk
|
|
7
9
|
# Permanently deletes up to 1,000 users at a time.
|
|
8
10
|
sig do
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
5
|
class Users
|
|
6
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
7
|
+
# commonly a recipient of a notification.
|
|
6
8
|
class Guides
|
|
7
9
|
# Returns a list of eligible in-app guides for a specific user and channel.
|
|
8
10
|
sig do
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
6
|
+
# commonly a recipient of a notification.
|
|
5
7
|
class Users
|
|
8
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
9
|
+
# commonly a recipient of a notification.
|
|
6
10
|
sig { returns(Knockapi::Resources::Users::Feeds) }
|
|
7
11
|
attr_reader :feeds
|
|
8
12
|
|
|
13
|
+
# A user is an individual from your system, represented in Knock. They are most
|
|
14
|
+
# commonly a recipient of a notification.
|
|
9
15
|
sig { returns(Knockapi::Resources::Users::Guides) }
|
|
10
16
|
attr_reader :guides
|
|
11
17
|
|
|
18
|
+
# A bulk operation is a set of changes applied across zero or more records
|
|
19
|
+
# triggered via a call to the Knock API and performed asynchronously.
|
|
12
20
|
sig { returns(Knockapi::Resources::Users::Bulk) }
|
|
13
21
|
attr_reader :bulk
|
|
14
22
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
module Knockapi
|
|
4
4
|
module Resources
|
|
5
|
+
# A workflow is a structured set of steps that is triggered to produce
|
|
6
|
+
# notifications sent over channels.
|
|
5
7
|
class Workflows
|
|
6
8
|
# When invoked for a workflow using a specific workflow key and cancellation key,
|
|
7
9
|
# will cancel any queued workflow runs associated with that key/cancellation key
|
|
@@ -106,6 +106,16 @@ module Knockapi
|
|
|
106
106
|
JSON_CONTENT: Regexp
|
|
107
107
|
JSONL_CONTENT: Regexp
|
|
108
108
|
|
|
109
|
+
def encode_query_params: (
|
|
110
|
+
::Hash[Symbol, top] query
|
|
111
|
+
) -> ::Hash[Symbol, top]
|
|
112
|
+
|
|
113
|
+
private def write_query_param_element!: (
|
|
114
|
+
::Hash[Symbol, top] collection,
|
|
115
|
+
String key,
|
|
116
|
+
top element
|
|
117
|
+
) -> nil
|
|
118
|
+
|
|
109
119
|
def self?.write_multipart_content: (
|
|
110
120
|
Enumerator::Yielder y,
|
|
111
121
|
val: top,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: knockapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.33.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Knock
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|