knockapi 1.20.0 → 1.22.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59aa0cd10e59e4f0f18ddbefd0da6e0482a90c1243539d52389c1074e1a9e14c
4
- data.tar.gz: 9a797662afb59af4d0964d0025957607feb398ea4f8a728e359a174886222d31
3
+ metadata.gz: '0874267848eeb99b21173d6b7115415dd08b573b1939f271f2b0e672e8c93394'
4
+ data.tar.gz: 5f112a3e47ef2b1b237f3359a61bd9e7e6caa6e079f37531d08c87df26979a01
5
5
  SHA512:
6
- metadata.gz: 6d1da55316e1915100adc1748a00de8aee8b46c8b7a710948a34190faa8f6a03cbe33f0856817c9437b82eb09aeb6fc7ea18f04b87498234dd7ddb623f4b5734
7
- data.tar.gz: a4268192cef85172e23bdaf4287e7a0d6f9257bb199ea56b17800974aa16e8424fcdff12ee87eddd7e205801e40605ab6a00d5c7cbed8977a7057bb5227054d9
6
+ metadata.gz: aa578c36d4937f35de975638eac48ab6d0d96c25d019cb152115dcb62f32b0ecf08d90d5a57082a83f9930a7a6291754caa0ad57c9b3554001e1415b1efb0cbb
7
+ data.tar.gz: 130e34f48bb8264cfdd25b05473ff4b4cef74a02dc4f7a52f75994128aac908a747f74c162bd6109c39e41d7f3c002723886993439d4dfe639a2669503b60ce9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.0 (2025-12-04)
4
+
5
+ Full Changelog: [v1.21.0...v1.22.0](https://github.com/knocklabs/knock-ruby/compare/v1.21.0...v1.22.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([28047a5](https://github.com/knocklabs/knock-ruby/commit/28047a59ac407ca2ecff51cfa13fc4a5c1d27019))
10
+
11
+ ## 1.21.0 (2025-11-20)
12
+
13
+ Full Changelog: [v1.20.0...v1.21.0](https://github.com/knocklabs/knock-ruby/compare/v1.20.0...v1.21.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** Add bulk delete subscriptions ([2fed837](https://github.com/knocklabs/knock-ruby/commit/2fed8371bbd0a682d8a5c3fd030024847c69180b))
18
+
19
+
20
+ ### Chores
21
+
22
+ * explicitly require "base64" gem ([cde84e5](https://github.com/knocklabs/knock-ruby/commit/cde84e5db590434da5db78b9138915f3072ec82d))
23
+
3
24
  ## 1.20.0 (2025-11-19)
4
25
 
5
26
  Full Changelog: [v1.19.0...v1.20.0](https://github.com/knocklabs/knock-ruby/compare/v1.19.0...v1.20.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "knockapi", "~> 1.20.0"
20
+ gem "knockapi", "~> 1.22.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -252,7 +252,24 @@ module Knockapi
252
252
  # @return [Symbol, Knockapi::Models::Message::Source::Type, nil]
253
253
  optional :type, enum: -> { Knockapi::Message::Source::Type }
254
254
 
255
- # @!method initialize(_typename:, categories:, key:, version_id:, step_ref: nil, type: nil)
255
+ # @!attribute workflow_recipient_run_id
256
+ # The unique identifier for the workflow recipient run that generated this
257
+ # message. Only present for workflow/broadcast messages.
258
+ #
259
+ # @return [String, nil]
260
+ optional :workflow_recipient_run_id, String, nil?: true
261
+
262
+ # @!attribute workflow_run_id
263
+ # The unique identifier for the workflow run that generated this message. Only
264
+ # present for workflow/broadcast messages.
265
+ #
266
+ # @return [String, nil]
267
+ optional :workflow_run_id, String, nil?: true
268
+
269
+ # @!method initialize(_typename:, categories:, key:, version_id:, step_ref: nil, type: nil, workflow_recipient_run_id: nil, workflow_run_id: nil)
270
+ # Some parameter documentations has been truncated, see
271
+ # {Knockapi::Models::Message::Source} for more details.
272
+ #
256
273
  # The workflow or guide that triggered the message.
257
274
  #
258
275
  # @param _typename [String]
@@ -266,6 +283,10 @@ module Knockapi
266
283
  # @param step_ref [String, nil] The step reference for the step in the workflow that generated the message.
267
284
  #
268
285
  # @param type [Symbol, Knockapi::Models::Message::Source::Type] Whether this message was generated from a workflow, broadcast, or guide.
286
+ #
287
+ # @param workflow_recipient_run_id [String, nil] The unique identifier for the workflow recipient run that generated this message
288
+ #
289
+ # @param workflow_run_id [String, nil] The unique identifier for the workflow run that generated this message. Only pre
269
290
 
270
291
  # Whether this message was generated from a workflow, broadcast, or guide.
271
292
  #
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Knockapi
4
+ module Models
5
+ module Objects
6
+ # @see Knockapi::Resources::Objects::Bulk#delete_subscriptions
7
+ class BulkDeleteSubscriptionsParams < Knockapi::Internal::Type::BaseModel
8
+ extend Knockapi::Internal::Type::RequestParameters::Converter
9
+ include Knockapi::Internal::Type::RequestParameters
10
+
11
+ # @!attribute subscriptions
12
+ # A nested list of subscriptions.
13
+ #
14
+ # @return [Array<Knockapi::Models::Objects::BulkDeleteSubscriptionsParams::Subscription>]
15
+ required :subscriptions,
16
+ -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription] }
17
+
18
+ # @!method initialize(subscriptions:, request_options: {})
19
+ # @param subscriptions [Array<Knockapi::Models::Objects::BulkDeleteSubscriptionsParams::Subscription>] A nested list of subscriptions.
20
+ #
21
+ # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}]
22
+
23
+ class Subscription < Knockapi::Internal::Type::BaseModel
24
+ # @!attribute id
25
+ # Unique identifier for the object.
26
+ #
27
+ # @return [String]
28
+ required :id, String
29
+
30
+ # @!attribute recipients
31
+ # The recipients of the subscription. You can subscribe up to 100 recipients to an
32
+ # object at a time.
33
+ #
34
+ # @return [Array<String, Knockapi::Models::RecipientReference::ObjectReference>]
35
+ required :recipients, -> { Knockapi::Internal::Type::ArrayOf[union: Knockapi::RecipientReference] }
36
+
37
+ # @!method initialize(id:, recipients:)
38
+ # Some parameter documentations has been truncated, see
39
+ # {Knockapi::Models::Objects::BulkDeleteSubscriptionsParams::Subscription} for
40
+ # more details.
41
+ #
42
+ # A list of subscriptions. 1 subscribed-to id, and N subscriber recipients.
43
+ #
44
+ # @param id [String] Unique identifier for the object.
45
+ #
46
+ # @param recipients [Array<String, Knockapi::Models::RecipientReference::ObjectReference>] The recipients of the subscription. You can subscribe up to 100 recipients to an
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -56,6 +56,31 @@ module Knockapi
56
56
  )
57
57
  end
58
58
 
59
+ # Delete subscriptions for many objects in a single collection type. If a
60
+ # subscription for an object in the collection doesn't exist, it will be skipped.
61
+ #
62
+ # @overload delete_subscriptions(collection, subscriptions:, request_options: {})
63
+ #
64
+ # @param collection [String] The collection this object belongs to.
65
+ #
66
+ # @param subscriptions [Array<Knockapi::Models::Objects::BulkDeleteSubscriptionsParams::Subscription>] A nested list of subscriptions.
67
+ #
68
+ # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
69
+ #
70
+ # @return [Knockapi::Models::BulkOperation]
71
+ #
72
+ # @see Knockapi::Models::Objects::BulkDeleteSubscriptionsParams
73
+ def delete_subscriptions(collection, params)
74
+ parsed, options = Knockapi::Objects::BulkDeleteSubscriptionsParams.dump_request(params)
75
+ @client.request(
76
+ method: :post,
77
+ path: ["v1/objects/%1$s/bulk/subscriptions/delete", collection],
78
+ body: parsed,
79
+ model: Knockapi::BulkOperation,
80
+ options: options
81
+ )
82
+ end
83
+
59
84
  # Bulk sets up to 1,000 objects at a time in the specified collection.
60
85
  #
61
86
  # @overload set(collection, objects:, request_options: {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Knockapi
4
- VERSION = "1.20.0"
4
+ VERSION = "1.22.0"
5
5
  end
data/lib/knockapi.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  # Standard libraries.
4
4
  # rubocop:disable Lint/RedundantRequireStatement
5
5
  require "English"
6
+ require "base64"
6
7
  require "cgi"
7
8
  require "date"
8
9
  require "erb"
@@ -125,6 +126,7 @@ require_relative "knockapi/models/object_list_schedules_params"
125
126
  require_relative "knockapi/models/object_list_subscriptions_params"
126
127
  require_relative "knockapi/models/objects/bulk_add_subscriptions_params"
127
128
  require_relative "knockapi/models/objects/bulk_delete_params"
129
+ require_relative "knockapi/models/objects/bulk_delete_subscriptions_params"
128
130
  require_relative "knockapi/models/objects/bulk_set_params"
129
131
  require_relative "knockapi/models/object_set_channel_data_params"
130
132
  require_relative "knockapi/models/object_set_params"
data/manifest.yaml CHANGED
@@ -1,5 +1,6 @@
1
1
  dependencies:
2
2
  - English
3
+ - base64
3
4
  - cgi
4
5
  - date
5
6
  - erb
@@ -316,6 +316,16 @@ module Knockapi
316
316
  sig { params(type: Knockapi::Message::Source::Type::OrSymbol).void }
317
317
  attr_writer :type
318
318
 
319
+ # The unique identifier for the workflow recipient run that generated this
320
+ # message. Only present for workflow/broadcast messages.
321
+ sig { returns(T.nilable(String)) }
322
+ attr_accessor :workflow_recipient_run_id
323
+
324
+ # The unique identifier for the workflow run that generated this message. Only
325
+ # present for workflow/broadcast messages.
326
+ sig { returns(T.nilable(String)) }
327
+ attr_accessor :workflow_run_id
328
+
319
329
  # The workflow or guide that triggered the message.
320
330
  sig do
321
331
  params(
@@ -324,7 +334,9 @@ module Knockapi
324
334
  key: String,
325
335
  version_id: String,
326
336
  step_ref: T.nilable(String),
327
- type: Knockapi::Message::Source::Type::OrSymbol
337
+ type: Knockapi::Message::Source::Type::OrSymbol,
338
+ workflow_recipient_run_id: T.nilable(String),
339
+ workflow_run_id: T.nilable(String)
328
340
  ).returns(T.attached_class)
329
341
  end
330
342
  def self.new(
@@ -338,7 +350,13 @@ module Knockapi
338
350
  # The step reference for the step in the workflow that generated the message.
339
351
  step_ref: nil,
340
352
  # Whether this message was generated from a workflow, broadcast, or guide.
341
- type: nil
353
+ type: nil,
354
+ # The unique identifier for the workflow recipient run that generated this
355
+ # message. Only present for workflow/broadcast messages.
356
+ workflow_recipient_run_id: nil,
357
+ # The unique identifier for the workflow run that generated this message. Only
358
+ # present for workflow/broadcast messages.
359
+ workflow_run_id: nil
342
360
  )
343
361
  end
344
362
 
@@ -350,7 +368,9 @@ module Knockapi
350
368
  key: String,
351
369
  version_id: String,
352
370
  step_ref: T.nilable(String),
353
- type: Knockapi::Message::Source::Type::TaggedSymbol
371
+ type: Knockapi::Message::Source::Type::TaggedSymbol,
372
+ workflow_recipient_run_id: T.nilable(String),
373
+ workflow_run_id: T.nilable(String)
354
374
  }
355
375
  )
