zyphr 0.1.3 → 0.1.6

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 (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -3
  3. data/docs/Category.md +4 -2
  4. data/docs/Device.md +10 -12
  5. data/docs/DeviceStats.md +3 -1
  6. data/docs/DevicesApi.md +3 -3
  7. data/docs/PushApi.md +3 -3
  8. data/docs/PushMessage.md +13 -7
  9. data/docs/PushMessageDetail.md +17 -15
  10. data/docs/PushMessageDetailAllOfActionButtons.md +24 -0
  11. data/docs/RegisterDeviceRequest.md +4 -14
  12. data/docs/SMSApi.md +4 -4
  13. data/docs/SendPushRequest.md +35 -15
  14. data/docs/SendPushRequestActionButtonsInner.md +24 -0
  15. data/docs/TemplatesApi.md +2 -2
  16. data/docs/TopicsApi.md +2 -2
  17. data/docs/WaaSApplication.md +4 -2
  18. data/docs/WaaSApplicationsApi.md +1 -1
  19. data/docs/{WebhookWorkspaceMetricsResponse.md → WebhookAccountMetricsResponse.md} +3 -3
  20. data/docs/WebhooksApi.md +70 -70
  21. data/lib/zyphr/api/devices_api.rb +4 -4
  22. data/lib/zyphr/api/push_api.rb +4 -4
  23. data/lib/zyphr/api/sms_api.rb +8 -8
  24. data/lib/zyphr/api/templates_api.rb +4 -4
  25. data/lib/zyphr/api/topics_api.rb +4 -4
  26. data/lib/zyphr/api/waa_s_applications_api.rb +2 -2
  27. data/lib/zyphr/api/webhooks_api.rb +59 -59
  28. data/lib/zyphr/models/category.rb +16 -7
  29. data/lib/zyphr/models/device.rb +34 -57
  30. data/lib/zyphr/models/device_stats.rb +13 -4
  31. data/lib/zyphr/models/push_message.rb +67 -36
  32. data/lib/zyphr/models/push_message_detail.rb +88 -75
  33. data/lib/zyphr/models/push_message_detail_all_of_action_buttons.rb +247 -0
  34. data/lib/zyphr/models/register_device_request.rb +43 -59
  35. data/lib/zyphr/models/send_push_request.rb +278 -91
  36. data/lib/zyphr/models/{push_payload.rb → send_push_request_action_buttons_inner.rb} +72 -73
  37. data/lib/zyphr/models/waa_s_application.rb +16 -7
  38. data/lib/zyphr/models/{webhook_workspace_metrics_response.rb → webhook_account_metrics_response.rb} +4 -4
  39. data/lib/zyphr.rb +3 -2
  40. data/spec/api/devices_api_spec.rb +2 -2
  41. data/spec/api/push_api_spec.rb +2 -2
  42. data/spec/api/sms_api_spec.rb +4 -4
  43. data/spec/api/templates_api_spec.rb +2 -2
  44. data/spec/api/topics_api_spec.rb +2 -2
  45. data/spec/api/waa_s_applications_api_spec.rb +1 -1
  46. data/spec/api/webhooks_api_spec.rb +12 -12
  47. data/spec/models/category_spec.rb +7 -1
  48. data/spec/models/device_spec.rb +5 -15
  49. data/spec/models/device_stats_spec.rb +6 -0
  50. data/spec/models/{push_payload_spec.rb → push_message_detail_all_of_action_buttons_spec.rb} +10 -34
  51. data/spec/models/push_message_detail_spec.rb +26 -20
  52. data/spec/models/push_message_spec.rb +26 -8
  53. data/spec/models/register_device_request_spec.rb +2 -32
  54. data/spec/models/send_push_request_action_buttons_inner_spec.rb +54 -0
  55. data/spec/models/send_push_request_spec.rb +67 -11
  56. data/spec/models/waa_s_application_spec.rb +7 -1
  57. data/spec/models/{webhook_workspace_metrics_response_spec.rb → webhook_account_metrics_response_spec.rb} +6 -6
  58. data/zyphr.gemspec +1 -1
  59. metadata +328 -324
  60. data/docs/PushPayload.md +0 -32
@@ -15,25 +15,16 @@ require 'time'
15
15
 
16
16
  module Zyphr
17
17
  class RegisterDeviceRequest
18
- attr_accessor :subscriber_id
19
-
20
- # External ID to look up subscriber
21
- attr_accessor :external_user_id
18
+ # User or subscriber ID to associate with the device
19
+ attr_accessor :user_id
22
20
 
23
21
  attr_accessor :platform
24
22
 
25
23
  # Push notification token from the device
26
24
  attr_accessor :token
27
25
 
28
- attr_accessor :app_version
29
-
30
- attr_accessor :device_model
31
-
32
- attr_accessor :os_version
33
-
34
- attr_accessor :timezone
35
-
36
- attr_accessor :locale
26
+ # Additional device metadata
27
+ attr_accessor :metadata
37
28
 
38
29
  class EnumAttributeValidator
39
30
  attr_reader :datatype
@@ -60,15 +51,10 @@ module Zyphr
60
51
  # Attribute mapping from ruby-style variable name to JSON key.
61
52
  def self.attribute_map
62
53
  {
63
- :'subscriber_id' => :'subscriber_id',
64
- :'external_user_id' => :'external_user_id',
54
+ :'user_id' => :'user_id',
65
55
  :'platform' => :'platform',
66
56
  :'token' => :'token',
67
- :'app_version' => :'app_version',
68
- :'device_model' => :'device_model',
69
- :'os_version' => :'os_version',
70
- :'timezone' => :'timezone',
71
- :'locale' => :'locale'
57
+ :'metadata' => :'metadata'
72
58
  }
73
59
  end
74
60
 
@@ -85,15 +71,10 @@ module Zyphr
85
71
  # Attribute type mapping.
86
72
  def self.openapi_types
87
73
  {
88
- :'subscriber_id' => :'String',
89
- :'external_user_id' => :'String',
74
+ :'user_id' => :'String',
90
75
  :'platform' => :'String',
91
76
  :'token' => :'String',
92
- :'app_version' => :'String',
93
- :'device_model' => :'String',
94
- :'os_version' => :'String',
95
- :'timezone' => :'String',
96
- :'locale' => :'String'
77
+ :'metadata' => :'Hash<String, Object>'
97
78
  }
98
79
  end
99
80
 
@@ -119,12 +100,10 @@ module Zyphr
119
100
  h[k.to_sym] = v
120
101
  }
