knockapi 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -0
- data/README.md +1 -1
- data/lib/knockapi/client.rb +0 -4
- data/lib/knockapi/file_part.rb +10 -7
- data/lib/knockapi/internal/transport/pooled_net_requester.rb +34 -31
- data/lib/knockapi/internal/type/file_input.rb +7 -4
- data/lib/knockapi/internal/util.rb +7 -6
- data/lib/knockapi/models/audience_add_members_params.rb +2 -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 +2 -2
- data/lib/knockapi/models/message.rb +124 -11
- data/lib/knockapi/models/messages/batch_archive_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_interacted_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_read_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_seen_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_unread_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_mark_as_unseen_response.rb +1 -1
- data/lib/knockapi/models/messages/batch_unarchive_response.rb +1 -1
- data/lib/knockapi/models/object_set_params.rb +2 -2
- data/lib/knockapi/models/objects/bulk_set_params.rb +2 -2
- data/lib/knockapi/models/recipients/channel_data.rb +133 -11
- data/lib/knockapi/models/recipients/channel_data_request.rb +36 -10
- data/lib/knockapi/models/recipients/inline_channel_data_request.rb +34 -8
- data/lib/knockapi/models/recipients/preference_set.rb +130 -3
- data/lib/knockapi/models/recipients/preference_set_request.rb +136 -3
- data/lib/knockapi/models/tenant_request.rb +2 -2
- data/lib/knockapi/models/tenant_set_params.rb +2 -2
- data/lib/knockapi/models/users/guide_get_channel_response.rb +270 -34
- data/lib/knockapi/resources/audiences.rb +1 -1
- data/lib/knockapi/resources/messages/batch.rb +7 -7
- data/lib/knockapi/resources/objects.rb +7 -3
- data/lib/knockapi/resources/tenants/bulk.rb +3 -2
- data/lib/knockapi/resources/tenants.rb +1 -1
- data/lib/knockapi/resources/users.rb +7 -3
- data/lib/knockapi/version.rb +1 -1
- data/lib/knockapi.rb +0 -3
- data/rbi/knockapi/client.rbi +0 -3
- data/rbi/knockapi/file_part.rbi +1 -1
- data/rbi/knockapi/models/audience_add_members_params.rbi +2 -2
- data/rbi/knockapi/models/identify_user_request.rbi +9 -9
- data/rbi/knockapi/models/inline_identify_user_request.rbi +9 -9
- data/rbi/knockapi/models/inline_object_request.rbi +9 -9
- data/rbi/knockapi/models/message.rbi +169 -12
- data/rbi/knockapi/models/messages/batch_archive_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_interacted_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_read_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_seen_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_unread_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_mark_as_unseen_response.rbi +1 -1
- data/rbi/knockapi/models/messages/batch_unarchive_response.rbi +1 -1
- data/rbi/knockapi/models/object_set_params.rbi +12 -12
- data/rbi/knockapi/models/objects/bulk_set_params.rbi +9 -9
- data/rbi/knockapi/models/recipients/channel_data.rbi +250 -12
- data/rbi/knockapi/models/recipients/channel_data_request.rbi +68 -14
- data/rbi/knockapi/models/recipients/inline_channel_data_request.rbi +57 -5
- data/rbi/knockapi/models/recipients/preference_set.rbi +279 -0
- data/rbi/knockapi/models/recipients/preference_set_request.rbi +299 -0
- data/rbi/knockapi/models/tenant_request.rbi +9 -9
- data/rbi/knockapi/models/tenant_set_params.rbi +9 -9
- data/rbi/knockapi/models/users/guide_get_channel_response.rbi +532 -70
- data/rbi/knockapi/resources/audiences.rbi +1 -1
- data/rbi/knockapi/resources/messages/batch.rbi +7 -7
- data/rbi/knockapi/resources/objects.rbi +22 -6
- data/rbi/knockapi/resources/tenants/bulk.rbi +3 -2
- data/rbi/knockapi/resources/tenants.rbi +3 -3
- data/rbi/knockapi/resources/users.rbi +22 -6
- data/sig/knockapi/client.rbs +0 -2
- data/sig/knockapi/file_part.rbs +1 -1
- data/sig/knockapi/models/message.rbs +103 -3
- data/sig/knockapi/models/messages/batch_archive_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_interacted_response.rbs +1 -2
- data/sig/knockapi/models/messages/batch_mark_as_read_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_seen_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_unread_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_mark_as_unseen_response.rbs +1 -1
- data/sig/knockapi/models/messages/batch_unarchive_response.rbs +1 -1
- data/sig/knockapi/models/recipients/channel_data.rbs +97 -7
- data/sig/knockapi/models/recipients/channel_data_request.rbs +27 -5
- data/sig/knockapi/models/recipients/inline_channel_data_request.rbs +27 -5
- data/sig/knockapi/models/recipients/preference_set.rbs +87 -0
- data/sig/knockapi/models/recipients/preference_set_request.rbs +87 -0
- data/sig/knockapi/models/users/guide_get_channel_response.rbs +294 -31
- data/sig/knockapi/resources/objects.rbs +2 -0
- data/sig/knockapi/resources/users.rbs +2 -0
- metadata +2 -11
- data/lib/knockapi/models/recipients/one_signal_channel_data.rb +0 -20
- data/lib/knockapi/models/recipients/push_channel_data.rb +0 -20
- data/lib/knockapi/resources/shared.rb +0 -14
- data/rbi/knockapi/models/recipients/one_signal_channel_data.rbi +0 -33
- data/rbi/knockapi/models/recipients/push_channel_data.rbi +0 -33
- data/rbi/knockapi/resources/shared.rbi +0 -12
- data/sig/knockapi/models/recipients/one_signal_channel_data.rbs +0 -15
- data/sig/knockapi/models/recipients/push_channel_data.rbs +0 -15
- data/sig/knockapi/resources/shared.rbs +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fc785b0ad211db7b83b53f41e0049c338cb773c1e38939ae169b79d8f7c864c0
|
|
4
|
+
data.tar.gz: 6da67b0bb566b75e47f5f8e3df16f186d1be34d66a465e64849cad9f796da95d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8aa5dd11bb82eb2b81d6c2e359db5da4a97088f649d9808eccf6fd74d356ead63b919aedaa2b61bd339a958ade85deccf9965f20677b5d5646c38d9b9567169
|
|
7
|
+
data.tar.gz: 2d0532da30ba698de50465a59f46cd96ce75cd63be73807ee92124181ec5e03e48b804a1011f16cc43ff4cf6a08c285550bb7bcbd7db6b43f089121946e95f3a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.17.0 (2025-10-24)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.16.0...v1.17.0](https://github.com/knocklabs/knock-ruby/compare/v1.16.0...v1.17.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([fd477b8](https://github.com/knocklabs/knock-ruby/commit/fd477b877f0a74c124a531a9f9b09e52905383b7))
|
|
10
|
+
* **api:** api update ([e47f831](https://github.com/knocklabs/knock-ruby/commit/e47f831b8ec05779d0003c27f701f9b0fd1c85b5))
|
|
11
|
+
* **api:** api update ([2b5808c](https://github.com/knocklabs/knock-ruby/commit/2b5808ccb42252fdebc45486d231aba4dfa9a7b7))
|
|
12
|
+
* **api:** api update ([99546b7](https://github.com/knocklabs/knock-ruby/commit/99546b73a6a6440e373059c1bdc71d48532af3fa))
|
|
13
|
+
* **api:** api update ([042c92a](https://github.com/knocklabs/knock-ruby/commit/042c92a80665539dfeda7c2b8de0acead59fcfb1))
|
|
14
|
+
* **api:** api update ([0f7fc4a](https://github.com/knocklabs/knock-ruby/commit/0f7fc4a35357d5cf6cb8394f0df9b60598d15e63))
|
|
15
|
+
* handle thread interrupts in the core HTTP client ([6161a77](https://github.com/knocklabs/knock-ruby/commit/6161a7749b9fa424f49758cebd3753d135a84095))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* absolutely qualified uris should always override the default ([2bb6341](https://github.com/knocklabs/knock-ruby/commit/2bb63414bbf3b9d9b4b996cd75341a183a6aa792))
|
|
21
|
+
* should not reuse buffers for `IO.copy_stream` interop ([6464681](https://github.com/knocklabs/knock-ruby/commit/64646819574a19a1eb4969dc4abbc1d718ed7f4f))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Chores
|
|
25
|
+
|
|
26
|
+
* ignore linter error for tests having large collections ([20f8ea6](https://github.com/knocklabs/knock-ruby/commit/20f8ea6a8cae8b3463b48d48f4ad065df465cddb))
|
|
27
|
+
* simplify model references ([c126d85](https://github.com/knocklabs/knock-ruby/commit/c126d85300aa1ffe211fbc8e1c25eff4ca25ab7e))
|
|
28
|
+
|
|
29
|
+
## 1.16.0 (2025-10-07)
|
|
30
|
+
|
|
31
|
+
Full Changelog: [v1.15.0...v1.16.0](https://github.com/knocklabs/knock-ruby/compare/v1.15.0...v1.16.0)
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **api:** api update ([f006836](https://github.com/knocklabs/knock-ruby/commit/f0068369fd1ad7dfa9843753966d6bfb3758e1ea))
|
|
36
|
+
* **api:** api update ([8f74167](https://github.com/knocklabs/knock-ruby/commit/8f74167231ab9aba28065beb23922d7c4cba9cea))
|
|
37
|
+
* **api:** api update ([27835b7](https://github.com/knocklabs/knock-ruby/commit/27835b7a76ec99e59511e5f92e0ddb88a48ed608))
|
|
38
|
+
* **api:** manual updates ([22850d8](https://github.com/knocklabs/knock-ruby/commit/22850d8c0b0605e045cc7d19020ac9f9c97ae163))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* always send `filename=...` for multipart requests where a file is expected ([1a6d4ac](https://github.com/knocklabs/knock-ruby/commit/1a6d4acdcf66e42ddc5b813a61dc7c535e5f90ee))
|
|
44
|
+
* coroutine leaks from connection pool ([3bc1ff2](https://github.com/knocklabs/knock-ruby/commit/3bc1ff25c7b0cda3f712779d67a8c5f6f5b28969))
|
|
45
|
+
* **internal:** use null byte as file separator in the fast formatting script ([d8c723e](https://github.com/knocklabs/knock-ruby/commit/d8c723ed107313e3cc641ea8b68eb5ee8543bfcc))
|
|
46
|
+
* shorten multipart boundary sep to less than RFC specificed max length ([66403e8](https://github.com/knocklabs/knock-ruby/commit/66403e82039587fbf154aff05c2cbfc1e56066a0))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Performance Improvements
|
|
50
|
+
|
|
51
|
+
* faster code formatting ([b578cd0](https://github.com/knocklabs/knock-ruby/commit/b578cd025eefbe8b3ba863403c8a59f9b0acc6bf))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Chores
|
|
55
|
+
|
|
56
|
+
* allow fast-format to use bsd sed as well ([c57f00b](https://github.com/knocklabs/knock-ruby/commit/c57f00b885b596ea799f8929986228240fa3aab4))
|
|
57
|
+
|
|
3
58
|
## 1.15.0 (2025-09-23)
|
|
4
59
|
|
|
5
60
|
Full Changelog: [v1.14.0...v1.15.0](https://github.com/knocklabs/knock-ruby/compare/v1.14.0...v1.15.0)
|
data/README.md
CHANGED
data/lib/knockapi/client.rb
CHANGED
|
@@ -18,9 +18,6 @@ module Knockapi
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
attr_reader :api_key
|
|
20
20
|
|
|
21
|
-
# @return [Knockapi::Resources::Shared]
|
|
22
|
-
attr_reader :shared
|
|
23
|
-
|
|
24
21
|
# @return [Knockapi::Resources::Recipients]
|
|
25
22
|
attr_reader :recipients
|
|
26
23
|
|
|
@@ -108,7 +105,6 @@ module Knockapi
|
|
|
108
105
|
idempotency_header: idempotency_header
|
|
109
106
|
)
|
|
110
107
|
|
|
111
|
-
@shared = Knockapi::Resources::Shared.new(client: self)
|
|
112
108
|
@recipients = Knockapi::Resources::Recipients.new(client: self)
|
|
113
109
|
@users = Knockapi::Resources::Users.new(client: self)
|
|
114
110
|
@objects = Knockapi::Resources::Objects.new(client: self)
|
data/lib/knockapi/file_part.rb
CHANGED
|
@@ -38,18 +38,21 @@ module Knockapi
|
|
|
38
38
|
def to_yaml(*a) = read.to_yaml(*a)
|
|
39
39
|
|
|
40
40
|
# @param content [Pathname, StringIO, IO, String]
|
|
41
|
-
# @param filename [String, nil]
|
|
41
|
+
# @param filename [Pathname, String, nil]
|
|
42
42
|
# @param content_type [String, nil]
|
|
43
43
|
def initialize(content, filename: nil, content_type: nil)
|
|
44
|
-
@
|
|
44
|
+
@content_type = content_type
|
|
45
45
|
@filename =
|
|
46
|
-
case content
|
|
47
|
-
in Pathname
|
|
48
|
-
|
|
46
|
+
case [filename, (@content = content)]
|
|
47
|
+
in [String | Pathname, _]
|
|
48
|
+
::File.basename(filename)
|
|
49
|
+
in [nil, Pathname]
|
|
50
|
+
content.basename.to_path
|
|
51
|
+
in [nil, IO]
|
|
52
|
+
content.to_path
|
|
49
53
|
else
|
|
50
|
-
filename
|
|
54
|
+
filename
|
|
51
55
|
end
|
|
52
|
-
@content_type = content_type
|
|
53
56
|
end
|
|
54
57
|
end
|
|
55
58
|
end
|
|
@@ -128,37 +128,47 @@ module Knockapi
|
|
|
128
128
|
url, deadline = request.fetch_values(:url, :deadline)
|
|
129
129
|
|
|
130
130
|
req = nil
|
|
131
|
-
eof = false
|
|
132
131
|
finished = false
|
|
133
|
-
closing = nil
|
|
134
132
|
|
|
135
133
|
# rubocop:disable Metrics/BlockLength
|
|
136
134
|
enum = Enumerator.new do |y|
|
|
137
|
-
|
|
138
|
-
next if finished
|
|
139
|
-
|
|
140
|
-
req, closing = self.class.build_request(request) do
|
|
141
|
-
self.class.calibrate_socket_timeout(conn, deadline)
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
self.class.calibrate_socket_timeout(conn, deadline)
|
|
145
|
-
unless conn.started?
|
|
146
|
-
conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT
|
|
147
|
-
conn.start
|
|
148
|
-
end
|
|
135
|
+
next if finished
|
|
149
136
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
137
|
+
with_pool(url, deadline: deadline) do |conn|
|
|
138
|
+
eof = false
|
|
139
|
+
closing = nil
|
|
140
|
+
::Thread.handle_interrupt(Object => :never) do
|
|
141
|
+
::Thread.handle_interrupt(Object => :immediate) do
|
|
142
|
+
req, closing = self.class.build_request(request) do
|
|
143
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
144
|
+
end
|
|
154
145
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
146
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
147
|
+
unless conn.started?
|
|
148
|
+
conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT
|
|
149
|
+
conn.start
|
|
150
|
+
end
|
|
158
151
|
|
|
159
152
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
153
|
+
conn.request(req) do |rsp|
|
|
154
|
+
y << [req, rsp]
|
|
155
|
+
break if finished
|
|
156
|
+
|
|
157
|
+
rsp.read_body do |bytes|
|
|
158
|
+
y << bytes.force_encoding(Encoding::BINARY)
|
|
159
|
+
break if finished
|
|
160
|
+
|
|
161
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
162
|
+
end
|
|
163
|
+
eof = true
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
ensure
|
|
167
|
+
begin
|
|
168
|
+
conn.finish if !eof && conn&.started?
|
|
169
|
+
ensure
|
|
170
|
+
closing&.call
|
|
160
171
|
end
|
|
161
|
-
eof = true
|
|
162
172
|
end
|
|
163
173
|
end
|
|
164
174
|
rescue Timeout::Error
|
|
@@ -168,17 +178,10 @@ module Knockapi
|
|
|
168
178
|
end
|
|
169
179
|
# rubocop:enable Metrics/BlockLength
|
|
170
180
|
|
|
171
|
-
|
|
181
|
+
_, response = enum.next
|
|
172
182
|
body = Knockapi::Internal::Util.fused_enum(enum, external: true) do
|
|
173
183
|
finished = true
|
|
174
|
-
|
|
175
|
-
enum.next
|
|
176
|
-
rescue StopIteration
|
|
177
|
-
nil
|
|
178
|
-
end
|
|
179
|
-
ensure
|
|
180
|
-
conn.finish if !eof && conn&.started?
|
|
181
|
-
closing&.call
|
|
184
|
+
loop { enum.next }
|
|
182
185
|
end
|
|
183
186
|
[Integer(response.code), response, body]
|
|
184
187
|
end
|
|
@@ -82,17 +82,20 @@ module Knockapi
|
|
|
82
82
|
#
|
|
83
83
|
# @return [Pathname, StringIO, IO, String, Object]
|
|
84
84
|
def dump(value, state:)
|
|
85
|
-
# rubocop:disable Lint/DuplicateBranch
|
|
86
85
|
case value
|
|
86
|
+
in StringIO | String
|
|
87
|
+
# https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
|
|
88
|
+
# while not required, a filename is recommended, and in practice many servers do expect this
|
|
89
|
+
Knockapi::FilePart.new(value, filename: "upload")
|
|
87
90
|
in IO
|
|
88
91
|
state[:can_retry] = false
|
|
92
|
+
value.to_path.nil? ? Knockapi::FilePart.new(value, filename: "upload") : value
|
|
89
93
|
in Knockapi::FilePart if value.content.is_a?(IO)
|
|
90
94
|
state[:can_retry] = false
|
|
95
|
+
value
|
|
91
96
|
else
|
|
97
|
+
value
|
|
92
98
|
end
|
|
93
|
-
# rubocop:enable Lint/DuplicateBranch
|
|
94
|
-
|
|
95
|
-
value
|
|
96
99
|
end
|
|
97
100
|
|
|
98
101
|
# @api private
|
|
@@ -346,8 +346,9 @@ module Knockapi
|
|
|
346
346
|
base_path, base_query = lhs.fetch_values(:path, :query)
|
|
347
347
|
slashed = base_path.end_with?("/") ? base_path : "#{base_path}/"
|
|
348
348
|
|
|
349
|
-
|
|
350
|
-
|
|
349
|
+
merged = {**parse_uri(rhs.fetch(:path)), **rhs.except(:path, :query)}
|
|
350
|
+
parsed_path, parsed_query = merged.fetch_values(:path, :query)
|
|
351
|
+
override = URI::Generic.build(**merged.slice(:scheme, :host, :port), path: parsed_path)
|
|
351
352
|
|
|
352
353
|
joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override)
|
|
353
354
|
query = deep_merge(
|
|
@@ -473,10 +474,9 @@ module Knockapi
|
|
|
473
474
|
# @return [Enumerable<String>]
|
|
474
475
|
def writable_enum(&blk)
|
|
475
476
|
Enumerator.new do |y|
|
|
476
|
-
buf = String.new
|
|
477
477
|
y.define_singleton_method(:write) do
|
|
478
|
-
self <<
|
|
479
|
-
|
|
478
|
+
self << _1.dup
|
|
479
|
+
_1.bytesize
|
|
480
480
|
end
|
|
481
481
|
|
|
482
482
|
blk.call(y)
|
|
@@ -566,7 +566,8 @@ module Knockapi
|
|
|
566
566
|
#
|
|
567
567
|
# @return [Array(String, Enumerable<String>)]
|
|
568
568
|
private def encode_multipart_streaming(body)
|
|
569
|
-
|
|
569
|
+
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
570
|
+
boundary = SecureRandom.urlsafe_base64(46)
|
|
570
571
|
|
|
571
572
|
closing = []
|
|
572
573
|
strio = writable_enum do |y|
|
|
@@ -8,13 +8,13 @@ module Knockapi
|
|
|
8
8
|
include Knockapi::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute members
|
|
11
|
-
# A list of audience members to add.
|
|
11
|
+
# A list of audience members to add. Limited to 1,000 members per request.
|
|
12
12
|
#
|
|
13
13
|
# @return [Array<Knockapi::Models::AudienceAddMembersParams::Member>]
|
|
14
14
|
required :members, -> { Knockapi::Internal::Type::ArrayOf[Knockapi::AudienceAddMembersParams::Member] }
|
|
15
15
|
|
|
16
16
|
# @!method initialize(members:, request_options: {})
|
|
17
|
-
# @param members [Array<Knockapi::Models::AudienceAddMembersParams::Member>] A list of audience members to add.
|
|
17
|
+
# @param members [Array<Knockapi::Models::AudienceAddMembersParams::Member>] A list of audience members to add. Limited to 1,000 members per request.
|
|
18
18
|
#
|
|
19
19
|
# @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}]
|
|
20
20
|
|
|
@@ -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::
|
|
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]
|
|
@@ -79,7 +79,7 @@ module Knockapi
|
|
|
79
79
|
#
|
|
80
80
|
# @param avatar [String, nil] A URL for the avatar of the user.
|
|
81
81
|
#
|
|
82
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
82
|
+
# @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.
|
|
83
83
|
#
|
|
84
84
|
# @param created_at [Time, nil] The creation date of the user from your system.
|
|
85
85
|
#
|
|
@@ -18,7 +18,7 @@ module Knockapi
|
|
|
18
18
|
# @!attribute channel_data
|
|
19
19
|
# A request to set channel data for a type of channel inline.
|
|
20
20
|
#
|
|
21
|
-
# @return [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
21
|
+
# @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]
|
|
22
22
|
optional :channel_data,
|
|
23
23
|
-> {
|
|
24
24
|
Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
|
|
@@ -88,7 +88,7 @@ module Knockapi
|
|
|
88
88
|
#
|
|
89
89
|
# @param avatar [String, nil] A URL for the avatar of the user.
|
|
90
90
|
#
|
|
91
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
91
|
+
# @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.
|
|
92
92
|
#
|
|
93
93
|
# @param created_at [Time, nil] The creation date of the user from your system.
|
|
94
94
|
#
|
|
@@ -18,7 +18,7 @@ module Knockapi
|
|
|
18
18
|
# @!attribute channel_data
|
|
19
19
|
# A request to set channel data for a type of channel inline.
|
|
20
20
|
#
|
|
21
|
-
# @return [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
21
|
+
# @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]
|
|
22
22
|
optional :channel_data,
|
|
23
23
|
-> {
|
|
24
24
|
Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
|
|
@@ -51,7 +51,7 @@ module Knockapi
|
|
|
51
51
|
#
|
|
52
52
|
# @param collection [String] The collection this object belongs to.
|
|
53
53
|
#
|
|
54
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
54
|
+
# @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.
|
|
55
55
|
#
|
|
56
56
|
# @param created_at [Time, nil] Timestamp when the resource was created.
|
|
57
57
|
#
|
|
@@ -17,7 +17,9 @@ module Knockapi
|
|
|
17
17
|
required :_typename, String, api_name: :__typename
|
|
18
18
|
|
|
19
19
|
# @!attribute channel_id
|
|
20
|
-
#
|
|
20
|
+
# @deprecated
|
|
21
|
+
#
|
|
22
|
+
# Deprecated, use channel.id instead.
|
|
21
23
|
#
|
|
22
24
|
# @return [String]
|
|
23
25
|
required :channel_id, String
|
|
@@ -43,7 +45,7 @@ module Knockapi
|
|
|
43
45
|
required :recipient, union: -> { Knockapi::RecipientReference }
|
|
44
46
|
|
|
45
47
|
# @!attribute source
|
|
46
|
-
# The workflow that triggered the message.
|
|
48
|
+
# The workflow or guide that triggered the message.
|
|
47
49
|
#
|
|
48
50
|
# @return [Knockapi::Models::Message::Source]
|
|
49
51
|
required :source, -> { Knockapi::Message::Source }
|
|
@@ -74,6 +76,12 @@ module Knockapi
|
|
|
74
76
|
# @return [Time, nil]
|
|
75
77
|
optional :archived_at, Time, nil?: true
|
|
76
78
|
|
|
79
|
+
# @!attribute channel
|
|
80
|
+
# A configured channel, which is a way to route messages to a provider.
|
|
81
|
+
#
|
|
82
|
+
# @return [Knockapi::Models::Message::Channel, nil]
|
|
83
|
+
optional :channel, -> { Knockapi::Message::Channel }
|
|
84
|
+
|
|
77
85
|
# @!attribute clicked_at
|
|
78
86
|
# Timestamp when the message was clicked.
|
|
79
87
|
#
|
|
@@ -141,7 +149,7 @@ module Knockapi
|
|
|
141
149
|
# @return [String, nil]
|
|
142
150
|
optional :workflow, String, nil?: true
|
|
143
151
|
|
|
144
|
-
# @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil)
|
|
152
|
+
# @!method initialize(id:, _typename:, channel_id:, engagement_statuses:, inserted_at:, recipient:, source:, status:, updated_at:, actors: nil, archived_at: nil, channel: nil, clicked_at: nil, data: nil, interacted_at: nil, link_clicked_at: nil, metadata: nil, read_at: nil, scheduled_at: nil, seen_at: nil, tenant: nil, workflow: nil)
|
|
145
153
|
# Some parameter documentations has been truncated, see
|
|
146
154
|
# {Knockapi::Models::Message} for more details.
|
|
147
155
|
#
|
|
@@ -152,7 +160,7 @@ module Knockapi
|
|
|
152
160
|
#
|
|
153
161
|
# @param _typename [String] The typename of the schema.
|
|
154
162
|
#
|
|
155
|
-
# @param channel_id [String]
|
|
163
|
+
# @param channel_id [String] Deprecated, use channel.id instead.
|
|
156
164
|
#
|
|
157
165
|
# @param engagement_statuses [Array<Symbol, Knockapi::Models::Message::EngagementStatus>] A list of engagement statuses.
|
|
158
166
|
#
|
|
@@ -160,7 +168,7 @@ module Knockapi
|
|
|
160
168
|
#
|
|
161
169
|
# @param recipient [String, Knockapi::Models::RecipientReference::ObjectReference] A reference to a recipient, either a user identifier (string) or an object refer
|
|
162
170
|
#
|
|
163
|
-
# @param source [Knockapi::Models::Message::Source] The workflow that triggered the message.
|
|
171
|
+
# @param source [Knockapi::Models::Message::Source] The workflow or guide that triggered the message.
|
|
164
172
|
#
|
|
165
173
|
# @param status [Symbol, Knockapi::Models::Message::Status] The message delivery status.
|
|
166
174
|
#
|
|
@@ -170,6 +178,8 @@ module Knockapi
|
|
|
170
178
|
#
|
|
171
179
|
# @param archived_at [Time, nil] Timestamp when the message was archived.
|
|
172
180
|
#
|
|
181
|
+
# @param channel [Knockapi::Models::Message::Channel] A configured channel, which is a way to route messages to a provider.
|
|
182
|
+
#
|
|
173
183
|
# @param clicked_at [Time, nil] Timestamp when the message was clicked.
|
|
174
184
|
#
|
|
175
185
|
# @param data [Hash{Symbol=>Object}, nil] Data associated with the message’s workflow run. Includes the workflow trigger r
|
|
@@ -219,13 +229,13 @@ module Knockapi
|
|
|
219
229
|
required :categories, Knockapi::Internal::Type::ArrayOf[String]
|
|
220
230
|
|
|
221
231
|
# @!attribute key
|
|
222
|
-
# The key of the workflow that triggered the message.
|
|
232
|
+
# The key of the workflow or guide that triggered the message.
|
|
223
233
|
#
|
|
224
234
|
# @return [String]
|
|
225
235
|
required :key, String
|
|
226
236
|
|
|
227
237
|
# @!attribute version_id
|
|
228
|
-
# The ID of the version of the workflow that triggered the message.
|
|
238
|
+
# The ID of the version of the workflow or guide that triggered the message.
|
|
229
239
|
#
|
|
230
240
|
# @return [String]
|
|
231
241
|
required :version_id, String
|
|
@@ -236,18 +246,40 @@ module Knockapi
|
|
|
236
246
|
# @return [String, nil]
|
|
237
247
|
optional :step_ref, String, nil?: true
|
|
238
248
|
|
|
239
|
-
# @!
|
|
240
|
-
#
|
|
249
|
+
# @!attribute type
|
|
250
|
+
# Whether this message was generated from a workflow, broadcast, or guide.
|
|
251
|
+
#
|
|
252
|
+
# @return [Symbol, Knockapi::Models::Message::Source::Type, nil]
|
|
253
|
+
optional :type, enum: -> { Knockapi::Message::Source::Type }
|
|
254
|
+
|
|
255
|
+
# @!method initialize(_typename:, categories:, key:, version_id:, step_ref: nil, type: nil)
|
|
256
|
+
# The workflow or guide that triggered the message.
|
|
241
257
|
#
|
|
242
258
|
# @param _typename [String]
|
|
243
259
|
#
|
|
244
260
|
# @param categories [Array<String>] The categories associated with the message.
|
|
245
261
|
#
|
|
246
|
-
# @param key [String] The key of the workflow that triggered the message.
|
|
262
|
+
# @param key [String] The key of the workflow or guide that triggered the message.
|
|
247
263
|
#
|
|
248
|
-
# @param version_id [String] The ID of the version of the workflow that triggered the message.
|
|
264
|
+
# @param version_id [String] The ID of the version of the workflow or guide that triggered the message.
|
|
249
265
|
#
|
|
250
266
|
# @param step_ref [String, nil] The step reference for the step in the workflow that generated the message.
|
|
267
|
+
#
|
|
268
|
+
# @param type [Symbol, Knockapi::Models::Message::Source::Type] Whether this message was generated from a workflow, broadcast, or guide.
|
|
269
|
+
|
|
270
|
+
# Whether this message was generated from a workflow, broadcast, or guide.
|
|
271
|
+
#
|
|
272
|
+
# @see Knockapi::Models::Message::Source#type
|
|
273
|
+
module Type
|
|
274
|
+
extend Knockapi::Internal::Type::Enum
|
|
275
|
+
|
|
276
|
+
BROADCAST = :broadcast
|
|
277
|
+
WORKFLOW = :workflow
|
|
278
|
+
GUIDE = :guide
|
|
279
|
+
|
|
280
|
+
# @!method self.values
|
|
281
|
+
# @return [Array<Symbol>]
|
|
282
|
+
end
|
|
251
283
|
end
|
|
252
284
|
|
|
253
285
|
# The message delivery status.
|
|
@@ -267,6 +299,87 @@ module Knockapi
|
|
|
267
299
|
# @!method self.values
|
|
268
300
|
# @return [Array<Symbol>]
|
|
269
301
|
end
|
|
302
|
+
|
|
303
|
+
# @see Knockapi::Models::Message#channel
|
|
304
|
+
class Channel < Knockapi::Internal::Type::BaseModel
|
|
305
|
+
# @!attribute id
|
|
306
|
+
# The unique identifier for the channel.
|
|
307
|
+
#
|
|
308
|
+
# @return [String]
|
|
309
|
+
required :id, String
|
|
310
|
+
|
|
311
|
+
# @!attribute created_at
|
|
312
|
+
# The timestamp of when the channel was created.
|
|
313
|
+
#
|
|
314
|
+
# @return [Time]
|
|
315
|
+
required :created_at, Time
|
|
316
|
+
|
|
317
|
+
# @!attribute provider
|
|
318
|
+
# The ID of the provider that this channel uses to deliver messages.
|
|
319
|
+
#
|
|
320
|
+
# @return [String]
|
|
321
|
+
required :provider, String
|
|
322
|
+
|
|
323
|
+
# @!attribute type
|
|
324
|
+
# The type of channel, determining what kind of messages it can send.
|
|
325
|
+
#
|
|
326
|
+
# @return [Symbol, Knockapi::Models::Message::Channel::Type]
|
|
327
|
+
required :type, enum: -> { Knockapi::Message::Channel::Type }
|
|
328
|
+
|
|
329
|
+
# @!attribute updated_at
|
|
330
|
+
# The timestamp of when the channel was last updated.
|
|
331
|
+
#
|
|
332
|
+
# @return [Time]
|
|
333
|
+
required :updated_at, Time
|
|
334
|
+
|
|
335
|
+
# @!attribute key
|
|
336
|
+
# Unique identifier for the channel within a project (immutable once created).
|
|
337
|
+
#
|
|
338
|
+
# @return [String, nil]
|
|
339
|
+
optional :key, String, nil?: true
|
|
340
|
+
|
|
341
|
+
# @!attribute name
|
|
342
|
+
# The human-readable name of the channel.
|
|
343
|
+
#
|
|
344
|
+
# @return [String, nil]
|
|
345
|
+
optional :name, String, nil?: true
|
|
346
|
+
|
|
347
|
+
# @!method initialize(id:, created_at:, provider:, type:, updated_at:, key: nil, name: nil)
|
|
348
|
+
# A configured channel, which is a way to route messages to a provider.
|
|
349
|
+
#
|
|
350
|
+
# @param id [String] The unique identifier for the channel.
|
|
351
|
+
#
|
|
352
|
+
# @param created_at [Time] The timestamp of when the channel was created.
|
|
353
|
+
#
|
|
354
|
+
# @param provider [String] The ID of the provider that this channel uses to deliver messages.
|
|
355
|
+
#
|
|
356
|
+
# @param type [Symbol, Knockapi::Models::Message::Channel::Type] The type of channel, determining what kind of messages it can send.
|
|
357
|
+
#
|
|
358
|
+
# @param updated_at [Time] The timestamp of when the channel was last updated.
|
|
359
|
+
#
|
|
360
|
+
# @param key [String, nil] Unique identifier for the channel within a project (immutable once created).
|
|
361
|
+
#
|
|
362
|
+
# @param name [String, nil] The human-readable name of the channel.
|
|
363
|
+
|
|
364
|
+
# The type of channel, determining what kind of messages it can send.
|
|
365
|
+
#
|
|
366
|
+
# @see Knockapi::Models::Message::Channel#type
|
|
367
|
+
module Type
|
|
368
|
+
extend Knockapi::Internal::Type::Enum
|
|
369
|
+
|
|
370
|
+
EMAIL = :email
|
|
371
|
+
IN_APP = :in_app
|
|
372
|
+
IN_APP_FEED = :in_app_feed
|
|
373
|
+
IN_APP_GUIDE = :in_app_guide
|
|
374
|
+
SMS = :sms
|
|
375
|
+
PUSH = :push
|
|
376
|
+
CHAT = :chat
|
|
377
|
+
HTTP = :http
|
|
378
|
+
|
|
379
|
+
# @!method self.values
|
|
380
|
+
# @return [Array<Symbol>]
|
|
381
|
+
end
|
|
382
|
+
end
|
|
270
383
|
end
|
|
271
384
|
end
|
|
272
385
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchArchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchArchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchMarkAsInteractedResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchMarkAsInteractedResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchMarkAsReadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchMarkAsReadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchMarkAsSeenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchMarkAsSeenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchMarkAsUnreadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchMarkAsUnreadResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchMarkAsUnseenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchMarkAsUnseenResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Knockapi
|
|
|
4
4
|
module Models
|
|
5
5
|
module Messages
|
|
6
6
|
# @type [Knockapi::Internal::Type::Converter]
|
|
7
|
-
BatchUnarchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::
|
|
7
|
+
BatchUnarchiveResponse = Knockapi::Internal::Type::ArrayOf[-> { Knockapi::Message }]
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|