-
Notifications
You must be signed in to change notification settings - Fork 28
/
model_phone_number.go
209 lines (174 loc) · 5.67 KB
/
model_phone_number.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
/*
Configuration webhooks
API version: 2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package configurationwebhook
import (
"encoding/json"
"github.com/adyen/adyen-go-api-library/v16/src/common"
)
// checks if the PhoneNumber type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &PhoneNumber{}
// PhoneNumber struct for PhoneNumber
type PhoneNumber struct {
// The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**.
PhoneCountryCode *string `json:"phoneCountryCode,omitempty"`
// The phone number. The inclusion of the phone number country code is not necessary.
PhoneNumber *string `json:"phoneNumber,omitempty"`
// The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**.
PhoneType *string `json:"phoneType,omitempty"`
}
// NewPhoneNumber instantiates a new PhoneNumber 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 NewPhoneNumber() *PhoneNumber {
this := PhoneNumber{}
return &this
}
// NewPhoneNumberWithDefaults instantiates a new PhoneNumber 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 NewPhoneNumberWithDefaults() *PhoneNumber {
this := PhoneNumber{}
return &this
}
// GetPhoneCountryCode returns the PhoneCountryCode field value if set, zero value otherwise.
func (o *PhoneNumber) GetPhoneCountryCode() string {
if o == nil || common.IsNil(o.PhoneCountryCode) {
var ret string
return ret
}
return *o.PhoneCountryCode
}
// GetPhoneCountryCodeOk returns a tuple with the PhoneCountryCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PhoneNumber) GetPhoneCountryCodeOk() (*string, bool) {
if o == nil || common.IsNil(o.PhoneCountryCode) {
return nil, false
}
return o.PhoneCountryCode, true
}
// HasPhoneCountryCode returns a boolean if a field has been set.
func (o *PhoneNumber) HasPhoneCountryCode() bool {
if o != nil && !common.IsNil(o.PhoneCountryCode) {
return true
}
return false
}
// SetPhoneCountryCode gets a reference to the given string and assigns it to the PhoneCountryCode field.
func (o *PhoneNumber) SetPhoneCountryCode(v string) {
o.PhoneCountryCode = &v
}
// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise.
func (o *PhoneNumber) GetPhoneNumber() string {
if o == nil || common.IsNil(o.PhoneNumber) {
var ret string
return ret
}
return *o.PhoneNumber
}
// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PhoneNumber) GetPhoneNumberOk() (*string, bool) {
if o == nil || common.IsNil(o.PhoneNumber) {
return nil, false
}
return o.PhoneNumber, true
}
// HasPhoneNumber returns a boolean if a field has been set.
func (o *PhoneNumber) HasPhoneNumber() bool {
if o != nil && !common.IsNil(o.PhoneNumber) {
return true
}
return false
}
// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field.
func (o *PhoneNumber) SetPhoneNumber(v string) {
o.PhoneNumber = &v
}
// GetPhoneType returns the PhoneType field value if set, zero value otherwise.
func (o *PhoneNumber) GetPhoneType() string {
if o == nil || common.IsNil(o.PhoneType) {
var ret string
return ret
}
return *o.PhoneType
}
// GetPhoneTypeOk returns a tuple with the PhoneType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PhoneNumber) GetPhoneTypeOk() (*string, bool) {
if o == nil || common.IsNil(o.PhoneType) {
return nil, false
}
return o.PhoneType, true
}
// HasPhoneType returns a boolean if a field has been set.
func (o *PhoneNumber) HasPhoneType() bool {
if o != nil && !common.IsNil(o.PhoneType) {
return true
}
return false
}
// SetPhoneType gets a reference to the given string and assigns it to the PhoneType field.
func (o *PhoneNumber) SetPhoneType(v string) {
o.PhoneType = &v
}
func (o PhoneNumber) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PhoneNumber) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !common.IsNil(o.PhoneCountryCode) {
toSerialize["phoneCountryCode"] = o.PhoneCountryCode
}
if !common.IsNil(o.PhoneNumber) {
toSerialize["phoneNumber"] = o.PhoneNumber
}
if !common.IsNil(o.PhoneType) {
toSerialize["phoneType"] = o.PhoneType
}
return toSerialize, nil
}
type NullablePhoneNumber struct {
value *PhoneNumber
isSet bool
}
func (v NullablePhoneNumber) Get() *PhoneNumber {
return v.value
}
func (v *NullablePhoneNumber) Set(val *PhoneNumber) {
v.value = val
v.isSet = true
}
func (v NullablePhoneNumber) IsSet() bool {
return v.isSet
}
func (v *NullablePhoneNumber) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePhoneNumber(val *PhoneNumber) *NullablePhoneNumber {
return &NullablePhoneNumber{value: val, isSet: true}
}
func (v NullablePhoneNumber) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePhoneNumber) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
func (o *PhoneNumber) isValidPhoneType() bool {
var allowedEnumValues = []string{"Fax", "Landline", "Mobile", "SIP"}
for _, allowed := range allowedEnumValues {
if o.GetPhoneType() == allowed {
return true
}
}
return false
}