-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodel_create_price_request.go
More file actions
1164 lines (996 loc) · 37.4 KB
/
Copy pathmodel_create_price_request.go
File metadata and controls
1164 lines (996 loc) · 37.4 KB
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
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
OpenPay API
super charge your subscription management.
API version: 1.2.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package getopenpay
import (
"encoding/json"
"fmt"
)
// checks if the CreatePriceRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreatePriceRequest{}
// CreatePriceRequest struct for CreatePriceRequest
type CreatePriceRequest struct {
// Specifies a usage aggregation strategy for prices of usage_type 'metered'.
AggregateUsage *UsageAggMethodEnum `json:"aggregate_usage,omitempty"`
BillingInterval NullableCalendarIntervalEnum `json:"billing_interval,omitempty"`
BillingIntervalCount NullableInt32 `json:"billing_interval_count,omitempty"`
// This price can only be purchased in a subscription if subscriptioncontains at least one of these prices.
CanOnlyBePurchasedWith []string `json:"can_only_be_purchased_with,omitempty"`
ContractAutoRenew NullableBool `json:"contract_auto_renew,omitempty"`
ContractTermMultiple NullableInt32 `json:"contract_term_multiple,omitempty"`
// Three-letter ISO currency code, in lowercase.
Currency *CurrencyEnum `json:"currency,omitempty"`
CustomFields map[string]interface{} `json:"custom_fields,omitempty"`
DefaultNetD NullableInt32 `json:"default_net_d,omitempty"`
InternalDescription NullableString `json:"internal_description,omitempty"`
// Whether the price can be used for new purchases.
IsActive bool `json:"is_active"`
IsDefault NullableBool `json:"is_default,omitempty"`
IsExclusive NullableBool `json:"is_exclusive,omitempty"`
// When listed_exclusively_for_customers is passed only customers under listed_exclusively_for_customers can list the given price. Anyone who has a payment_link containing the price can view and subscribe the prices regardless of it.Please do not pass a value if a price is not exclusive.
ListedExclusivelyForCustomers []string `json:"listed_exclusively_for_customers,omitempty"`
Meta map[string]interface{} `json:"meta,omitempty"`
MeterId NullableString `json:"meter_id,omitempty"`
Name NullableString `json:"name,omitempty"`
// List of price_tiers.
PriceTiers []PriceTierParams `json:"price_tiers,omitempty"`
// One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
PriceType PriceTypeEnum `json:"price_type"`
// Indicates which pricing model to be used for product.
PricingModel PricingModel `json:"pricing_model"`
// Unique identifier of the product.
ProductId string `json:"product_id"`
// This transformation will be applied on quantity before multiplying by unit_amount_atom.
TransformQuantityDivideBy *float32 `json:"transform_quantity_divide_by,omitempty"`
// Number of trail days for this Price.
TrialPeriodDays *int32 `json:"trial_period_days,omitempty"`
UnitAmountAtom NullableInt32 `json:"unit_amount_atom,omitempty"`
// Configures how the quantity per period should be determined. Can be either 'metered' or 'licensed'. 'licensed' automatically bills the quantity set when adding it to a subscription. 'metered' aggregates the total usage based on usage records. Defaults to 'licensed'.
UsageType *UsageTypeEnum `json:"usage_type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CreatePriceRequest CreatePriceRequest
// NewCreatePriceRequest instantiates a new CreatePriceRequest 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 NewCreatePriceRequest(isActive bool, priceType PriceTypeEnum, pricingModel PricingModel, productId string) *CreatePriceRequest {
this := CreatePriceRequest{}
this.IsActive = isActive
this.PriceType = priceType
this.PricingModel = pricingModel
this.ProductId = productId
var transformQuantityDivideBy float32 = 1.0
this.TransformQuantityDivideBy = &transformQuantityDivideBy
var trialPeriodDays int32 = 0
this.TrialPeriodDays = &trialPeriodDays
return &this
}
// NewCreatePriceRequestWithDefaults instantiates a new CreatePriceRequest 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 NewCreatePriceRequestWithDefaults() *CreatePriceRequest {
this := CreatePriceRequest{}
var transformQuantityDivideBy float32 = 1.0
this.TransformQuantityDivideBy = &transformQuantityDivideBy
var trialPeriodDays int32 = 0
this.TrialPeriodDays = &trialPeriodDays
return &this
}
// GetAggregateUsage returns the AggregateUsage field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetAggregateUsage() UsageAggMethodEnum {
if o == nil || IsNil(o.AggregateUsage) {
var ret UsageAggMethodEnum
return ret
}
return *o.AggregateUsage
}
// GetAggregateUsageOk returns a tuple with the AggregateUsage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetAggregateUsageOk() (*UsageAggMethodEnum, bool) {
if o == nil || IsNil(o.AggregateUsage) {
return nil, false
}
return o.AggregateUsage, true
}
// HasAggregateUsage returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasAggregateUsage() bool {
if o != nil && !IsNil(o.AggregateUsage) {
return true
}
return false
}
// SetAggregateUsage gets a reference to the given UsageAggMethodEnum and assigns it to the AggregateUsage field.
func (o *CreatePriceRequest) SetAggregateUsage(v UsageAggMethodEnum) {
o.AggregateUsage = &v
}
// GetBillingInterval returns the BillingInterval field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetBillingInterval() CalendarIntervalEnum {
if o == nil || IsNil(o.BillingInterval.Get()) {
var ret CalendarIntervalEnum
return ret
}
return *o.BillingInterval.Get()
}
// GetBillingIntervalOk returns a tuple with the BillingInterval 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 *CreatePriceRequest) GetBillingIntervalOk() (*CalendarIntervalEnum, bool) {
if o == nil {
return nil, false
}
return o.BillingInterval.Get(), o.BillingInterval.IsSet()
}
// HasBillingInterval returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasBillingInterval() bool {
if o != nil && o.BillingInterval.IsSet() {
return true
}
return false
}
// SetBillingInterval gets a reference to the given NullableCalendarIntervalEnum and assigns it to the BillingInterval field.
func (o *CreatePriceRequest) SetBillingInterval(v CalendarIntervalEnum) {
o.BillingInterval.Set(&v)
}
// SetBillingIntervalNil sets the value for BillingInterval to be an explicit nil
func (o *CreatePriceRequest) SetBillingIntervalNil() {
o.BillingInterval.Set(nil)
}
// UnsetBillingInterval ensures that no value is present for BillingInterval, not even an explicit nil
func (o *CreatePriceRequest) UnsetBillingInterval() {
o.BillingInterval.Unset()
}
// GetBillingIntervalCount returns the BillingIntervalCount field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetBillingIntervalCount() int32 {
if o == nil || IsNil(o.BillingIntervalCount.Get()) {
var ret int32
return ret
}
return *o.BillingIntervalCount.Get()
}
// GetBillingIntervalCountOk returns a tuple with the BillingIntervalCount 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 *CreatePriceRequest) GetBillingIntervalCountOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.BillingIntervalCount.Get(), o.BillingIntervalCount.IsSet()
}
// HasBillingIntervalCount returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasBillingIntervalCount() bool {
if o != nil && o.BillingIntervalCount.IsSet() {
return true
}
return false
}
// SetBillingIntervalCount gets a reference to the given NullableInt32 and assigns it to the BillingIntervalCount field.
func (o *CreatePriceRequest) SetBillingIntervalCount(v int32) {
o.BillingIntervalCount.Set(&v)
}
// SetBillingIntervalCountNil sets the value for BillingIntervalCount to be an explicit nil
func (o *CreatePriceRequest) SetBillingIntervalCountNil() {
o.BillingIntervalCount.Set(nil)
}
// UnsetBillingIntervalCount ensures that no value is present for BillingIntervalCount, not even an explicit nil
func (o *CreatePriceRequest) UnsetBillingIntervalCount() {
o.BillingIntervalCount.Unset()
}
// GetCanOnlyBePurchasedWith returns the CanOnlyBePurchasedWith field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetCanOnlyBePurchasedWith() []string {
if o == nil || IsNil(o.CanOnlyBePurchasedWith) {
var ret []string
return ret
}
return o.CanOnlyBePurchasedWith
}
// GetCanOnlyBePurchasedWithOk returns a tuple with the CanOnlyBePurchasedWith field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetCanOnlyBePurchasedWithOk() ([]string, bool) {
if o == nil || IsNil(o.CanOnlyBePurchasedWith) {
return nil, false
}
return o.CanOnlyBePurchasedWith, true
}
// HasCanOnlyBePurchasedWith returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasCanOnlyBePurchasedWith() bool {
if o != nil && !IsNil(o.CanOnlyBePurchasedWith) {
return true
}
return false
}
// SetCanOnlyBePurchasedWith gets a reference to the given []string and assigns it to the CanOnlyBePurchasedWith field.
func (o *CreatePriceRequest) SetCanOnlyBePurchasedWith(v []string) {
o.CanOnlyBePurchasedWith = v
}
// GetContractAutoRenew returns the ContractAutoRenew field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetContractAutoRenew() bool {
if o == nil || IsNil(o.ContractAutoRenew.Get()) {
var ret bool
return ret
}
return *o.ContractAutoRenew.Get()
}
// GetContractAutoRenewOk returns a tuple with the ContractAutoRenew 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 *CreatePriceRequest) GetContractAutoRenewOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.ContractAutoRenew.Get(), o.ContractAutoRenew.IsSet()
}
// HasContractAutoRenew returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasContractAutoRenew() bool {
if o != nil && o.ContractAutoRenew.IsSet() {
return true
}
return false
}
// SetContractAutoRenew gets a reference to the given NullableBool and assigns it to the ContractAutoRenew field.
func (o *CreatePriceRequest) SetContractAutoRenew(v bool) {
o.ContractAutoRenew.Set(&v)
}
// SetContractAutoRenewNil sets the value for ContractAutoRenew to be an explicit nil
func (o *CreatePriceRequest) SetContractAutoRenewNil() {
o.ContractAutoRenew.Set(nil)
}
// UnsetContractAutoRenew ensures that no value is present for ContractAutoRenew, not even an explicit nil
func (o *CreatePriceRequest) UnsetContractAutoRenew() {
o.ContractAutoRenew.Unset()
}
// GetContractTermMultiple returns the ContractTermMultiple field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetContractTermMultiple() int32 {
if o == nil || IsNil(o.ContractTermMultiple.Get()) {
var ret int32
return ret
}
return *o.ContractTermMultiple.Get()
}
// GetContractTermMultipleOk returns a tuple with the ContractTermMultiple 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 *CreatePriceRequest) GetContractTermMultipleOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.ContractTermMultiple.Get(), o.ContractTermMultiple.IsSet()
}
// HasContractTermMultiple returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasContractTermMultiple() bool {
if o != nil && o.ContractTermMultiple.IsSet() {
return true
}
return false
}
// SetContractTermMultiple gets a reference to the given NullableInt32 and assigns it to the ContractTermMultiple field.
func (o *CreatePriceRequest) SetContractTermMultiple(v int32) {
o.ContractTermMultiple.Set(&v)
}
// SetContractTermMultipleNil sets the value for ContractTermMultiple to be an explicit nil
func (o *CreatePriceRequest) SetContractTermMultipleNil() {
o.ContractTermMultiple.Set(nil)
}
// UnsetContractTermMultiple ensures that no value is present for ContractTermMultiple, not even an explicit nil
func (o *CreatePriceRequest) UnsetContractTermMultiple() {
o.ContractTermMultiple.Unset()
}
// GetCurrency returns the Currency field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetCurrency() CurrencyEnum {
if o == nil || IsNil(o.Currency) {
var ret CurrencyEnum
return ret
}
return *o.Currency
}
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetCurrencyOk() (*CurrencyEnum, bool) {
if o == nil || IsNil(o.Currency) {
return nil, false
}
return o.Currency, true
}
// HasCurrency returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasCurrency() bool {
if o != nil && !IsNil(o.Currency) {
return true
}
return false
}
// SetCurrency gets a reference to the given CurrencyEnum and assigns it to the Currency field.
func (o *CreatePriceRequest) SetCurrency(v CurrencyEnum) {
o.Currency = &v
}
// GetCustomFields returns the CustomFields field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetCustomFields() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.CustomFields
}
// GetCustomFieldsOk returns a tuple with the CustomFields 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 *CreatePriceRequest) GetCustomFieldsOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.CustomFields) {
return map[string]interface{}{}, false
}
return o.CustomFields, true
}
// HasCustomFields returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasCustomFields() bool {
if o != nil && !IsNil(o.CustomFields) {
return true
}
return false
}
// SetCustomFields gets a reference to the given map[string]interface{} and assigns it to the CustomFields field.
func (o *CreatePriceRequest) SetCustomFields(v map[string]interface{}) {
o.CustomFields = v
}
// GetDefaultNetD returns the DefaultNetD field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetDefaultNetD() int32 {
if o == nil || IsNil(o.DefaultNetD.Get()) {
var ret int32
return ret
}
return *o.DefaultNetD.Get()
}
// GetDefaultNetDOk returns a tuple with the DefaultNetD 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 *CreatePriceRequest) GetDefaultNetDOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.DefaultNetD.Get(), o.DefaultNetD.IsSet()
}
// HasDefaultNetD returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasDefaultNetD() bool {
if o != nil && o.DefaultNetD.IsSet() {
return true
}
return false
}
// SetDefaultNetD gets a reference to the given NullableInt32 and assigns it to the DefaultNetD field.
func (o *CreatePriceRequest) SetDefaultNetD(v int32) {
o.DefaultNetD.Set(&v)
}
// SetDefaultNetDNil sets the value for DefaultNetD to be an explicit nil
func (o *CreatePriceRequest) SetDefaultNetDNil() {
o.DefaultNetD.Set(nil)
}
// UnsetDefaultNetD ensures that no value is present for DefaultNetD, not even an explicit nil
func (o *CreatePriceRequest) UnsetDefaultNetD() {
o.DefaultNetD.Unset()
}
// GetInternalDescription returns the InternalDescription field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetInternalDescription() string {
if o == nil || IsNil(o.InternalDescription.Get()) {
var ret string
return ret
}
return *o.InternalDescription.Get()
}
// GetInternalDescriptionOk returns a tuple with the InternalDescription 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 *CreatePriceRequest) GetInternalDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.InternalDescription.Get(), o.InternalDescription.IsSet()
}
// HasInternalDescription returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasInternalDescription() bool {
if o != nil && o.InternalDescription.IsSet() {
return true
}
return false
}
// SetInternalDescription gets a reference to the given NullableString and assigns it to the InternalDescription field.
func (o *CreatePriceRequest) SetInternalDescription(v string) {
o.InternalDescription.Set(&v)
}
// SetInternalDescriptionNil sets the value for InternalDescription to be an explicit nil
func (o *CreatePriceRequest) SetInternalDescriptionNil() {
o.InternalDescription.Set(nil)
}
// UnsetInternalDescription ensures that no value is present for InternalDescription, not even an explicit nil
func (o *CreatePriceRequest) UnsetInternalDescription() {
o.InternalDescription.Unset()
}
// GetIsActive returns the IsActive field value
func (o *CreatePriceRequest) GetIsActive() bool {
if o == nil {
var ret bool
return ret
}
return o.IsActive
}
// GetIsActiveOk returns a tuple with the IsActive field value
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetIsActiveOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsActive, true
}
// SetIsActive sets field value
func (o *CreatePriceRequest) SetIsActive(v bool) {
o.IsActive = v
}
// GetIsDefault returns the IsDefault field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetIsDefault() bool {
if o == nil || IsNil(o.IsDefault.Get()) {
var ret bool
return ret
}
return *o.IsDefault.Get()
}
// GetIsDefaultOk returns a tuple with the IsDefault 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 *CreatePriceRequest) GetIsDefaultOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.IsDefault.Get(), o.IsDefault.IsSet()
}
// HasIsDefault returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasIsDefault() bool {
if o != nil && o.IsDefault.IsSet() {
return true
}
return false
}
// SetIsDefault gets a reference to the given NullableBool and assigns it to the IsDefault field.
func (o *CreatePriceRequest) SetIsDefault(v bool) {
o.IsDefault.Set(&v)
}
// SetIsDefaultNil sets the value for IsDefault to be an explicit nil
func (o *CreatePriceRequest) SetIsDefaultNil() {
o.IsDefault.Set(nil)
}
// UnsetIsDefault ensures that no value is present for IsDefault, not even an explicit nil
func (o *CreatePriceRequest) UnsetIsDefault() {
o.IsDefault.Unset()
}
// GetIsExclusive returns the IsExclusive field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetIsExclusive() bool {
if o == nil || IsNil(o.IsExclusive.Get()) {
var ret bool
return ret
}
return *o.IsExclusive.Get()
}
// GetIsExclusiveOk returns a tuple with the IsExclusive 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 *CreatePriceRequest) GetIsExclusiveOk() (*bool, bool) {
if o == nil {
return nil, false
}
return o.IsExclusive.Get(), o.IsExclusive.IsSet()
}
// HasIsExclusive returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasIsExclusive() bool {
if o != nil && o.IsExclusive.IsSet() {
return true
}
return false
}
// SetIsExclusive gets a reference to the given NullableBool and assigns it to the IsExclusive field.
func (o *CreatePriceRequest) SetIsExclusive(v bool) {
o.IsExclusive.Set(&v)
}
// SetIsExclusiveNil sets the value for IsExclusive to be an explicit nil
func (o *CreatePriceRequest) SetIsExclusiveNil() {
o.IsExclusive.Set(nil)
}
// UnsetIsExclusive ensures that no value is present for IsExclusive, not even an explicit nil
func (o *CreatePriceRequest) UnsetIsExclusive() {
o.IsExclusive.Unset()
}
// GetListedExclusivelyForCustomers returns the ListedExclusivelyForCustomers field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetListedExclusivelyForCustomers() []string {
if o == nil || IsNil(o.ListedExclusivelyForCustomers) {
var ret []string
return ret
}
return o.ListedExclusivelyForCustomers
}
// GetListedExclusivelyForCustomersOk returns a tuple with the ListedExclusivelyForCustomers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetListedExclusivelyForCustomersOk() ([]string, bool) {
if o == nil || IsNil(o.ListedExclusivelyForCustomers) {
return nil, false
}
return o.ListedExclusivelyForCustomers, true
}
// HasListedExclusivelyForCustomers returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasListedExclusivelyForCustomers() bool {
if o != nil && !IsNil(o.ListedExclusivelyForCustomers) {
return true
}
return false
}
// SetListedExclusivelyForCustomers gets a reference to the given []string and assigns it to the ListedExclusivelyForCustomers field.
func (o *CreatePriceRequest) SetListedExclusivelyForCustomers(v []string) {
o.ListedExclusivelyForCustomers = v
}
// GetMeta returns the Meta field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetMeta() map[string]interface{} {
if o == nil {
var ret map[string]interface{}
return ret
}
return o.Meta
}
// GetMetaOk returns a tuple with the Meta 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 *CreatePriceRequest) GetMetaOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Meta) {
return map[string]interface{}{}, false
}
return o.Meta, true
}
// HasMeta returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasMeta() bool {
if o != nil && !IsNil(o.Meta) {
return true
}
return false
}
// SetMeta gets a reference to the given map[string]interface{} and assigns it to the Meta field.
func (o *CreatePriceRequest) SetMeta(v map[string]interface{}) {
o.Meta = v
}
// GetMeterId returns the MeterId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetMeterId() string {
if o == nil || IsNil(o.MeterId.Get()) {
var ret string
return ret
}
return *o.MeterId.Get()
}
// GetMeterIdOk returns a tuple with the MeterId 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 *CreatePriceRequest) GetMeterIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.MeterId.Get(), o.MeterId.IsSet()
}
// HasMeterId returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasMeterId() bool {
if o != nil && o.MeterId.IsSet() {
return true
}
return false
}
// SetMeterId gets a reference to the given NullableString and assigns it to the MeterId field.
func (o *CreatePriceRequest) SetMeterId(v string) {
o.MeterId.Set(&v)
}
// SetMeterIdNil sets the value for MeterId to be an explicit nil
func (o *CreatePriceRequest) SetMeterIdNil() {
o.MeterId.Set(nil)
}
// UnsetMeterId ensures that no value is present for MeterId, not even an explicit nil
func (o *CreatePriceRequest) UnsetMeterId() {
o.MeterId.Unset()
}
// GetName returns the Name field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetName() string {
if o == nil || IsNil(o.Name.Get()) {
var ret string
return ret
}
return *o.Name.Get()
}
// GetNameOk returns a tuple with the Name 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 *CreatePriceRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Name.Get(), o.Name.IsSet()
}
// HasName returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasName() bool {
if o != nil && o.Name.IsSet() {
return true
}
return false
}
// SetName gets a reference to the given NullableString and assigns it to the Name field.
func (o *CreatePriceRequest) SetName(v string) {
o.Name.Set(&v)
}
// SetNameNil sets the value for Name to be an explicit nil
func (o *CreatePriceRequest) SetNameNil() {
o.Name.Set(nil)
}
// UnsetName ensures that no value is present for Name, not even an explicit nil
func (o *CreatePriceRequest) UnsetName() {
o.Name.Unset()
}
// GetPriceTiers returns the PriceTiers field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetPriceTiers() []PriceTierParams {
if o == nil || IsNil(o.PriceTiers) {
var ret []PriceTierParams
return ret
}
return o.PriceTiers
}
// GetPriceTiersOk returns a tuple with the PriceTiers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetPriceTiersOk() ([]PriceTierParams, bool) {
if o == nil || IsNil(o.PriceTiers) {
return nil, false
}
return o.PriceTiers, true
}
// HasPriceTiers returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasPriceTiers() bool {
if o != nil && !IsNil(o.PriceTiers) {
return true
}
return false
}
// SetPriceTiers gets a reference to the given []PriceTierParams and assigns it to the PriceTiers field.
func (o *CreatePriceRequest) SetPriceTiers(v []PriceTierParams) {
o.PriceTiers = v
}
// GetPriceType returns the PriceType field value
func (o *CreatePriceRequest) GetPriceType() PriceTypeEnum {
if o == nil {
var ret PriceTypeEnum
return ret
}
return o.PriceType
}
// GetPriceTypeOk returns a tuple with the PriceType field value
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetPriceTypeOk() (*PriceTypeEnum, bool) {
if o == nil {
return nil, false
}
return &o.PriceType, true
}
// SetPriceType sets field value
func (o *CreatePriceRequest) SetPriceType(v PriceTypeEnum) {
o.PriceType = v
}
// GetPricingModel returns the PricingModel field value
func (o *CreatePriceRequest) GetPricingModel() PricingModel {
if o == nil {
var ret PricingModel
return ret
}
return o.PricingModel
}
// GetPricingModelOk returns a tuple with the PricingModel field value
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetPricingModelOk() (*PricingModel, bool) {
if o == nil {
return nil, false
}
return &o.PricingModel, true
}
// SetPricingModel sets field value
func (o *CreatePriceRequest) SetPricingModel(v PricingModel) {
o.PricingModel = v
}
// GetProductId returns the ProductId field value
func (o *CreatePriceRequest) GetProductId() string {
if o == nil {
var ret string
return ret
}
return o.ProductId
}
// GetProductIdOk returns a tuple with the ProductId field value
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetProductIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ProductId, true
}
// SetProductId sets field value
func (o *CreatePriceRequest) SetProductId(v string) {
o.ProductId = v
}
// GetTransformQuantityDivideBy returns the TransformQuantityDivideBy field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetTransformQuantityDivideBy() float32 {
if o == nil || IsNil(o.TransformQuantityDivideBy) {
var ret float32
return ret
}
return *o.TransformQuantityDivideBy
}
// GetTransformQuantityDivideByOk returns a tuple with the TransformQuantityDivideBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetTransformQuantityDivideByOk() (*float32, bool) {
if o == nil || IsNil(o.TransformQuantityDivideBy) {
return nil, false
}
return o.TransformQuantityDivideBy, true
}
// HasTransformQuantityDivideBy returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasTransformQuantityDivideBy() bool {
if o != nil && !IsNil(o.TransformQuantityDivideBy) {
return true
}
return false
}
// SetTransformQuantityDivideBy gets a reference to the given float32 and assigns it to the TransformQuantityDivideBy field.
func (o *CreatePriceRequest) SetTransformQuantityDivideBy(v float32) {
o.TransformQuantityDivideBy = &v
}
// GetTrialPeriodDays returns the TrialPeriodDays field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetTrialPeriodDays() int32 {
if o == nil || IsNil(o.TrialPeriodDays) {
var ret int32
return ret
}
return *o.TrialPeriodDays
}
// GetTrialPeriodDaysOk returns a tuple with the TrialPeriodDays field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetTrialPeriodDaysOk() (*int32, bool) {
if o == nil || IsNil(o.TrialPeriodDays) {
return nil, false
}
return o.TrialPeriodDays, true
}
// HasTrialPeriodDays returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasTrialPeriodDays() bool {
if o != nil && !IsNil(o.TrialPeriodDays) {
return true
}
return false
}
// SetTrialPeriodDays gets a reference to the given int32 and assigns it to the TrialPeriodDays field.
func (o *CreatePriceRequest) SetTrialPeriodDays(v int32) {
o.TrialPeriodDays = &v
}
// GetUnitAmountAtom returns the UnitAmountAtom field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreatePriceRequest) GetUnitAmountAtom() int32 {
if o == nil || IsNil(o.UnitAmountAtom.Get()) {
var ret int32
return ret
}
return *o.UnitAmountAtom.Get()
}
// GetUnitAmountAtomOk returns a tuple with the UnitAmountAtom 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 *CreatePriceRequest) GetUnitAmountAtomOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.UnitAmountAtom.Get(), o.UnitAmountAtom.IsSet()
}
// HasUnitAmountAtom returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasUnitAmountAtom() bool {
if o != nil && o.UnitAmountAtom.IsSet() {
return true
}
return false
}
// SetUnitAmountAtom gets a reference to the given NullableInt32 and assigns it to the UnitAmountAtom field.
func (o *CreatePriceRequest) SetUnitAmountAtom(v int32) {
o.UnitAmountAtom.Set(&v)
}
// SetUnitAmountAtomNil sets the value for UnitAmountAtom to be an explicit nil
func (o *CreatePriceRequest) SetUnitAmountAtomNil() {
o.UnitAmountAtom.Set(nil)
}
// UnsetUnitAmountAtom ensures that no value is present for UnitAmountAtom, not even an explicit nil
func (o *CreatePriceRequest) UnsetUnitAmountAtom() {
o.UnitAmountAtom.Unset()
}
// GetUsageType returns the UsageType field value if set, zero value otherwise.
func (o *CreatePriceRequest) GetUsageType() UsageTypeEnum {
if o == nil || IsNil(o.UsageType) {
var ret UsageTypeEnum
return ret
}
return *o.UsageType
}
// GetUsageTypeOk returns a tuple with the UsageType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreatePriceRequest) GetUsageTypeOk() (*UsageTypeEnum, bool) {
if o == nil || IsNil(o.UsageType) {
return nil, false
}
return o.UsageType, true
}
// HasUsageType returns a boolean if a field has been set.
func (o *CreatePriceRequest) HasUsageType() bool {
if o != nil && !IsNil(o.UsageType) {
return true
}
return false
}
// SetUsageType gets a reference to the given UsageTypeEnum and assigns it to the UsageType field.
func (o *CreatePriceRequest) SetUsageType(v UsageTypeEnum) {
o.UsageType = &v
}
func (o CreatePriceRequest) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CreatePriceRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AggregateUsage) {
toSerialize["aggregate_usage"] = o.AggregateUsage
}
if o.BillingInterval.IsSet() {
toSerialize["billing_interval"] = o.BillingInterval.Get()
}
if o.BillingIntervalCount.IsSet() {
toSerialize["billing_interval_count"] = o.BillingIntervalCount.Get()
}
if !IsNil(o.CanOnlyBePurchasedWith) {
toSerialize["can_only_be_purchased_with"] = o.CanOnlyBePurchasedWith
}
if o.ContractAutoRenew.IsSet() {
toSerialize["contract_auto_renew"] = o.ContractAutoRenew.Get()
}
if o.ContractTermMultiple.IsSet() {
toSerialize["contract_term_multiple"] = o.ContractTermMultiple.Get()