zyphr 0.1.4 → 0.1.8

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.
@@ -19,22 +19,28 @@ module Zyphr
19
19
 
20
20
  attr_accessor :device_id
21
21
 
22
- attr_accessor :subscriber_id
22
+ attr_accessor :user_id
23
+
24
+ attr_accessor :platform
23
25
 
24
26
  attr_accessor :title
25
27
 
26
28
  attr_accessor :body
27
29
 
30
+ attr_accessor :data
31
+
28
32
  attr_accessor :status
29
33
 
30
- attr_accessor :platform
34
+ attr_accessor :tags
31
35
 
32
- attr_accessor :created_at
36
+ attr_accessor :queued_at
33
37
 
34
38
  attr_accessor :sent_at
35
39
 
36
40
  attr_accessor :delivered_at
37
41
 
42
+ attr_accessor :created_at
43
+
38
44
  class EnumAttributeValidator
39
45
  attr_reader :datatype
40
46
  attr_reader :allowable_values
@@ -62,14 +68,17 @@ module Zyphr
62
68
  {
63
69
  :'id' => :'id',
64
70
  :'device_id' => :'device_id',
65
- :'subscriber_id' => :'subscriber_id',
71
+ :'user_id' => :'user_id',
72
+ :'platform' => :'platform',
66
73
  :'title' => :'title',
67
74
  :'body' => :'body',
75
+ :'data' => :'data',
68
76
  :'status' => :'status',
69
- :'platform' => :'platform',
70
- :'created_at' => :'created_at',
77
+ :'tags' => :'tags',
78
+ :'queued_at' => :'queued_at',
71
79
  :'sent_at' => :'sent_at',
72
- :'delivered_at' => :'delivered_at'
80
+ :'delivered_at' => :'delivered_at',
81
+ :'created_at' => :'created_at'
73
82
  }
74
83
  end
75
84
 
@@ -88,23 +97,26 @@ module Zyphr
88
97
  {
89
98
  :'id' => :'String',
90
99
  :'device_id' => :'String',
91
- :'subscriber_id' => :'String',
100
+ :'user_id' => :'String',
101
+ :'platform' => :'String',
92
102
  :'title' => :'String',
93
103
  :'body' => :'String',
104
+ :'data' => :'Hash<String, Object>',
94
105
  :'status' => :'String',
95
- :'platform' => :'String',
96
- :'created_at' => :'Time',
106
+ :'tags' => :'Array<String>',
107
+ :'queued_at' => :'Time',
97
108
  :'sent_at' => :'Time',
98
- :'delivered_at' => :'Time'
109
+ :'delivered_at' => :'Time',
110
+ :'created_at' => :'Time'
99
111
  }
100
112
  end
101
113
 
102
114
  # List of attributes with nullable: true
103
115
  def self.openapi_nullable
104
116
  Set.new([
105
- :'subscriber_id',
117
+ :'queued_at',
106
118
  :'sent_at',
107
- :'delivered_at'
119
+ :'delivered_at',
108
120
  ])
109
121
  end
110
122
 
@@ -132,8 +144,12 @@ module Zyphr
132
144
  self.device_id = attributes[:'device_id']
133
145
  end
134
146
 
135
- if attributes.key?(:'subscriber_id')
136
- self.subscriber_id = attributes[:'subscriber_id']
147
+ if attributes.key?(:'user_id')
148
+ self.user_id = attributes[:'user_id']
149
+ end
150
+
151
+ if attributes.key?(:'platform')
152
+ self.platform = attributes[:'platform']
137
153
  end
138
154
 
139
155
  if attributes.key?(:'title')
@@ -144,16 +160,24 @@ module Zyphr
144
160
  self.body = attributes[:'body']
145
161
  end
146
162
 
163
+ if attributes.key?(:'data')
164
+ if (value = attributes[:'data']).is_a?(Hash)
165
+ self.data = value
166
+ end
167
+ end
168
+
147
169
  if attributes.key?(:'status')
148
170
  self.status = attributes[:'status']
149
171
  end
150
172
 
151
- if attributes.key?(:'platform')
152
- self.platform = attributes[:'platform']
173
+ if attributes.key?(:'tags')
174
+ if (value = attributes[:'tags']).is_a?(Array)
175
+ self.tags = value
176
+ end
153
177
  end