356
376
  end
@@ -0,0 +1,121 @@
1
+ # typed: strong
2
+
3
+ module Knockapi
4
+ module Models
5
+ module Objects
6
+ class BulkDeleteSubscriptionsParams < Knockapi::Internal::Type::BaseModel
7
+ extend Knockapi::Internal::Type::RequestParameters::Converter
8
+ include Knockapi::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Knockapi::Objects::BulkDeleteSubscriptionsParams,
14
+ Knockapi::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # A nested list of subscriptions.
19
+ sig do
20
+ returns(
21
+ T::Array[
22
+ Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription
23
+ ]
24
+ )
25
+ end
26
+ attr_accessor :subscriptions
27
+
28
+ sig do
29
+ params(
30
+ subscriptions:
31
+ T::Array[
32
+ Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription::OrHash
33
+ ],
34
+ request_options: Knockapi::RequestOptions::OrHash
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(
38
+ # A nested list of subscriptions.
39
+ subscriptions:,
40
+ request_options: {}
41
+ )
42
+ end
43
+
44
+ sig do
45
+ override.returns(
46
+ {
47
+ subscriptions:
48
+ T::Array[
49
+ Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription
50
+ ],
51
+ request_options: Knockapi::RequestOptions
52
+ }
53
+ )
54
+ end
55
+ def to_hash
56
+ end
57
+
58
+ class Subscription < Knockapi::Internal::Type::BaseModel
59
+ OrHash =
60
+ T.type_alias do
61
+ T.any(
62
+ Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription,
63
+ Knockapi::Internal::AnyHash
64
+ )
65
+ end
66
+
67
+ # Unique identifier for the object.
68
+ sig { returns(String) }
69
+ attr_accessor :id
70
+
71
+ # The recipients of the subscription. You can subscribe up to 100 recipients to an
72
+ # object at a time.
73
+ sig do
74
+ returns(
75
+ T::Array[
76
+ T.any(String, Knockapi::RecipientReference::ObjectReference)
77
+ ]
78
+ )
79
+ end
80
+ attr_accessor :recipients
81
+
82
+ # A list of subscriptions. 1 subscribed-to id, and N subscriber recipients.
83
+ sig do
84
+ params(
85
+ id: String,
86
+ recipients:
87
+ T::Array[
88
+ T.any(
89
+ String,
90
+ Knockapi::RecipientReference::ObjectReference::OrHash
91
+ )
92
+ ]
93
+ ).returns(T.attached_class)
94
+ end
95
+ def self.new(
96
+ # Unique identifier for the object.
97
+ id:,
98
+ # The recipients of the subscription. You can subscribe up to 100 recipients to an
99
+ # object at a time.
100
+ recipients:
101
+ )
102
+ end
103
+
104
+ sig do
105
+ override.returns(
106
+ {
107
+ id: String,
108
+ recipients:
109
+ T::Array[
110
+ T.any(String, Knockapi::RecipientReference::ObjectReference)
111
+ ]
112
+ }
113
+ )
114
+ end
115
+ def to_hash
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
@@ -45,6 +45,27 @@ module Knockapi
45
45
  )
