-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_tracking_event_normal.go
executable file
·415 lines (351 loc) · 12.3 KB
/
model_tracking_event_normal.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
/*
Lob
The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
API version: 1.3.0
Contact: lob-openapi@lob.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package lob
import (
"encoding/json"
"time"
)
// TrackingEventNormal struct for TrackingEventNormal
type TrackingEventNormal struct {
// non-Certified postcards, self mailers, letters, and checks
Type string `json:"type"`
// Name of tracking event (for normal postcards, self mailers, letters, and checks): * `In Transit` - The mailpiece is being processed at the entry/origin facility. * `In Local Area` - The mailpiece is being processed at the destination facility. * `Processed for Delivery` - The mailpiece has been greenlit for delivery at the recipient's nearest postal facility. The mailpiece should reach the mailbox within 1 business day of this tracking event. * `Re-Routed` - The mailpiece is re-routed due to recipient change of address, address errors, or USPS relabeling of barcode/ID tag area. * `Returned to Sender` - The mailpiece is being returned to sender due to barcode, ID tag area, or address errors. * `Mailed` - The mailpiece has been handed off to and accepted by USPS and is en route. [More about Mailed.](https://support.lob.com/hc/en-us/articles/360001724400-What-does-a-Mailed-tracking-event-mean-) Note this data is only available in Enterprise editions of Lob. [Contact Sales](https://lob.com/support/contact#contact) if you want access to this feature. [More about tracking](https://support.lob.com/hc/en-us/articles/115000097404-Can-I-track-my-mail-)
Name string `json:"name"`
// Will be `null` for `type=normal` events
Details map[string]interface{} `json:"details,omitempty"`
// The zip code in which the scan event occurred. Null for `Mailed` events.
Location NullableString `json:"location,omitempty"`
// Unique identifier prefixed with `evnt_`.
Id *string `json:"id,omitempty"`
// A timestamp in ISO 8601 format of the date USPS registered the event.
Time *time.Time `json:"time,omitempty"`
// A timestamp in ISO 8601 format of the date the resource was created.
DateCreated *time.Time `json:"date_created,omitempty"`
// A timestamp in ISO 8601 format of the date the resource was last modified.
DateModified *time.Time `json:"date_modified,omitempty"`
Object *string `json:"object,omitempty"`
}
// NewTrackingEventNormal instantiates a new TrackingEventNormal 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 NewTrackingEventNormal(type_ string, name string) *TrackingEventNormal {
this := TrackingEventNormal{}
this.Type = type_
this.Name = name
var object string = "tracking_event"
this.Object = &object
return &this
}
// NewTrackingEventNormalWithDefaults instantiates a new TrackingEventNormal 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 NewTrackingEventNormalWithDefaults() *TrackingEventNormal {
this := TrackingEventNormal{}
var object string = "tracking_event"
this.Object = &object
return &this
}
// GetType returns the Type field value
func (o *TrackingEventNormal) 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 *TrackingEventNormal) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *TrackingEventNormal) SetType(v string) {
o.Type = v
}
// GetName returns the Name field value
func (o *TrackingEventNormal) 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 *TrackingEventNormal) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *TrackingEventNormal) SetName(v string) {
o.Name = v
}
// GetDetails returns the Details field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TrackingEventNormal) GetDetails() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Details
}
// GetDetailsOk returns a tuple with the Details 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 *TrackingEventNormal) GetDetailsOk() (map[string]interface{}, bool) {
if o == nil || o.Details == nil {
return nil, false
}
return o.Details, true
}
// HasDetails returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasDetails() bool {
if o != nil && o.Details != nil {
return true
}
return false
}
// SetDetails gets a reference to the given map[string]interface{} and assigns it to the Details field.
func (o *TrackingEventNormal) SetDetails(v map[string]interface{}) {
o.Details = v
}
// GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *TrackingEventNormal) GetLocation() string {
if o == nil || o.Location.Get() == nil {
var ret string
return ret
}
return *o.Location.Get()
}
// GetLocationOk returns a tuple with the Location 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 *TrackingEventNormal) GetLocationOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Location.Get(), o.Location.IsSet()
}
// HasLocation returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasLocation() bool {
if o != nil && o.Location.IsSet() {
return true
}
return false
}
// SetLocation gets a reference to the given NullableString and assigns it to the Location field.
func (o *TrackingEventNormal) SetLocation(v string) {
o.Location.Set(&v)
}
// SetLocationNil sets the value for Location to be an explicit nil
func (o *TrackingEventNormal) SetLocationNil() {
o.Location.Set(nil)
}
// UnsetLocation ensures that no value is present for Location, not even an explicit nil
func (o *TrackingEventNormal) UnsetLocation() {
o.Location.Unset()
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *TrackingEventNormal) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrackingEventNormal) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *TrackingEventNormal) SetId(v string) {
o.Id = &v
}
// GetTime returns the Time field value if set, zero value otherwise.
func (o *TrackingEventNormal) GetTime() time.Time {
if o == nil || o.Time == nil {
var ret time.Time
return ret
}
return *o.Time
}
// GetTimeOk returns a tuple with the Time field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrackingEventNormal) GetTimeOk() (*time.Time, bool) {
if o == nil || o.Time == nil {
return nil, false
}
return o.Time, true
}
// HasTime returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasTime() bool {
if o != nil && o.Time != nil {
return true
}
return false
}
// SetTime gets a reference to the given time.Time and assigns it to the Time field.
func (o *TrackingEventNormal) SetTime(v time.Time) {
o.Time = &v
}
// GetDateCreated returns the DateCreated field value if set, zero value otherwise.
func (o *TrackingEventNormal) GetDateCreated() time.Time {
if o == nil || o.DateCreated == nil {
var ret time.Time
return ret
}
return *o.DateCreated
}
// GetDateCreatedOk returns a tuple with the DateCreated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrackingEventNormal) GetDateCreatedOk() (*time.Time, bool) {
if o == nil || o.DateCreated == nil {
return nil, false
}
return o.DateCreated, true
}
// HasDateCreated returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasDateCreated() bool {
if o != nil && o.DateCreated != nil {
return true
}
return false
}
// SetDateCreated gets a reference to the given time.Time and assigns it to the DateCreated field.
func (o *TrackingEventNormal) SetDateCreated(v time.Time) {
o.DateCreated = &v
}
// GetDateModified returns the DateModified field value if set, zero value otherwise.
func (o *TrackingEventNormal) GetDateModified() time.Time {
if o == nil || o.DateModified == nil {
var ret time.Time
return ret
}
return *o.DateModified
}
// GetDateModifiedOk returns a tuple with the DateModified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrackingEventNormal) GetDateModifiedOk() (*time.Time, bool) {
if o == nil || o.DateModified == nil {
return nil, false
}
return o.DateModified, true
}
// HasDateModified returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasDateModified() bool {
if o != nil && o.DateModified != nil {
return true
}
return false
}
// SetDateModified gets a reference to the given time.Time and assigns it to the DateModified field.
func (o *TrackingEventNormal) SetDateModified(v time.Time) {
o.DateModified = &v
}
// GetObject returns the Object field value if set, zero value otherwise.
func (o *TrackingEventNormal) GetObject() string {
if o == nil || o.Object == nil {
var ret string
return ret
}
return *o.Object
}
// GetObjectOk returns a tuple with the Object field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *TrackingEventNormal) GetObjectOk() (*string, bool) {
if o == nil || o.Object == nil {
return nil, false
}
return o.Object, true
}
// HasObject returns a boolean if a field has been set.
func (o *TrackingEventNormal) HasObject() bool {
if o != nil && o.Object != nil {
return true
}
return false
}
// SetObject gets a reference to the given string and assigns it to the Object field.
func (o *TrackingEventNormal) SetObject(v string) {
o.Object = &v
}
func (o TrackingEventNormal) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["type"] = o.Type
}
if true {
toSerialize["name"] = o.Name
}
if o.Details != nil {
toSerialize["details"] = o.Details
}
if o.Location.IsSet() {
toSerialize["location"] = o.Location.Get()
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Time != nil {
toSerialize["time"] = o.Time
}
if o.DateCreated != nil {
toSerialize["date_created"] = o.DateCreated
}
if o.DateModified != nil {
toSerialize["date_modified"] = o.DateModified
}
if o.Object != nil {
toSerialize["object"] = o.Object
}
return json.Marshal(toSerialize)
}
type NullableTrackingEventNormal struct {
value *TrackingEventNormal
isSet bool
}
func (v NullableTrackingEventNormal) Get() *TrackingEventNormal {
return v.value
}
func (v *NullableTrackingEventNormal) Set(val *TrackingEventNormal) {
v.value = val
v.isSet = true
}
func (v NullableTrackingEventNormal) IsSet() bool {
return v.isSet
}
func (v *NullableTrackingEventNormal) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTrackingEventNormal(val *TrackingEventNormal) *NullableTrackingEventNormal {
return &NullableTrackingEventNormal{value: val, isSet: true}
}
func (v NullableTrackingEventNormal) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableTrackingEventNormal) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}