-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_checkout_session.go
570 lines (480 loc) · 14.1 KB
/
model_checkout_session.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
/*
ForestVPN API
ForestVPN - Fast, secure, and modern VPN. It offers Distributed Computing, Crypto Mining, P2P, Ad Blocking, TOR over VPN, 30+ locations, and a free version with unlimited data.
API version: 2.0
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package forestvpn_api
import (
"encoding/json"
"time"
)
// checks if the CheckoutSession type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CheckoutSession{}
// CheckoutSession struct for CheckoutSession
type CheckoutSession struct {
Id string `json:"id"`
CancelUrl string `json:"cancel_url"`
SuccessUrl string `json:"success_url"`
RedirectUrl *string `json:"redirect_url,omitempty"`
Currency string `json:"currency"`
AmountSubtotal float64 `json:"amount_subtotal"`
AmountTotal float64 `json:"amount_total"`
Locale *string `json:"locale,omitempty"`
Email *string `json:"email,omitempty"`
Products []CheckoutSessionProduct `json:"products"`
PaymentStatus string `json:"payment_status"`
Status string `json:"status"`
// Trial period duration in ISO 8601 format.
TrialPeriod *string `json:"trial_period,omitempty"`
User *string `json:"user,omitempty"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
}
// NewCheckoutSession instantiates a new CheckoutSession 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 NewCheckoutSession(id string, cancelUrl string, successUrl string, currency string, amountSubtotal float64, amountTotal float64, products []CheckoutSessionProduct, paymentStatus string, status string, createdAt time.Time, expiresAt time.Time) *CheckoutSession {
this := CheckoutSession{}
this.Id = id
this.CancelUrl = cancelUrl
this.SuccessUrl = successUrl
this.Currency = currency
this.AmountSubtotal = amountSubtotal
this.AmountTotal = amountTotal
this.Products = products
this.PaymentStatus = paymentStatus
this.Status = status
this.CreatedAt = createdAt
this.ExpiresAt = expiresAt
return &this
}
// NewCheckoutSessionWithDefaults instantiates a new CheckoutSession 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 NewCheckoutSessionWithDefaults() *CheckoutSession {
this := CheckoutSession{}
return &this
}
// GetId returns the Id field value
func (o *CheckoutSession) 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 *CheckoutSession) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *CheckoutSession) SetId(v string) {
o.Id = v
}
// GetCancelUrl returns the CancelUrl field value
func (o *CheckoutSession) GetCancelUrl() string {
if o == nil {
var ret string
return ret
}
return o.CancelUrl
}
// GetCancelUrlOk returns a tuple with the CancelUrl field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetCancelUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CancelUrl, true
}
// SetCancelUrl sets field value
func (o *CheckoutSession) SetCancelUrl(v string) {
o.CancelUrl = v
}
// GetSuccessUrl returns the SuccessUrl field value
func (o *CheckoutSession) GetSuccessUrl() string {
if o == nil {
var ret string
return ret
}
return o.SuccessUrl
}
// GetSuccessUrlOk returns a tuple with the SuccessUrl field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetSuccessUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SuccessUrl, true
}
// SetSuccessUrl sets field value
func (o *CheckoutSession) SetSuccessUrl(v string) {
o.SuccessUrl = v
}
// GetRedirectUrl returns the RedirectUrl field value if set, zero value otherwise.
func (o *CheckoutSession) GetRedirectUrl() string {
if o == nil || isNil(o.RedirectUrl) {
var ret string
return ret
}
return *o.RedirectUrl
}
// GetRedirectUrlOk returns a tuple with the RedirectUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetRedirectUrlOk() (*string, bool) {
if o == nil || isNil(o.RedirectUrl) {
return nil, false
}
return o.RedirectUrl, true
}
// HasRedirectUrl returns a boolean if a field has been set.
func (o *CheckoutSession) HasRedirectUrl() bool {
if o != nil && !isNil(o.RedirectUrl) {
return true
}
return false
}
// SetRedirectUrl gets a reference to the given string and assigns it to the RedirectUrl field.
func (o *CheckoutSession) SetRedirectUrl(v string) {
o.RedirectUrl = &v
}
// GetCurrency returns the Currency field value
func (o *CheckoutSession) GetCurrency() string {
if o == nil {
var ret string
return ret
}
return o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetCurrencyOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Currency, true
}
// SetCurrency sets field value
func (o *CheckoutSession) SetCurrency(v string) {
o.Currency = v
}
// GetAmountSubtotal returns the AmountSubtotal field value
func (o *CheckoutSession) GetAmountSubtotal() float64 {
if o == nil {
var ret float64
return ret
}
return o.AmountSubtotal
}
// GetAmountSubtotalOk returns a tuple with the AmountSubtotal field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetAmountSubtotalOk() (*float64, bool) {
if o == nil {
return nil, false
}
return &o.AmountSubtotal, true
}
// SetAmountSubtotal sets field value
func (o *CheckoutSession) SetAmountSubtotal(v float64) {
o.AmountSubtotal = v
}
// GetAmountTotal returns the AmountTotal field value
func (o *CheckoutSession) GetAmountTotal() float64 {
if o == nil {
var ret float64
return ret
}
return o.AmountTotal
}
// GetAmountTotalOk returns a tuple with the AmountTotal field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetAmountTotalOk() (*float64, bool) {
if o == nil {
return nil, false
}
return &o.AmountTotal, true
}
// SetAmountTotal sets field value
func (o *CheckoutSession) SetAmountTotal(v float64) {
o.AmountTotal = v
}
// GetLocale returns the Locale field value if set, zero value otherwise.
func (o *CheckoutSession) GetLocale() string {
if o == nil || isNil(o.Locale) {
var ret string
return ret
}
return *o.Locale
}
// GetLocaleOk returns a tuple with the Locale field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetLocaleOk() (*string, bool) {
if o == nil || isNil(o.Locale) {
return nil, false
}
return o.Locale, true
}
// HasLocale returns a boolean if a field has been set.
func (o *CheckoutSession) HasLocale() bool {
if o != nil && !isNil(o.Locale) {
return true
}
return false
}
// SetLocale gets a reference to the given string and assigns it to the Locale field.
func (o *CheckoutSession) SetLocale(v string) {
o.Locale = &v
}
// GetEmail returns the Email field value if set, zero value otherwise.
func (o *CheckoutSession) GetEmail() string {
if o == nil || isNil(o.Email) {
var ret string
return ret
}
return *o.Email
}
// GetEmailOk returns a tuple with the Email field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetEmailOk() (*string, bool) {
if o == nil || isNil(o.Email) {
return nil, false
}
return o.Email, true
}
// HasEmail returns a boolean if a field has been set.
func (o *CheckoutSession) HasEmail() bool {
if o != nil && !isNil(o.Email) {
return true
}
return false
}
// SetEmail gets a reference to the given string and assigns it to the Email field.
func (o *CheckoutSession) SetEmail(v string) {
o.Email = &v
}
// GetProducts returns the Products field value
func (o *CheckoutSession) GetProducts() []CheckoutSessionProduct {
if o == nil {
var ret []CheckoutSessionProduct
return ret
}
return o.Products
}
// GetProductsOk returns a tuple with the Products field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetProductsOk() ([]CheckoutSessionProduct, bool) {
if o == nil {
return nil, false
}
return o.Products, true
}
// SetProducts sets field value
func (o *CheckoutSession) SetProducts(v []CheckoutSessionProduct) {
o.Products = v
}
// GetPaymentStatus returns the PaymentStatus field value
func (o *CheckoutSession) GetPaymentStatus() string {
if o == nil {
var ret string
return ret
}
return o.PaymentStatus
}
// GetPaymentStatusOk returns a tuple with the PaymentStatus field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetPaymentStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.PaymentStatus, true
}
// SetPaymentStatus sets field value
func (o *CheckoutSession) SetPaymentStatus(v string) {
o.PaymentStatus = v
}
// GetStatus returns the Status field value
func (o *CheckoutSession) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *CheckoutSession) SetStatus(v string) {
o.Status = v
}
// GetTrialPeriod returns the TrialPeriod field value if set, zero value otherwise.
func (o *CheckoutSession) GetTrialPeriod() string {
if o == nil || isNil(o.TrialPeriod) {
var ret string
return ret
}
return *o.TrialPeriod
}
// GetTrialPeriodOk returns a tuple with the TrialPeriod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetTrialPeriodOk() (*string, bool) {
if o == nil || isNil(o.TrialPeriod) {
return nil, false
}
return o.TrialPeriod, true
}
// HasTrialPeriod returns a boolean if a field has been set.
func (o *CheckoutSession) HasTrialPeriod() bool {
if o != nil && !isNil(o.TrialPeriod) {
return true
}
return false
}
// SetTrialPeriod gets a reference to the given string and assigns it to the TrialPeriod field.
func (o *CheckoutSession) SetTrialPeriod(v string) {
o.TrialPeriod = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *CheckoutSession) GetUser() string {
if o == nil || isNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetUserOk() (*string, bool) {
if o == nil || isNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *CheckoutSession) HasUser() bool {
if o != nil && !isNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *CheckoutSession) SetUser(v string) {
o.User = &v
}
// GetCreatedAt returns the CreatedAt field value
func (o *CheckoutSession) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *CheckoutSession) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
// GetExpiresAt returns the ExpiresAt field value
func (o *CheckoutSession) GetExpiresAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.ExpiresAt
}
// GetExpiresAtOk returns a tuple with the ExpiresAt field value
// and a boolean to check if the value has been set.
func (o *CheckoutSession) GetExpiresAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.ExpiresAt, true
}
// SetExpiresAt sets field value
func (o *CheckoutSession) SetExpiresAt(v time.Time) {
o.ExpiresAt = v
}
func (o CheckoutSession) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CheckoutSession) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["cancel_url"] = o.CancelUrl
toSerialize["success_url"] = o.SuccessUrl
if !isNil(o.RedirectUrl) {
toSerialize["redirect_url"] = o.RedirectUrl
}
toSerialize["currency"] = o.Currency
toSerialize["amount_subtotal"] = o.AmountSubtotal
toSerialize["amount_total"] = o.AmountTotal
if !isNil(o.Locale) {
toSerialize["locale"] = o.Locale
}
if !isNil(o.Email) {
toSerialize["email"] = o.Email
}
toSerialize["products"] = o.Products
toSerialize["payment_status"] = o.PaymentStatus
toSerialize["status"] = o.Status
if !isNil(o.TrialPeriod) {
toSerialize["trial_period"] = o.TrialPeriod
}
if !isNil(o.User) {
toSerialize["user"] = o.User
}
toSerialize["created_at"] = o.CreatedAt
toSerialize["expires_at"] = o.ExpiresAt
return toSerialize, nil
}
type NullableCheckoutSession struct {
value *CheckoutSession
isSet bool
}
func (v NullableCheckoutSession) Get() *CheckoutSession {
return v.value
}
func (v *NullableCheckoutSession) Set(val *CheckoutSession) {
v.value = val
v.isSet = true
}
func (v NullableCheckoutSession) IsSet() bool {
return v.isSet
}
func (v *NullableCheckoutSession) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCheckoutSession(val *CheckoutSession) *NullableCheckoutSession {
return &NullableCheckoutSession{value: val, isSet: true}
}
func (v NullableCheckoutSession) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCheckoutSession) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}