121
102
 
122
- if attributes.key?(:'subscriber_id')
123
- self.subscriber_id = attributes[:'subscriber_id']
124
- end
125
-
126
- if attributes.key?(:'external_user_id')
127
- self.external_user_id = attributes[:'external_user_id']
103
+ if attributes.key?(:'user_id')
104
+ self.user_id = attributes[:'user_id']
105
+ else
106
+ self.user_id = nil
128
107
  end
129
108
 
130
109
  if attributes.key?(:'platform')
@@ -139,24 +118,10 @@ module Zyphr
139
118
  self.token = nil
140
119
  end
141
120
 
142
- if attributes.key?(:'app_version')
143
- self.app_version = attributes[:'app_version']
144
- end
145
-
146
- if attributes.key?(:'device_model')
147
- self.device_model = attributes[:'device_model']
148
- end
149
-
150
- if attributes.key?(:'os_version')
151
- self.os_version = attributes[:'os_version']
152
- end
153
-
154
- if attributes.key?(:'timezone')
155
- self.timezone = attributes[:'timezone']
156
- end
157
-
158
- if attributes.key?(:'locale')
159
- self.locale = attributes[:'locale']
121
+ if attributes.key?(:'metadata')
122
+ if (value = attributes[:'metadata']).is_a?(Hash)
123
+ self.metadata = value
124
+ end
160
125
  end
161
126
  end
162
127
 
@@ -165,6 +130,10 @@ module Zyphr
165
130
  def list_invalid_properties
166
131
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
167
132
  invalid_properties = Array.new