154
178
 
155
- if attributes.key?(:'created_at')
156
- self.created_at = attributes[:'created_at']
179
+ if attributes.key?(:'queued_at')
180
+ self.queued_at = attributes[:'queued_at']
157
181
  end
158
182
 
159
183
  if attributes.key?(:'sent_at')
@@ -163,6 +187,10 @@ module Zyphr
163
187
  if attributes.key?(:'delivered_at')
164
188
  self.delivered_at = attributes[:'delivered_at']
165
189
  end
190
+
191
+ if attributes.key?(:'created_at')
192
+ self.created_at = attributes[:'created_at']
193
+ end
166
194
  end
167
195
 
168
196
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -177,23 +205,13 @@ module Zyphr
177
205
  # @return true if the model is valid
178
206
  def valid?
179
207
  warn '[DEPRECATED] the `valid?` method is obsolete'
180
- status_validator = EnumAttributeValidator.new('String', ["pending", "queued", "sent", "delivered", "failed"])
181
- return false unless status_validator.valid?(@status)
182
208
  platform_validator = EnumAttributeValidator.new('String', ["ios", "android", "web"])
183
209
  return false unless platform_validator.valid?(@platform)
210
+ status_validator = EnumAttributeValidator.new('String', ["queued", "sending", "sent", "delivered", "failed", "expired"])
211
+ return false unless status_validator.valid?(@status)
184
212
  true
185
213
  end
186
214
 
187
- # Custom attribute writer method checking allowed values (enum).
188
- # @param [Object] status Object to be assigned
189
- def status=(status)
190
- validator = EnumAttributeValidator.new('String', ["pending", "queued", "sent", "delivered", "failed"])
191
- unless validator.valid?(status)
192
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
193
- end
194
- @status = status
195
- end
196
-
197
215
  # Custom attribute writer method checking allowed values (enum).
198
216
  # @param [Object] platform Object to be assigned
199
217
  def platform=(platform)
@@ -204,6 +222,16 @@ module Zyphr
204
222
  @platform = platform
205
223
  end
206
224
 
225
+ # Custom attribute writer method checking allowed values (enum).
226
+ # @param [Object] status Object to be assigned
227
+ def status=(status)
228
+ validator = EnumAttributeValidator.new('String', ["queued", "sending", "sent", "delivered", "failed", "expired"])
229
+ unless validator.valid?(status)
230
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
231
+ end
232
+ @status = status
233
+ end
234
+
207
235
  # Checks equality by comparing each attribute.
208
236
  # @param [Object] Object to be compared
209
237
  def ==(o)
@@ -211,14 +239,17 @@ module Zyphr
211
239
  self.class == o.class &&
212
240
  id == o.id &&
213
241
  device_id == o.device_id &&
214
- subscriber_id == o.subscriber_id &&
242
+ user_id == o.user_id &&
243
+ platform == o.platform &&
215
244
  title == o.title &&
216
245
  body == o.body &&
246
+ data == o.data &&
217
247
  status == o.status &&
218
- platform == o.platform &&
219
- created_at == o.created_at &&
248
+ tags == o.tags &&
249
+ queued_at == o.queued_at &&
220
250
  sent_at == o.sent_at &&
221
- delivered_at == o.delivered_at
251
+ delivered_at == o.delivered_at &&
252
+ created_at == o.created_at
222
253
  end
223
254
 
224
255
  # @see the `==` method
@@ -230,7 +261,7 @@ module Zyphr
230
261
  # Calculates hash code according to all attributes.
231
262
  # @return [Integer] Hash code
232
263
  def hash
233
- [id, device_id, subscriber_id, title, body, status, platform, created_at, sent_at, delivered_at].hash
264
+ [id, device_id, user_id, platform, title, body, data, status, tags, queued_at, sent_at, delivered_at, created_at].hash
234
265
  end
235
266
 
236
267
  # Builds the object from hash
@@ -19,27 +19,29 @@ module Zyphr
19
19
 
20
20
  attr_accessor :device_id
21
21
 
22
- attr_accessor :subscriber_id
22
+ attr_accessor :user_id
23
+
24
+ attr_accessor :platform
23
25
 
24
26
  attr_accessor :title
25
27
 
26
28
  attr_accessor :body
