-
Notifications
You must be signed in to change notification settings - Fork 3
/
model_customer_details.go
382 lines (323 loc) · 12.3 KB
/
model_customer_details.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
/*
Cashfree Payment Gateway APIs
Cashfree's Payment Gateway APIs provide developers with a streamlined pathway to integrate advanced payment processing capabilities into their applications, platforms and websites.
API version: 2022-09-01
Contact: developers@cashfree.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package cashfree_pg
import (
"encoding/json"
)
// checks if the CustomerDetails type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CustomerDetails{}
// CustomerDetails The customer details that are necessary. Note that you can pass dummy details if your use case does not require the customer details.
type CustomerDetails struct {
// A unique identifier for the customer. Use alphanumeric values only.
CustomerId string `json:"customer_id"`
// Customer email address.
CustomerEmail NullableString `json:"customer_email,omitempty"`
// Customer phone number.
CustomerPhone string `json:"customer_phone"`
// Name of the customer.
CustomerName NullableString `json:"customer_name,omitempty"`
// Customer bank account. Required if you want to do a bank account check (TPV)
CustomerBankAccountNumber NullableString `json:"customer_bank_account_number,omitempty"`
// Customer bank IFSC. Required if you want to do a bank account check (TPV)
CustomerBankIfsc NullableString `json:"customer_bank_ifsc,omitempty"`
// Customer bank code. Required for net banking payments, if you want to do a bank account check (TPV)
CustomerBankCode NullableFloat32 `json:"customer_bank_code,omitempty"`
}
// NewCustomerDetails instantiates a new CustomerDetails 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 NewCustomerDetails(customerId string, customerPhone string) *CustomerDetails {
this := CustomerDetails{}
this.CustomerId = customerId
this.CustomerPhone = customerPhone
return &this
}
// NewCustomerDetailsWithDefaults instantiates a new CustomerDetails 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 NewCustomerDetailsWithDefaults() *CustomerDetails {
this := CustomerDetails{}
return &this
}
// GetCustomerId returns the CustomerId field value
func (o *CustomerDetails) GetCustomerId() string {
if o == nil {
var ret string
return ret
}
return o.CustomerId
}
// GetCustomerIdOk returns a tuple with the CustomerId field value
// and a boolean to check if the value has been set.
func (o *CustomerDetails) GetCustomerIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CustomerId, true
}
// SetCustomerId sets field value
func (o *CustomerDetails) SetCustomerId(v string) {
o.CustomerId = v
}
// GetCustomerEmail returns the CustomerEmail field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CustomerDetails) GetCustomerEmail() string {
if o == nil || IsNil(o.CustomerEmail.Get()) {
var ret string
return ret
}
return *o.CustomerEmail.Get()
}
// GetCustomerEmailOk returns a tuple with the CustomerEmail 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 *CustomerDetails) GetCustomerEmailOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CustomerEmail.Get(), o.CustomerEmail.IsSet()
}
// HasCustomerEmail returns a boolean if a field has been set.
func (o *CustomerDetails) HasCustomerEmail() bool {
if o != nil && o.CustomerEmail.IsSet() {
return true
}
return false
}
// SetCustomerEmail gets a reference to the given NullableString and assigns it to the CustomerEmail field.
func (o *CustomerDetails) SetCustomerEmail(v string) {
o.CustomerEmail.Set(&v)
}
// SetCustomerEmailNil sets the value for CustomerEmail to be an explicit nil
func (o *CustomerDetails) SetCustomerEmailNil() {
o.CustomerEmail.Set(nil)
}
// UnsetCustomerEmail ensures that no value is present for CustomerEmail, not even an explicit nil
func (o *CustomerDetails) UnsetCustomerEmail() {
o.CustomerEmail.Unset()
}
// GetCustomerPhone returns the CustomerPhone field value
func (o *CustomerDetails) GetCustomerPhone() string {
if o == nil {
var ret string
return ret
}
return o.CustomerPhone
}
// GetCustomerPhoneOk returns a tuple with the CustomerPhone field value
// and a boolean to check if the value has been set.
func (o *CustomerDetails) GetCustomerPhoneOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CustomerPhone, true
}
// SetCustomerPhone sets field value
func (o *CustomerDetails) SetCustomerPhone(v string) {
o.CustomerPhone = v
}
// GetCustomerName returns the CustomerName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CustomerDetails) GetCustomerName() string {
if o == nil || IsNil(o.CustomerName.Get()) {
var ret string
return ret
}
return *o.CustomerName.Get()
}
// GetCustomerNameOk returns a tuple with the CustomerName 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 *CustomerDetails) GetCustomerNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CustomerName.Get(), o.CustomerName.IsSet()
}
// HasCustomerName returns a boolean if a field has been set.
func (o *CustomerDetails) HasCustomerName() bool {
if o != nil && o.CustomerName.IsSet() {
return true
}
return false
}
// SetCustomerName gets a reference to the given NullableString and assigns it to the CustomerName field.
func (o *CustomerDetails) SetCustomerName(v string) {
o.CustomerName.Set(&v)
}
// SetCustomerNameNil sets the value for CustomerName to be an explicit nil
func (o *CustomerDetails) SetCustomerNameNil() {
o.CustomerName.Set(nil)
}
// UnsetCustomerName ensures that no value is present for CustomerName, not even an explicit nil
func (o *CustomerDetails) UnsetCustomerName() {
o.CustomerName.Unset()
}
// GetCustomerBankAccountNumber returns the CustomerBankAccountNumber field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CustomerDetails) GetCustomerBankAccountNumber() string {
if o == nil || IsNil(o.CustomerBankAccountNumber.Get()) {
var ret string
return ret
}
return *o.CustomerBankAccountNumber.Get()
}
// GetCustomerBankAccountNumberOk returns a tuple with the CustomerBankAccountNumber 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 *CustomerDetails) GetCustomerBankAccountNumberOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CustomerBankAccountNumber.Get(), o.CustomerBankAccountNumber.IsSet()
}
// HasCustomerBankAccountNumber returns a boolean if a field has been set.
func (o *CustomerDetails) HasCustomerBankAccountNumber() bool {
if o != nil && o.CustomerBankAccountNumber.IsSet() {
return true
}
return false
}
// SetCustomerBankAccountNumber gets a reference to the given NullableString and assigns it to the CustomerBankAccountNumber field.
func (o *CustomerDetails) SetCustomerBankAccountNumber(v string) {
o.CustomerBankAccountNumber.Set(&v)
}
// SetCustomerBankAccountNumberNil sets the value for CustomerBankAccountNumber to be an explicit nil
func (o *CustomerDetails) SetCustomerBankAccountNumberNil() {
o.CustomerBankAccountNumber.Set(nil)
}
// UnsetCustomerBankAccountNumber ensures that no value is present for CustomerBankAccountNumber, not even an explicit nil
func (o *CustomerDetails) UnsetCustomerBankAccountNumber() {
o.CustomerBankAccountNumber.Unset()
}
// GetCustomerBankIfsc returns the CustomerBankIfsc field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CustomerDetails) GetCustomerBankIfsc() string {
if o == nil || IsNil(o.CustomerBankIfsc.Get()) {
var ret string
return ret
}
return *o.CustomerBankIfsc.Get()
}
// GetCustomerBankIfscOk returns a tuple with the CustomerBankIfsc 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 *CustomerDetails) GetCustomerBankIfscOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.CustomerBankIfsc.Get(), o.CustomerBankIfsc.IsSet()
}
// HasCustomerBankIfsc returns a boolean if a field has been set.
func (o *CustomerDetails) HasCustomerBankIfsc() bool {
if o != nil && o.CustomerBankIfsc.IsSet() {
return true
}
return false
}
// SetCustomerBankIfsc gets a reference to the given NullableString and assigns it to the CustomerBankIfsc field.
func (o *CustomerDetails) SetCustomerBankIfsc(v string) {
o.CustomerBankIfsc.Set(&v)
}
// SetCustomerBankIfscNil sets the value for CustomerBankIfsc to be an explicit nil
func (o *CustomerDetails) SetCustomerBankIfscNil() {
o.CustomerBankIfsc.Set(nil)
}
// UnsetCustomerBankIfsc ensures that no value is present for CustomerBankIfsc, not even an explicit nil
func (o *CustomerDetails) UnsetCustomerBankIfsc() {
o.CustomerBankIfsc.Unset()
}
// GetCustomerBankCode returns the CustomerBankCode field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CustomerDetails) GetCustomerBankCode() float32 {
if o == nil || IsNil(o.CustomerBankCode.Get()) {
var ret float32
return ret
}
return *o.CustomerBankCode.Get()
}
// GetCustomerBankCodeOk returns a tuple with the CustomerBankCode 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 *CustomerDetails) GetCustomerBankCodeOk() (*float32, bool) {
if o == nil {
return nil, false
}
return o.CustomerBankCode.Get(), o.CustomerBankCode.IsSet()
}
// HasCustomerBankCode returns a boolean if a field has been set.
func (o *CustomerDetails) HasCustomerBankCode() bool {
if o != nil && o.CustomerBankCode.IsSet() {
return true
}
return false
}
// SetCustomerBankCode gets a reference to the given NullableFloat32 and assigns it to the CustomerBankCode field.
func (o *CustomerDetails) SetCustomerBankCode(v float32) {
o.CustomerBankCode.Set(&v)
}
// SetCustomerBankCodeNil sets the value for CustomerBankCode to be an explicit nil
func (o *CustomerDetails) SetCustomerBankCodeNil() {
o.CustomerBankCode.Set(nil)
}
// UnsetCustomerBankCode ensures that no value is present for CustomerBankCode, not even an explicit nil
func (o *CustomerDetails) UnsetCustomerBankCode() {
o.CustomerBankCode.Unset()
}
func (o CustomerDetails) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CustomerDetails) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["customer_id"] = o.CustomerId
if o.CustomerEmail.IsSet() {
toSerialize["customer_email"] = o.CustomerEmail.Get()
}
toSerialize["customer_phone"] = o.CustomerPhone
if o.CustomerName.IsSet() {
toSerialize["customer_name"] = o.CustomerName.Get()
}
if o.CustomerBankAccountNumber.IsSet() {
toSerialize["customer_bank_account_number"] = o.CustomerBankAccountNumber.Get()
}
if o.CustomerBankIfsc.IsSet() {
toSerialize["customer_bank_ifsc"] = o.CustomerBankIfsc.Get()
}
if o.CustomerBankCode.IsSet() {
toSerialize["customer_bank_code"] = o.CustomerBankCode.Get()
}
return toSerialize, nil
}
type NullableCustomerDetails struct {
value *CustomerDetails
isSet bool
}
func (v NullableCustomerDetails) Get() *CustomerDetails {
return v.value
}
func (v *NullableCustomerDetails) Set(val *CustomerDetails) {
v.value = val
v.isSet = true
}
func (v NullableCustomerDetails) IsSet() bool {
return v.isSet
}
func (v *NullableCustomerDetails) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCustomerDetails(val *CustomerDetails) *NullableCustomerDetails {
return &NullableCustomerDetails{value: val, isSet: true}
}
func (v NullableCustomerDetails) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCustomerDetails) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}