-
Notifications
You must be signed in to change notification settings - Fork 825
Expand file tree
/
Copy pathmodel_source_device.go
More file actions
574 lines (478 loc) · 12.7 KB
/
model_source_device.go
File metadata and controls
574 lines (478 loc) · 12.7 KB
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
560
561
562
563
564
565
566
567
568
569
570
571
572
/*
Cloudflare WARP API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: 536
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"fmt"
)
// checks if the SourceDevice type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SourceDevice{}
// SourceDevice struct for SourceDevice
type SourceDevice struct {
Created string `json:"created"`
Enabled bool `json:"enabled"`
FcmToken string `json:"fcm_token"`
Id string `json:"id"`
InstallId string `json:"install_id"`
Key string `json:"key"`
Locale string `json:"locale"`
Model string `json:"model"`
Name string `json:"name"`
Place float32 `json:"place"`
Tos string `json:"tos"`
Type string `json:"type"`
Updated string `json:"updated"`
WaitlistEnabled bool `json:"waitlist_enabled"`
WarpEnabled bool `json:"warp_enabled"`
AdditionalProperties map[string]interface{}
}
type _SourceDevice SourceDevice
// NewSourceDevice instantiates a new SourceDevice 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 NewSourceDevice(created string, enabled bool, fcmToken string, id string, installId string, key string, locale string, model string, name string, place float32, tos string, type_ string, updated string, waitlistEnabled bool, warpEnabled bool) *SourceDevice {
this := SourceDevice{}
this.Created = created
this.Enabled = enabled
this.FcmToken = fcmToken
this.Id = id
this.InstallId = installId
this.Key = key
this.Locale = locale
this.Model = model
this.Name = name
this.Place = place
this.Tos = tos
this.Type = type_
this.Updated = updated
this.WaitlistEnabled = waitlistEnabled
this.WarpEnabled = warpEnabled
return &this
}
// NewSourceDeviceWithDefaults instantiates a new SourceDevice 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 NewSourceDeviceWithDefaults() *SourceDevice {
this := SourceDevice{}
return &this
}
// GetCreated returns the Created field value
func (o *SourceDevice) GetCreated() string {
if o == nil {
var ret string
return ret
}
return o.Created
}
// GetCreatedOk returns a tuple with the Created field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetCreatedOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Created, true
}
// SetCreated sets field value
func (o *SourceDevice) SetCreated(v string) {
o.Created = v
}
// GetEnabled returns the Enabled field value
func (o *SourceDevice) GetEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Enabled, true
}
// SetEnabled sets field value
func (o *SourceDevice) SetEnabled(v bool) {
o.Enabled = v
}
// GetFcmToken returns the FcmToken field value
func (o *SourceDevice) GetFcmToken() string {
if o == nil {
var ret string
return ret
}
return o.FcmToken
}
// GetFcmTokenOk returns a tuple with the FcmToken field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetFcmTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.FcmToken, true
}
// SetFcmToken sets field value
func (o *SourceDevice) SetFcmToken(v string) {
o.FcmToken = v
}
// GetId returns the Id field value
func (o *SourceDevice) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *SourceDevice) SetId(v string) {
o.Id = v
}
// GetInstallId returns the InstallId field value
func (o *SourceDevice) GetInstallId() string {
if o == nil {
var ret string
return ret
}
return o.InstallId
}
// GetInstallIdOk returns a tuple with the InstallId field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetInstallIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.InstallId, true
}
// SetInstallId sets field value
func (o *SourceDevice) SetInstallId(v string) {
o.InstallId = v
}
// GetKey returns the Key field value
func (o *SourceDevice) GetKey() string {
if o == nil {
var ret string
return ret
}
return o.Key
}
// GetKeyOk returns a tuple with the Key field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetKeyOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Key, true
}
// SetKey sets field value
func (o *SourceDevice) SetKey(v string) {
o.Key = v
}
// GetLocale returns the Locale field value
func (o *SourceDevice) GetLocale() string {
if o == nil {
var ret string
return ret
}
return o.Locale
}
// GetLocaleOk returns a tuple with the Locale field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetLocaleOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Locale, true
}
// SetLocale sets field value
func (o *SourceDevice) SetLocale(v string) {
o.Locale = v
}
// GetModel returns the Model field value
func (o *SourceDevice) GetModel() string {
if o == nil {
var ret string
return ret
}
return o.Model
}
// GetModelOk returns a tuple with the Model field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetModelOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Model, true
}
// SetModel sets field value
func (o *SourceDevice) SetModel(v string) {
o.Model = v
}
// GetName returns the Name field value
func (o *SourceDevice) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *SourceDevice) SetName(v string) {
o.Name = v
}
// GetPlace returns the Place field value
func (o *SourceDevice) GetPlace() float32 {
if o == nil {
var ret float32
return ret
}
return o.Place
}
// GetPlaceOk returns a tuple with the Place field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetPlaceOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Place, true
}
// SetPlace sets field value
func (o *SourceDevice) SetPlace(v float32) {
o.Place = v
}
// GetTos returns the Tos field value
func (o *SourceDevice) GetTos() string {
if o == nil {
var ret string
return ret
}
return o.Tos
}
// GetTosOk returns a tuple with the Tos field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetTosOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Tos, true
}
// SetTos sets field value
func (o *SourceDevice) SetTos(v string) {
o.Tos = v
}
// GetType returns the Type field value
func (o *SourceDevice) GetType() string {
if o == nil {
var ret string
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *SourceDevice) SetType(v string) {
o.Type = v
}
// GetUpdated returns the Updated field value
func (o *SourceDevice) GetUpdated() string {
if o == nil {
var ret string
return ret
}
return o.Updated
}
// GetUpdatedOk returns a tuple with the Updated field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetUpdatedOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Updated, true
}
// SetUpdated sets field value
func (o *SourceDevice) SetUpdated(v string) {
o.Updated = v
}
// GetWaitlistEnabled returns the WaitlistEnabled field value
func (o *SourceDevice) GetWaitlistEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.WaitlistEnabled
}
// GetWaitlistEnabledOk returns a tuple with the WaitlistEnabled field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetWaitlistEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.WaitlistEnabled, true
}
// SetWaitlistEnabled sets field value
func (o *SourceDevice) SetWaitlistEnabled(v bool) {
o.WaitlistEnabled = v
}
// GetWarpEnabled returns the WarpEnabled field value
func (o *SourceDevice) GetWarpEnabled() bool {
if o == nil {
var ret bool
return ret
}
return o.WarpEnabled
}
// GetWarpEnabledOk returns a tuple with the WarpEnabled field value
// and a boolean to check if the value has been set.
func (o *SourceDevice) GetWarpEnabledOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.WarpEnabled, true
}
// SetWarpEnabled sets field value
func (o *SourceDevice) SetWarpEnabled(v bool) {
o.WarpEnabled = v
}
func (o SourceDevice) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SourceDevice) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["created"] = o.Created
toSerialize["enabled"] = o.Enabled
toSerialize["fcm_token"] = o.FcmToken
toSerialize["id"] = o.Id
toSerialize["install_id"] = o.InstallId
toSerialize["key"] = o.Key
toSerialize["locale"] = o.Locale
toSerialize["model"] = o.Model
toSerialize["name"] = o.Name
toSerialize["place"] = o.Place
toSerialize["tos"] = o.Tos
toSerialize["type"] = o.Type
toSerialize["updated"] = o.Updated
toSerialize["waitlist_enabled"] = o.WaitlistEnabled
toSerialize["warp_enabled"] = o.WarpEnabled
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SourceDevice) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"created",
"enabled",
"fcm_token",
"id",
"install_id",
"key",
"locale",
"model",
"name",
"place",
"tos",
"type",
"updated",
"waitlist_enabled",
"warp_enabled",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varSourceDevice := _SourceDevice{}
err = json.Unmarshal(data, &varSourceDevice)
if err != nil {
return err
}
*o = SourceDevice(varSourceDevice)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created")
delete(additionalProperties, "enabled")
delete(additionalProperties, "fcm_token")
delete(additionalProperties, "id")
delete(additionalProperties, "install_id")
delete(additionalProperties, "key")
delete(additionalProperties, "locale")
delete(additionalProperties, "model")
delete(additionalProperties, "name")
delete(additionalProperties, "place")
delete(additionalProperties, "tos")
delete(additionalProperties, "type")
delete(additionalProperties, "updated")
delete(additionalProperties, "waitlist_enabled")
delete(additionalProperties, "warp_enabled")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSourceDevice struct {
value *SourceDevice
isSet bool
}
func (v NullableSourceDevice) Get() *SourceDevice {
return v.value
}
func (v *NullableSourceDevice) Set(val *SourceDevice) {
v.value = val
v.isSet = true
}
func (v NullableSourceDevice) IsSet() bool {
return v.isSet
}
func (v *NullableSourceDevice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSourceDevice(val *SourceDevice) *NullableSourceDevice {
return &NullableSourceDevice{value: val, isSet: true}
}
func (v NullableSourceDevice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSourceDevice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}