27
29
 
30
+ attr_accessor :data
31
+
28
32
  attr_accessor :status
29
33
 
30
- attr_accessor :platform
34
+ attr_accessor :tags
31
35
 
32
- attr_accessor :created_at
36
+ attr_accessor :queued_at
33
37
 
34
38
  attr_accessor :sent_at
35
39
 
36
40
  attr_accessor :delivered_at
37
41
 
38
- attr_accessor :batch_id
39
-
40
- attr_accessor :user_id
42
+ attr_accessor :created_at
41
43
 
42
- attr_accessor :data
44
+ attr_accessor :batch_id
43
45
 
44
46
  attr_accessor :badge
45
47
 
@@ -47,16 +49,16 @@ module Zyphr
47
49
 
48
50
  attr_accessor :image_url
49
51
 
52
+ attr_accessor :content_available
53
+
54
+ attr_accessor :action_buttons
55
+
50
56
  attr_accessor :status_reason
51
57
 
52
58
  attr_accessor :provider_message_id
53
59
 
54
- attr_accessor :tags
55
-
56
60
  attr_accessor :metadata
57
61
 
58
- attr_accessor :queued_at
59
-
60
62
  attr_accessor :failed_at
61
63
 
62
64
  attr_accessor :events
@@ -88,25 +90,26 @@ module Zyphr
88
90
  {
89
91
  :'id' => :'id',
90
92
  :'device_id' => :'device_id',
91
- :'subscriber_id' => :'subscriber_id',
93
+ :'user_id' => :'user_id',
94
+ :'platform' => :'platform',
92
95
  :'title' => :'title',
93
96
  :'body' => :'body',
97
+ :'data' => :'data',
94
98
  :'status' => :'status',
95
- :'platform' => :'platform',
96
- :'created_at' => :'created_at',
99
+ :'tags' => :'tags',
100
+ :'queued_at' => :'queued_at',
97
101
  :'sent_at' => :'sent_at',
98
102
  :'delivered_at' => :'delivered_at',
103
+ :'created_at' => :'created_at',
99
104
  :'batch_id' => :'batch_id',
100
- :'user_id' => :'user_id',
101
- :'data' => :'data',
102
105
  :'badge' => :'badge',
103
106
  :'sound' => :'sound',
104
107
  :'image_url' => :'image_url',
108
+ :'content_available' => :'content_available',
109
+ :'action_buttons' => :'action_buttons',
105
110
  :'status_reason' => :'status_reason',
106
111
  :'provider_message_id' => :'provider_message_id',
107
- :'tags' => :'tags',
108
112
  :'metadata' => :'metadata',
109
- :'queued_at' => :'queued_at',
110
113
  :'failed_at' => :'failed_at',
111
114
  :'events' => :'events'
112
115
  }
@@ -127,25 +130,26 @@ module Zyphr
127
130
  {
128
131
  :'id' => :'String',
129
132
  :'device_id' => :'String',
130
- :'subscriber_id' => :'String',
133
+ :'user_id' => :'String',
134
+ :'platform' => :'String',
131
135
  :'title' => :'String',
132
136
  :'body' => :'String',
137
+ :'data' => :'Hash<String, Object>',
133
138
  :'status' => :'String',
134
- :'platform' => :'String',
135
- :'created_at' => :'Time',
139
+ :'tags' => :'Array<String>',
140
+ :'queued_at' => :'Time',
136
141
  :'sent_at' => :'Time',
137
142
  :'delivered_at' => :'Time',
143
+ :'created_at' => :'Time',
138
144
  :'batch_id' => :'String',
139
- :'user_id' => :'String',
140
- :'data' => :'Hash<String, Object>',
141
- :'badge' => :'String',
145
+ :'badge' => :'Integer',
142
146
  :'sound' => :'String',
143
147
  :'image_url' => :'String',
148
+ :'content_available' => :'Boolean',
149
+ :'action_buttons' => :'Array<PushMessageDetailAllOfActionButtons>',
144
150
  :'status_reason' => :'String',
145
151
  :'provider_message_id' => :'String',
146
- :'tags' => :'Array<String>',
147
152
  :'metadata' => :'Hash<String, Object>',
148
- :'queued_at' => :'Time',
149
153
  :'failed_at' => :'Time',
150
154
  :'events' => :'Array<PushEvent>'
151
155
  }
