trycourier 3.4.0.pre.alpha4 → 3.4.0.pre.alpha6

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/trycourier/internal/type/base_model.rb +3 -5
  5. data/lib/trycourier/models/audience.rb +1 -0
  6. data/lib/trycourier/models/audit_event.rb +1 -0
  7. data/lib/trycourier/models/brand.rb +1 -0
  8. data/lib/trycourier/models/message_details.rb +1 -0
  9. data/lib/trycourier/models/notification_get_content.rb +1 -0
  10. data/lib/trycourier/models/recipient.rb +2 -2
  11. data/lib/trycourier/models/subscription_list.rb +1 -0
  12. data/lib/trycourier/models/tenant.rb +1 -0
  13. data/lib/trycourier/models/user_recipient.rb +2 -2
  14. data/lib/trycourier/models/users/preference_retrieve_response.rb +3 -3
  15. data/lib/trycourier/models/users/preference_retrieve_topic_response.rb +3 -3
  16. data/lib/trycourier/models/users/token_add_single_params.rb +1 -1
  17. data/lib/trycourier/models/users/token_list_response.rb +1 -1
  18. data/lib/trycourier/models/users/token_retrieve_response.rb +1 -1
  19. data/lib/trycourier/models/users/topic_preference.rb +55 -0
  20. data/lib/trycourier/models/users/user_token.rb +183 -0
  21. data/lib/trycourier/models.rb +0 -4
  22. data/lib/trycourier/resources/users/tokens.rb +5 -5
  23. data/lib/trycourier/version.rb +1 -1
  24. data/lib/trycourier.rb +2 -2
  25. data/rbi/trycourier/models/recipient.rbi +2 -2
  26. data/rbi/trycourier/models/user_recipient.rbi +2 -2
  27. data/rbi/trycourier/models/users/preference_retrieve_response.rbi +3 -3
  28. data/rbi/trycourier/models/users/preference_retrieve_topic_response.rbi +4 -4
  29. data/rbi/trycourier/models/users/token_add_single_params.rbi +1 -1
  30. data/rbi/trycourier/models/users/token_list_response.rbi +1 -1
  31. data/rbi/trycourier/models/users/token_retrieve_response.rbi +1 -1
  32. data/rbi/trycourier/models/users/topic_preference.rbi +80 -0
  33. data/rbi/trycourier/models/users/user_token.rbi +291 -0
  34. data/rbi/trycourier/models.rbi +0 -4
  35. data/rbi/trycourier/resources/users/tokens.rbi +6 -5
  36. data/sig/trycourier/models/users/preference_retrieve_response.rbs +4 -4
  37. data/sig/trycourier/models/users/preference_retrieve_topic_response.rbs +4 -4
  38. data/sig/trycourier/models/users/token_add_single_params.rbs +1 -1
  39. data/sig/trycourier/models/users/token_list_response.rbs +1 -1
  40. data/sig/trycourier/models/users/token_retrieve_response.rbs +1 -1
  41. data/sig/trycourier/models/users/topic_preference.rbs +47 -0
  42. data/sig/trycourier/models/users/user_token.rbs +141 -0
  43. data/sig/trycourier/models.rbs +0 -4
  44. data/sig/trycourier/resources/users/tokens.rbs +4 -4
  45. metadata +8 -8
  46. data/lib/trycourier/models/topic_preference.rb +0 -53
  47. data/lib/trycourier/models/user_token.rb +0 -179
  48. data/rbi/trycourier/models/topic_preference.rbi +0 -75
  49. data/rbi/trycourier/models/user_token.rbi +0 -267
  50. data/sig/trycourier/models/topic_preference.rbs +0 -45
  51. data/sig/trycourier/models/user_token.rbs +0 -137