133
+ if @user_id.nil?
134
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
135
+ end
136
+
168
137
  if @platform.nil?
169
138
  invalid_properties.push('invalid value for "platform", platform cannot be nil.')
170
139
  end
@@ -173,6 +142,10 @@ module Zyphr
173
142
  invalid_properties.push('invalid value for "token", token cannot be nil.')
174
143
  end
175
144
 
145
+ if @token.to_s.length > 4096
146
+ invalid_properties.push('invalid value for "token", the character length must be smaller than or equal to 4096.')
147
+ end
148
+
176
149
  invalid_properties
177
150
  end
178
151
 
@@ -180,13 +153,25 @@ module Zyphr
180
153
  # @return true if the model is valid
181
154
  def valid?
182
155
  warn '[DEPRECATED] the `valid?` method is obsolete'
156
+ return false if @user_id.nil?
183
157
  return false if @platform.nil?
184
158
  platform_validator = EnumAttributeValidator.new('String', ["ios", "android", "web"])
185
159
  return false unless platform_validator.valid?(@platform)
186
160
  return false if @token.nil?
161
+ return false if @token.to_s.length > 4096
187
162
  true
188
163
  end
189
164
 
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] user_id Value to be assigned
167
+ def user_id=(user_id)
168
+ if user_id.nil?
169
+ fail ArgumentError, 'user_id cannot be nil'
170
+ end
171
+
172
+ @user_id = user_id
173
+ end
174
+
190
175
  # Custom attribute writer method checking allowed values (enum).
191
176
  # @param [Object] platform Object to be assigned
192
177
  def platform=(platform)
@@ -204,6 +189,10 @@ module Zyphr
204
189
  fail ArgumentError, 'token cannot be nil'
205
190
  end
206
191
 
192
+ if token.to_s.length > 4096
193
+ fail ArgumentError, 'invalid value for "token", the character length must be smaller than or equal to 4096.'
194
+ end
195
+
207
196
  @token = token
208
197
  end
209
198
 
@@ -212,15 +201,10 @@ module Zyphr
212
201
  def ==(o)
213
202
  return true if self.equal?(o)
214
203
  self.class == o.class &&
215
- subscriber_id == o.subscriber_id &&
216
- external_user_id == o.external_user_id &&
204
+ user_id == o.user_id &&
217
205
  platform == o.platform &&
218
206
  token == o.token &&
219
- app_version == o.app_version &&
220
- device_model == o.device_model &&
221
- os_version == o.os_version &&
222
- timezone == o.timezone &&
223
- locale == o.locale
207
+ metadata == o.metadata
224
208
  end
225
209
 
226
210
  # @see the `==` method
@@ -232,7 +216,7 @@ module Zyphr
232
216
  # Calculates hash code according to all attributes.
233
217
  # @return [Integer] Hash code
234
218
  def hash
235
- [subscriber_id, external_user_id, platform, token, app_version, device_model, os_version, timezone, locale].hash
219
+ [user_id, platform, token, metadata].hash
236
220
  end
237
221
 
238
222
  # Builds the object from hash
@@ -15,64 +15,83 @@ require 'time'
15
15
 
16
16
  module Zyphr
17
17
  class SendPushRequest
18
- # Send to specific device
18
+ # Send to all devices for a user
19
+ attr_accessor :user_id
20
+
21
+ # Send to a specific device
19
22
  attr_accessor :device_id
20
23
 
21
- # Send to multiple devices
22
- attr_accessor :device_ids
24
+ # Push notification title
25
+ attr_accessor :title
23
26
 
24
- # Send to all subscriber devices
25
- attr_accessor :subscriber_id
27
+ # Push notification body text
28
+ attr_accessor :body
29
+
30
+ # Custom data payload
31
+ attr_accessor :data
32
+
33
+ # Badge count (iOS)
34
+ attr_accessor :badge
26
35
 
27
- # Send to topic subscribers
28
- attr_accessor :topic
36
+ # Notification sound
37
+ attr_accessor :sound
29
38
 
