-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodel_checkout_processors_preferences.go
More file actions
232 lines (186 loc) · 7.23 KB
/
Copy pathmodel_checkout_processors_preferences.go
File metadata and controls
232 lines (186 loc) · 7.23 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
/*
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"
)
// checks if the CheckoutProcessorsPreferences type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CheckoutProcessorsPreferences{}
// CheckoutProcessorsPreferences Allows customization of which payment processors are available during each checkout session.
type CheckoutProcessorsPreferences struct {
// If not empty, the enabled providers will be filtered by this list.
FilterProviders []PaymentProviderType `json:"filter_providers,omitempty"`
// If not empty, only the processors with these ids will be accepted.
IdsWhitelist []string `json:"ids_whitelist,omitempty"`
// If not empty, only the processors with these names will be accepted. Valid values are: adyen, airwallex, authorize_net, checkout_com, braintree, stripe, foobar, pockyt, cybersource, loop, paypal, nmi.
NamesWhitelist []string `json:"names_whitelist,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CheckoutProcessorsPreferences CheckoutProcessorsPreferences
// NewCheckoutProcessorsPreferences instantiates a new CheckoutProcessorsPreferences 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 NewCheckoutProcessorsPreferences() *CheckoutProcessorsPreferences {
this := CheckoutProcessorsPreferences{}
return &this
}
// NewCheckoutProcessorsPreferencesWithDefaults instantiates a new CheckoutProcessorsPreferences 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 NewCheckoutProcessorsPreferencesWithDefaults() *CheckoutProcessorsPreferences {
this := CheckoutProcessorsPreferences{}
return &this
}
// GetFilterProviders returns the FilterProviders field value if set, zero value otherwise.
func (o *CheckoutProcessorsPreferences) GetFilterProviders() []PaymentProviderType {
if o == nil || IsNil(o.FilterProviders) {
var ret []PaymentProviderType
return ret
}
return o.FilterProviders
}
// GetFilterProvidersOk returns a tuple with the FilterProviders field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutProcessorsPreferences) GetFilterProvidersOk() ([]PaymentProviderType, bool) {
if o == nil || IsNil(o.FilterProviders) {
return nil, false
}
return o.FilterProviders, true
}
// HasFilterProviders returns a boolean if a field has been set.
func (o *CheckoutProcessorsPreferences) HasFilterProviders() bool {
if o != nil && !IsNil(o.FilterProviders) {
return true
}
return false
}
// SetFilterProviders gets a reference to the given []PaymentProviderType and assigns it to the FilterProviders field.
func (o *CheckoutProcessorsPreferences) SetFilterProviders(v []PaymentProviderType) {
o.FilterProviders = v
}
// GetIdsWhitelist returns the IdsWhitelist field value if set, zero value otherwise.
func (o *CheckoutProcessorsPreferences) GetIdsWhitelist() []string {
if o == nil || IsNil(o.IdsWhitelist) {
var ret []string
return ret
}
return o.IdsWhitelist
}
// GetIdsWhitelistOk returns a tuple with the IdsWhitelist field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutProcessorsPreferences) GetIdsWhitelistOk() ([]string, bool) {
if o == nil || IsNil(o.IdsWhitelist) {
return nil, false
}
return o.IdsWhitelist, true
}
// HasIdsWhitelist returns a boolean if a field has been set.
func (o *CheckoutProcessorsPreferences) HasIdsWhitelist() bool {
if o != nil && !IsNil(o.IdsWhitelist) {
return true
}
return false
}
// SetIdsWhitelist gets a reference to the given []string and assigns it to the IdsWhitelist field.
func (o *CheckoutProcessorsPreferences) SetIdsWhitelist(v []string) {
o.IdsWhitelist = v
}
// GetNamesWhitelist returns the NamesWhitelist field value if set, zero value otherwise.
func (o *CheckoutProcessorsPreferences) GetNamesWhitelist() []string {
if o == nil || IsNil(o.NamesWhitelist) {
var ret []string
return ret
}
return o.NamesWhitelist
}
// GetNamesWhitelistOk returns a tuple with the NamesWhitelist field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckoutProcessorsPreferences) GetNamesWhitelistOk() ([]string, bool) {
if o == nil || IsNil(o.NamesWhitelist) {
return nil, false
}
return o.NamesWhitelist, true
}
// HasNamesWhitelist returns a boolean if a field has been set.
func (o *CheckoutProcessorsPreferences) HasNamesWhitelist() bool {
if o != nil && !IsNil(o.NamesWhitelist) {
return true
}
return false
}
// SetNamesWhitelist gets a reference to the given []string and assigns it to the NamesWhitelist field.
func (o *CheckoutProcessorsPreferences) SetNamesWhitelist(v []string) {
o.NamesWhitelist = v
}
func (o CheckoutProcessorsPreferences) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CheckoutProcessorsPreferences) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.FilterProviders) {
toSerialize["filter_providers"] = o.FilterProviders
}
if !IsNil(o.IdsWhitelist) {
toSerialize["ids_whitelist"] = o.IdsWhitelist
}
if !IsNil(o.NamesWhitelist) {
toSerialize["names_whitelist"] = o.NamesWhitelist
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CheckoutProcessorsPreferences) UnmarshalJSON(data []byte) (err error) {
varCheckoutProcessorsPreferences := _CheckoutProcessorsPreferences{}
err = json.Unmarshal(data, &varCheckoutProcessorsPreferences)
if err != nil {
return err
}
*o = CheckoutProcessorsPreferences(varCheckoutProcessorsPreferences)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "filter_providers")
delete(additionalProperties, "ids_whitelist")
delete(additionalProperties, "names_whitelist")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCheckoutProcessorsPreferences struct {
value *CheckoutProcessorsPreferences
isSet bool
}
func (v NullableCheckoutProcessorsPreferences) Get() *CheckoutProcessorsPreferences {
return v.value
}
func (v *NullableCheckoutProcessorsPreferences) Set(val *CheckoutProcessorsPreferences) {
v.value = val
v.isSet = true
}
func (v NullableCheckoutProcessorsPreferences) IsSet() bool {
return v.isSet
}
func (v *NullableCheckoutProcessorsPreferences) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCheckoutProcessorsPreferences(val *CheckoutProcessorsPreferences) *NullableCheckoutProcessorsPreferences {
return &NullableCheckoutProcessorsPreferences{value: val, isSet: true}
}
func (v NullableCheckoutProcessorsPreferences) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCheckoutProcessorsPreferences) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}