-
Notifications
You must be signed in to change notification settings - Fork 28
/
model_installment_option.go
236 lines (197 loc) · 6.59 KB
/
model_installment_option.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
/*
Adyen Checkout API
API version: 71
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package checkout
import (
"encoding/json"
"github.com/adyen/adyen-go-api-library/v8/src/common"
)
// checks if the InstallmentOption type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &InstallmentOption{}
// InstallmentOption struct for InstallmentOption
type InstallmentOption struct {
// The maximum number of installments offered for this payment method.
MaxValue *int32 `json:"maxValue,omitempty"`
// Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * **regular** * **revolving**
Plans []string `json:"plans,omitempty"`
// Preselected number of installments offered for this payment method.
PreselectedValue *int32 `json:"preselectedValue,omitempty"`
// An array of the number of installments that the shopper can choose from. For example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`.
Values []int32 `json:"values,omitempty"`
}
// NewInstallmentOption instantiates a new InstallmentOption 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 NewInstallmentOption() *InstallmentOption {
this := InstallmentOption{}
return &this
}
// NewInstallmentOptionWithDefaults instantiates a new InstallmentOption 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 NewInstallmentOptionWithDefaults() *InstallmentOption {
this := InstallmentOption{}
return &this
}
// GetMaxValue returns the MaxValue field value if set, zero value otherwise.
func (o *InstallmentOption) GetMaxValue() int32 {
if o == nil || common.IsNil(o.MaxValue) {
var ret int32
return ret
}
return *o.MaxValue
}
// GetMaxValueOk returns a tuple with the MaxValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InstallmentOption) GetMaxValueOk() (*int32, bool) {
if o == nil || common.IsNil(o.MaxValue) {
return nil, false
}
return o.MaxValue, true
}
// HasMaxValue returns a boolean if a field has been set.
func (o *InstallmentOption) HasMaxValue() bool {
if o != nil && !common.IsNil(o.MaxValue) {
return true
}
return false
}
// SetMaxValue gets a reference to the given int32 and assigns it to the MaxValue field.
func (o *InstallmentOption) SetMaxValue(v int32) {
o.MaxValue = &v
}
// GetPlans returns the Plans field value if set, zero value otherwise.
func (o *InstallmentOption) GetPlans() []string {
if o == nil || common.IsNil(o.Plans) {
var ret []string
return ret
}
return o.Plans
}
// GetPlansOk returns a tuple with the Plans field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InstallmentOption) GetPlansOk() ([]string, bool) {
if o == nil || common.IsNil(o.Plans) {
return nil, false
}
return o.Plans, true
}
// HasPlans returns a boolean if a field has been set.
func (o *InstallmentOption) HasPlans() bool {
if o != nil && !common.IsNil(o.Plans) {
return true
}
return false
}
// SetPlans gets a reference to the given []string and assigns it to the Plans field.
func (o *InstallmentOption) SetPlans(v []string) {
o.Plans = v
}
// GetPreselectedValue returns the PreselectedValue field value if set, zero value otherwise.
func (o *InstallmentOption) GetPreselectedValue() int32 {
if o == nil || common.IsNil(o.PreselectedValue) {
var ret int32
return ret
}
return *o.PreselectedValue
}
// GetPreselectedValueOk returns a tuple with the PreselectedValue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InstallmentOption) GetPreselectedValueOk() (*int32, bool) {
if o == nil || common.IsNil(o.PreselectedValue) {
return nil, false
}
return o.PreselectedValue, true
}
// HasPreselectedValue returns a boolean if a field has been set.
func (o *InstallmentOption) HasPreselectedValue() bool {
if o != nil && !common.IsNil(o.PreselectedValue) {
return true
}
return false
}
// SetPreselectedValue gets a reference to the given int32 and assigns it to the PreselectedValue field.
func (o *InstallmentOption) SetPreselectedValue(v int32) {
o.PreselectedValue = &v
}
// GetValues returns the Values field value if set, zero value otherwise.
func (o *InstallmentOption) GetValues() []int32 {
if o == nil || common.IsNil(o.Values) {
var ret []int32
return ret
}
return o.Values
}
// GetValuesOk returns a tuple with the Values field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InstallmentOption) GetValuesOk() ([]int32, bool) {
if o == nil || common.IsNil(o.Values) {
return nil, false
}
return o.Values, true
}
// HasValues returns a boolean if a field has been set.
func (o *InstallmentOption) HasValues() bool {
if o != nil && !common.IsNil(o.Values) {
return true
}
return false
}
// SetValues gets a reference to the given []int32 and assigns it to the Values field.
func (o *InstallmentOption) SetValues(v []int32) {
o.Values = v
}
func (o InstallmentOption) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o InstallmentOption) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !common.IsNil(o.MaxValue) {
toSerialize["maxValue"] = o.MaxValue
}
if !common.IsNil(o.Plans) {
toSerialize["plans"] = o.Plans
}
if !common.IsNil(o.PreselectedValue) {
toSerialize["preselectedValue"] = o.PreselectedValue
}
if !common.IsNil(o.Values) {
toSerialize["values"] = o.Values
}
return toSerialize, nil
}
type NullableInstallmentOption struct {
value *InstallmentOption
isSet bool
}
func (v NullableInstallmentOption) Get() *InstallmentOption {
return v.value
}
func (v *NullableInstallmentOption) Set(val *InstallmentOption) {
v.value = val
v.isSet = true
}
func (v NullableInstallmentOption) IsSet() bool {
return v.isSet
}
func (v *NullableInstallmentOption) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInstallmentOption(val *InstallmentOption) *NullableInstallmentOption {
return &NullableInstallmentOption{value: val, isSet: true}
}
func (v NullableInstallmentOption) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInstallmentOption) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}