@@ -1,267 +0,0 @@
1
- # typed: strong
2
-
3
- module Trycourier
4
- module Models
5
- class UserToken < Trycourier::Internal::Type::BaseModel
6
- OrHash =
7
- T.type_alias do
8
- T.any(Trycourier::UserToken, Trycourier::Internal::AnyHash)
9
- end
10
-
11
- sig { returns(Trycourier::UserToken::ProviderKey::TaggedSymbol) }
12
- attr_accessor :provider_key
13
-
14
- # Full body of the token. Must match token in URL.
15
- sig { returns(T.nilable(String)) }
16
- attr_accessor :token
17
-
18
- # Information about the device the token is associated with.
19
- sig { returns(T.nilable(Trycourier::UserToken::Device)) }
20
- attr_reader :device
21
-
22
- sig do
23
- params(device: T.nilable(Trycourier::UserToken::Device::OrHash)).void
24
- end
25
- attr_writer :device
26
-
27
- # ISO 8601 formatted date the token expires. Defaults to 2 months. Set to false to
28
- # disable expiration.
29
- sig { returns(T.nilable(Trycourier::UserToken::ExpiryDate::Variants)) }
30
- attr_accessor :expiry_date
31
-
32
- # Properties sent to the provider along with the token
33
- sig { returns(T.nilable(T.anything)) }
34
- attr_reader :properties
35
-
36
- sig { params(properties: T.anything).void }
37
- attr_writer :properties
38
-
39
- # Information about the device the token is associated with.
40
- sig { returns(T.nilable(Trycourier::UserToken::Tracking)) }
41
- attr_reader :tracking
42
-
43
- sig do
44
- params(
45
- tracking: T.nilable(Trycourier::UserToken::Tracking::OrHash)
46
- ).void
47
- end
48
- attr_writer :tracking
49
-
50
- sig do
51
- params(
52
- provider_key: Trycourier::UserToken::ProviderKey::OrSymbol,
53
- token: T.nilable(String),
54
- device: T.nilable(Trycourier::UserToken::Device::OrHash),
55
- expiry_date: T.nilable(Trycourier::UserToken::ExpiryDate::Variants),
56
- properties: T.anything,
57
- tracking: T.nilable(Trycourier::UserToken::Tracking::OrHash)
58
- ).returns(T.attached_class)
59
- end
60
- def self.new(
61
- provider_key:,
62
- # Full body of the token. Must match token in URL.
63
- token: nil,
64
- # Information about the device the token is associated with.
65
- device: nil,
66
- # ISO 8601 formatted date the token expires. Defaults to 2 months. Set to false to
67
- # disable expiration.
68
- expiry_date: nil,
69
- # Properties sent to the provider along with the token
70
- properties: nil,
71
- # Information about the device the token is associated with.
72
- tracking: nil
73
- )
74
- end
75
-
76
- sig do
77
- override.returns(
78
- {
79
- provider_key: Trycourier::UserToken::ProviderKey::TaggedSymbol,
80
- token: T.nilable(String),
81
- device: T.nilable(Trycourier::UserToken::Device),
82
- expiry_date: T.nilable(Trycourier::UserToken::ExpiryDate::Variants),
83
- properties: T.anything,
84
- tracking: T.nilable(Trycourier::UserToken::Tracking)
85
- }
86
- )
87
- end
88
- def to_hash
89
- end
90
-
91
- module ProviderKey
92
- extend Trycourier::Internal::Type::Enum
93
-
94
- TaggedSymbol =
95
- T.type_alias { T.all(Symbol, Trycourier::UserToken::ProviderKey) }
96
- OrSymbol = T.type_alias { T.any(Symbol, String) }
97
-
98
- FIREBASE_FCM =
99
- T.let(
100
- :"firebase-fcm",
101
- Trycourier::UserToken::ProviderKey::TaggedSymbol
102
- )
103
- APN = T.let(:apn, Trycourier::UserToken::ProviderKey::TaggedSymbol)
104
- EXPO = T.let(:expo, Trycourier::UserToken::ProviderKey::TaggedSymbol)
105
- ONESIGNAL =
106
- T.let(:onesignal, Trycourier::UserToken::ProviderKey::TaggedSymbol)
107
-
108
- sig do
109
- override.returns(
110
- T::Array[Trycourier::UserToken::ProviderKey::TaggedSymbol]
111
- )
112
- end
113
- def self.values
114
- end
115
- end
116
-
117
- class Device < Trycourier::Internal::Type::BaseModel
118
- OrHash =
119
- T.type_alias do
120
- T.any(Trycourier::UserToken::Device, Trycourier::Internal::AnyHash)
121
- end
122
-
123
- # Id of the advertising identifier
124
- sig { returns(T.nilable(String)) }
125
- attr_accessor :ad_id
126
-
127
- # Id of the application the token is used for
128
- sig { returns(T.nilable(String)) }
129
- attr_accessor :app_id
130
-
131
- # Id of the device the token is associated with
132
- sig { returns(T.nilable(String)) }
133
- attr_accessor :device_id
134
-
135
- # The device manufacturer
136
- sig { returns(T.nilable(String)) }
137
- attr_accessor :manufacturer
138
-
139
- # The device model
140
- sig { returns(T.nilable(String)) }
141
- attr_accessor :model
142
-
143
- # The device platform i.e. android, ios, web
144
- sig { returns(T.nilable(String)) }
145
- attr_accessor :platform
146
-
147
- # Information about the device the token is associated with.
148
- sig do
149
- params(
150
- ad_id: T.nilable(String),
151
- app_id: T.nilable(String),
152
- device_id: T.nilable(String),
153
- manufacturer: T.nilable(String),
154
- model: T.nilable(String),
155
- platform: T.nilable(String)
156
- ).returns(T.attached_class)
157
- end
158
- def self.new(
159
- # Id of the advertising identifier
160
- ad_id: nil,
161
- # Id of the application the token is used for
162
- app_id: nil,
163
- # Id of the device the token is associated with
164
- device_id: nil,
165
- # The device manufacturer
166
- manufacturer: nil,
167
- # The device model
168
- model: nil,
169
- # The device platform i.e. android, ios, web
170
- platform: nil
171
- )
172
- end
173
-
174
- sig do
175
- override.returns(
176
- {
177
- ad_id: T.nilable(String),
178
- app_id: T.nilable(String),
179
- device_id: T.nilable(String),
180
- manufacturer: T.nilable(String),
181
- model: T.nilable(String),
182
- platform: T.nilable(String)
183
- }
184
- )
185
- end
186
- def to_hash
187
- end
188
- end
189
-
190
- # ISO 8601 formatted date the token expires. Defaults to 2 months. Set to false to
191
- # disable expiration.
192
- module ExpiryDate
193
- extend Trycourier::Internal::Type::Union
194
-
195
- Variants = T.type_alias { T.any(String, T::Boolean) }
196
-
197
- sig do
198
- override.returns(
199
- T::Array[Trycourier::UserToken::ExpiryDate::Variants]
200
- )
201
- end
202
- def self.variants
203
- end
204
- end
205
-
206
- class Tracking < Trycourier::Internal::Type::BaseModel
207
- OrHash =
208
- T.type_alias do
209
- T.any(
210
- Trycourier::UserToken::Tracking,
211
- Trycourier::Internal::AnyHash
212
- )
213
- end
214
-
215
- # The IP address of the device
216
- sig { returns(T.nilable(String)) }
217
- attr_accessor :ip
218
-
219
- # The latitude of the device
220
- sig { returns(T.nilable(String)) }
221
- attr_accessor :lat
222
-
223
- # The longitude of the device
224
- sig { returns(T.nilable(String)) }
225
- attr_accessor :long
226
-
227
- # The operating system version
228
- sig { returns(T.nilable(String)) }
229
- attr_accessor :os_version
230
-
231
- # Information about the device the token is associated with.
232
- sig do
233
- params(
234
- ip: T.nilable(String),
235
- lat: T.nilable(String),
236
- long: T.nilable(String),
237
- os_version: T.nilable(String)
238
- ).returns(T.attached_class)
239
- end
240
- def self.new(
241
- # The IP address of the device
242
- ip: nil,
243
- # The latitude of the device
244
- lat: nil,
245
- # The longitude of the device
246
- long: nil,
247
- # The operating system version
248
- os_version: nil
249
- )
250
- end
251
-
252
- sig do
253
- override.returns(
254
- {
255
- ip: T.nilable(String),
256
- lat: T.nilable(String),
257
- long: T.nilable(String),
258
- os_version: T.nilable(String)
259
- }
260
- )
261
- end
262
- def to_hash
263
- end
264
- end
265
- end
266
- end
267
- end
@@ -1,45 +0,0 @@
1
- module Trycourier
2
- module Models
3
- type topic_preference =
4
- {
5
- default_status: Trycourier::Models::preference_status,
6
- status: Trycourier::Models::preference_status,
7
- topic_id: String,
8
- topic_name: String,
9
- custom_routing: ::Array[Trycourier::Models::channel_classification]?,
10
- has_custom_routing: bool?
11
- }
12
-
13
- class TopicPreference < Trycourier::Internal::Type::BaseModel
14
- attr_accessor default_status: Trycourier::Models::preference_status
15
-
16
- attr_accessor status: Trycourier::Models::preference_status
17
-
18
- attr_accessor topic_id: String
19
-
20
- attr_accessor topic_name: String
21
-
22
- attr_accessor custom_routing: ::Array[Trycourier::Models::channel_classification]?
23
-
24
- attr_accessor has_custom_routing: bool?
25
-
26
- def initialize: (
27
- default_status: Trycourier::Models::preference_status,
28
- status: Trycourier::Models::preference_status,
29
- topic_id: String,
30
- topic_name: String,
31
- ?custom_routing: ::Array[Trycourier::Models::channel_classification]?,
32
- ?has_custom_routing: bool?
33
- ) -> void
34
-
35
- def to_hash: -> {
36
- default_status: Trycourier::Models::preference_status,
37
- status: Trycourier::Models::preference_status,
38
- topic_id: String,
39
- topic_name: String,
40
- custom_routing: ::Array[Trycourier::Models::channel_classification]?,
41
- has_custom_routing: bool?
42
- }
43
- end
44
- end
45
- end
@@ -1,137 +0,0 @@
1
- module Trycourier
2
- module Models
3
- type user_token =
4
- {
5
- provider_key: Trycourier::Models::UserToken::provider_key,
6
- token: String?,
7
- device: Trycourier::UserToken::Device?,
8
- expiry_date: Trycourier::Models::UserToken::expiry_date?,
9
- properties: top,
10
- tracking: Trycourier::UserToken::Tracking?
11
- }
12
-
13
- class UserToken < Trycourier::Internal::Type::BaseModel
14
- attr_accessor provider_key: Trycourier::Models::UserToken::provider_key
15
-
16
- attr_accessor token: String?
17
-
18
- attr_accessor device: Trycourier::UserToken::Device?
19
-
20
- attr_accessor expiry_date: Trycourier::Models::UserToken::expiry_date?
21
-
22
- attr_reader properties: top?
23
-
24
- def properties=: (top) -> top
25
-
26
- attr_accessor tracking: Trycourier::UserToken::Tracking?
27
-
28
- def initialize: (
29
- provider_key: Trycourier::Models::UserToken::provider_key,
30
- ?token: String?,
31
- ?device: Trycourier::UserToken::Device?,
32
- ?expiry_date: Trycourier::Models::UserToken::expiry_date?,
33
- ?properties: top,
34
- ?tracking: Trycourier::UserToken::Tracking?
35
- ) -> void
36
-
37
- def to_hash: -> {
38
- provider_key: Trycourier::Models::UserToken::provider_key,
39
- token: String?,
40
- device: Trycourier::UserToken::Device?,
41
- expiry_date: Trycourier::Models::UserToken::expiry_date?,
42
- properties: top,
43
- tracking: Trycourier::UserToken::Tracking?
44
- }
45
-
46
- type provider_key = :"firebase-fcm" | :apn | :expo | :onesignal
47
-
48
- module ProviderKey
49
- extend Trycourier::Internal::Type::Enum
50
-
51
- FIREBASE_FCM: :"firebase-fcm"
52
- APN: :apn
53
- EXPO: :expo
54
- ONESIGNAL: :onesignal
55
-
56
- def self?.values: -> ::Array[Trycourier::Models::UserToken::provider_key]
57
- end
58
-
59
- type device =
60
- {
61
- ad_id: String?,
62
- app_id: String?,
63
- device_id: String?,
64
- manufacturer: String?,
65
- model: String?,
66
- platform: String?
67
- }
68
-
69
- class Device < Trycourier::Internal::Type::BaseModel
70
- attr_accessor ad_id: String?
71
-
72
- attr_accessor app_id: String?
73
-
74
- attr_accessor device_id: String?
75
-
76
- attr_accessor manufacturer: String?
77
-
78
- attr_accessor model: String?
79
-
80
- attr_accessor platform: String?
81
-
82
- def initialize: (
83
- ?ad_id: String?,
84
- ?app_id: String?,
85
- ?device_id: String?,
86
- ?manufacturer: String?,
87
- ?model: String?,
88
- ?platform: String?
89
- ) -> void
90
-
91
- def to_hash: -> {
92
- ad_id: String?,
93
- app_id: String?,
94
- device_id: String?,
95
- manufacturer: String?,
96
- model: String?,
97
- platform: String?
98
- }
99
- end
100
-
101
- type expiry_date = String | bool
102
-
103
- module ExpiryDate
104
- extend Trycourier::Internal::Type::Union
105
-
106
- def self?.variants: -> ::Array[Trycourier::Models::UserToken::expiry_date]
107
- end
108
-
109
- type tracking =
110
- { ip: String?, lat: String?, long: String?, os_version: String? }
111
-
112
- class Tracking < Trycourier::Internal::Type::BaseModel
113
- attr_accessor ip: String?
114
-
115
- attr_accessor lat: String?
116
-
117
- attr_accessor long: String?
118
-
119
- attr_accessor os_version: String?
120
-
121
- def initialize: (
122
- ?ip: String?,
123
- ?lat: String?,
124
- ?long: String?,
125
- ?os_version: String?
126
- ) -> void
127
-
128
- def to_hash: -> {
129
- ip: String?,
130
- lat: String?,
131
- long: String?,
132
- os_version: String?
133
- }
134
- end
135
- end
136
- end
137
- end