-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_order.go
735 lines (627 loc) · 19.3 KB
/
model_order.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
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
/*
ShipBob Developer API
ShipBob Developer API Documentation
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package shipbob
import (
"encoding/json"
"time"
)
// checks if the Order type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Order{}
// Order struct for Order
type Order struct {
Channel *ChannelInfo `json:"channel,omitempty"`
// Date this order was created
CreatedDate NullableTime `json:"created_date,omitempty"`
Financials *Financials `json:"financials,omitempty"`
// Gift message associated with the order
GiftMessage *string `json:"gift_message,omitempty"`
// Unique id of the order
Id *int32 `json:"id,omitempty"`
// User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used
OrderNumber *string `json:"order_number,omitempty"`
// List of products included in the order
Products []ProductInfo `json:"products,omitempty"`
// Date this order was purchase by the end user
PurchaseDate NullableTime `json:"purchase_date,omitempty"`
Recipient *RecipientInfo `json:"recipient,omitempty"`
// Client-defined external unique id of the order
ReferenceId *string `json:"reference_id,omitempty"`
RetailerProgramData *RetailerProgramData `json:"retailer_program_data,omitempty"`
// Shipments affiliated with the order
Shipments []Shipment `json:"shipments,omitempty"`
// Client-defined shipping method
ShippingMethod *string `json:"shipping_method,omitempty"`
ShippingTerms *ShippingTerms `json:"shipping_terms,omitempty"`
// The order status
Status *string `json:"status,omitempty"`
// Client-defined order tags
Tags []Tag `json:"tags,omitempty"`
// Shipment type of the order
Type *string `json:"type,omitempty"`
}
// NewOrder instantiates a new Order 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 NewOrder() *Order {
this := Order{}
return &this
}
// NewOrderWithDefaults instantiates a new Order 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 NewOrderWithDefaults() *Order {
this := Order{}
return &this
}
// GetChannel returns the Channel field value if set, zero value otherwise.
func (o *Order) GetChannel() ChannelInfo {
if o == nil || IsNil(o.Channel) {
var ret ChannelInfo
return ret
}
return *o.Channel
}
// GetChannelOk returns a tuple with the Channel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetChannelOk() (*ChannelInfo, bool) {
if o == nil || IsNil(o.Channel) {
return nil, false
}
return o.Channel, true
}
// HasChannel returns a boolean if a field has been set.
func (o *Order) HasChannel() bool {
if o != nil && !IsNil(o.Channel) {
return true
}
return false
}
// SetChannel gets a reference to the given ChannelInfo and assigns it to the Channel field.
func (o *Order) SetChannel(v ChannelInfo) {
o.Channel = &v
}
// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Order) GetCreatedDate() time.Time {
if o == nil || IsNil(o.CreatedDate.Get()) {
var ret time.Time
return ret
}
return *o.CreatedDate.Get()
}
// GetCreatedDateOk returns a tuple with the CreatedDate 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 *Order) GetCreatedDateOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.CreatedDate.Get(), o.CreatedDate.IsSet()
}
// HasCreatedDate returns a boolean if a field has been set.
func (o *Order) HasCreatedDate() bool {
if o != nil && o.CreatedDate.IsSet() {
return true
}
return false
}
// SetCreatedDate gets a reference to the given NullableTime and assigns it to the CreatedDate field.
func (o *Order) SetCreatedDate(v time.Time) {
o.CreatedDate.Set(&v)
}
// SetCreatedDateNil sets the value for CreatedDate to be an explicit nil
func (o *Order) SetCreatedDateNil() {
o.CreatedDate.Set(nil)
}
// UnsetCreatedDate ensures that no value is present for CreatedDate, not even an explicit nil
func (o *Order) UnsetCreatedDate() {
o.CreatedDate.Unset()
}
// GetFinancials returns the Financials field value if set, zero value otherwise.
func (o *Order) GetFinancials() Financials {
if o == nil || IsNil(o.Financials) {
var ret Financials
return ret
}
return *o.Financials
}
// GetFinancialsOk returns a tuple with the Financials field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetFinancialsOk() (*Financials, bool) {
if o == nil || IsNil(o.Financials) {
return nil, false
}
return o.Financials, true
}
// HasFinancials returns a boolean if a field has been set.
func (o *Order) HasFinancials() bool {
if o != nil && !IsNil(o.Financials) {
return true
}
return false
}
// SetFinancials gets a reference to the given Financials and assigns it to the Financials field.
func (o *Order) SetFinancials(v Financials) {
o.Financials = &v
}
// GetGiftMessage returns the GiftMessage field value if set, zero value otherwise.
func (o *Order) GetGiftMessage() string {
if o == nil || IsNil(o.GiftMessage) {
var ret string
return ret
}
return *o.GiftMessage
}
// GetGiftMessageOk returns a tuple with the GiftMessage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetGiftMessageOk() (*string, bool) {
if o == nil || IsNil(o.GiftMessage) {
return nil, false
}
return o.GiftMessage, true
}
// HasGiftMessage returns a boolean if a field has been set.
func (o *Order) HasGiftMessage() bool {
if o != nil && !IsNil(o.GiftMessage) {
return true
}
return false
}
// SetGiftMessage gets a reference to the given string and assigns it to the GiftMessage field.
func (o *Order) SetGiftMessage(v string) {
o.GiftMessage = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Order) GetId() int32 {
if o == nil || IsNil(o.Id) {
var ret int32
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 *Order) GetIdOk() (*int32, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Order) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given int32 and assigns it to the Id field.
func (o *Order) SetId(v int32) {
o.Id = &v
}
// GetOrderNumber returns the OrderNumber field value if set, zero value otherwise.
func (o *Order) GetOrderNumber() string {
if o == nil || IsNil(o.OrderNumber) {
var ret string
return ret
}
return *o.OrderNumber
}
// GetOrderNumberOk returns a tuple with the OrderNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetOrderNumberOk() (*string, bool) {
if o == nil || IsNil(o.OrderNumber) {
return nil, false
}
return o.OrderNumber, true
}
// HasOrderNumber returns a boolean if a field has been set.
func (o *Order) HasOrderNumber() bool {
if o != nil && !IsNil(o.OrderNumber) {
return true
}
return false
}
// SetOrderNumber gets a reference to the given string and assigns it to the OrderNumber field.
func (o *Order) SetOrderNumber(v string) {
o.OrderNumber = &v
}
// GetProducts returns the Products field value if set, zero value otherwise.
func (o *Order) GetProducts() []ProductInfo {
if o == nil || IsNil(o.Products) {
var ret []ProductInfo
return ret
}
return o.Products
}
// GetProductsOk returns a tuple with the Products field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetProductsOk() ([]ProductInfo, bool) {
if o == nil || IsNil(o.Products) {
return nil, false
}
return o.Products, true
}
// HasProducts returns a boolean if a field has been set.
func (o *Order) HasProducts() bool {
if o != nil && !IsNil(o.Products) {
return true
}
return false
}
// SetProducts gets a reference to the given []ProductInfo and assigns it to the Products field.
func (o *Order) SetProducts(v []ProductInfo) {
o.Products = v
}
// GetPurchaseDate returns the PurchaseDate field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Order) GetPurchaseDate() time.Time {
if o == nil || IsNil(o.PurchaseDate.Get()) {
var ret time.Time
return ret
}
return *o.PurchaseDate.Get()
}
// GetPurchaseDateOk returns a tuple with the PurchaseDate 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 *Order) GetPurchaseDateOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.PurchaseDate.Get(), o.PurchaseDate.IsSet()
}
// HasPurchaseDate returns a boolean if a field has been set.
func (o *Order) HasPurchaseDate() bool {
if o != nil && o.PurchaseDate.IsSet() {
return true
}
return false
}
// SetPurchaseDate gets a reference to the given NullableTime and assigns it to the PurchaseDate field.
func (o *Order) SetPurchaseDate(v time.Time) {
o.PurchaseDate.Set(&v)
}
// SetPurchaseDateNil sets the value for PurchaseDate to be an explicit nil
func (o *Order) SetPurchaseDateNil() {
o.PurchaseDate.Set(nil)
}
// UnsetPurchaseDate ensures that no value is present for PurchaseDate, not even an explicit nil
func (o *Order) UnsetPurchaseDate() {
o.PurchaseDate.Unset()
}
// GetRecipient returns the Recipient field value if set, zero value otherwise.
func (o *Order) GetRecipient() RecipientInfo {
if o == nil || IsNil(o.Recipient) {
var ret RecipientInfo
return ret
}
return *o.Recipient
}
// GetRecipientOk returns a tuple with the Recipient field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetRecipientOk() (*RecipientInfo, bool) {
if o == nil || IsNil(o.Recipient) {
return nil, false
}
return o.Recipient, true
}
// HasRecipient returns a boolean if a field has been set.
func (o *Order) HasRecipient() bool {
if o != nil && !IsNil(o.Recipient) {
return true
}
return false
}
// SetRecipient gets a reference to the given RecipientInfo and assigns it to the Recipient field.
func (o *Order) SetRecipient(v RecipientInfo) {
o.Recipient = &v
}
// GetReferenceId returns the ReferenceId field value if set, zero value otherwise.
func (o *Order) GetReferenceId() string {
if o == nil || IsNil(o.ReferenceId) {
var ret string
return ret
}
return *o.ReferenceId
}
// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetReferenceIdOk() (*string, bool) {
if o == nil || IsNil(o.ReferenceId) {
return nil, false
}
return o.ReferenceId, true
}
// HasReferenceId returns a boolean if a field has been set.
func (o *Order) HasReferenceId() bool {
if o != nil && !IsNil(o.ReferenceId) {
return true
}
return false
}
// SetReferenceId gets a reference to the given string and assigns it to the ReferenceId field.
func (o *Order) SetReferenceId(v string) {
o.ReferenceId = &v
}
// GetRetailerProgramData returns the RetailerProgramData field value if set, zero value otherwise.
func (o *Order) GetRetailerProgramData() RetailerProgramData {
if o == nil || IsNil(o.RetailerProgramData) {
var ret RetailerProgramData
return ret
}
return *o.RetailerProgramData
}
// GetRetailerProgramDataOk returns a tuple with the RetailerProgramData field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetRetailerProgramDataOk() (*RetailerProgramData, bool) {
if o == nil || IsNil(o.RetailerProgramData) {
return nil, false
}
return o.RetailerProgramData, true
}
// HasRetailerProgramData returns a boolean if a field has been set.
func (o *Order) HasRetailerProgramData() bool {
if o != nil && !IsNil(o.RetailerProgramData) {
return true
}
return false
}
// SetRetailerProgramData gets a reference to the given RetailerProgramData and assigns it to the RetailerProgramData field.
func (o *Order) SetRetailerProgramData(v RetailerProgramData) {
o.RetailerProgramData = &v
}
// GetShipments returns the Shipments field value if set, zero value otherwise.
func (o *Order) GetShipments() []Shipment {
if o == nil || IsNil(o.Shipments) {
var ret []Shipment
return ret
}
return o.Shipments
}
// GetShipmentsOk returns a tuple with the Shipments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetShipmentsOk() ([]Shipment, bool) {
if o == nil || IsNil(o.Shipments) {
return nil, false
}
return o.Shipments, true
}
// HasShipments returns a boolean if a field has been set.
func (o *Order) HasShipments() bool {
if o != nil && !IsNil(o.Shipments) {
return true
}
return false
}
// SetShipments gets a reference to the given []Shipment and assigns it to the Shipments field.
func (o *Order) SetShipments(v []Shipment) {
o.Shipments = v
}
// GetShippingMethod returns the ShippingMethod field value if set, zero value otherwise.
func (o *Order) GetShippingMethod() string {
if o == nil || IsNil(o.ShippingMethod) {
var ret string
return ret
}
return *o.ShippingMethod
}
// GetShippingMethodOk returns a tuple with the ShippingMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetShippingMethodOk() (*string, bool) {
if o == nil || IsNil(o.ShippingMethod) {
return nil, false
}
return o.ShippingMethod, true
}
// HasShippingMethod returns a boolean if a field has been set.
func (o *Order) HasShippingMethod() bool {
if o != nil && !IsNil(o.ShippingMethod) {
return true
}
return false
}
// SetShippingMethod gets a reference to the given string and assigns it to the ShippingMethod field.
func (o *Order) SetShippingMethod(v string) {
o.ShippingMethod = &v
}
// GetShippingTerms returns the ShippingTerms field value if set, zero value otherwise.
func (o *Order) GetShippingTerms() ShippingTerms {
if o == nil || IsNil(o.ShippingTerms) {
var ret ShippingTerms
return ret
}
return *o.ShippingTerms
}
// GetShippingTermsOk returns a tuple with the ShippingTerms field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetShippingTermsOk() (*ShippingTerms, bool) {
if o == nil || IsNil(o.ShippingTerms) {
return nil, false
}
return o.ShippingTerms, true
}
// HasShippingTerms returns a boolean if a field has been set.
func (o *Order) HasShippingTerms() bool {
if o != nil && !IsNil(o.ShippingTerms) {
return true
}
return false
}
// SetShippingTerms gets a reference to the given ShippingTerms and assigns it to the ShippingTerms field.
func (o *Order) SetShippingTerms(v ShippingTerms) {
o.ShippingTerms = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Order) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *Order) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *Order) SetStatus(v string) {
o.Status = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *Order) GetTags() []Tag {
if o == nil || IsNil(o.Tags) {
var ret []Tag
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 *Order) GetTagsOk() ([]Tag, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *Order) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []Tag and assigns it to the Tags field.
func (o *Order) SetTags(v []Tag) {
o.Tags = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Order) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Order) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *Order) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *Order) SetType(v string) {
o.Type = &v
}
func (o Order) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Order) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Channel) {
toSerialize["channel"] = o.Channel
}
if o.CreatedDate.IsSet() {
toSerialize["created_date"] = o.CreatedDate.Get()
}
if !IsNil(o.Financials) {
toSerialize["financials"] = o.Financials
}
if !IsNil(o.GiftMessage) {
toSerialize["gift_message"] = o.GiftMessage
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.OrderNumber) {
toSerialize["order_number"] = o.OrderNumber
}
if !IsNil(o.Products) {
toSerialize["products"] = o.Products
}
if o.PurchaseDate.IsSet() {
toSerialize["purchase_date"] = o.PurchaseDate.Get()
}
if !IsNil(o.Recipient) {
toSerialize["recipient"] = o.Recipient
}
if !IsNil(o.ReferenceId) {
toSerialize["reference_id"] = o.ReferenceId
}
if !IsNil(o.RetailerProgramData) {
toSerialize["retailer_program_data"] = o.RetailerProgramData
}
if !IsNil(o.Shipments) {
toSerialize["shipments"] = o.Shipments
}
if !IsNil(o.ShippingMethod) {
toSerialize["shipping_method"] = o.ShippingMethod
}
if !IsNil(o.ShippingTerms) {
toSerialize["shipping_terms"] = o.ShippingTerms
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
return toSerialize, nil
}
type NullableOrder struct {
value *Order
isSet bool
}
func (v NullableOrder) Get() *Order {
return v.value
}
func (v *NullableOrder) Set(val *Order) {
v.value = val
v.isSet = true
}
func (v NullableOrder) IsSet() bool {
return v.isSet
}
func (v *NullableOrder) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableOrder(val *Order) *NullableOrder {
return &NullableOrder{value: val, isSet: true}
}
func (v NullableOrder) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableOrder) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}