@@ -154,14 +158,16 @@ module Zyphr
154
158
  # List of attributes with nullable: true
155
159
  def self.openapi_nullable
156
160
  Set.new([
157
- :'subscriber_id',
161
+ :'queued_at',
158
162
  :'sent_at',
159
163
  :'delivered_at',
160
164
  :'batch_id',
161
- :'user_id',
165
+ :'badge',
166
+ :'sound',
167
+ :'image_url',
168
+ :'action_buttons',
162
169
  :'status_reason',
163
170
  :'provider_message_id',
164
- :'queued_at',
165
171
  :'failed_at',
166
172
  ])
167
173
  end
@@ -197,8 +203,12 @@ module Zyphr
197
203
  self.device_id = attributes[:'device_id']
198
204
  end
199
205
 
200
- if attributes.key?(:'subscriber_id')
201
- self.subscriber_id = attributes[:'subscriber_id']
206
+ if attributes.key?(:'user_id')
207
+ self.user_id = attributes[:'user_id']
208
+ end
209
+
210
+ if attributes.key?(:'platform')
211
+ self.platform = attributes[:'platform']
202
212
  end
203
213
 
204
214
  if attributes.key?(:'title')
@@ -209,16 +219,24 @@ module Zyphr
209
219
  self.body = attributes[:'body']
210
220
  end
211
221
 
222
+ if attributes.key?(:'data')
223
+ if (value = attributes[:'data']).is_a?(Hash)
224
+ self.data = value
225
+ end
226
+ end
227
+
212
228
  if attributes.key?(:'status')
213
229
  self.status = attributes[:'status']
214
230
  end
215
231
 
216
- if attributes.key?(:'platform')
217
- self.platform = attributes[:'platform']
232
+ if attributes.key?(:'tags')
233
+ if (value = attributes[:'tags']).is_a?(Array)
234
+ self.tags = value
235
+ end
218
236
  end
219
237
 
220
- if attributes.key?(:'created_at')
221
- self.created_at = attributes[:'created_at']
238
+ if attributes.key?(:'queued_at')
239
+ self.queued_at = attributes[:'queued_at']
222
240
  end
223
241
 
224
242
  if attributes.key?(:'sent_at')
@@ -229,18 +247,12 @@ module Zyphr
229
247
  self.delivered_at = attributes[:'delivered_at']
230
248
  end
231
249
 
232
- if attributes.key?(:'batch_id')
233
- self.batch_id = attributes[:'batch_id']
234
- end
235
-
236
- if attributes.key?(:'user_id')
237
- self.user_id = attributes[:'user_id']
250
+ if attributes.key?(:'created_at')
251
+ self.created_at = attributes[:'created_at']
238
252
  end
239
253
 
240
- if attributes.key?(:'data')
241
- if (value = attributes[:'data']).is_a?(Hash)
242
- self.data = value
243
- end
254
+ if attributes.key?(:'batch_id')
255
+ self.batch_id = attributes[:'batch_id']
244
256
  end
245
257
 
246
258
  if attributes.key?(:'badge')
@@ -255,6 +267,16 @@ module Zyphr
255
267
  self.image_url = attributes[:'image_url']
256
268
  end
257
269
 
270
+ if attributes.key?(:'content_available')
271
+ self.content_available = attributes[:'content_available']
272
+ end
273
+
274
+ if attributes.key?(:'action_buttons')
275
+ if (value = attributes[:'action_buttons']).is_a?(Array)
276
+ self.action_buttons = value
277
+ end
278
+ end
279
+
258
280
  if attributes.key?(:'status_reason')
259
281
  self.status_reason = attributes[:'status_reason']
260
282
  end
@@ -263,22 +285,12 @@ module Zyphr
263
285
  self.provider_message_id = attributes[:'provider_message_id']
264
286
  end
265
287
 
266
- if attributes.key?(:'tags')
267
- if (value = attributes[:'tags']).is_a?(Array)
268
- self.tags = value
269
- end
270
- end
271
-
272
288
  if attributes.key?(:'metadata')
273
289
  if (value = attributes[:'metadata']).is_a?(Hash)
274
290
  self.metadata = value
275
291
  end
276
292
  end
277
293
 
