knockapi 1.19.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: ac0712fabab74c852c94a2b9965183efac90dfa032a82fe7cde8278646d2b618
4
- data.tar.gz: 9d76422f9303bae5aee52d8b258637ea69c32dcb982a666d1a6c5379db2721fe
3
+ metadata.gz: f84eb716141c76105b2acb3a28285745d095515554458a21179ebd249a4d718b
4
+ data.tar.gz: 4eecf79648fb8d92f89a70bd9898a1baf42f050194074e488fda86b17c7a17b2
5
5
  SHA512:
6
- metadata.gz: 190a4ac895ece179f333b0db6e7aecdb754682a3707150932882f8e89eb239a5dd22dff185d348ac016cdc36dd26f86079224ba9511b355f201d477c6cdb2f14
7
- data.tar.gz: 41e71629aa63e8d7c06ac71f4809235cc61988d01392ef44815e70c6721a753df11d9d47c6cae340e13ed5003638e6a5a70b4837209a10bcdd0c7831a59396e9
6
+ metadata.gz: 709a46b6b32a02e00757e34b88bf9a856648a651764d0efcb70025c71b89ce4dcd23db575fd761733c00f370aa2e92bd6cd1b7bd1792e8fd2a779f5b9ed9d71e
7
+ data.tar.gz: 5de4b46c82ce8adb49182334b3048ad403fb5d96576d2e942c84d6f9b82ade253b4c69d8f8188f1ab5383965afbf1e9eef4a35dc34d0998c11bc164a3591e95f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
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
+
16
+ ## 1.20.0 (2025-11-19)
17
+
18
+ Full Changelog: [v1.19.0...v1.20.0](https://github.com/knocklabs/knock-ruby/compare/v1.19.0...v1.20.0)
19
+
20
+ ### Features
21
+
22
+ * **api:** api update ([fb4c210](https://github.com/knocklabs/knock-ruby/commit/fb4c2104b4be76381a3fd224879c356f66882a1c))
23
+ * **api:** api update ([d0a06cf](https://github.com/knocklabs/knock-ruby/commit/d0a06cf1572a04f6dae4551c18471f4ef808e2c2))
24
+
3
25
  ## 1.19.0 (2025-11-07)
4
26
 
5
27
  Full Changelog: [v1.18.0...v1.19.0](https://github.com/knocklabs/knock-ruby/compare/v1.18.0...v1.19.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.19.0"
20
+ gem "knockapi", "~> 1.21.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -9,18 +9,24 @@ module Knockapi
9
9
  include Knockapi::Internal::Type::RequestParameters
10
10
 
11
11
  # @!attribute subscriptions
12
- # A list of subscriptions.
12
+ # A nested list of subscriptions.
13
13
  #
14
14
  # @return [Array<Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription>]
15
15
  required :subscriptions,
16
16
  -> { Knockapi::Internal::Type::ArrayOf[Knockapi::Objects::BulkAddSubscriptionsParams::Subscription] }
17
17
 
18
18
  # @!method initialize(subscriptions:, request_options: {})
19
- # @param subscriptions [Array<Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription>] A list of subscriptions.
19
+ # @param subscriptions [Array<Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription>] A nested list of subscriptions.
20
20
  #
21
21
  # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}]
22
22
 
23
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
+
24
30
  # @!attribute recipients
25
31
  # The recipients of the subscription. You can subscribe up to 100 recipients to an
26
32
  # object at a time.
@@ -36,11 +42,15 @@ module Knockapi
36
42
  Knockapi::Internal::Type::HashOf[Knockapi::Internal::Type::Unknown],
37
43
  nil?: true
38
44
 
39
- # @!method initialize(recipients:, properties: nil)
45
+ # @!method initialize(id:, recipients:, properties: nil)
40
46
  # Some parameter documentations has been truncated, see
41
47
  # {Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription} for more
42
48
  # details.
43
49
  #
50
+ # A list of subscriptions. 1 subscribed-to id, and N subscriber recipients.
51
+ #
52
+ # @param id [String] Unique identifier for the object.
53
+ #
44
54
  # @param recipients [Array<String, Knockapi::Models::InlineIdentifyUserRequest, Knockapi::Models::InlineObjectRequest>] The recipients of the subscription. You can subscribe up to 100 recipients to an
45
55
  #
46
56
  # @param properties [Hash{Symbol=>Object}, nil] The custom properties associated with the subscription relationship.
@@ -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
@@ -7,7 +7,20 @@ module Knockapi
7
7
  extend Knockapi::Internal::Type::RequestParameters::Converter
8
8
  include Knockapi::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute resolve_full_preference_settings
11
+ # When true, merges environment-level default preferences into the tenant's
12
+ # `settings.preference_set` field before returning the response. Defaults to
13
+ # false.
14
+ #
15
+ # @return [Boolean, nil]
16
+ optional :resolve_full_preference_settings, Knockapi::Internal::Type::Boolean
17
+
18
+ # @!method initialize(resolve_full_preference_settings: nil, request_options: {})
19
+ # Some parameter documentations has been truncated, see
20
+ # {Knockapi::Models::TenantGetParams} for more details.
21
+ #
22
+ # @param resolve_full_preference_settings [Boolean] When true, merges environment-level default preferences into the tenant's `setti
23
+ #
11
24
  # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}]
12
25
  end
13
26
  end
@@ -7,6 +7,14 @@ module Knockapi
7
7
  extend Knockapi::Internal::Type::RequestParameters::Converter
8
8
  include Knockapi::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute resolve_full_preference_settings
11
+ # When true, merges environment-level default preferences into the tenant's
12
+ # `settings.preference_set` field before returning the response. Defaults to
13
+ # false.
14
+ #
15
+ # @return [Boolean, nil]
16
+ optional :resolve_full_preference_settings, Knockapi::Internal::Type::Boolean
17
+
10
18
  # @!attribute channel_data
11
19
  # A request to set channel data for a type of channel inline.
12
20
  #
@@ -29,7 +37,12 @@ module Knockapi
29
37
  # @return [Knockapi::Models::TenantSetParams::Settings, nil]
30
38
  optional :settings, -> { Knockapi::TenantSetParams::Settings }
31
39
 
32
- # @!method initialize(channel_data: nil, name: nil, settings: nil, request_options: {})
40
+ # @!method initialize(resolve_full_preference_settings: nil, channel_data: nil, name: nil, settings: nil, request_options: {})
41
+ # Some parameter documentations has been truncated, see
42
+ # {Knockapi::Models::TenantSetParams} for more details.
43
+ #
44
+ # @param resolve_full_preference_settings [Boolean] When true, merges environment-level default preferences into the tenant's `setti
45
+ #
33
46
  # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
34
47
  #
35
48
  # @param name [String, nil] An optional name for the tenant.
@@ -38,7 +38,7 @@ module Knockapi
38
38
  #
39
39
  # @param collection [String] The collection this object belongs to.
40
40
  #
41
- # @param subscriptions [Array<Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription>] A list of subscriptions.
41
+ # @param subscriptions [Array<Knockapi::Models::Objects::BulkAddSubscriptionsParams::Subscription>] A nested list of subscriptions.
42
42
  #
43
43
  # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
44
44
  #
@@ -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: {})
@@ -57,38 +57,50 @@ module Knockapi
57
57
  )
58
58
  end
59
59
 
60
+ # Some parameter documentations has been truncated, see
61
+ # {Knockapi::Models::TenantGetParams} for more details.
62
+ #
60
63
  # Get a tenant by ID.
61
64
  #
62
- # @overload get(id, request_options: {})
65
+ # @overload get(id, resolve_full_preference_settings: nil, request_options: {})
63
66
  #
64
67
  # @param id [String] The unique identifier for the tenant.
65
68
  #
69
+ # @param resolve_full_preference_settings [Boolean] When true, merges environment-level default preferences into the tenant's `setti
70
+ #
66
71
  # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
67
72
  #
68
73
  # @return [Knockapi::Models::Tenant]
69
74
  #
70
75
  # @see Knockapi::Models::TenantGetParams
71
76
  def get(id, params = {})
77
+ parsed, options = Knockapi::TenantGetParams.dump_request(params)
72
78
  @client.request(
73
79
  method: :get,
74
80
  path: ["v1/tenants/%1$s", id],
81
+ query: parsed,
75
82
  model: Knockapi::Tenant,
76
- options: params[:request_options]
83
+ options: options
77
84
  )
78
85
  end
79
86
 
87
+ # Some parameter documentations has been truncated, see
88
+ # {Knockapi::Models::TenantSetParams} for more details.
89
+ #
80
90
  # Sets a tenant within an environment, performing an upsert operation. Any
81
91
  # existing properties will be merged with the incoming properties.
82
92
  #
83
- # @overload set(id, channel_data: nil, name: nil, settings: nil, request_options: {})
93
+ # @overload set(id, resolve_full_preference_settings: nil, channel_data: nil, name: nil, settings: nil, request_options: {})
84
94
  #
85
- # @param id [String] The unique identifier for the tenant.
95
+ # @param id [String] Path param: The unique identifier for the tenant.
96
+ #
97
+ # @param resolve_full_preference_settings [Boolean] Query param: When true, merges environment-level default preferences into the te
86
98
  #
87
- # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] A request to set channel data for a type of channel inline.
99
+ # @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::PushChannelDataTokensOnly, Knockapi::Models::Recipients::PushChannelDataDevicesOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly, Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData}, nil] Body param: A request to set channel data for a type of channel inline.
88
100
  #
89
- # @param name [String, nil] An optional name for the tenant.
101
+ # @param name [String, nil] Body param: An optional name for the tenant.
90
102
  #
91
- # @param settings [Knockapi::Models::TenantSetParams::Settings] The settings for the tenant. Includes branding and preference set.
103
+ # @param settings [Knockapi::Models::TenantSetParams::Settings] Body param: The settings for the tenant. Includes branding and preference set.
92
104
  #
93
105
  # @param request_options [Knockapi::RequestOptions, Hash{Symbol=>Object}, nil]
94
106
  #
@@ -97,10 +109,12 @@ module Knockapi
97
109
  # @see Knockapi::Models::TenantSetParams
98
110
  def set(id, params = {})
99
111
  parsed, options = Knockapi::TenantSetParams.dump_request(params)
112
+ query_params = [:resolve_full_preference_settings]
100
113
  @client.request(
101
114
  method: :put,
102
115
  path: ["v1/tenants/%1$s", id],
103
- body: parsed,
116
+ query: parsed.slice(*query_params),
117
+ body: parsed.except(*query_params),
104
118
  model: Knockapi::Tenant,
105
119
  options: options
106
120
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Knockapi
4
- VERSION = "1.19.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
@@ -15,7 +15,7 @@ module Knockapi
15
15
  )
16
16
  end
17
17
 
18
- # A list of subscriptions.
18
+ # A nested list of subscriptions.
19
19
  sig do
20
20
  returns(
21
21
  T::Array[
@@ -35,7 +35,7 @@ module Knockapi
35
35
  ).returns(T.attached_class)
36
36
  end
37
37
  def self.new(
38
- # A list of subscriptions.
38
+ # A nested list of subscriptions.
39
39
  subscriptions:,
40
40
  request_options: {}
41
41
  )
@@ -64,6 +64,10 @@ module Knockapi
64
64
  )
65
65
  end
66
66
 
67
+ # Unique identifier for the object.
68
+ sig { returns(String) }
69
+ attr_accessor :id
70
+
67
71
  # The recipients of the subscription. You can subscribe up to 100 recipients to an
68
72
  # object at a time.
69
73
  sig do
@@ -83,8 +87,10 @@ module Knockapi
83
87
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
84
88
  attr_accessor :properties
85
89
 
90
+ # A list of subscriptions. 1 subscribed-to id, and N subscriber recipients.
86
91
  sig do
87
92
  params(
93
+ id: String,
88
94
  recipients:
89
95
  T::Array[
90
96
  T.any(
@@ -97,6 +103,8 @@ module Knockapi
97
103
  ).returns(T.attached_class)
98
104
  end
99
105
  def self.new(
106
+ # Unique identifier for the object.
107
+ id:,
100
108
  # The recipients of the subscription. You can subscribe up to 100 recipients to an
101
109
  # object at a time.
102
110
  recipients:,
@@ -108,6 +116,7 @@ module Knockapi
108
116
  sig do
109
117
  override.returns(
110
118
  {
119
+ id: String,
111
120
  recipients:
112
121
  T::Array[
113
122
  T.any(
@@ -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
@@ -11,15 +11,38 @@ module Knockapi
11
11
  T.any(Knockapi::TenantGetParams, Knockapi::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # When true, merges environment-level default preferences into the tenant's
15
+ # `settings.preference_set` field before returning the response. Defaults to
16
+ # false.
17
+ sig { returns(T.nilable(T::Boolean)) }
18
+ attr_reader :resolve_full_preference_settings
19
+
20
+ sig { params(resolve_full_preference_settings: T::Boolean).void }
21
+ attr_writer :resolve_full_preference_settings
22
+
14
23
  sig do
15
- params(request_options: Knockapi::RequestOptions::OrHash).returns(
16
- T.attached_class
17
- )
24
+ params(
25
+ resolve_full_preference_settings: T::Boolean,
26
+ request_options: Knockapi::RequestOptions::OrHash
27
+ ).returns(T.attached_class)
18
28
  end
19
- def self.new(request_options: {})
29
+ def self.new(
30
+ # When true, merges environment-level default preferences into the tenant's
31
+ # `settings.preference_set` field before returning the response. Defaults to
32
+ # false.
33
+ resolve_full_preference_settings: nil,
34
+ request_options: {}
35
+ )
20
36
  end
21
37
 
22
- sig { override.returns({ request_options: Knockapi::RequestOptions }) }
38
+ sig do
39
+ override.returns(
40
+ {
41
+ resolve_full_preference_settings: T::Boolean,
42
+ request_options: Knockapi::RequestOptions
43
+ }
44
+ )
45
+ end
23
46
  def to_hash
24
47
  end
25
48
  end
@@ -11,6 +11,15 @@ module Knockapi
11
11
  T.any(Knockapi::TenantSetParams, Knockapi::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # When true, merges environment-level default preferences into the tenant's
15
+ # `settings.preference_set` field before returning the response. Defaults to
16
+ # false.
17
+ sig { returns(T.nilable(T::Boolean)) }
18
+ attr_reader :resolve_full_preference_settings
19
+
20
+ sig { params(resolve_full_preference_settings: T::Boolean).void }
21
+ attr_writer :resolve_full_preference_settings
22
+
14
23
  # A request to set channel data for a type of channel inline.
15
24
  sig do
16
25
  returns(
@@ -46,6 +55,7 @@ module Knockapi
46
55
 
47
56
  sig do
48
57
  params(
58
+ resolve_full_preference_settings: T::Boolean,
49
59
  channel_data:
50
60
  T.nilable(
51
61
  T::Hash[
@@ -68,6 +78,10 @@ module Knockapi
68
78
  ).returns(T.attached_class)
69
79
  end
70
80
  def self.new(
81
+ # When true, merges environment-level default preferences into the tenant's
82
+ # `settings.preference_set` field before returning the response. Defaults to
83
+ # false.
84
+ resolve_full_preference_settings: nil,
71
85
  # A request to set channel data for a type of channel inline.
72
86
  channel_data: nil,
73
87
  # An optional name for the tenant.
@@ -81,6 +95,7 @@ module Knockapi
81
95
  sig do
82
96
  override.returns(
83
97
  {
98
+ resolve_full_preference_settings: T::Boolean,
84
99
  channel_data:
85
100
  T.nilable(
86
101
  T::Hash[
@@ -39,7 +39,28 @@ module Knockapi
39
39
  def add_subscriptions(
40
40
  # The collection this object belongs to.
41
41
  collection,
42
- # A list of subscriptions.
42
+ # A nested list of subscriptions.
43
+ subscriptions:,
44
+ request_options: {}
45
+ )
46
+ end
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.
43
64
  subscriptions:,
44
65
  request_options: {}
45
66
  )
@@ -50,12 +50,17 @@ module Knockapi
50
50
  sig do
51
51
  params(
52
52
  id: String,
53
+ resolve_full_preference_settings: T::Boolean,
53
54
  request_options: Knockapi::RequestOptions::OrHash
54
55
  ).returns(Knockapi::Tenant)
55
56
  end
56
57
  def get(
57
58
  # The unique identifier for the tenant.
58
59
  id,
60
+ # When true, merges environment-level default preferences into the tenant's
61
+ # `settings.preference_set` field before returning the response. Defaults to
62
+ # false.
63
+ resolve_full_preference_settings: nil,
59
64
  request_options: {}
60
65
  )
61
66
  end
@@ -65,6 +70,7 @@ module Knockapi
65
70
  sig do
66
71
  params(
67
72
  id: String,
73
+ resolve_full_preference_settings: T::Boolean,
68
74
  channel_data:
69
75
  T.nilable(
70
76
  T::Hash[
@@ -87,13 +93,17 @@ module Knockapi
87
93
  ).returns(Knockapi::Tenant)
88
94
  end
89
95
  def set(
90
- # The unique identifier for the tenant.
96
+ # Path param: The unique identifier for the tenant.
91
97
  id,
92
- # A request to set channel data for a type of channel inline.
98
+ # Query param: When true, merges environment-level default preferences into the
99
+ # tenant's `settings.preference_set` field before returning the response. Defaults
100
+ # to false.
101
+ resolve_full_preference_settings: nil,
102
+ # Body param: A request to set channel data for a type of channel inline.
93
103
  channel_data: nil,
94
- # An optional name for the tenant.
104
+ # Body param: An optional name for the tenant.
95
105
  name: nil,
96
- # The settings for the tenant. Includes branding and preference set.
106
+ # Body param: The settings for the tenant. Includes branding and preference set.
97
107
  settings: nil,
98
108
  request_options: {}
99
109
  )
@@ -25,21 +25,26 @@ module Knockapi
25
25
 
26
26
  type subscription =
27
27
  {
28
+ id: String,
28
29
  recipients: ::Array[Knockapi::Models::recipient_request],
29
30
  properties: ::Hash[Symbol, top]?
30
31
  }
31
32
 
32
33
  class Subscription < Knockapi::Internal::Type::BaseModel
34
+ attr_accessor id: String
35
+
33
36
  attr_accessor recipients: ::Array[Knockapi::Models::recipient_request]
34
37
 
35
38
  attr_accessor properties: ::Hash[Symbol, top]?
36
39
 
37
40
  def initialize: (
41
+ id: String,
38
42
  recipients: ::Array[Knockapi::Models::recipient_request],
39
43
  ?properties: ::Hash[Symbol, top]?
40
44
  ) -> void
41
45
 
42
46
  def to_hash: -> {
47
+ id: String,
43
48
  recipients: ::Array[Knockapi::Models::recipient_request],
44
49
  properties: ::Hash[Symbol, top]?
45
50
  }
@@ -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
@@ -1,14 +1,26 @@
1
1
  module Knockapi
2
2
  module Models
3
- type tenant_get_params = { } & Knockapi::Internal::Type::request_parameters
3
+ type tenant_get_params =
4
+ { resolve_full_preference_settings: bool }
5
+ & Knockapi::Internal::Type::request_parameters
4
6
 
5
7
  class TenantGetParams < Knockapi::Internal::Type::BaseModel
6
8
  extend Knockapi::Internal::Type::RequestParameters::Converter
7
9
  include Knockapi::Internal::Type::RequestParameters
8
10
 
9
- def initialize: (?request_options: Knockapi::request_opts) -> void
11
+ attr_reader resolve_full_preference_settings: bool?
10
12
 
11
- def to_hash: -> { request_options: Knockapi::RequestOptions }
13
+ def resolve_full_preference_settings=: (bool) -> bool
14
+
15
+ def initialize: (
16
+ ?resolve_full_preference_settings: bool,
17
+ ?request_options: Knockapi::request_opts
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ resolve_full_preference_settings: bool,
22
+ request_options: Knockapi::RequestOptions
23
+ }
12
24
  end
13
25
  end
14
26
  end
@@ -2,6 +2,7 @@ module Knockapi
2
2
  module Models
3
3
  type tenant_set_params =
4
4
  {
5
+ resolve_full_preference_settings: bool,
5
6
  channel_data: Knockapi::Models::Recipients::inline_channel_data_request?,
6
7
  name: String?,
7
8
  settings: Knockapi::TenantSetParams::Settings
@@ -12,6 +13,10 @@ module Knockapi
12
13
  extend Knockapi::Internal::Type::RequestParameters::Converter
13
14
  include Knockapi::Internal::Type::RequestParameters
14
15
 
16
+ attr_reader resolve_full_preference_settings: bool?
17
+
18
+ def resolve_full_preference_settings=: (bool) -> bool
19
+
15
20
  attr_accessor channel_data: Knockapi::Models::Recipients::inline_channel_data_request?
16
21
 
17
22
  attr_accessor name: String?
@@ -23,6 +28,7 @@ module Knockapi
23
28
  ) -> Knockapi::TenantSetParams::Settings
24
29
 
25
30
  def initialize: (
31
+ ?resolve_full_preference_settings: bool,
26
32
  ?channel_data: Knockapi::Models::Recipients::inline_channel_data_request?,
27
33
  ?name: String?,
28
34
  ?settings: Knockapi::TenantSetParams::Settings,
@@ -30,6 +36,7 @@ module Knockapi
30
36
  ) -> void
31
37
 
32
38
  def to_hash: -> {
39
+ resolve_full_preference_settings: bool,
33
40
  channel_data: Knockapi::Models::Recipients::inline_channel_data_request?,
34
41
  name: String?,
35
42
  settings: Knockapi::TenantSetParams::Settings,
@@ -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],
@@ -16,11 +16,13 @@ module Knockapi
16
16
 
17
17
  def get: (
18
18
  String id,
19
+ ?resolve_full_preference_settings: bool,
19
20
  ?request_options: Knockapi::request_opts
20
21
  ) -> Knockapi::Tenant
21
22
 
22
23
  def set: (
23
24
  String id,
25
+ ?resolve_full_preference_settings: bool,
24
26
  ?channel_data: Knockapi::Models::Recipients::inline_channel_data_request?,
25
27
  ?name: String?,
26
28
  ?settings: Knockapi::TenantSetParams::Settings,
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.19.0
4
+ version: 1.21.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-07 00:00:00.000000000 Z
11
+ date: 2025-11-20 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