-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmodel_delivery_data.go
344 lines (287 loc) · 9.6 KB
/
model_delivery_data.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
/*
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"
)
// DeliveryData struct for DeliveryData
type DeliveryData struct {
// Number of messages delivered to push servers, mobile carriers, or email service providers.
Successful NullableInt32 `json:"successful,omitempty"`
// Number of messages sent to unsubscribed devices.
Failed NullableInt32 `json:"failed,omitempty"`
// Number of errors reported.
Errored NullableInt32 `json:"errored,omitempty"`
// Number of messages that were clicked.
Converted NullableInt32 `json:"converted,omitempty"`
// Number of devices that received the message.
Received NullableInt32 `json:"received,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DeliveryData DeliveryData
// NewDeliveryData instantiates a new DeliveryData 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 NewDeliveryData() *DeliveryData {
this := DeliveryData{}
return &this
}
// NewDeliveryDataWithDefaults instantiates a new DeliveryData 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 NewDeliveryDataWithDefaults() *DeliveryData {
this := DeliveryData{}
return &this
}
// GetSuccessful returns the Successful field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeliveryData) GetSuccessful() int32 {
if o == nil || o.Successful.Get() == nil {
var ret int32
return ret
}
return *o.Successful.Get()
}
// GetSuccessfulOk returns a tuple with the Successful 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 *DeliveryData) GetSuccessfulOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Successful.Get(), o.Successful.IsSet()
}
// HasSuccessful returns a boolean if a field has been set.
func (o *DeliveryData) HasSuccessful() bool {
if o != nil && o.Successful.IsSet() {
return true
}
return false
}
// SetSuccessful gets a reference to the given NullableInt32 and assigns it to the Successful field.
func (o *DeliveryData) SetSuccessful(v int32) {
o.Successful.Set(&v)
}
// SetSuccessfulNil sets the value for Successful to be an explicit nil
func (o *DeliveryData) SetSuccessfulNil() {
o.Successful.Set(nil)
}
// UnsetSuccessful ensures that no value is present for Successful, not even an explicit nil
func (o *DeliveryData) UnsetSuccessful() {
o.Successful.Unset()
}
// GetFailed returns the Failed field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeliveryData) GetFailed() int32 {
if o == nil || o.Failed.Get() == nil {
var ret int32
return ret
}
return *o.Failed.Get()
}
// GetFailedOk returns a tuple with the Failed 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 *DeliveryData) GetFailedOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Failed.Get(), o.Failed.IsSet()
}
// HasFailed returns a boolean if a field has been set.
func (o *DeliveryData) HasFailed() bool {
if o != nil && o.Failed.IsSet() {
return true
}
return false
}
// SetFailed gets a reference to the given NullableInt32 and assigns it to the Failed field.
func (o *DeliveryData) SetFailed(v int32) {
o.Failed.Set(&v)
}
// SetFailedNil sets the value for Failed to be an explicit nil
func (o *DeliveryData) SetFailedNil() {
o.Failed.Set(nil)
}
// UnsetFailed ensures that no value is present for Failed, not even an explicit nil
func (o *DeliveryData) UnsetFailed() {
o.Failed.Unset()
}
// GetErrored returns the Errored field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeliveryData) GetErrored() int32 {
if o == nil || o.Errored.Get() == nil {
var ret int32
return ret
}
return *o.Errored.Get()
}
// GetErroredOk returns a tuple with the Errored 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 *DeliveryData) GetErroredOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Errored.Get(), o.Errored.IsSet()
}
// HasErrored returns a boolean if a field has been set.
func (o *DeliveryData) HasErrored() bool {
if o != nil && o.Errored.IsSet() {
return true
}
return false
}
// SetErrored gets a reference to the given NullableInt32 and assigns it to the Errored field.
func (o *DeliveryData) SetErrored(v int32) {
o.Errored.Set(&v)
}
// SetErroredNil sets the value for Errored to be an explicit nil
func (o *DeliveryData) SetErroredNil() {
o.Errored.Set(nil)
}
// UnsetErrored ensures that no value is present for Errored, not even an explicit nil
func (o *DeliveryData) UnsetErrored() {
o.Errored.Unset()
}
// GetConverted returns the Converted field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeliveryData) GetConverted() int32 {
if o == nil || o.Converted.Get() == nil {
var ret int32
return ret
}
return *o.Converted.Get()
}
// GetConvertedOk returns a tuple with the Converted 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 *DeliveryData) GetConvertedOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Converted.Get(), o.Converted.IsSet()
}
// HasConverted returns a boolean if a field has been set.
func (o *DeliveryData) HasConverted() bool {
if o != nil && o.Converted.IsSet() {
return true
}
return false
}
// SetConverted gets a reference to the given NullableInt32 and assigns it to the Converted field.
func (o *DeliveryData) SetConverted(v int32) {
o.Converted.Set(&v)
}
// SetConvertedNil sets the value for Converted to be an explicit nil
func (o *DeliveryData) SetConvertedNil() {
o.Converted.Set(nil)
}
// UnsetConverted ensures that no value is present for Converted, not even an explicit nil
func (o *DeliveryData) UnsetConverted() {
o.Converted.Unset()
}
// GetReceived returns the Received field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *DeliveryData) 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 *DeliveryData) 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 *DeliveryData) 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 *DeliveryData) SetReceived(v int32) {
o.Received.Set(&v)
}
// SetReceivedNil sets the value for Received to be an explicit nil
func (o *DeliveryData) SetReceivedNil() {
o.Received.Set(nil)
}
// UnsetReceived ensures that no value is present for Received, not even an explicit nil
func (o *DeliveryData) UnsetReceived() {
o.Received.Unset()
}
func (o DeliveryData) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Successful.IsSet() {
toSerialize["successful"] = o.Successful.Get()
}
if o.Failed.IsSet() {
toSerialize["failed"] = o.Failed.Get()
}
if o.Errored.IsSet() {
toSerialize["errored"] = o.Errored.Get()
}
if o.Converted.IsSet() {
toSerialize["converted"] = o.Converted.Get()
}
if o.Received.IsSet() {
toSerialize["received"] = o.Received.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *DeliveryData) UnmarshalJSON(bytes []byte) (err error) {
varDeliveryData := _DeliveryData{}
if err = json.Unmarshal(bytes, &varDeliveryData); err == nil {
*o = DeliveryData(varDeliveryData)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "successful")
delete(additionalProperties, "failed")
delete(additionalProperties, "errored")
delete(additionalProperties, "converted")
delete(additionalProperties, "received")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDeliveryData struct {
value *DeliveryData
isSet bool
}
func (v NullableDeliveryData) Get() *DeliveryData {
return v.value
}
func (v *NullableDeliveryData) Set(val *DeliveryData) {
v.value = val
v.isSet = true
}
func (v NullableDeliveryData) IsSet() bool {
return v.isSet
}
func (v *NullableDeliveryData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeliveryData(val *DeliveryData) *NullableDeliveryData {
return &NullableDeliveryData{value: val, isSet: true}
}
func (v NullableDeliveryData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeliveryData) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}