278
- if attributes.key?(:'queued_at')
279
- self.queued_at = attributes[:'queued_at']
280
- end
281
-
282
294
  if attributes.key?(:'failed_at')
283
295
  self.failed_at = attributes[:'failed_at']
284
296
  end
@@ -302,23 +314,13 @@ module Zyphr
302
314
  # @return true if the model is valid
303
315
  def valid?
304
316
  warn '[DEPRECATED] the `valid?` method is obsolete'
305
- status_validator = EnumAttributeValidator.new('String', ["pending", "queued", "sent", "delivered", "failed"])
306
- return false unless status_validator.valid?(@status)
307
317
  platform_validator = EnumAttributeValidator.new('String', ["ios", "android", "web"])
308
318
  return false unless platform_validator.valid?(@platform)
319
+ status_validator = EnumAttributeValidator.new('String', ["queued", "sending", "sent", "delivered", "failed", "expired"])
320
+ return false unless status_validator.valid?(@status)
309
321
  true
310
322
  end
311
323
 
312
- # Custom attribute writer method checking allowed values (enum).
313
- # @param [Object] status Object to be assigned
314
- def status=(status)
315
- validator = EnumAttributeValidator.new('String', ["pending", "queued", "sent", "delivered", "failed"])
316
- unless validator.valid?(status)
317
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
318
- end
319
- @status = status
320
- end
321
-
322
324
  # Custom attribute writer method checking allowed values (enum).
323
325
  # @param [Object] platform Object to be assigned
324
326
  def platform=(platform)
@@ -329,6 +331,16 @@ module Zyphr
329
331
  @platform = platform
330
332
  end
331
333
 
334
+ # Custom attribute writer method checking allowed values (enum).
335
+ # @param [Object] status Object to be assigned
336
+ def status=(status)
337
+ validator = EnumAttributeValidator.new('String', ["queued", "sending", "sent", "delivered", "failed", "expired"])
338
+ unless validator.valid?(status)
339
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
340
+ end
341
+ @status = status
342
+ end
343
+
332
344
  # Checks equality by comparing each attribute.
333
345
  # @param [Object] Object to be compared
334
346
  def ==(o)
@@ -336,25 +348,26 @@ module Zyphr
336
348
  self.class == o.class &&
337
349
  id == o.id &&
338
350
  device_id == o.device_id &&
339
- subscriber_id == o.subscriber_id &&
351
+ user_id == o.user_id &&
352
+ platform == o.platform &&
340
353
  title == o.title &&
341
354
  body == o.body &&
355
+ data == o.data &&
342
356
  status == o.status &&
343
- platform == o.platform &&
344
- created_at == o.created_at &&
357
+ tags == o.tags &&
358
+ queued_at == o.queued_at &&
345
359
  sent_at == o.sent_at &&
346
360
  delivered_at == o.delivered_at &&
361
+ created_at == o.created_at &&
347
362
  batch_id == o.batch_id &&
348
- user_id == o.user_id &&
349
- data == o.data &&
350
363
  badge == o.badge &&
351
364
  sound == o.sound &&
352
365
  image_url == o.image_url &&
366
+ content_available == o.content_available &&
367
+ action_buttons == o.action_buttons &&
353
368
  status_reason == o.status_reason &&
354
369
  provider_message_id == o.provider_message_id &&
355
- tags == o.tags &&
356
370
  metadata == o.metadata &&
357
- queued_at == o.queued_at &&
358
371
  failed_at == o.failed_at &&
359
372
  events == o.events
360
373
  end
@@ -368,7 +381,7 @@ module Zyphr
368
381
  # Calculates hash code according to all attributes.
369
382
  # @return [Integer] Hash code
370
383
  def hash
371
- [id, device_id, subscriber_id, title, body, status, platform, created_at, sent_at, delivered_at, batch_id, user_id, data, badge, sound, image_url, status_reason, provider_message_id, tags, metadata, queued_at, failed_at, events].hash
384
+ [id, device_id, user_id, platform, title, body, data, status, tags, queued_at, sent_at, delivered_at, created_at, batch_id, badge, sound, image_url, content_available, action_buttons, status_reason, provider_message_id, metadata, failed_at, events].hash
372
385
  end
373
386
 
374
387
  # Builds the object from hash