30
- attr_accessor :payload
39
+ # Image URL for rich notifications
40
+ attr_accessor :image_url
31
41
 
32
- attr_accessor :priority
42
+ # Silent/background push notification
43
+ attr_accessor :content_available
33
44
 
34
- # Time-to-live in seconds
35
- attr_accessor :ttl
45
+ # Interactive notification buttons (max 3)
46
+ attr_accessor :action_buttons
47
+
48
+ attr_accessor :tags
49
+
50
+ attr_accessor :metadata
36
51
 
37
52
  # Replace previous notification with same key
38
53
  attr_accessor :collapse_key
39
54
 
40
- attr_accessor :scheduled_at
41
-
42
- class EnumAttributeValidator
43
- attr_reader :datatype
44
- attr_reader :allowable_values
45
-
46
- def initialize(datatype, allowable_values)
47
- @allowable_values = allowable_values.map do |value|
48
- case datatype.to_s
49
- when /Integer/i
50
- value.to_i
51
- when /Float/i
52
- value.to_f
53
- else
54
- value
55
- end
56
- end
57
- end
55
+ # Subscriber ID for preference checking
56
+ attr_accessor :subscriber_id
58
57
 
59
- def valid?(value)
60
- !value || allowable_values.include?(value)
61
- end
62
- end
58
+ # Subscriber external ID for preference checking
59
+ attr_accessor :subscriber_external_id
60
+
61
+ # Notification category for preference checking
62
+ attr_accessor :category
63
+
64
+ # Skip subscriber preference checks
65
+ attr_accessor :force
66
+
67
+ # Schedule for future delivery (ISO 8601)
68
+ attr_accessor :send_at
69
+
70
+ # Delay in seconds before sending
71
+ attr_accessor :delay
63
72
 
64
73
  # Attribute mapping from ruby-style variable name to JSON key.
65
74
  def self.attribute_map
66
75
  {
76
+ :'user_id' => :'user_id',
67
77
  :'device_id' => :'device_id',
68
- :'device_ids' => :'device_ids',
69
- :'subscriber_id' => :'subscriber_id',
70
- :'topic' => :'topic',
71
- :'payload' => :'payload',
72
- :'priority' => :'priority',
73
- :'ttl' => :'ttl',
78
+ :'title' => :'title',
79
+ :'body' => :'body',
80
+ :'data' => :'data',
81
+ :'badge' => :'badge',
82
+ :'sound' => :'sound',
83
+ :'image_url' => :'image_url',
84
+ :'content_available' => :'content_available',
85
+ :'action_buttons' => :'action_buttons',
86
+ :'tags' => :'tags',
87
+ :'metadata' => :'metadata',
74
88
  :'collapse_key' => :'collapse_key',
75
- :'scheduled_at' => :'scheduled_at'
89
+ :'subscriber_id' => :'subscriber_id',
90
+ :'subscriber_external_id' => :'subscriber_external_id',
91
+ :'category' => :'category',
92
+ :'force' => :'force',
93
+ :'send_at' => :'send_at',
94
+ :'delay' => :'delay'
76
95
  }
77
96
  end
78
97
 
@@ -89,15 +108,25 @@ module Zyphr
89
108
  # Attribute type mapping.
90
109
  def self.openapi_types
91
110
  {
111
+ :'user_id' => :'String',
92
112
  :'device_id' => :'String',
93
- :'device_ids' => :'Array<String>',
94
- :'subscriber_id' => :'String',
95
- :'topic' => :'String',
96
- :'payload' => :'PushPayload',
97
- :'priority' => :'String',
98
- :'ttl' => :'Integer',
113
+ :'title' => :'String',
114
+ :'body' => :'String',
115
+ :'data' => :'Hash<String, Object>',
116
+ :'badge' => :'Integer',
117
+ :'sound' => :'String',
118
+ :'image_url' => :'String',
119
+ :'content_available' => :'Boolean',
120
+ :'action_buttons' => :'Array<SendPushRequestActionButtonsInner>',
121
+ :'tags' => :'Array<String>',
122
+ :'metadata' => :'Hash<String, Object>',
99
123
  :'collapse_key' => :'String',
100
- :'scheduled_at' => :'Time'
124
+ :'subscriber_id' => :'String',
125
+ :'subscriber_external_id' => :'String',
126
+ :'category' => :'String',
127
+ :'force' => :'Boolean',
128
+ :'send_at' => :'Time',
129
+ :'delay' => :'Integer'
101
130
  }
