/
model_multi_line_address.go
executable file
·389 lines (328 loc) · 11.5 KB
/
model_multi_line_address.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
381
382
383
384
385
386
387
/*
Lob
The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)?
API version: 1.3.0
Contact: lob-openapi@lob.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package lob
import (
"encoding/json"
)
// MultiLineAddress struct for MultiLineAddress
type MultiLineAddress struct {
// The intended recipient, typically a person's or firm's name.
Recipient NullableString `json:"recipient,omitempty"`
// Either `name` or `company` is required, you may also add both.
Company NullableString `json:"company,omitempty"`
// The primary delivery line (usually the street address) of the address. Combination of the following applicable `components`: * `primary_number` * `street_predirection` * `street_name` * `street_suffix` * `street_postdirection` * `secondary_designator` * `secondary_number` * `pmb_designator` * `pmb_number`
PrimaryLine string `json:"primary_line"`
// The secondary delivery line of the address. This field is typically empty but may contain information if `primary_line` is too long.
SecondaryLine *string `json:"secondary_line,omitempty"`
// Only present for addresses in Puerto Rico. An urbanization refers to an area, sector, or development within a city. See [USPS documentation](https://pe.usps.com/text/pub28/28api_008.htm#:~:text=I51.,-4%20Urbanizations&text=In%20Puerto%20Rico%2C%20identical%20street,placed%20before%20the%20urbanization%20name.) for clarification.
Urbanization *string `json:"urbanization,omitempty"`
City *string `json:"city,omitempty"`
// The <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2:US\" target=\"_blank\">ISO 3166-2</a> two letter code or subdivision name for the state. `city` and `state` are required if no `zip_code` is passed.
State *string `json:"state,omitempty"`
// Required if `city` and `state` are not passed in. If included, must be formatted as a US ZIP or ZIP+4 (e.g. `94107`, `941072282`, `94107-2282`).
ZipCode *string `json:"zip_code,omitempty"`
}
// NewMultiLineAddress instantiates a new MultiLineAddress 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 NewMultiLineAddress(primaryLine string) *MultiLineAddress {
this := MultiLineAddress{}
this.PrimaryLine = primaryLine
return &this
}
// NewMultiLineAddressWithDefaults instantiates a new MultiLineAddress 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 NewMultiLineAddressWithDefaults() *MultiLineAddress {
this := MultiLineAddress{}
return &this
}
// GetRecipient returns the Recipient field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MultiLineAddress) GetRecipient() string {
if o == nil || o.Recipient.Get() == nil {
var ret string
return ret
}
return *o.Recipient.Get()
}
// GetRecipientOk returns a tuple with the Recipient 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 *MultiLineAddress) GetRecipientOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Recipient.Get(), o.Recipient.IsSet()
}
// HasRecipient returns a boolean if a field has been set.
func (o *MultiLineAddress) HasRecipient() bool {
if o != nil && o.Recipient.IsSet() {
return true
}
return false
}
// SetRecipient gets a reference to the given NullableString and assigns it to the Recipient field.
func (o *MultiLineAddress) SetRecipient(v string) {
o.Recipient.Set(&v)
}
// SetRecipientNil sets the value for Recipient to be an explicit nil
func (o *MultiLineAddress) SetRecipientNil() {
o.Recipient.Set(nil)
}
// UnsetRecipient ensures that no value is present for Recipient, not even an explicit nil
func (o *MultiLineAddress) UnsetRecipient() {
o.Recipient.Unset()
}
// GetCompany returns the Company field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MultiLineAddress) GetCompany() string {
if o == nil || o.Company.Get() == nil {
var ret string
return ret
}
return *o.Company.Get()
}
// GetCompanyOk returns a tuple with the Company 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 *MultiLineAddress) GetCompanyOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Company.Get(), o.Company.IsSet()
}
// HasCompany returns a boolean if a field has been set.
func (o *MultiLineAddress) HasCompany() bool {
if o != nil && o.Company.IsSet() {
return true
}
return false
}
// SetCompany gets a reference to the given NullableString and assigns it to the Company field.
func (o *MultiLineAddress) SetCompany(v string) {
o.Company.Set(&v)
}
// SetCompanyNil sets the value for Company to be an explicit nil
func (o *MultiLineAddress) SetCompanyNil() {
o.Company.Set(nil)
}
// UnsetCompany ensures that no value is present for Company, not even an explicit nil
func (o *MultiLineAddress) UnsetCompany() {
o.Company.Unset()
}
// GetPrimaryLine returns the PrimaryLine field value
func (o *MultiLineAddress) GetPrimaryLine() string {
if o == nil {
var ret string
return ret
}
return o.PrimaryLine
}
// GetPrimaryLineOk returns a tuple with the PrimaryLine field value
// and a boolean to check if the value has been set.
func (o *MultiLineAddress) GetPrimaryLineOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.PrimaryLine, true
}
// SetPrimaryLine sets field value
func (o *MultiLineAddress) SetPrimaryLine(v string) {
o.PrimaryLine = v
}
// GetSecondaryLine returns the SecondaryLine field value if set, zero value otherwise.
func (o *MultiLineAddress) GetSecondaryLine() string {
if o == nil || o.SecondaryLine == nil {
var ret string
return ret
}
return *o.SecondaryLine
}
// GetSecondaryLineOk returns a tuple with the SecondaryLine field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MultiLineAddress) GetSecondaryLineOk() (*string, bool) {
if o == nil || o.SecondaryLine == nil {
return nil, false
}
return o.SecondaryLine, true
}
// HasSecondaryLine returns a boolean if a field has been set.
func (o *MultiLineAddress) HasSecondaryLine() bool {
if o != nil && o.SecondaryLine != nil {
return true
}
return false
}
// SetSecondaryLine gets a reference to the given string and assigns it to the SecondaryLine field.
func (o *MultiLineAddress) SetSecondaryLine(v string) {
o.SecondaryLine = &v
}
// GetUrbanization returns the Urbanization field value if set, zero value otherwise.
func (o *MultiLineAddress) GetUrbanization() string {
if o == nil || o.Urbanization == nil {
var ret string
return ret
}
return *o.Urbanization
}
// GetUrbanizationOk returns a tuple with the Urbanization field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MultiLineAddress) GetUrbanizationOk() (*string, bool) {
if o == nil || o.Urbanization == nil {
return nil, false
}
return o.Urbanization, true
}
// HasUrbanization returns a boolean if a field has been set.
func (o *MultiLineAddress) HasUrbanization() bool {
if o != nil && o.Urbanization != nil {
return true
}
return false
}
// SetUrbanization gets a reference to the given string and assigns it to the Urbanization field.
func (o *MultiLineAddress) SetUrbanization(v string) {
o.Urbanization = &v
}
// GetCity returns the City field value if set, zero value otherwise.
func (o *MultiLineAddress) GetCity() string {
if o == nil || o.City == nil {
var ret string
return ret
}
return *o.City
}
// GetCityOk returns a tuple with the City field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MultiLineAddress) GetCityOk() (*string, bool) {
if o == nil || o.City == nil {
return nil, false
}
return o.City, true
}
// HasCity returns a boolean if a field has been set.
func (o *MultiLineAddress) HasCity() bool {
if o != nil && o.City != nil {
return true
}
return false
}
// SetCity gets a reference to the given string and assigns it to the City field.
func (o *MultiLineAddress) SetCity(v string) {
o.City = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *MultiLineAddress) GetState() string {
if o == nil || o.State == nil {
var ret string
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MultiLineAddress) GetStateOk() (*string, bool) {
if o == nil || o.State == nil {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *MultiLineAddress) HasState() bool {
if o != nil && o.State != nil {
return true
}
return false
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *MultiLineAddress) SetState(v string) {
o.State = &v
}
// GetZipCode returns the ZipCode field value if set, zero value otherwise.
func (o *MultiLineAddress) GetZipCode() string {
if o == nil || o.ZipCode == nil {
var ret string
return ret
}
return *o.ZipCode
}
// GetZipCodeOk returns a tuple with the ZipCode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MultiLineAddress) GetZipCodeOk() (*string, bool) {
if o == nil || o.ZipCode == nil {
return nil, false
}
return o.ZipCode, true
}
// HasZipCode returns a boolean if a field has been set.
func (o *MultiLineAddress) HasZipCode() bool {
if o != nil && o.ZipCode != nil {
return true
}
return false
}
// SetZipCode gets a reference to the given string and assigns it to the ZipCode field.
func (o *MultiLineAddress) SetZipCode(v string) {
o.ZipCode = &v
}
func (o MultiLineAddress) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Recipient.IsSet() {
toSerialize["recipient"] = o.Recipient.Get()
}
if o.Company.IsSet() {
toSerialize["company"] = o.Company.Get()
}
if true {
toSerialize["primary_line"] = o.PrimaryLine
}
if o.SecondaryLine != nil {
toSerialize["secondary_line"] = o.SecondaryLine
}
if o.Urbanization != nil {
toSerialize["urbanization"] = o.Urbanization
}
if o.City != nil {
toSerialize["city"] = o.City
}
if o.State != nil {
toSerialize["state"] = o.State
}
if o.ZipCode != nil {
toSerialize["zip_code"] = o.ZipCode
}
return json.Marshal(toSerialize)
}
type NullableMultiLineAddress struct {
value *MultiLineAddress
isSet bool
}
func (v NullableMultiLineAddress) Get() *MultiLineAddress {
return v.value
}
func (v *NullableMultiLineAddress) Set(val *MultiLineAddress) {
v.value = val
v.isSet = true
}
func (v NullableMultiLineAddress) IsSet() bool {
return v.isSet
}
func (v *NullableMultiLineAddress) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMultiLineAddress(val *MultiLineAddress) *NullableMultiLineAddress {
return &NullableMultiLineAddress{value: val, isSet: true}
}
func (v NullableMultiLineAddress) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMultiLineAddress) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}