knockapi 1.20.0 → 1.21.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: f84eb716141c76105b2acb3a28285745d095515554458a21179ebd249a4d718b
4
+ data.tar.gz: 4eecf79648fb8d92f89a70bd9898a1baf42f050194074e488fda86b17c7a17b2
5
5
  SHA512:
6
- metadata.gz: 6d1da55316e1915100adc1748a00de8aee8b46c8b7a710948a34190faa8f6a03cbe33f0856817c9437b82eb09aeb6fc7ea18f04b87498234dd7ddb623f4b5734
7
- data.tar.gz: a4268192cef85172e23bdaf4287e7a0d6f9257bb199ea56b17800974aa16e8424fcdff12ee87eddd7e205801e40605ab6a00d5c7cbed8977a7057bb5227054d9
6
+ metadata.gz: 709a46b6b32a02e00757e34b88bf9a856648a651764d0efcb70025c71b89ce4dcd23db575fd761733c00f370aa2e92bd6cd1b7bd1792e8fd2a779f5b9ed9d71e
7
+ data.tar.gz: 5de4b46c82ce8adb49182334b3048ad403fb5d96576d2e942c84d6f9b82ade253b4c69d8f8188f1ab5383965afbf1e9eef4a35dc34d0998c11bc164a3591e95f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.21.0 (2025-11-20)
4
+
5
+ Full Changelog: [v1.20.0...v1.21.0](https://github.com/knocklabs/knock-ruby/compare/v1.20.0...v1.21.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add bulk delete subscriptions ([2fed837](https://github.com/knocklabs/knock-ruby/commit/2fed8371bbd0a682d8a5c3fd030024847c69180b))
10
+
11
+
12
+ ### Chores
13
+
14
+ * explicitly require "base64" gem ([cde84e5](https://github.com/knocklabs/knock-ruby/commit/cde84e5db590434da5db78b9138915f3072ec82d))
15
+
3
16
  ## 1.20.0 (2025-11-19)
4
17
 
5
18
  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.21.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -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.21.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
@@ -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(
@@ -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,7 +1,7 @@
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.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Knock
@@ -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