102
131
  end
103
132
 
@@ -123,46 +152,88 @@ module Zyphr
123
152
  h[k.to_sym] = v
124
153
  }
125
154
 
155
+ if attributes.key?(:'user_id')
156
+ self.user_id = attributes[:'user_id']
157
+ end
158
+
126
159
  if attributes.key?(:'device_id')
127
160
  self.device_id = attributes[:'device_id']
128
161
  end
129
162
 
130
- if attributes.key?(:'device_ids')
131
- if (value = attributes[:'device_ids']).is_a?(Array)
132
- self.device_ids = value
163
+ if attributes.key?(:'title')
164
+ self.title = attributes[:'title']
165
+ end
166
+
167
+ if attributes.key?(:'body')
168
+ self.body = attributes[:'body']
169
+ end
170
+
171
+ if attributes.key?(:'data')
172
+ if (value = attributes[:'data']).is_a?(Hash)
173
+ self.data = value
133
174
  end
134
175
  end
135
176
 
136
- if attributes.key?(:'subscriber_id')
137
- self.subscriber_id = attributes[:'subscriber_id']
177
+ if attributes.key?(:'badge')
178
+ self.badge = attributes[:'badge']
138
179
  end
139
180
 
140
- if attributes.key?(:'topic')
141
- self.topic = attributes[:'topic']
181
+ if attributes.key?(:'sound')
182
+ self.sound = attributes[:'sound']
142
183
  end
143
184
 
144
- if attributes.key?(:'payload')
145
- self.payload = attributes[:'payload']
146
- else
147
- self.payload = nil
185
+ if attributes.key?(:'image_url')
186
+ self.image_url = attributes[:'image_url']
148
187
  end
149
188
 
150
- if attributes.key?(:'priority')
151
- self.priority = attributes[:'priority']
152
- else
153
- self.priority = 'normal'
189
+ if attributes.key?(:'content_available')
190
+ self.content_available = attributes[:'content_available']
154
191
  end
155
192
 
156
- if attributes.key?(:'ttl')
157
- self.ttl = attributes[:'ttl']
193
+ if attributes.key?(:'action_buttons')
194
+ if (value = attributes[:'action_buttons']).is_a?(Array)
195
+ self.action_buttons = value
196
+ end
197
+ end
198
+
199
+ if attributes.key?(:'tags')
200
+ if (value = attributes[:'tags']).is_a?(Array)
201
+ self.tags = value
202
+ end
203
+ end
204
+
205
+ if attributes.key?(:'metadata')
206
+ if (value = attributes[:'metadata']).is_a?(Hash)
207
+ self.metadata = value
208
+ end
158
209
  end
159
210
 
160
211
  if attributes.key?(:'collapse_key')
161
212
  self.collapse_key = attributes[:'collapse_key']
162
213
  end
163
214
 
164
- if attributes.key?(:'scheduled_at')
165
- self.scheduled_at = attributes[:'scheduled_at']
215
+ if attributes.key?(:'subscriber_id')
216
+ self.subscriber_id = attributes[:'subscriber_id']
217
+ end
218
+
219
+ if attributes.key?(:'subscriber_external_id')
220
+ self.subscriber_external_id = attributes[:'subscriber_external_id']
221
+ end
222
+
223
+ if attributes.key?(:'category')
224
+ self.category = attributes[:'category']
225
+ end
226
+
227
+ if attributes.key?(:'force')
228
+ self.force = attributes[:'force']
229
+ end
230
+
231
+ if attributes.key?(:'send_at')
232
+ self.send_at = attributes[:'send_at']
233
+ end
234
+
235
+ if attributes.key?(:'delay')
236
+ self.delay = attributes[:'delay']
166
237
  end
