knockapi 1.18.0 → 1.19.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 +23 -0
- data/README.md +1 -1
- data/lib/knockapi/client.rb +12 -0
- data/lib/knockapi/internal/transport/base_client.rb +7 -1
- data/lib/knockapi/internal/transport/pooled_net_requester.rb +6 -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 +11 -3
- data/lib/knockapi/models/object_set_params.rb +11 -3
- data/lib/knockapi/models/objects/bulk_set_params.rb +11 -3
- data/lib/knockapi/models/recipients/aws_sns_push_channel_data_devices_only.rb +63 -0
- data/lib/knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only.rb +25 -0
- data/lib/knockapi/models/recipients/channel_data.rb +4 -17
- data/lib/knockapi/models/recipients/channel_data_request.rb +8 -162
- data/lib/knockapi/models/recipients/inline_channel_data_request.rb +6 -160
- data/lib/knockapi/models/recipients/one_signal_channel_data_player_ids_only.rb +20 -0
- data/lib/knockapi/models/recipients/preference_set.rb +12 -54
- data/lib/knockapi/models/recipients/preference_set_channel_setting.rb +21 -0
- data/lib/knockapi/models/recipients/preference_set_request.rb +12 -54
- data/lib/knockapi/models/recipients/push_channel_data_devices_only.rb +60 -0
- data/lib/knockapi/models/recipients/push_channel_data_tokens_only.rb +20 -0
- data/lib/knockapi/models/tenant_request.rb +11 -3
- data/lib/knockapi/models/tenant_set_params.rb +11 -3
- data/lib/knockapi/models/users/feed_list_items_params.rb +15 -1
- data/lib/knockapi/resources/objects.rb +6 -4
- data/lib/knockapi/resources/tenants.rb +4 -2
- data/lib/knockapi/resources/users/feeds.rb +6 -1
- data/lib/knockapi/resources/users.rb +3 -3
- data/lib/knockapi/version.rb +1 -1
- data/lib/knockapi.rb +7 -0
- data/manifest.yaml +1 -0
- data/rbi/knockapi/client.rbi +7 -0
- data/rbi/knockapi/internal/transport/base_client.rbi +5 -0
- data/rbi/knockapi/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/knockapi/internal/type/base_model.rbi +8 -4
- data/rbi/knockapi/models/identify_user_request.rbi +15 -15
- data/rbi/knockapi/models/inline_identify_user_request.rbi +15 -15
- data/rbi/knockapi/models/inline_object_request.rbi +23 -15
- data/rbi/knockapi/models/object_set_params.rbi +28 -20
- data/rbi/knockapi/models/objects/bulk_set_params.rbi +23 -15
- data/rbi/knockapi/models/recipients/aws_sns_push_channel_data_devices_only.rbi +120 -0
- data/rbi/knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only.rbi +35 -0
- data/rbi/knockapi/models/recipients/channel_data.rbi +2 -30
- data/rbi/knockapi/models/recipients/channel_data_request.rbi +20 -326
- data/rbi/knockapi/models/recipients/inline_channel_data_request.rbi +5 -309
- data/rbi/knockapi/models/recipients/one_signal_channel_data_player_ids_only.rbi +33 -0
- data/rbi/knockapi/models/recipients/preference_set.rbi +6 -109
- data/rbi/knockapi/models/recipients/preference_set_channel_setting.rbi +38 -0
- data/rbi/knockapi/models/recipients/preference_set_request.rbi +12 -115
- data/rbi/knockapi/models/recipients/push_channel_data_devices_only.rbi +114 -0
- data/rbi/knockapi/models/recipients/push_channel_data_tokens_only.rbi +33 -0
- data/rbi/knockapi/models/tenant_request.rbi +23 -15
- data/rbi/knockapi/models/tenant_set_params.rbi +23 -15
- data/rbi/knockapi/models/users/feed_list_items_params.rbi +17 -0
- data/rbi/knockapi/resources/objects.rbi +14 -11
- data/rbi/knockapi/resources/tenants.rbi +8 -5
- data/rbi/knockapi/resources/users/feeds.rbi +6 -0
- data/rbi/knockapi/resources/users.rbi +11 -11
- data/sig/knockapi/client.rbs +3 -0
- data/sig/knockapi/internal/transport/base_client.rbs +2 -0
- data/sig/knockapi/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/knockapi/models/inline_object_request.rbs +5 -0
- data/sig/knockapi/models/object_set_params.rbs +5 -0
- data/sig/knockapi/models/objects/bulk_set_params.rbs +5 -0
- data/sig/knockapi/models/recipients/aws_sns_push_channel_data_devices_only.rbs +44 -0
- data/sig/knockapi/models/recipients/aws_sns_push_channel_data_target_arns_only.rbs +16 -0
- data/sig/knockapi/models/recipients/channel_data.rbs +1 -12
- data/sig/knockapi/models/recipients/channel_data_request.rbs +5 -116
- data/sig/knockapi/models/recipients/inline_channel_data_request.rbs +5 -116
- data/sig/knockapi/models/recipients/one_signal_channel_data_player_ids_only.rbs +16 -0
- data/sig/knockapi/models/recipients/preference_set.rbs +3 -44
- data/sig/knockapi/models/recipients/preference_set_channel_setting.rbs +16 -0
- data/sig/knockapi/models/recipients/preference_set_request.rbs +3 -44
- data/sig/knockapi/models/recipients/push_channel_data_devices_only.rbs +40 -0
- data/sig/knockapi/models/recipients/push_channel_data_tokens_only.rbs +15 -0
- data/sig/knockapi/models/tenant_request.rbs +5 -0
- data/sig/knockapi/models/tenant_set_params.rbs +5 -0
- data/sig/knockapi/models/users/feed_list_items_params.rbs +7 -0
- data/sig/knockapi/resources/objects.rbs +1 -0
- data/sig/knockapi/resources/tenants.rbs +1 -0
- data/sig/knockapi/resources/users/feeds.rbs +1 -0
- metadata +20 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac0712fabab74c852c94a2b9965183efac90dfa032a82fe7cde8278646d2b618
|
|
4
|
+
data.tar.gz: 9d76422f9303bae5aee52d8b258637ea69c32dcb982a666d1a6c5379db2721fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 190a4ac895ece179f333b0db6e7aecdb754682a3707150932882f8e89eb239a5dd22dff185d348ac016cdc36dd26f86079224ba9511b355f201d477c6cdb2f14
|
|
7
|
+
data.tar.gz: 41e71629aa63e8d7c06ac71f4809235cc61988d01392ef44815e70c6721a753df11d9d47c6cae340e13ed5003638e6a5a70b4837209a10bcdd0c7831a59396e9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.19.0 (2025-11-07)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.18.0...v1.19.0](https://github.com/knocklabs/knock-ruby/compare/v1.18.0...v1.19.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([49dfcac](https://github.com/knocklabs/knock-ruby/commit/49dfcacc09c8dfe929b609b27160fbc378953e67))
|
|
10
|
+
* **api:** api update ([21f8ae5](https://github.com/knocklabs/knock-ruby/commit/21f8ae5d08e7a977043af146d5eca6ed2204153d))
|
|
11
|
+
* **api:** api update ([6cf1256](https://github.com/knocklabs/knock-ruby/commit/6cf125684bca003fcde03286c25e12275702eb46))
|
|
12
|
+
* **api:** support specifying a branch ([ebb9daa](https://github.com/knocklabs/knock-ruby/commit/ebb9daa2a60ff30730a5e5566ef4495d038b8ff0))
|
|
13
|
+
* correct channel data schemas ([10baf42](https://github.com/knocklabs/knock-ruby/commit/10baf42ada5f4249951177b98f338e103fe648ae))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* better thread safety via early initializing SSL store during HTTP client creation ([513da8d](https://github.com/knocklabs/knock-ruby/commit/513da8d87063a34c430572553cc987996cebf1aa))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Chores
|
|
22
|
+
|
|
23
|
+
* bump dependency version and update sorbet types ([373db9a](https://github.com/knocklabs/knock-ruby/commit/373db9a9ef43934c3783a5fda89c443062bf6780))
|
|
24
|
+
* **client:** send user-agent header ([5946677](https://github.com/knocklabs/knock-ruby/commit/59466777a63ea93441435ac1cd468a1d7ca76cd6))
|
|
25
|
+
|
|
3
26
|
## 1.18.0 (2025-10-28)
|
|
4
27
|
|
|
5
28
|
Full Changelog: [v1.17.0...v1.18.0](https://github.com/knocklabs/knock-ruby/compare/v1.17.0...v1.18.0)
|
data/README.md
CHANGED
data/lib/knockapi/client.rb
CHANGED
|
@@ -18,6 +18,10 @@ module Knockapi
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
attr_reader :api_key
|
|
20
20
|
|
|
21
|
+
# The slug of an existing branch
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
attr_reader :branch
|
|
24
|
+
|
|
21
25
|
# @return [Knockapi::Resources::Recipients]
|
|
22
26
|
attr_reader :recipients
|
|
23
27
|
|
|
@@ -67,6 +71,8 @@ module Knockapi
|
|
|
67
71
|
#
|
|
68
72
|
# @param api_key [String, nil] Defaults to `ENV["KNOCK_API_KEY"]`
|
|
69
73
|
#
|
|
74
|
+
# @param branch [String, nil] The slug of an existing branch Defaults to `ENV["KNOCK_BRANCH"]`
|
|
75
|
+
#
|
|
70
76
|
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
|
|
71
77
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["KNOCK_BASE_URL"]`
|
|
72
78
|
#
|
|
@@ -81,6 +87,7 @@ module Knockapi
|
|
|
81
87
|
# @param idempotency_header [String]
|
|
82
88
|
def initialize(
|
|
83
89
|
api_key: ENV["KNOCK_API_KEY"],
|
|
90
|
+
branch: ENV["KNOCK_BRANCH"],
|
|
84
91
|
base_url: ENV["KNOCK_BASE_URL"],
|
|
85
92
|
max_retries: self.class::DEFAULT_MAX_RETRIES,
|
|
86
93
|
timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
|
|
@@ -94,6 +101,10 @@ module Knockapi
|
|
|
94
101
|
raise ArgumentError.new("api_key is required, and can be set via environ: \"KNOCK_API_KEY\"")
|
|
95
102
|
end
|
|
96
103
|
|
|
104
|
+
headers = {
|
|
105
|
+
"x-knock-branch" => (@branch = branch&.to_s)
|
|
106
|
+
}
|
|
107
|
+
|
|
97
108
|
@api_key = api_key.to_s
|
|
98
109
|
|
|
99
110
|
super(
|
|
@@ -102,6 +113,7 @@ module Knockapi
|
|
|
102
113
|
max_retries: max_retries,
|
|
103
114
|
initial_retry_delay: initial_retry_delay,
|
|
104
115
|
max_retry_delay: max_retry_delay,
|
|
116
|
+
headers: headers,
|
|
105
117
|
idempotency_header: idempotency_header
|
|
106
118
|
)
|
|
107
119
|
|
|
@@ -201,7 +201,8 @@ module Knockapi
|
|
|
201
201
|
self.class::PLATFORM_HEADERS,
|
|
202
202
|
{
|
|
203
203
|
"accept" => "application/json",
|
|
204
|
-
"content-type" => "application/json"
|
|
204
|
+
"content-type" => "application/json",
|
|
205
|
+
"user-agent" => user_agent
|
|
205
206
|
},
|
|
206
207
|
headers
|
|
207
208
|
)
|
|
@@ -219,6 +220,11 @@ module Knockapi
|
|
|
219
220
|
# @return [Hash{String=>String}]
|
|
220
221
|
private def auth_headers = {}
|
|
221
222
|
|
|
223
|
+
# @api private
|
|
224
|
+
#
|
|
225
|
+
# @return [String]
|
|
226
|
+
private def user_agent = "#{self.class.name}/Ruby #{Knockapi::VERSION}"
|
|
227
|
+
|
|
222
228
|
# @api private
|
|
223
229
|
#
|
|
224
230
|
# @return [String]
|
|
@@ -16,10 +16,11 @@ module Knockapi
|
|
|
16
16
|
class << self
|
|
17
17
|
# @api private
|
|
18
18
|
#
|
|
19
|
+
# @param cert_store [OpenSSL::X509::Store]
|
|
19
20
|
# @param url [URI::Generic]
|
|
20
21
|
#
|
|
21
22
|
# @return [Net::HTTP]
|
|
22
|
-
def connect(url)
|
|
23
|
+
def connect(cert_store:, url:)
|
|
23
24
|
port =
|
|
24
25
|
case [url.port, url.scheme]
|
|
25
26
|
in [Integer, _]
|
|
@@ -33,6 +34,8 @@ module Knockapi
|
|
|
33
34
|
Net::HTTP.new(url.host, port).tap do
|
|
34
35
|
_1.use_ssl = %w[https wss].include?(url.scheme)
|
|
35
36
|
_1.max_retries = 0
|
|
37
|
+
|
|
38
|
+
(_1.cert_store = cert_store) if _1.use_ssl?
|
|
36
39
|
end
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -102,7 +105,7 @@ module Knockapi
|
|
|
102
105
|
pool =
|
|
103
106
|
@mutex.synchronize do
|
|
104
107
|
@pools[origin] ||= ConnectionPool.new(size: @size) do
|
|
105
|
-
self.class.connect(url)
|
|
108
|
+
self.class.connect(cert_store: @cert_store, url: url)
|
|
106
109
|
end
|
|
107
110
|
end
|
|
108
111
|
|
|
@@ -192,6 +195,7 @@ module Knockapi
|
|
|
192
195
|
def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
|
|
193
196
|
@mutex = Mutex.new
|
|
194
197
|
@size = size
|
|
198
|
+
@cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
|
195
199
|
@pools = {}
|
|
196
200
|
end
|
|
197
201
|
|
|
@@ -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::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]
|
|
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::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.
|
|
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::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]
|
|
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::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.
|
|
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::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]
|
|
22
22
|
optional :channel_data,
|
|
23
23
|
-> {
|
|
24
24
|
Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
|
|
@@ -31,6 +31,12 @@ module Knockapi
|
|
|
31
31
|
# @return [Time, nil]
|
|
32
32
|
optional :created_at, Time, nil?: true
|
|
33
33
|
|
|
34
|
+
# @!attribute name
|
|
35
|
+
# An optional name for the object.
|
|
36
|
+
#
|
|
37
|
+
# @return [String, nil]
|
|
38
|
+
optional :name, String, nil?: true
|
|
39
|
+
|
|
34
40
|
# @!attribute preferences
|
|
35
41
|
# Inline set preferences for a recipient, where the key is the preference set id.
|
|
36
42
|
# Preferences that are set inline will be merged into any existing preferences
|
|
@@ -41,7 +47,7 @@ module Knockapi
|
|
|
41
47
|
-> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] },
|
|
42
48
|
nil?: true
|
|
43
49
|
|
|
44
|
-
# @!method initialize(id:, collection:, channel_data: nil, created_at: nil, preferences: nil)
|
|
50
|
+
# @!method initialize(id:, collection:, channel_data: nil, created_at: nil, name: nil, preferences: nil)
|
|
45
51
|
# Some parameter documentations has been truncated, see
|
|
46
52
|
# {Knockapi::Models::InlineObjectRequest} for more details.
|
|
47
53
|
#
|
|
@@ -51,10 +57,12 @@ module Knockapi
|
|
|
51
57
|
#
|
|
52
58
|
# @param collection [String] The collection this object belongs to.
|
|
53
59
|
#
|
|
54
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
60
|
+
# @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.
|
|
55
61
|
#
|
|
56
62
|
# @param created_at [Time, nil] Timestamp when the resource was created.
|
|
57
63
|
#
|
|
64
|
+
# @param name [String, nil] An optional name for the object.
|
|
65
|
+
#
|
|
58
66
|
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
|
|
59
67
|
end
|
|
60
68
|
end
|
|
@@ -10,7 +10,7 @@ module Knockapi
|
|
|
10
10
|
# @!attribute channel_data
|
|
11
11
|
# A request to set channel data for a type of channel inline.
|
|
12
12
|
#
|
|
13
|
-
# @return [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
13
|
+
# @return [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]
|
|
14
14
|
optional :channel_data,
|
|
15
15
|
-> { Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem] }
|
|
16
16
|
|
|
@@ -21,6 +21,12 @@ module Knockapi
|
|
|
21
21
|
# @return [String, nil]
|
|
22
22
|
optional :locale, String, nil?: true
|
|
23
23
|
|
|
24
|
+
# @!attribute name
|
|
25
|
+
# An optional name for the object.
|
|
26
|
+
#
|
|
27
|
+
# @return [String, nil]
|
|
28
|
+
optional :name, String, nil?: true
|
|
29
|
+
|
|
24
30
|
# @!attribute preferences
|
|
25
31
|
# Inline set preferences for a recipient, where the key is the preference set id.
|
|
26
32
|
# Preferences that are set inline will be merged into any existing preferences
|
|
@@ -38,14 +44,16 @@ module Knockapi
|
|
|
38
44
|
# @return [String, nil]
|
|
39
45
|
optional :timezone, String, nil?: true
|
|
40
46
|
|
|
41
|
-
# @!method initialize(channel_data: nil, locale: nil, preferences: nil, timezone: nil, request_options: {})
|
|
47
|
+
# @!method initialize(channel_data: nil, locale: nil, name: nil, preferences: nil, timezone: nil, request_options: {})
|
|
42
48
|
# Some parameter documentations has been truncated, see
|
|
43
49
|
# {Knockapi::Models::ObjectSetParams} for more details.
|
|
44
50
|
#
|
|
45
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
51
|
+
# @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}] A request to set channel data for a type of channel inline.
|
|
46
52
|
#
|
|
47
53
|
# @param locale [String, nil] The locale of the object. Used for [message localization](/concepts/translations
|
|
48
54
|
#
|
|
55
|
+
# @param name [String, nil] An optional name for the object.
|
|
56
|
+
#
|
|
49
57
|
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}] Inline set preferences for a recipient, where the key is the preference set id.
|
|
50
58
|
#
|
|
51
59
|
# @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https
|
|
@@ -29,7 +29,7 @@ module Knockapi
|
|
|
29
29
|
# @!attribute channel_data
|
|
30
30
|
# A request to set channel data for a type of channel inline.
|
|
31
31
|
#
|
|
32
|
-
# @return [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
32
|
+
# @return [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]
|
|
33
33
|
optional :channel_data,
|
|
34
34
|
-> {
|
|
35
35
|
Knockapi::Internal::Type::HashOf[union: Knockapi::Recipients::InlineChannelDataRequestItem]
|
|
@@ -42,6 +42,12 @@ module Knockapi
|
|
|
42
42
|
# @return [Time, nil]
|
|
43
43
|
optional :created_at, Time, nil?: true
|
|
44
44
|
|
|
45
|
+
# @!attribute name
|
|
46
|
+
# An optional name for the object.
|
|
47
|
+
#
|
|
48
|
+
# @return [String, nil]
|
|
49
|
+
optional :name, String, nil?: true
|
|
50
|
+
|
|
45
51
|
# @!attribute preferences
|
|
46
52
|
# Inline set preferences for a recipient, where the key is the preference set id.
|
|
47
53
|
# Preferences that are set inline will be merged into any existing preferences
|
|
@@ -52,7 +58,7 @@ module Knockapi
|
|
|
52
58
|
-> { Knockapi::Internal::Type::HashOf[Knockapi::Recipients::PreferenceSetRequest] },
|
|
53
59
|
nil?: true
|
|
54
60
|
|
|
55
|
-
# @!method initialize(id:, channel_data: nil, created_at: nil, preferences: nil)
|
|
61
|
+
# @!method initialize(id:, channel_data: nil, created_at: nil, name: nil, preferences: nil)
|
|
56
62
|
# Some parameter documentations has been truncated, see
|
|
57
63
|
# {Knockapi::Models::Objects::BulkSetParams::Object} for more details.
|
|
58
64
|
#
|
|
@@ -60,10 +66,12 @@ module Knockapi
|
|
|
60
66
|
#
|
|
61
67
|
# @param id [String] Unique identifier for the object.
|
|
62
68
|
#
|
|
63
|
-
# @param channel_data [Hash{Symbol=>Knockapi::Models::Recipients::
|
|
69
|
+
# @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.
|
|
64
70
|
#
|
|
65
71
|
# @param created_at [Time, nil] Timestamp when the resource was created.
|
|
66
72
|
#
|
|
73
|
+
# @param name [String, nil] An optional name for the object.
|
|
74
|
+
#
|
|
67
75
|
# @param preferences [Hash{Symbol=>Knockapi::Models::Recipients::PreferenceSetRequest}, nil] Inline set preferences for a recipient, where the key is the preference set id.
|
|
68
76
|
end
|
|
69
77
|
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Knockapi
|
|
4
|
+
module Models
|
|
5
|
+
module Recipients
|
|
6
|
+
class AwsSnsPushChannelDataDevicesOnly < Knockapi::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute devices
|
|
8
|
+
# A list of devices. Each device contains a target_arn, and optionally a locale
|
|
9
|
+
# and timezone.
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly::Device>]
|
|
12
|
+
required :devices,
|
|
13
|
+
-> { Knockapi::Internal::Type::ArrayOf[Knockapi::Recipients::AwsSnsPushChannelDataDevicesOnly::Device] }
|
|
14
|
+
|
|
15
|
+
# @!method initialize(devices:)
|
|
16
|
+
# Some parameter documentations has been truncated, see
|
|
17
|
+
# {Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly} for more
|
|
18
|
+
# details.
|
|
19
|
+
#
|
|
20
|
+
# AWS SNS push channel data.
|
|
21
|
+
#
|
|
22
|
+
# @param devices [Array<Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly::Device>] A list of devices. Each device contains a target_arn, and optionally a locale an
|
|
23
|
+
|
|
24
|
+
class Device < Knockapi::Internal::Type::BaseModel
|
|
25
|
+
# @!attribute target_arn
|
|
26
|
+
# The ARN of a platform endpoint associated with a platform application and a
|
|
27
|
+
# device token. See
|
|
28
|
+
# [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
|
|
29
|
+
#
|
|
30
|
+
# @return [String]
|
|
31
|
+
required :target_arn, String
|
|
32
|
+
|
|
33
|
+
# @!attribute locale
|
|
34
|
+
# The locale of the object. Used for
|
|
35
|
+
# [message localization](/concepts/translations).
|
|
36
|
+
#
|
|
37
|
+
# @return [String, nil]
|
|
38
|
+
optional :locale, String, nil?: true
|
|
39
|
+
|
|
40
|
+
# @!attribute timezone
|
|
41
|
+
# The timezone of the object. Must be a
|
|
42
|
+
# valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
|
43
|
+
# Used
|
|
44
|
+
# for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :timezone, String, nil?: true
|
|
48
|
+
|
|
49
|
+
# @!method initialize(target_arn:, locale: nil, timezone: nil)
|
|
50
|
+
# Some parameter documentations has been truncated, see
|
|
51
|
+
# {Knockapi::Models::Recipients::AwsSnsPushChannelDataDevicesOnly::Device} for
|
|
52
|
+
# more details.
|
|
53
|
+
#
|
|
54
|
+
# @param target_arn [String] The ARN of a platform endpoint associated with a platform application and a devi
|
|
55
|
+
#
|
|
56
|
+
# @param locale [String, nil] The locale of the object. Used for [message localization](/concepts/translations
|
|
57
|
+
#
|
|
58
|
+
# @param timezone [String, nil] The timezone of the object. Must be a valid [tz database time zone string](https
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Knockapi
|
|
4
|
+
module Models
|
|
5
|
+
module Recipients
|
|
6
|
+
class AwsSnsPushChannelDataTargetArnsOnly < Knockapi::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute target_arns
|
|
8
|
+
# A list of platform endpoint ARNs. See
|
|
9
|
+
# [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
|
|
10
|
+
#
|
|
11
|
+
# @return [Array<String>]
|
|
12
|
+
required :target_arns, Knockapi::Internal::Type::ArrayOf[String]
|
|
13
|
+
|
|
14
|
+
# @!method initialize(target_arns:)
|
|
15
|
+
# Some parameter documentations has been truncated, see
|
|
16
|
+
# {Knockapi::Models::Recipients::AwsSnsPushChannelDataTargetArnsOnly} for more
|
|
17
|
+
# details.
|
|
18
|
+
#
|
|
19
|
+
# AWS SNS push channel data.
|
|
20
|
+
#
|
|
21
|
+
# @param target_arns [Array<String>] A list of platform endpoint ARNs. See [Setting up an Amazon SNS platform endpoin
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -19,7 +19,7 @@ module Knockapi
|
|
|
19
19
|
# @!attribute data
|
|
20
20
|
# Channel data for a given channel type.
|
|
21
21
|
#
|
|
22
|
-
# @return [Knockapi::Models::Recipients::RecipientsChannelData::Data::PushChannelDataFull, Knockapi::Models::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull, Knockapi::Models::Recipients::
|
|
22
|
+
# @return [Knockapi::Models::Recipients::RecipientsChannelData::Data::PushChannelDataFull, Knockapi::Models::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData]
|
|
23
23
|
required :data, union: -> { Knockapi::Recipients::RecipientsChannelData::Data }
|
|
24
24
|
|
|
25
25
|
# @!attribute provider
|
|
@@ -35,7 +35,7 @@ module Knockapi
|
|
|
35
35
|
#
|
|
36
36
|
# @param channel_id [String] The unique identifier for the channel.
|
|
37
37
|
#
|
|
38
|
-
# @param data [Knockapi::Models::Recipients::RecipientsChannelData::Data::PushChannelDataFull, Knockapi::Models::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull, Knockapi::Models::Recipients::
|
|
38
|
+
# @param data [Knockapi::Models::Recipients::RecipientsChannelData::Data::PushChannelDataFull, Knockapi::Models::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData] Channel data for a given channel type.
|
|
39
39
|
#
|
|
40
40
|
# @param provider [Symbol, Knockapi::Models::Recipients::RecipientsChannelData::Provider] The type of provider.
|
|
41
41
|
|
|
@@ -52,7 +52,7 @@ module Knockapi
|
|
|
52
52
|
variant -> { Knockapi::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull }
|
|
53
53
|
|
|
54
54
|
# OneSignal channel data.
|
|
55
|
-
variant -> { Knockapi::Recipients::
|
|
55
|
+
variant -> { Knockapi::Recipients::OneSignalChannelDataPlayerIDsOnly }
|
|
56
56
|
|
|
57
57
|
# Slack channel data.
|
|
58
58
|
variant -> { Knockapi::Recipients::SlackChannelData }
|
|
@@ -190,21 +190,8 @@ module Knockapi
|
|
|
190
190
|
end
|
|
191
191
|
end
|
|
192
192
|
|
|
193
|
-
class OneSignalChannelDataPlayerIDsOnly < Knockapi::Internal::Type::BaseModel
|
|
194
|
-
# @!attribute player_ids
|
|
195
|
-
# A list of OneSignal player IDs.
|
|
196
|
-
#
|
|
197
|
-
# @return [Array<String>]
|
|
198
|
-
required :player_ids, Knockapi::Internal::Type::ArrayOf[String]
|
|
199
|
-
|
|
200
|
-
# @!method initialize(player_ids:)
|
|
201
|
-
# OneSignal channel data.
|
|
202
|
-
#
|
|
203
|
-
# @param player_ids [Array<String>] A list of OneSignal player IDs.
|
|
204
|
-
end
|
|
205
|
-
|
|
206
193
|
# @!method self.variants
|
|
207
|
-
# @return [Array(Knockapi::Models::Recipients::RecipientsChannelData::Data::PushChannelDataFull, Knockapi::Models::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull, Knockapi::Models::Recipients::
|
|
194
|
+
# @return [Array(Knockapi::Models::Recipients::RecipientsChannelData::Data::PushChannelDataFull, Knockapi::Models::Recipients::RecipientsChannelData::Data::AwssnsPushChannelDataFull, Knockapi::Models::Recipients::OneSignalChannelDataPlayerIDsOnly, Knockapi::Models::Recipients::SlackChannelData, Knockapi::Models::Recipients::MsTeamsChannelData, Knockapi::Models::Recipients::DiscordChannelData)]
|
|
208
195
|
end
|
|
209
196
|
|
|
210
197
|
# The type of provider.
|