46
46
  end
47
47
 
48
+ # Delete subscriptions for many objects in a single collection type. If a
49
+ # subscription for an object in the collection doesn't exist, it will be skipped.
50
+ sig do
51
+ params(
52
+ collection: String,
53
+ subscriptions:
54
+ T::Array[
55
+ Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription::OrHash
56
+ ],
57
+ request_options: Knockapi::RequestOptions::OrHash
58
+ ).returns(Knockapi::BulkOperation)
59
+ end
60
+ def delete_subscriptions(
61
+ # The collection this object belongs to.
62
+ collection,
63
+ # A nested list of subscriptions.
64
+ subscriptions:,
65
+ request_options: {}
66
+ )
67
+ end
68
+
48
69
  # Bulk sets up to 1,000 objects at a time in the specified collection.
49
70
  sig do
50
71
  params(
@@ -149,7 +149,9 @@ module Knockapi
149
149
  key: String,
150
150
  version_id: String,
151
151
  step_ref: String?,
152
- type: Knockapi::Models::Message::Source::type_
152
+ type: Knockapi::Models::Message::Source::type_,
153
+ workflow_recipient_run_id: String?,
154
+ workflow_run_id: String?
153
155
  }
154
156
 
155
157
  class Source < Knockapi::Internal::Type::BaseModel