167
238
  end
168
239
 
@@ -171,8 +242,32 @@ module Zyphr
171
242
  def list_invalid_properties
172
243
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
173
244
  invalid_properties = Array.new
174
- if @payload.nil?
175
- invalid_properties.push('invalid value for "payload", payload cannot be nil.')
245
+ if !@title.nil? && @title.to_s.length > 255
246
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.')
247
+ end
248
+
249
+ if !@body.nil? && @body.to_s.length > 4096
250
+ invalid_properties.push('invalid value for "body", the character length must be smaller than or equal to 4096.')
251
+ end
252
+
253
+ if !@badge.nil? && @badge < 0
254
+ invalid_properties.push('invalid value for "badge", must be greater than or equal to 0.')
255
+ end
256
+
257
+ if !@sound.nil? && @sound.to_s.length > 255
258
+ invalid_properties.push('invalid value for "sound", the character length must be smaller than or equal to 255.')
259
+ end
260
+
261
+ if !@action_buttons.nil? && @action_buttons.length > 3
262
+ invalid_properties.push('invalid value for "action_buttons", number of items must be less than or equal to 3.')
263
+ end
264
+
265
+ if !@tags.nil? && @tags.length > 10
266
+ invalid_properties.push('invalid value for "tags", number of items must be less than or equal to 10.')
267
+ end
268
+
269
+ if !@delay.nil? && @delay < 0
270
+ invalid_properties.push('invalid value for "delay", must be greater than or equal to 0.')
176
271
  end
177
272
 
178
273
  invalid_properties
@@ -182,30 +277,112 @@ module Zyphr
182
277
  # @return true if the model is valid
183
278
  def valid?
184
279
  warn '[DEPRECATED] the `valid?` method is obsolete'
185
- return false if @payload.nil?
186
- priority_validator = EnumAttributeValidator.new('String', ["low", "normal", "high", "urgent"])
187
- return false unless priority_validator.valid?(@priority)
280
+ return false if !@title.nil? && @title.to_s.length > 255
281
+ return false if !@body.nil? && @body.to_s.length > 4096
282
+ return false if !@badge.nil? && @badge < 0
283
+ return false if !@sound.nil? && @sound.to_s.length > 255
284
+ return false if !@action_buttons.nil? && @action_buttons.length > 3
285
+ return false if !@tags.nil? && @tags.length > 10
286
+ return false if !@delay.nil? && @delay < 0
188
287
  true
189
288
  end
190
289
 
191
290
  # Custom attribute writer method with validation
192
- # @param [Object] payload Value to be assigned
193
- def payload=(payload)
194
- if payload.nil?
195
- fail ArgumentError, 'payload cannot be nil'
291
+ # @param [Object] title Value to be assigned
292
+ def title=(title)
293
+ if title.nil?
294
+ fail ArgumentError, 'title cannot be nil'
295
+ end
296
+
297
+ if title.to_s.length > 255
298
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 255.'
299
+ end
300
+
301
+ @title = title
302
+ end
303
+
304
+ # Custom attribute writer method with validation
305
+ # @param [Object] body Value to be assigned
306
+ def body=(body)
307
+ if body.nil?
308
+ fail ArgumentError, 'body cannot be nil'
309
+ end
310
+
311
+ if body.to_s.length > 4096
312
+ fail ArgumentError, 'invalid value for "body", the character length must be smaller than or equal to 4096.'
313
+ end
314
+
315
+ @body = body
316
+ end
317
+
318
+ # Custom attribute writer method with validation
319
+ # @param [Object] badge Value to be assigned
320
+ def badge=(badge)
321
+ if badge.nil?
322
+ fail ArgumentError, 'badge cannot be nil'
323
+ end
324
+
325
+ if badge < 0
326
+ fail ArgumentError, 'invalid value for "badge", must be greater than or equal to 0.'
327
+ end
328
+
329
+ @badge = badge
330
+ end
331
+
332
+ # Custom attribute writer method with validation
333
+ # @param [Object] sound Value to be assigned
334
+ def sound=(sound)
335
+ if sound.nil?
336
+ fail ArgumentError, 'sound cannot be nil'
337
+ end
338
+
339
+ if sound.to_s.length > 255
340
+ fail ArgumentError, 'invalid value for "sound", the character length must be smaller than or equal to 255.'
341
+ end
342
+
343
+ @sound = sound
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] action_buttons Value to be assigned
348
+ def action_buttons=(action_buttons)
349
+ if action_buttons.nil?
350
+ fail ArgumentError, 'action_buttons cannot be nil'
351
+ end
352
+
353
+ if action_buttons.length > 3
354
+ fail ArgumentError, 'invalid value for "action_buttons", number of items must be less than or equal to 3.'
355
+ end
356
+
357
+ @action_buttons = action_buttons
358
+ end
359
+
360
+ # Custom attribute writer method with validation
361
+ # @param [Object] tags Value to be assigned
362
+ def tags=(tags)
363
+ if tags.nil?
364
+ fail ArgumentError, 'tags cannot be nil'
365
+ end
366
+
367
+ if tags.length > 10
368
+ fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 10.'
196
369
  end
