-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_card_order.go
executable file
·554 lines (472 loc) · 14.6 KB
/
model_card_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
/*
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"
)
// CardOrder struct for CardOrder
type CardOrder struct {
// Unique identifier prefixed with `co_`.
Id *string `json:"id,omitempty"`
// Unique identifier prefixed with `card_`.
CardId *string `json:"card_id,omitempty"`
// The status of the card order.
Status *string `json:"status,omitempty"`
// The inventory of the card order.
Inventory *float32 `json:"inventory,omitempty"`
// The quantity of cards ordered
QuantityOrdered *float32 `json:"quantity_ordered,omitempty"`
// The unit price for the card order.
UnitPrice *float32 `json:"unit_price,omitempty"`
// The reason for cancellation.
CancelledReason *string `json:"cancelled_reason,omitempty"`
// A timestamp in ISO 8601 format of the date the resource was created.
AvailabilityDate *time.Time `json:"availability_date,omitempty"`
// The fixed deadline for the cards to be printed.
ExpectedAvailabilityDate *time.Time `json:"expected_availability_date,omitempty"`
// A timestamp in ISO 8601 format of the date the resource was created.
DateCreated time.Time `json:"date_created"`
// A timestamp in ISO 8601 format of the date the resource was last modified.
DateModified time.Time `json:"date_modified"`
// Only returned if the resource has been successfully deleted.
Deleted *bool `json:"deleted,omitempty"`
// Value is type of resource.
Object string `json:"object"`
}
// NewCardOrder instantiates a new CardOrder 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 NewCardOrder(dateCreated time.Time, dateModified time.Time, object string) *CardOrder {
this := CardOrder{}
var inventory float32 = 0
this.Inventory = &inventory
var quantityOrdered float32 = 0
this.QuantityOrdered = &quantityOrdered
var unitPrice float32 = 0
this.UnitPrice = &unitPrice
this.DateCreated = dateCreated
this.DateModified = dateModified
this.Object = object
return &this
}
// NewCardOrderWithDefaults instantiates a new CardOrder 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 NewCardOrderWithDefaults() *CardOrder {
this := CardOrder{}
var inventory float32 = 0
this.Inventory = &inventory
var quantityOrdered float32 = 0
this.QuantityOrdered = &quantityOrdered
var unitPrice float32 = 0
this.UnitPrice = &unitPrice
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CardOrder) 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 *CardOrder) 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 *CardOrder) 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 *CardOrder) SetId(v string) {
o.Id = &v
}
// GetCardId returns the CardId field value if set, zero value otherwise.
func (o *CardOrder) GetCardId() string {
if o == nil || o.CardId == nil {
var ret string
return ret
}
return *o.CardId
}
// GetCardIdOk returns a tuple with the CardId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetCardIdOk() (*string, bool) {
if o == nil || o.CardId == nil {
return nil, false
}
return o.CardId, true
}
// HasCardId returns a boolean if a field has been set.
func (o *CardOrder) HasCardId() bool {
if o != nil && o.CardId != nil {
return true
}
return false
}
// SetCardId gets a reference to the given string and assigns it to the CardId field.
func (o *CardOrder) SetCardId(v string) {
o.CardId = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *CardOrder) GetStatus() string {
if o == nil || o.Status == nil {
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 *CardOrder) GetStatusOk() (*string, bool) {
if o == nil || o.Status == nil {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *CardOrder) HasStatus() bool {
if o != nil && o.Status != nil {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *CardOrder) SetStatus(v string) {
o.Status = &v
}
// GetInventory returns the Inventory field value if set, zero value otherwise.
func (o *CardOrder) GetInventory() float32 {
if o == nil || o.Inventory == nil {
var ret float32
return ret
}
return *o.Inventory
}
// GetInventoryOk returns a tuple with the Inventory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetInventoryOk() (*float32, bool) {
if o == nil || o.Inventory == nil {
return nil, false
}
return o.Inventory, true
}
// HasInventory returns a boolean if a field has been set.
func (o *CardOrder) HasInventory() bool {
if o != nil && o.Inventory != nil {
return true
}
return false
}
// SetInventory gets a reference to the given float32 and assigns it to the Inventory field.
func (o *CardOrder) SetInventory(v float32) {
o.Inventory = &v
}
// GetQuantityOrdered returns the QuantityOrdered field value if set, zero value otherwise.
func (o *CardOrder) GetQuantityOrdered() float32 {
if o == nil || o.QuantityOrdered == nil {
var ret float32
return ret
}
return *o.QuantityOrdered
}
// GetQuantityOrderedOk returns a tuple with the QuantityOrdered field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetQuantityOrderedOk() (*float32, bool) {
if o == nil || o.QuantityOrdered == nil {
return nil, false
}
return o.QuantityOrdered, true
}
// HasQuantityOrdered returns a boolean if a field has been set.
func (o *CardOrder) HasQuantityOrdered() bool {
if o != nil && o.QuantityOrdered != nil {
return true
}
return false
}
// SetQuantityOrdered gets a reference to the given float32 and assigns it to the QuantityOrdered field.
func (o *CardOrder) SetQuantityOrdered(v float32) {
o.QuantityOrdered = &v
}
// GetUnitPrice returns the UnitPrice field value if set, zero value otherwise.
func (o *CardOrder) GetUnitPrice() float32 {
if o == nil || o.UnitPrice == nil {
var ret float32
return ret
}
return *o.UnitPrice
}
// GetUnitPriceOk returns a tuple with the UnitPrice field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetUnitPriceOk() (*float32, bool) {
if o == nil || o.UnitPrice == nil {
return nil, false
}
return o.UnitPrice, true
}
// HasUnitPrice returns a boolean if a field has been set.
func (o *CardOrder) HasUnitPrice() bool {
if o != nil && o.UnitPrice != nil {
return true
}
return false
}
// SetUnitPrice gets a reference to the given float32 and assigns it to the UnitPrice field.
func (o *CardOrder) SetUnitPrice(v float32) {
o.UnitPrice = &v
}
// GetCancelledReason returns the CancelledReason field value if set, zero value otherwise.
func (o *CardOrder) GetCancelledReason() string {
if o == nil || o.CancelledReason == nil {
var ret string
return ret
}
return *o.CancelledReason
}
// GetCancelledReasonOk returns a tuple with the CancelledReason field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetCancelledReasonOk() (*string, bool) {
if o == nil || o.CancelledReason == nil {
return nil, false
}
return o.CancelledReason, true
}
// HasCancelledReason returns a boolean if a field has been set.
func (o *CardOrder) HasCancelledReason() bool {
if o != nil && o.CancelledReason != nil {
return true
}
return false
}
// SetCancelledReason gets a reference to the given string and assigns it to the CancelledReason field.
func (o *CardOrder) SetCancelledReason(v string) {
o.CancelledReason = &v
}
// GetAvailabilityDate returns the AvailabilityDate field value if set, zero value otherwise.
func (o *CardOrder) GetAvailabilityDate() time.Time {
if o == nil || o.AvailabilityDate == nil {
var ret time.Time
return ret
}
return *o.AvailabilityDate
}
// GetAvailabilityDateOk returns a tuple with the AvailabilityDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetAvailabilityDateOk() (*time.Time, bool) {
if o == nil || o.AvailabilityDate == nil {
return nil, false
}
return o.AvailabilityDate, true
}
// HasAvailabilityDate returns a boolean if a field has been set.
func (o *CardOrder) HasAvailabilityDate() bool {
if o != nil && o.AvailabilityDate != nil {
return true
}
return false
}
// SetAvailabilityDate gets a reference to the given time.Time and assigns it to the AvailabilityDate field.
func (o *CardOrder) SetAvailabilityDate(v time.Time) {
o.AvailabilityDate = &v
}
// GetExpectedAvailabilityDate returns the ExpectedAvailabilityDate field value if set, zero value otherwise.
func (o *CardOrder) GetExpectedAvailabilityDate() time.Time {
if o == nil || o.ExpectedAvailabilityDate == nil {
var ret time.Time
return ret
}
return *o.ExpectedAvailabilityDate
}
// GetExpectedAvailabilityDateOk returns a tuple with the ExpectedAvailabilityDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetExpectedAvailabilityDateOk() (*time.Time, bool) {
if o == nil || o.ExpectedAvailabilityDate == nil {
return nil, false
}
return o.ExpectedAvailabilityDate, true
}
// HasExpectedAvailabilityDate returns a boolean if a field has been set.
func (o *CardOrder) HasExpectedAvailabilityDate() bool {
if o != nil && o.ExpectedAvailabilityDate != nil {
return true
}
return false
}
// SetExpectedAvailabilityDate gets a reference to the given time.Time and assigns it to the ExpectedAvailabilityDate field.
func (o *CardOrder) SetExpectedAvailabilityDate(v time.Time) {
o.ExpectedAvailabilityDate = &v
}
// GetDateCreated returns the DateCreated field value
func (o *CardOrder) GetDateCreated() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.DateCreated
}
// GetDateCreatedOk returns a tuple with the DateCreated field value
// and a boolean to check if the value has been set.
func (o *CardOrder) GetDateCreatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.DateCreated, true
}
// SetDateCreated sets field value
func (o *CardOrder) SetDateCreated(v time.Time) {
o.DateCreated = v
}
// GetDateModified returns the DateModified field value
func (o *CardOrder) GetDateModified() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.DateModified
}
// GetDateModifiedOk returns a tuple with the DateModified field value
// and a boolean to check if the value has been set.
func (o *CardOrder) GetDateModifiedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.DateModified, true
}
// SetDateModified sets field value
func (o *CardOrder) SetDateModified(v time.Time) {
o.DateModified = v
}
// GetDeleted returns the Deleted field value if set, zero value otherwise.
func (o *CardOrder) GetDeleted() bool {
if o == nil || o.Deleted == nil {
var ret bool
return ret
}
return *o.Deleted
}
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CardOrder) GetDeletedOk() (*bool, bool) {
if o == nil || o.Deleted == nil {
return nil, false
}
return o.Deleted, true
}
// HasDeleted returns a boolean if a field has been set.
func (o *CardOrder) HasDeleted() bool {
if o != nil && o.Deleted != nil {
return true
}
return false
}
// SetDeleted gets a reference to the given bool and assigns it to the Deleted field.
func (o *CardOrder) SetDeleted(v bool) {
o.Deleted = &v
}
// GetObject returns the Object field value
func (o *CardOrder) GetObject() string {
if o == nil {
var ret string
return ret
}
return o.Object
}
// GetObjectOk returns a tuple with the Object field value
// and a boolean to check if the value has been set.
func (o *CardOrder) GetObjectOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Object, true
}
// SetObject sets field value
func (o *CardOrder) SetObject(v string) {
o.Object = v
}
func (o CardOrder) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.CardId != nil {
toSerialize["card_id"] = o.CardId
}
if o.Status != nil {
toSerialize["status"] = o.Status
}
if o.Inventory != nil {
toSerialize["inventory"] = o.Inventory
}
if o.QuantityOrdered != nil {
toSerialize["quantity_ordered"] = o.QuantityOrdered
}
if o.UnitPrice != nil {
toSerialize["unit_price"] = o.UnitPrice
}
if o.CancelledReason != nil {
toSerialize["cancelled_reason"] = o.CancelledReason
}
if o.AvailabilityDate != nil {
toSerialize["availability_date"] = o.AvailabilityDate
}
if o.ExpectedAvailabilityDate != nil {
toSerialize["expected_availability_date"] = o.ExpectedAvailabilityDate
}
if true {
toSerialize["date_created"] = o.DateCreated
}
if true {
toSerialize["date_modified"] = o.DateModified
}
if o.Deleted != nil {
toSerialize["deleted"] = o.Deleted
}
if true {
toSerialize["object"] = o.Object
}
return json.Marshal(toSerialize)
}
type NullableCardOrder struct {
value *CardOrder
isSet bool
}
func (v NullableCardOrder) Get() *CardOrder {
return v.value
}
func (v *NullableCardOrder) Set(val *CardOrder) {
v.value = val
v.isSet = true
}
func (v NullableCardOrder) IsSet() bool {
return v.isSet
}
func (v *NullableCardOrder) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCardOrder(val *CardOrder) *NullableCardOrder {
return &NullableCardOrder{value: val, isSet: true}
}
func (v NullableCardOrder) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCardOrder) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}