-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_asset.go
644 lines (551 loc) · 16.2 KB
/
model_asset.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
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
/*
* Live Objects REST API Guide v2.13.3
*
* API description for Live Objects service
*
* API version: 2.13.3
* Contact: liveobjects.support@orange.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package liveobjects
import (
"encoding/json"
)
// Asset struct for Asset
type Asset struct {
// True if asset is considered connected
Connected bool `json:"connected"`
// Date/time when asset was first registered
CreationTs int64 `json:"creationTs"`
// device description
Description *string `json:"description,omitempty"`
// Group Id where this asset is localize
GroupId *string `json:"groupId,omitempty"`
// Group path where this asset is localize
GroupPath *string `json:"groupPath,omitempty"`
// Asset identifier
Id string `json:"id"`
// Date/time when asset status has been lastly updated
LastUpdateTs *int64 `json:"lastUpdateTs,omitempty"`
// Additional asset info (from last device \"connected\" event)
Metadata *map[string]interface{} `json:"metadata,omitempty"`
// human readable name
Name *string `json:"name,omitempty"`
// Asset identifier namespace
Namespace string `json:"namespace"`
// Last path taken by a received message describing the asset status(i.e. connected/disconnected): the series of assets that forwarded the message.
Path *[]AssetAlias `json:"path,omitempty"`
// Static asset properties (from device provisioning
Properties *map[string]string `json:"properties,omitempty"`
// Device tags
Tags *[]string `json:"tags,omitempty"`
// Topic where generic commands can be sent to asset (if asset is still connected)
TopicCommand *string `json:"topicCommand,omitempty"`
// Topic where param update requests can be sent to asset (if asset is still connected)
TopicParamUpdate *string `json:"topicParamUpdate,omitempty"`
// Topic where resource update requests can be sent to asset (if asset is still connected)
TopicResourceUpdate *string `json:"topicResourceUpdate,omitempty"`
}
// NewAsset instantiates a new Asset 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 NewAsset(connected bool, creationTs int64, id string, namespace string, ) *Asset {
this := Asset{}
this.Connected = connected
this.CreationTs = creationTs
this.Id = id
this.Namespace = namespace
return &this
}
// NewAssetWithDefaults instantiates a new Asset 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 NewAssetWithDefaults() *Asset {
this := Asset{}
return &this
}
// GetConnected returns the Connected field value
func (o *Asset) GetConnected() bool {
if o == nil {
var ret bool
return ret
}
return o.Connected
}
// GetConnectedOk returns a tuple with the Connected field value
// and a boolean to check if the value has been set.
func (o *Asset) GetConnectedOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Connected, true
}
// SetConnected sets field value
func (o *Asset) SetConnected(v bool) {
o.Connected = v
}
// GetCreationTs returns the CreationTs field value
func (o *Asset) GetCreationTs() int64 {
if o == nil {
var ret int64
return ret
}
return o.CreationTs
}
// GetCreationTsOk returns a tuple with the CreationTs field value
// and a boolean to check if the value has been set.
func (o *Asset) GetCreationTsOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.CreationTs, true
}
// SetCreationTs sets field value
func (o *Asset) SetCreationTs(v int64) {
o.CreationTs = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Asset) GetDescription() string {
if o == nil || o.Description == nil {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *Asset) HasDescription() bool {
if o != nil && o.Description != nil {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *Asset) SetDescription(v string) {
o.Description = &v
}
// GetGroupId returns the GroupId field value if set, zero value otherwise.
func (o *Asset) GetGroupId() string {
if o == nil || o.GroupId == nil {
var ret string
return ret
}
return *o.GroupId
}
// GetGroupIdOk returns a tuple with the GroupId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetGroupIdOk() (*string, bool) {
if o == nil || o.GroupId == nil {
return nil, false
}
return o.GroupId, true
}
// HasGroupId returns a boolean if a field has been set.
func (o *Asset) HasGroupId() bool {
if o != nil && o.GroupId != nil {
return true
}
return false
}
// SetGroupId gets a reference to the given string and assigns it to the GroupId field.
func (o *Asset) SetGroupId(v string) {
o.GroupId = &v
}
// GetGroupPath returns the GroupPath field value if set, zero value otherwise.
func (o *Asset) GetGroupPath() string {
if o == nil || o.GroupPath == nil {
var ret string
return ret
}
return *o.GroupPath
}
// GetGroupPathOk returns a tuple with the GroupPath field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetGroupPathOk() (*string, bool) {
if o == nil || o.GroupPath == nil {
return nil, false
}
return o.GroupPath, true
}
// HasGroupPath returns a boolean if a field has been set.
func (o *Asset) HasGroupPath() bool {
if o != nil && o.GroupPath != nil {
return true
}
return false
}
// SetGroupPath gets a reference to the given string and assigns it to the GroupPath field.
func (o *Asset) SetGroupPath(v string) {
o.GroupPath = &v
}
// GetId returns the Id field value
func (o *Asset) 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 *Asset) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *Asset) SetId(v string) {
o.Id = v
}
// GetLastUpdateTs returns the LastUpdateTs field value if set, zero value otherwise.
func (o *Asset) GetLastUpdateTs() int64 {
if o == nil || o.LastUpdateTs == nil {
var ret int64
return ret
}
return *o.LastUpdateTs
}
// GetLastUpdateTsOk returns a tuple with the LastUpdateTs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetLastUpdateTsOk() (*int64, bool) {
if o == nil || o.LastUpdateTs == nil {
return nil, false
}
return o.LastUpdateTs, true
}
// HasLastUpdateTs returns a boolean if a field has been set.
func (o *Asset) HasLastUpdateTs() bool {
if o != nil && o.LastUpdateTs != nil {
return true
}
return false
}
// SetLastUpdateTs gets a reference to the given int64 and assigns it to the LastUpdateTs field.
func (o *Asset) SetLastUpdateTs(v int64) {
o.LastUpdateTs = &v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *Asset) GetMetadata() map[string]interface{} {
if o == nil || o.Metadata == nil {
var ret map[string]interface{}
return ret
}
return *o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetMetadataOk() (*map[string]interface{}, bool) {
if o == nil || o.Metadata == nil {
return nil, false
}
return o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *Asset) HasMetadata() bool {
if o != nil && o.Metadata != nil {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *Asset) SetMetadata(v map[string]interface{}) {
o.Metadata = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Asset) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *Asset) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Asset) SetName(v string) {
o.Name = &v
}
// GetNamespace returns the Namespace field value
func (o *Asset) GetNamespace() string {
if o == nil {
var ret string
return ret
}
return o.Namespace
}
// GetNamespaceOk returns a tuple with the Namespace field value
// and a boolean to check if the value has been set.
func (o *Asset) GetNamespaceOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Namespace, true
}
// SetNamespace sets field value
func (o *Asset) SetNamespace(v string) {
o.Namespace = v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *Asset) GetPath() []AssetAlias {
if o == nil || o.Path == nil {
var ret []AssetAlias
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetPathOk() (*[]AssetAlias, bool) {
if o == nil || o.Path == nil {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *Asset) HasPath() bool {
if o != nil && o.Path != nil {
return true
}
return false
}
// SetPath gets a reference to the given []AssetAlias and assigns it to the Path field.
func (o *Asset) SetPath(v []AssetAlias) {
o.Path = &v
}
// GetProperties returns the Properties field value if set, zero value otherwise.
func (o *Asset) GetProperties() map[string]string {
if o == nil || o.Properties == nil {
var ret map[string]string
return ret
}
return *o.Properties
}
// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetPropertiesOk() (*map[string]string, bool) {
if o == nil || o.Properties == nil {
return nil, false
}
return o.Properties, true
}
// HasProperties returns a boolean if a field has been set.
func (o *Asset) HasProperties() bool {
if o != nil && o.Properties != nil {
return true
}
return false
}
// SetProperties gets a reference to the given map[string]string and assigns it to the Properties field.
func (o *Asset) SetProperties(v map[string]string) {
o.Properties = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *Asset) GetTags() []string {
if o == nil || o.Tags == nil {
var ret []string
return ret
}
return *o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetTagsOk() (*[]string, bool) {
if o == nil || o.Tags == nil {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *Asset) HasTags() bool {
if o != nil && o.Tags != nil {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *Asset) SetTags(v []string) {
o.Tags = &v
}
// GetTopicCommand returns the TopicCommand field value if set, zero value otherwise.
func (o *Asset) GetTopicCommand() string {
if o == nil || o.TopicCommand == nil {
var ret string
return ret
}
return *o.TopicCommand
}
// GetTopicCommandOk returns a tuple with the TopicCommand field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetTopicCommandOk() (*string, bool) {
if o == nil || o.TopicCommand == nil {
return nil, false
}
return o.TopicCommand, true
}
// HasTopicCommand returns a boolean if a field has been set.
func (o *Asset) HasTopicCommand() bool {
if o != nil && o.TopicCommand != nil {
return true
}
return false
}
// SetTopicCommand gets a reference to the given string and assigns it to the TopicCommand field.
func (o *Asset) SetTopicCommand(v string) {
o.TopicCommand = &v
}
// GetTopicParamUpdate returns the TopicParamUpdate field value if set, zero value otherwise.
func (o *Asset) GetTopicParamUpdate() string {
if o == nil || o.TopicParamUpdate == nil {
var ret string
return ret
}
return *o.TopicParamUpdate
}
// GetTopicParamUpdateOk returns a tuple with the TopicParamUpdate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetTopicParamUpdateOk() (*string, bool) {
if o == nil || o.TopicParamUpdate == nil {
return nil, false
}
return o.TopicParamUpdate, true
}
// HasTopicParamUpdate returns a boolean if a field has been set.
func (o *Asset) HasTopicParamUpdate() bool {
if o != nil && o.TopicParamUpdate != nil {
return true
}
return false
}
// SetTopicParamUpdate gets a reference to the given string and assigns it to the TopicParamUpdate field.
func (o *Asset) SetTopicParamUpdate(v string) {
o.TopicParamUpdate = &v
}
// GetTopicResourceUpdate returns the TopicResourceUpdate field value if set, zero value otherwise.
func (o *Asset) GetTopicResourceUpdate() string {
if o == nil || o.TopicResourceUpdate == nil {
var ret string
return ret
}
return *o.TopicResourceUpdate
}
// GetTopicResourceUpdateOk returns a tuple with the TopicResourceUpdate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Asset) GetTopicResourceUpdateOk() (*string, bool) {
if o == nil || o.TopicResourceUpdate == nil {
return nil, false
}
return o.TopicResourceUpdate, true
}
// HasTopicResourceUpdate returns a boolean if a field has been set.
func (o *Asset) HasTopicResourceUpdate() bool {
if o != nil && o.TopicResourceUpdate != nil {
return true
}
return false
}
// SetTopicResourceUpdate gets a reference to the given string and assigns it to the TopicResourceUpdate field.
func (o *Asset) SetTopicResourceUpdate(v string) {
o.TopicResourceUpdate = &v
}
func (o Asset) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["connected"] = o.Connected
}
if true {
toSerialize["creationTs"] = o.CreationTs
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.GroupId != nil {
toSerialize["groupId"] = o.GroupId
}
if o.GroupPath != nil {
toSerialize["groupPath"] = o.GroupPath
}
if true {
toSerialize["id"] = o.Id
}
if o.LastUpdateTs != nil {
toSerialize["lastUpdateTs"] = o.LastUpdateTs
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if true {
toSerialize["namespace"] = o.Namespace
}
if o.Path != nil {
toSerialize["path"] = o.Path
}
if o.Properties != nil {
toSerialize["properties"] = o.Properties
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if o.TopicCommand != nil {
toSerialize["topicCommand"] = o.TopicCommand
}
if o.TopicParamUpdate != nil {
toSerialize["topicParamUpdate"] = o.TopicParamUpdate
}
if o.TopicResourceUpdate != nil {
toSerialize["topicResourceUpdate"] = o.TopicResourceUpdate
}
return json.Marshal(toSerialize)
}
type NullableAsset struct {
value *Asset
isSet bool
}
func (v NullableAsset) Get() *Asset {
return v.value
}
func (v *NullableAsset) Set(val *Asset) {
v.value = val
v.isSet = true
}
func (v NullableAsset) IsSet() bool {
return v.isSet
}
func (v *NullableAsset) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAsset(val *Asset) *NullableAsset {
return &NullableAsset{value: val, isSet: true}
}
func (v NullableAsset) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAsset) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}