-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmodel_notification_with_meta_all_of.go
561 lines (475 loc) · 17.8 KB
/
model_notification_with_meta_all_of.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
/*
OneSignal
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
API version: 1.2.2
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package onesignal
import (
"encoding/json"
)
// NotificationWithMetaAllOf struct for NotificationWithMetaAllOf
type NotificationWithMetaAllOf struct {
// Number of notifications that have not been sent out yet. This can mean either our system is still processing the notification or you have delayed options set.
Remaining *int32 `json:"remaining,omitempty"`
// Number of notifications that were successfully delivered.
Successful *int32 `json:"successful,omitempty"`
// Number of notifications that could not be delivered due to those devices being unsubscribed.
Failed *int32 `json:"failed,omitempty"`
// Number of notifications that could not be delivered due to an error. You can find more information by viewing the notification in the dashboard.
Errored *int32 `json:"errored,omitempty"`
// Number of users who have clicked / tapped on your notification.
Converted *int32 `json:"converted,omitempty"`
// Unix timestamp indicating when the notification was created.
QueuedAt *int64 `json:"queued_at,omitempty"`
// Unix timestamp indicating when notification delivery should begin.
SendAfter NullableInt64 `json:"send_after,omitempty"`
// Unix timestamp indicating when notification delivery completed. The delivery duration from start to finish can be calculated with completed_at - send_after.
CompletedAt NullableInt64 `json:"completed_at,omitempty"`
PlatformDeliveryStats *PlatformDeliveryData `json:"platform_delivery_stats,omitempty"`
// Confirmed Deliveries number of devices that received the push notification. Paid Feature Only. Free accounts will see 0.
Received NullableInt32 `json:"received,omitempty"`
// number of push notifications sent per minute. Paid Feature Only. If throttling is not enabled for the app or the notification, and for free accounts, null is returned. Refer to Throttling for more details.
ThrottleRatePerMinute NullableInt32 `json:"throttle_rate_per_minute,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NotificationWithMetaAllOf NotificationWithMetaAllOf
// NewNotificationWithMetaAllOf instantiates a new NotificationWithMetaAllOf object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewNotificationWithMetaAllOf() *NotificationWithMetaAllOf {
this := NotificationWithMetaAllOf{}
return &this
}
// NewNotificationWithMetaAllOfWithDefaults instantiates a new NotificationWithMetaAllOf object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewNotificationWithMetaAllOfWithDefaults() *NotificationWithMetaAllOf {
this := NotificationWithMetaAllOf{}
return &this
}
// GetRemaining returns the Remaining field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetRemaining() int32 {
if o == nil || o.Remaining == nil {
var ret int32
return ret
}
return *o.Remaining
}
// GetRemainingOk returns a tuple with the Remaining field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetRemainingOk() (*int32, bool) {
if o == nil || o.Remaining == nil {
return nil, false
}
return o.Remaining, true
}
// HasRemaining returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasRemaining() bool {
if o != nil && o.Remaining != nil {
return true
}
return false
}
// SetRemaining gets a reference to the given int32 and assigns it to the Remaining field.
func (o *NotificationWithMetaAllOf) SetRemaining(v int32) {
o.Remaining = &v
}
// GetSuccessful returns the Successful field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetSuccessful() int32 {
if o == nil || o.Successful == nil {
var ret int32
return ret
}
return *o.Successful
}
// GetSuccessfulOk returns a tuple with the Successful field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetSuccessfulOk() (*int32, bool) {
if o == nil || o.Successful == nil {
return nil, false
}
return o.Successful, true
}
// HasSuccessful returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasSuccessful() bool {
if o != nil && o.Successful != nil {
return true
}
return false
}
// SetSuccessful gets a reference to the given int32 and assigns it to the Successful field.
func (o *NotificationWithMetaAllOf) SetSuccessful(v int32) {
o.Successful = &v
}
// GetFailed returns the Failed field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetFailed() int32 {
if o == nil || o.Failed == nil {
var ret int32
return ret
}
return *o.Failed
}
// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetFailedOk() (*int32, bool) {
if o == nil || o.Failed == nil {
return nil, false
}
return o.Failed, true
}
// HasFailed returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasFailed() bool {
if o != nil && o.Failed != nil {
return true
}
return false
}
// SetFailed gets a reference to the given int32 and assigns it to the Failed field.
func (o *NotificationWithMetaAllOf) SetFailed(v int32) {
o.Failed = &v
}
// GetErrored returns the Errored field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetErrored() int32 {
if o == nil || o.Errored == nil {
var ret int32
return ret
}
return *o.Errored
}
// GetErroredOk returns a tuple with the Errored field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetErroredOk() (*int32, bool) {
if o == nil || o.Errored == nil {
return nil, false
}
return o.Errored, true
}
// HasErrored returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasErrored() bool {
if o != nil && o.Errored != nil {
return true
}
return false
}
// SetErrored gets a reference to the given int32 and assigns it to the Errored field.
func (o *NotificationWithMetaAllOf) SetErrored(v int32) {
o.Errored = &v
}
// GetConverted returns the Converted field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetConverted() int32 {
if o == nil || o.Converted == nil {
var ret int32
return ret
}
return *o.Converted
}
// GetConvertedOk returns a tuple with the Converted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetConvertedOk() (*int32, bool) {
if o == nil || o.Converted == nil {
return nil, false
}
return o.Converted, true
}
// HasConverted returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasConverted() bool {
if o != nil && o.Converted != nil {
return true
}
return false
}
// SetConverted gets a reference to the given int32 and assigns it to the Converted field.
func (o *NotificationWithMetaAllOf) SetConverted(v int32) {
o.Converted = &v
}
// GetQueuedAt returns the QueuedAt field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetQueuedAt() int64 {
if o == nil || o.QueuedAt == nil {
var ret int64
return ret
}
return *o.QueuedAt
}
// GetQueuedAtOk returns a tuple with the QueuedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetQueuedAtOk() (*int64, bool) {
if o == nil || o.QueuedAt == nil {
return nil, false
}
return o.QueuedAt, true
}
// HasQueuedAt returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasQueuedAt() bool {
if o != nil && o.QueuedAt != nil {
return true
}
return false
}
// SetQueuedAt gets a reference to the given int64 and assigns it to the QueuedAt field.
func (o *NotificationWithMetaAllOf) SetQueuedAt(v int64) {
o.QueuedAt = &v
}
// GetSendAfter returns the SendAfter field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NotificationWithMetaAllOf) GetSendAfter() int64 {
if o == nil || o.SendAfter.Get() == nil {
var ret int64
return ret
}
return *o.SendAfter.Get()
}
// GetSendAfterOk returns a tuple with the SendAfter field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NotificationWithMetaAllOf) GetSendAfterOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.SendAfter.Get(), o.SendAfter.IsSet()
}
// HasSendAfter returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasSendAfter() bool {
if o != nil && o.SendAfter.IsSet() {
return true
}
return false
}
// SetSendAfter gets a reference to the given NullableInt64 and assigns it to the SendAfter field.
func (o *NotificationWithMetaAllOf) SetSendAfter(v int64) {
o.SendAfter.Set(&v)
}
// SetSendAfterNil sets the value for SendAfter to be an explicit nil
func (o *NotificationWithMetaAllOf) SetSendAfterNil() {
o.SendAfter.Set(nil)
}
// UnsetSendAfter ensures that no value is present for SendAfter, not even an explicit nil
func (o *NotificationWithMetaAllOf) UnsetSendAfter() {
o.SendAfter.Unset()
}
// GetCompletedAt returns the CompletedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NotificationWithMetaAllOf) GetCompletedAt() int64 {
if o == nil || o.CompletedAt.Get() == nil {
var ret int64
return ret
}
return *o.CompletedAt.Get()
}
// GetCompletedAtOk returns a tuple with the CompletedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NotificationWithMetaAllOf) GetCompletedAtOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.CompletedAt.Get(), o.CompletedAt.IsSet()
}
// HasCompletedAt returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasCompletedAt() bool {
if o != nil && o.CompletedAt.IsSet() {
return true
}
return false
}
// SetCompletedAt gets a reference to the given NullableInt64 and assigns it to the CompletedAt field.
func (o *NotificationWithMetaAllOf) SetCompletedAt(v int64) {
o.CompletedAt.Set(&v)
}
// SetCompletedAtNil sets the value for CompletedAt to be an explicit nil
func (o *NotificationWithMetaAllOf) SetCompletedAtNil() {
o.CompletedAt.Set(nil)
}
// UnsetCompletedAt ensures that no value is present for CompletedAt, not even an explicit nil
func (o *NotificationWithMetaAllOf) UnsetCompletedAt() {
o.CompletedAt.Unset()
}
// GetPlatformDeliveryStats returns the PlatformDeliveryStats field value if set, zero value otherwise.
func (o *NotificationWithMetaAllOf) GetPlatformDeliveryStats() PlatformDeliveryData {
if o == nil || o.PlatformDeliveryStats == nil {
var ret PlatformDeliveryData
return ret
}
return *o.PlatformDeliveryStats
}
// GetPlatformDeliveryStatsOk returns a tuple with the PlatformDeliveryStats field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationWithMetaAllOf) GetPlatformDeliveryStatsOk() (*PlatformDeliveryData, bool) {
if o == nil || o.PlatformDeliveryStats == nil {
return nil, false
}
return o.PlatformDeliveryStats, true
}
// HasPlatformDeliveryStats returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasPlatformDeliveryStats() bool {
if o != nil && o.PlatformDeliveryStats != nil {
return true
}
return false
}
// SetPlatformDeliveryStats gets a reference to the given PlatformDeliveryData and assigns it to the PlatformDeliveryStats field.
func (o *NotificationWithMetaAllOf) SetPlatformDeliveryStats(v PlatformDeliveryData) {
o.PlatformDeliveryStats = &v
}
// GetReceived returns the Received field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NotificationWithMetaAllOf) GetReceived() int32 {
if o == nil || o.Received.Get() == nil {
var ret int32
return ret
}
return *o.Received.Get()
}
// GetReceivedOk returns a tuple with the Received field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NotificationWithMetaAllOf) GetReceivedOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Received.Get(), o.Received.IsSet()
}
// HasReceived returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasReceived() bool {
if o != nil && o.Received.IsSet() {
return true
}
return false
}
// SetReceived gets a reference to the given NullableInt32 and assigns it to the Received field.
func (o *NotificationWithMetaAllOf) SetReceived(v int32) {
o.Received.Set(&v)
}
// SetReceivedNil sets the value for Received to be an explicit nil
func (o *NotificationWithMetaAllOf) SetReceivedNil() {
o.Received.Set(nil)
}
// UnsetReceived ensures that no value is present for Received, not even an explicit nil
func (o *NotificationWithMetaAllOf) UnsetReceived() {
o.Received.Unset()
}
// GetThrottleRatePerMinute returns the ThrottleRatePerMinute field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NotificationWithMetaAllOf) GetThrottleRatePerMinute() int32 {
if o == nil || o.ThrottleRatePerMinute.Get() == nil {
var ret int32
return ret
}
return *o.ThrottleRatePerMinute.Get()
}
// GetThrottleRatePerMinuteOk returns a tuple with the ThrottleRatePerMinute field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NotificationWithMetaAllOf) GetThrottleRatePerMinuteOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.ThrottleRatePerMinute.Get(), o.ThrottleRatePerMinute.IsSet()
}
// HasThrottleRatePerMinute returns a boolean if a field has been set.
func (o *NotificationWithMetaAllOf) HasThrottleRatePerMinute() bool {
if o != nil && o.ThrottleRatePerMinute.IsSet() {
return true
}
return false
}
// SetThrottleRatePerMinute gets a reference to the given NullableInt32 and assigns it to the ThrottleRatePerMinute field.
func (o *NotificationWithMetaAllOf) SetThrottleRatePerMinute(v int32) {
o.ThrottleRatePerMinute.Set(&v)
}
// SetThrottleRatePerMinuteNil sets the value for ThrottleRatePerMinute to be an explicit nil
func (o *NotificationWithMetaAllOf) SetThrottleRatePerMinuteNil() {
o.ThrottleRatePerMinute.Set(nil)
}
// UnsetThrottleRatePerMinute ensures that no value is present for ThrottleRatePerMinute, not even an explicit nil
func (o *NotificationWithMetaAllOf) UnsetThrottleRatePerMinute() {
o.ThrottleRatePerMinute.Unset()
}
func (o NotificationWithMetaAllOf) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Remaining != nil {
toSerialize["remaining"] = o.Remaining
}
if o.Successful != nil {
toSerialize["successful"] = o.Successful
}
if o.Failed != nil {
toSerialize["failed"] = o.Failed
}
if o.Errored != nil {
toSerialize["errored"] = o.Errored
}
if o.Converted != nil {
toSerialize["converted"] = o.Converted
}
if o.QueuedAt != nil {
toSerialize["queued_at"] = o.QueuedAt
}
if o.SendAfter.IsSet() {
toSerialize["send_after"] = o.SendAfter.Get()
}
if o.CompletedAt.IsSet() {
toSerialize["completed_at"] = o.CompletedAt.Get()
}
if o.PlatformDeliveryStats != nil {
toSerialize["platform_delivery_stats"] = o.PlatformDeliveryStats
}
if o.Received.IsSet() {
toSerialize["received"] = o.Received.Get()
}
if o.ThrottleRatePerMinute.IsSet() {
toSerialize["throttle_rate_per_minute"] = o.ThrottleRatePerMinute.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *NotificationWithMetaAllOf) UnmarshalJSON(bytes []byte) (err error) {
varNotificationWithMetaAllOf := _NotificationWithMetaAllOf{}
if err = json.Unmarshal(bytes, &varNotificationWithMetaAllOf); err == nil {
*o = NotificationWithMetaAllOf(varNotificationWithMetaAllOf)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "remaining")
delete(additionalProperties, "successful")
delete(additionalProperties, "failed")
delete(additionalProperties, "errored")
delete(additionalProperties, "converted")
delete(additionalProperties, "queued_at")
delete(additionalProperties, "send_after")
delete(additionalProperties, "completed_at")
delete(additionalProperties, "platform_delivery_stats")
delete(additionalProperties, "received")
delete(additionalProperties, "throttle_rate_per_minute")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNotificationWithMetaAllOf struct {
value *NotificationWithMetaAllOf
isSet bool
}
func (v NullableNotificationWithMetaAllOf) Get() *NotificationWithMetaAllOf {
return v.value
}
func (v *NullableNotificationWithMetaAllOf) Set(val *NotificationWithMetaAllOf) {
v.value = val
v.isSet = true
}
func (v NullableNotificationWithMetaAllOf) IsSet() bool {
return v.isSet
}
func (v *NullableNotificationWithMetaAllOf) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNotificationWithMetaAllOf(val *NotificationWithMetaAllOf) *NullableNotificationWithMetaAllOf {
return &NullableNotificationWithMetaAllOf{value: val, isSet: true}
}
func (v NullableNotificationWithMetaAllOf) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNotificationWithMetaAllOf) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}