@@ -169,13 +171,19 @@ module Knockapi
169
171
  Knockapi::Models::Message::Source::type_
170
172
  ) -> Knockapi::Models::Message::Source::type_
171
173
 
174
+ attr_accessor workflow_recipient_run_id: String?
175
+
176
+ attr_accessor workflow_run_id: String?
177
+
172
178
  def initialize: (
173
179
  _typename: String,
174
180
  categories: ::Array[String],
175
181
  key: String,
176
182
  version_id: String,
177
183
  ?step_ref: String?,
178
- ?type: Knockapi::Models::Message::Source::type_
184
+ ?type: Knockapi::Models::Message::Source::type_,
185
+ ?workflow_recipient_run_id: String?,
186
+ ?workflow_run_id: String?
179
187
  ) -> void
180
188
 
181
189
  def to_hash: -> {
@@ -184,7 +192,9 @@ module Knockapi
184
192
  key: String,
185
193
  version_id: String,
186
194
  step_ref: String?,
187
- type: Knockapi::Models::Message::Source::type_
195
+ type: Knockapi::Models::Message::Source::type_,
196
+ workflow_recipient_run_id: String?,
197
+ workflow_run_id: String?
188
198
  }
189
199
 
190
200
  type type_ = :broadcast | :workflow | :guide