197
370
 
198
- @payload = payload
371
+ @tags = tags
199
372
  end
200
373
 
201
- # Custom attribute writer method checking allowed values (enum).
202
- # @param [Object] priority Object to be assigned
203
- def priority=(priority)
204
- validator = EnumAttributeValidator.new('String', ["low", "normal", "high", "urgent"])
205
- unless validator.valid?(priority)
206
- fail ArgumentError, "invalid value for \"priority\", must be one of #{validator.allowable_values}."
374
+ # Custom attribute writer method with validation
375
+ # @param [Object] delay Value to be assigned
376
+ def delay=(delay)
377
+ if delay.nil?
378
+ fail ArgumentError, 'delay cannot be nil'
379
+ end
380
+
381
+ if delay < 0
382
+ fail ArgumentError, 'invalid value for "delay", must be greater than or equal to 0.'
207
383
  end
208
- @priority = priority
384
+
385
+ @delay = delay
209
386
  end
210
387
 
211
388
  # Checks equality by comparing each attribute.
@@ -213,15 +390,25 @@ module Zyphr
213
390
  def ==(o)
214
391
  return true if self.equal?(o)
215
392
  self.class == o.class &&
393
+ user_id == o.user_id &&
216
394
  device_id == o.device_id &&
217
- device_ids == o.device_ids &&
218
- subscriber_id == o.subscriber_id &&
219
- topic == o.topic &&
220
- payload == o.payload &&
221
- priority == o.priority &&
222
- ttl == o.ttl &&
395
+ title == o.title &&
396
+ body == o.body &&
397
+ data == o.data &&
398
+ badge == o.badge &&
399
+ sound == o.sound &&
400
+ image_url == o.image_url &&
401
+ content_available == o.content_available &&
402
+ action_buttons == o.action_buttons &&
403
+ tags == o.tags &&
404
+ metadata == o.metadata &&
223
405
  collapse_key == o.collapse_key &&
224
- scheduled_at == o.scheduled_at
406
+ subscriber_id == o.subscriber_id &&
407
+ subscriber_external_id == o.subscriber_external_id &&
408
+ category == o.category &&
409
+ force == o.force &&
410
+ send_at == o.send_at &&
411
+ delay == o.delay
225
412
  end
226
413
 
227
414
  # @see the `==` method
@@ -233,7 +420,7 @@ module Zyphr
233
420
  # Calculates hash code according to all attributes.
234
421
  # @return [Integer] Hash code
235
422
  def hash
236
- [device_id, device_ids, subscriber_id, topic, payload, priority, ttl, collapse_key, scheduled_at].hash
423
+ [user_id, device_id, title, body, data, badge, sound, image_url, content_available, action_buttons, tags, metadata, collapse_key, subscriber_id, subscriber_external_id, category, force, send_at, delay].hash
237
424
  end
238
425
 
239
426
  # Builds the object from hash