/
model_shipment_event.go
519 lines (442 loc) · 15.3 KB
/
model_shipment_event.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
/*
DCSA OpenAPI specification for Track & Trace
Provides equipment actual milestones along with Estimated Time of Arrival following DCSA standards
API version: 2.2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package api
import (
"encoding/json"
"time"
)
// checks if the ShipmentEvent type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ShipmentEvent{}
// ShipmentEvent struct for ShipmentEvent
type ShipmentEvent struct {
// The unique identifier for the event (the message - not the source). <b>NB</b>: This field should be considered Metadata
EventID *string `json:"eventID,omitempty"`
// The timestamp of when the event was created. <b>NB</b>: This field should be considered Metadata
EventCreatedDateTime time.Time `json:"eventCreatedDateTime"`
EventType string `json:"eventType"`
// Code for the event classifier can be - ACT (Actual) - PLN (Planned) - EST (Estimated)
EventClassifierCode string `json:"eventClassifierCode"`
// Value for eventDateTime must be the same value as eventCreatedDateTime
EventDateTime interface{} `json:"eventDateTime"`
ShipmentEventTypeCode ShipmentEventTypeCode `json:"shipmentEventTypeCode"`
// The id of the object defined by the documentTypeCode.
DocumentID string `json:"documentID"`
DocumentTypeCode DocumentTypeCode `json:"documentTypeCode"`
// Deprecated
ShipmentInformationTypeCode *ShipmentInformationType `json:"shipmentInformationTypeCode,omitempty"`
// Reason field in a Shipment event. This field can be used to explain why a specific event has been sent.
Reason *string `json:"reason,omitempty"`
// Unique identifier for Event Type Code. For shipment events this can be - RECE (Received) - CONF (Confirmed) - ISSU (Issued) - APPR (Approved) - SUBM (Submitted) - SURR (Surrendered) - REJE (Rejected) - PENA (Pending approval) Deprecated - use shipmentEventTypeCode instead
// Deprecated
EventTypeCode *string `json:"eventTypeCode,omitempty"`
// ID uniquely identifying a shipment. Deprecated - this is replaced by documentID which can contain different values depending on the value of the documentTypeCode field
// Deprecated
ShipmentID interface{} `json:"shipmentID,omitempty"`
References []Reference `json:"references,omitempty"`
}
// NewShipmentEvent instantiates a new ShipmentEvent 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 NewShipmentEvent(eventCreatedDateTime time.Time, eventType string, eventClassifierCode string, eventDateTime interface{}, shipmentEventTypeCode ShipmentEventTypeCode, documentID string, documentTypeCode DocumentTypeCode) *ShipmentEvent {
this := ShipmentEvent{}
this.EventCreatedDateTime = eventCreatedDateTime
this.EventType = eventType
this.EventClassifierCode = eventClassifierCode
this.EventDateTime = eventDateTime
this.ShipmentEventTypeCode = shipmentEventTypeCode
this.DocumentID = documentID
this.DocumentTypeCode = documentTypeCode
return &this
}
// NewShipmentEventWithDefaults instantiates a new ShipmentEvent 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 NewShipmentEventWithDefaults() *ShipmentEvent {
this := ShipmentEvent{}
return &this
}
// GetEventID returns the EventID field value if set, zero value otherwise.
func (o *ShipmentEvent) GetEventID() string {
if o == nil || IsNil(o.EventID) {
var ret string
return ret
}
return *o.EventID
}
// GetEventIDOk returns a tuple with the EventID field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetEventIDOk() (*string, bool) {
if o == nil || IsNil(o.EventID) {
return nil, false
}
return o.EventID, true
}
// HasEventID returns a boolean if a field has been set.
func (o *ShipmentEvent) HasEventID() bool {
if o != nil && !IsNil(o.EventID) {
return true
}
return false
}
// SetEventID gets a reference to the given string and assigns it to the EventID field.
func (o *ShipmentEvent) SetEventID(v string) {
o.EventID = &v
}
// GetEventCreatedDateTime returns the EventCreatedDateTime field value
func (o *ShipmentEvent) GetEventCreatedDateTime() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.EventCreatedDateTime
}
// GetEventCreatedDateTimeOk returns a tuple with the EventCreatedDateTime field value
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetEventCreatedDateTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.EventCreatedDateTime, true
}
// SetEventCreatedDateTime sets field value
func (o *ShipmentEvent) SetEventCreatedDateTime(v time.Time) {
o.EventCreatedDateTime = v
}
// GetEventType returns the EventType field value
func (o *ShipmentEvent) GetEventType() string {
if o == nil {
var ret string
return ret
}
return o.EventType
}
// GetEventTypeOk returns a tuple with the EventType field value
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetEventTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.EventType, true
}
// SetEventType sets field value
func (o *ShipmentEvent) SetEventType(v string) {
o.EventType = v
}
// GetEventClassifierCode returns the EventClassifierCode field value
func (o *ShipmentEvent) GetEventClassifierCode() string {
if o == nil {
var ret string
return ret
}
return o.EventClassifierCode
}
// GetEventClassifierCodeOk returns a tuple with the EventClassifierCode field value
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetEventClassifierCodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.EventClassifierCode, true
}
// SetEventClassifierCode sets field value
func (o *ShipmentEvent) SetEventClassifierCode(v string) {
o.EventClassifierCode = v
}
// GetEventDateTime returns the EventDateTime field value
// If the value is explicit nil, the zero value for interface{} will be returned
func (o *ShipmentEvent) GetEventDateTime() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.EventDateTime
}
// GetEventDateTimeOk returns a tuple with the EventDateTime field value
// 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 *ShipmentEvent) GetEventDateTimeOk() (*interface{}, bool) {
if o == nil || IsNil(o.EventDateTime) {
return nil, false
}
return &o.EventDateTime, true
}
// SetEventDateTime sets field value
func (o *ShipmentEvent) SetEventDateTime(v interface{}) {
o.EventDateTime = v
}
// GetShipmentEventTypeCode returns the ShipmentEventTypeCode field value
func (o *ShipmentEvent) GetShipmentEventTypeCode() ShipmentEventTypeCode {
if o == nil {
var ret ShipmentEventTypeCode
return ret
}
return o.ShipmentEventTypeCode
}
// GetShipmentEventTypeCodeOk returns a tuple with the ShipmentEventTypeCode field value
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetShipmentEventTypeCodeOk() (*ShipmentEventTypeCode, bool) {
if o == nil {
return nil, false
}
return &o.ShipmentEventTypeCode, true
}
// SetShipmentEventTypeCode sets field value
func (o *ShipmentEvent) SetShipmentEventTypeCode(v ShipmentEventTypeCode) {
o.ShipmentEventTypeCode = v
}
// GetDocumentID returns the DocumentID field value
func (o *ShipmentEvent) GetDocumentID() string {
if o == nil {
var ret string
return ret
}
return o.DocumentID
}
// GetDocumentIDOk returns a tuple with the DocumentID field value
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetDocumentIDOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DocumentID, true
}
// SetDocumentID sets field value
func (o *ShipmentEvent) SetDocumentID(v string) {
o.DocumentID = v
}
// GetDocumentTypeCode returns the DocumentTypeCode field value
func (o *ShipmentEvent) GetDocumentTypeCode() DocumentTypeCode {
if o == nil {
var ret DocumentTypeCode
return ret
}
return o.DocumentTypeCode
}
// GetDocumentTypeCodeOk returns a tuple with the DocumentTypeCode field value
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetDocumentTypeCodeOk() (*DocumentTypeCode, bool) {
if o == nil {
return nil, false
}
return &o.DocumentTypeCode, true
}
// SetDocumentTypeCode sets field value
func (o *ShipmentEvent) SetDocumentTypeCode(v DocumentTypeCode) {
o.DocumentTypeCode = v
}
// GetShipmentInformationTypeCode returns the ShipmentInformationTypeCode field value if set, zero value otherwise.
// Deprecated
func (o *ShipmentEvent) GetShipmentInformationTypeCode() ShipmentInformationType {
if o == nil || IsNil(o.ShipmentInformationTypeCode) {
var ret ShipmentInformationType
return ret
}
return *o.ShipmentInformationTypeCode
}
// GetShipmentInformationTypeCodeOk returns a tuple with the ShipmentInformationTypeCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *ShipmentEvent) GetShipmentInformationTypeCodeOk() (*ShipmentInformationType, bool) {
if o == nil || IsNil(o.ShipmentInformationTypeCode) {
return nil, false
}
return o.ShipmentInformationTypeCode, true
}
// HasShipmentInformationTypeCode returns a boolean if a field has been set.
func (o *ShipmentEvent) HasShipmentInformationTypeCode() bool {
if o != nil && !IsNil(o.ShipmentInformationTypeCode) {
return true
}
return false
}
// SetShipmentInformationTypeCode gets a reference to the given ShipmentInformationType and assigns it to the ShipmentInformationTypeCode field.
// Deprecated
func (o *ShipmentEvent) SetShipmentInformationTypeCode(v ShipmentInformationType) {
o.ShipmentInformationTypeCode = &v
}
// GetReason returns the Reason field value if set, zero value otherwise.
func (o *ShipmentEvent) GetReason() string {
if o == nil || IsNil(o.Reason) {
var ret string
return ret
}
return *o.Reason
}
// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetReasonOk() (*string, bool) {
if o == nil || IsNil(o.Reason) {
return nil, false
}
return o.Reason, true
}
// HasReason returns a boolean if a field has been set.
func (o *ShipmentEvent) HasReason() bool {
if o != nil && !IsNil(o.Reason) {
return true
}
return false
}
// SetReason gets a reference to the given string and assigns it to the Reason field.
func (o *ShipmentEvent) SetReason(v string) {
o.Reason = &v
}
// GetEventTypeCode returns the EventTypeCode field value if set, zero value otherwise.
// Deprecated
func (o *ShipmentEvent) GetEventTypeCode() string {
if o == nil || IsNil(o.EventTypeCode) {
var ret string
return ret
}
return *o.EventTypeCode
}
// GetEventTypeCodeOk returns a tuple with the EventTypeCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *ShipmentEvent) GetEventTypeCodeOk() (*string, bool) {
if o == nil || IsNil(o.EventTypeCode) {
return nil, false
}
return o.EventTypeCode, true
}
// HasEventTypeCode returns a boolean if a field has been set.
func (o *ShipmentEvent) HasEventTypeCode() bool {
if o != nil && !IsNil(o.EventTypeCode) {
return true
}
return false
}
// SetEventTypeCode gets a reference to the given string and assigns it to the EventTypeCode field.
// Deprecated
func (o *ShipmentEvent) SetEventTypeCode(v string) {
o.EventTypeCode = &v
}
// GetShipmentID returns the ShipmentID field value if set, zero value otherwise (both if not set or set to explicit null).
// Deprecated
func (o *ShipmentEvent) GetShipmentID() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.ShipmentID
}
// GetShipmentIDOk returns a tuple with the ShipmentID 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
// Deprecated
func (o *ShipmentEvent) GetShipmentIDOk() (*interface{}, bool) {
if o == nil || IsNil(o.ShipmentID) {
return nil, false
}
return &o.ShipmentID, true
}
// HasShipmentID returns a boolean if a field has been set.
func (o *ShipmentEvent) HasShipmentID() bool {
if o != nil && IsNil(o.ShipmentID) {
return true
}
return false
}
// SetShipmentID gets a reference to the given interface{} and assigns it to the ShipmentID field.
// Deprecated
func (o *ShipmentEvent) SetShipmentID(v interface{}) {
o.ShipmentID = v
}
// GetReferences returns the References field value if set, zero value otherwise.
func (o *ShipmentEvent) GetReferences() []Reference {
if o == nil || IsNil(o.References) {
var ret []Reference
return ret
}
return o.References
}
// GetReferencesOk returns a tuple with the References field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShipmentEvent) GetReferencesOk() ([]Reference, bool) {
if o == nil || IsNil(o.References) {
return nil, false
}
return o.References, true
}
// HasReferences returns a boolean if a field has been set.
func (o *ShipmentEvent) HasReferences() bool {
if o != nil && !IsNil(o.References) {
return true
}
return false
}
// SetReferences gets a reference to the given []Reference and assigns it to the References field.
func (o *ShipmentEvent) SetReferences(v []Reference) {
o.References = v
}
func (o ShipmentEvent) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ShipmentEvent) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.EventID) {
toSerialize["eventID"] = o.EventID
}
toSerialize["eventCreatedDateTime"] = o.EventCreatedDateTime
toSerialize["eventType"] = o.EventType
toSerialize["eventClassifierCode"] = o.EventClassifierCode
if o.EventDateTime != nil {
toSerialize["eventDateTime"] = o.EventDateTime
}
toSerialize["shipmentEventTypeCode"] = o.ShipmentEventTypeCode
toSerialize["documentID"] = o.DocumentID
toSerialize["documentTypeCode"] = o.DocumentTypeCode
if !IsNil(o.ShipmentInformationTypeCode) {
toSerialize["shipmentInformationTypeCode"] = o.ShipmentInformationTypeCode
}
if !IsNil(o.Reason) {
toSerialize["reason"] = o.Reason
}
if !IsNil(o.EventTypeCode) {
toSerialize["eventTypeCode"] = o.EventTypeCode
}
if o.ShipmentID != nil {
toSerialize["shipmentID"] = o.ShipmentID
}
if !IsNil(o.References) {
toSerialize["references"] = o.References
}
return toSerialize, nil
}
type NullableShipmentEvent struct {
value *ShipmentEvent
isSet bool
}
func (v NullableShipmentEvent) Get() *ShipmentEvent {
return v.value
}
func (v *NullableShipmentEvent) Set(val *ShipmentEvent) {
v.value = val
v.isSet = true
}
func (v NullableShipmentEvent) IsSet() bool {
return v.isSet
}
func (v *NullableShipmentEvent) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableShipmentEvent(val *ShipmentEvent) *NullableShipmentEvent {
return &NullableShipmentEvent{value: val, isSet: true}
}
func (v NullableShipmentEvent) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableShipmentEvent) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}