@@ -0,0 +1,50 @@
1
+ module Knockapi
2
+ module Models
3
+ module Objects
4
+ type bulk_delete_subscriptions_params =
5
+ {
6
+ subscriptions: ::Array[Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription]
7
+ }
8
+ & Knockapi::Internal::Type::request_parameters
9
+
10
+ class BulkDeleteSubscriptionsParams < Knockapi::Internal::Type::BaseModel
11
+ extend Knockapi::Internal::Type::RequestParameters::Converter
12
+ include Knockapi::Internal::Type::RequestParameters
13
+
14
+ attr_accessor subscriptions: ::Array[Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription]
15
+
16
+ def initialize: (
17
+ subscriptions: ::Array[Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription],
18
+ ?request_options: Knockapi::request_opts
19
+ ) -> void
20
+
21
+ def to_hash: -> {
22
+ subscriptions: ::Array[Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription],
23
+ request_options: Knockapi::RequestOptions
24
+ }
25
+
26
+ type subscription =
27
+ {
28
+ id: String,
29
+ recipients: ::Array[Knockapi::Models::recipient_reference]
30
+ }
31
+
32
+ class Subscription < Knockapi::Internal::Type::BaseModel
33
+ attr_accessor id: String
34
+
35
+ attr_accessor recipients: ::Array[Knockapi::Models::recipient_reference]
36
+
37
+ def initialize: (
38
+ id: String,
39
+ recipients: ::Array[Knockapi::Models::recipient_reference]
40
+ ) -> void
41
+
42
+ def to_hash: -> {
43
+ id: String,
44
+ recipients: ::Array[Knockapi::Models::recipient_reference]
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -14,6 +14,12 @@ module Knockapi
14
14
  ?request_options: Knockapi::request_opts
15
15
  ) -> Knockapi::BulkOperation
16
16
 
17
+ def delete_subscriptions: (
18
+ String collection,
19
+ subscriptions: ::Array[Knockapi::Objects::BulkDeleteSubscriptionsParams::Subscription],
20
+ ?request_options: Knockapi::request_opts
21
+ ) -> Knockapi::BulkOperation
22
+
17
23
  def set: (
18
24
  String collection,
19
25
  objects: ::Array[Knockapi::Objects::BulkSetParams::Object],
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.20.0
4
+ version: 1.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Knock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-20 00:00:00.000000000 Z
11
+ date: 2025-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -131,6 +131,7 @@ files:
131
131
  - lib/knockapi/models/object_unset_channel_data_params.rb
132
132
  - lib/knockapi/models/objects/bulk_add_subscriptions_params.rb
133
133
  - lib/knockapi/models/objects/bulk_delete_params.rb
134
+ - lib/knockapi/models/objects/bulk_delete_subscriptions_params.rb
134
135
  - lib/knockapi/models/objects/bulk_set_params.rb
135
136
  - lib/knockapi/models/page_info.rb
136
137
  - lib/knockapi/models/providers/ms_team_check_auth_params.rb
@@ -345,6 +346,7 @@ files:
345
346
  - rbi/knockapi/models/object_unset_channel_data_params.rbi
346
347
  - rbi/knockapi/models/objects/bulk_add_subscriptions_params.rbi
347
348
  - rbi/knockapi/models/objects/bulk_delete_params.rbi
349
+ - rbi/knockapi/models/objects/bulk_delete_subscriptions_params.rbi
348
350
  - rbi/knockapi/models/objects/bulk_set_params.rbi
349
351
  - rbi/knockapi/models/page_info.rbi
350
352
  - rbi/knockapi/models/providers/ms_team_check_auth_params.rbi
@@ -558,6 +560,7 @@ files:
558
560
  - sig/knockapi/models/object_unset_channel_data_params.rbs
559
561
  - sig/knockapi/models/objects/bulk_add_subscriptions_params.rbs
560
562
  - sig/knockapi/models/objects/bulk_delete_params.rbs
563
+ - sig/knockapi/models/objects/bulk_delete_subscriptions_params.rbs
561
564
  - sig/knockapi/models/objects/bulk_set_params.rbs
562
565
  - sig/knockapi/models/page_info.rbs
563
566
  - sig/knockapi/models/providers/ms_team_check_auth_params.rbs