-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathAddressEditable.php
More file actions
executable file
·792 lines (690 loc) · 23.1 KB
/
Copy pathAddressEditable.php
File metadata and controls
executable file
·792 lines (690 loc) · 23.1 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
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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
<?php
/**
* AddressEditable
*
* PHP version 7.3
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
/**
* 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/)?
*
* The version of the OpenAPI document: 1.3.0
* Contact: lob-openapi@lob.com
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 5.2.1
*/
/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
namespace OpenAPI\Client\Model;
use \ArrayAccess;
use \OpenAPI\Client\ObjectSerializer;
/**
* AddressEditable Class Doc Comment
*
* @category Class
* @package OpenAPI\Client
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
* @implements \ArrayAccess<TKey, TValue>
* @template TKey int|null
* @template TValue mixed|null
*/
class AddressEditable implements ModelInterface, ArrayAccess, \JsonSerializable
{
public const DISCRIMINATOR = null;
/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'address_editable';
/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPITypes = [
'address_line1' => 'string',
'address_line2' => 'string',
'address_city' => 'string',
'address_state' => 'string',
'address_zip' => 'string',
'address_country' => '\OpenAPI\Client\Model\CountryExtended',
'description' => 'string',
'name' => 'string',
'company' => 'string',
'phone' => 'string',
'email' => 'string',
'metadata' => 'array<string,string>'
];
/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
* @phpstan-var array<string, string|null>
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'address_line1' => null,
'address_line2' => null,
'address_city' => null,
'address_state' => null,
'address_zip' => null,
'address_country' => null,
'description' => null,
'name' => null,
'company' => null,
'phone' => null,
'email' => null,
'metadata' => null
];
/**
* Array of property to type mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPITypes()
{
return self::$openAPITypes;
}
/**
* Array of property to format mappings. Used for (de)serialization
*
* @return array
*/
public static function openAPIFormats()
{
return self::$openAPIFormats;
}
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'address_line1' => 'address_line1',
'address_line2' => 'address_line2',
'address_city' => 'address_city',
'address_state' => 'address_state',
'address_zip' => 'address_zip',
'address_country' => 'address_country',
'description' => 'description',
'name' => 'name',
'company' => 'company',
'phone' => 'phone',
'email' => 'email',
'metadata' => 'metadata'
];
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'address_line1' => 'setAddressLine1',
'address_line2' => 'setAddressLine2',
'address_city' => 'setAddressCity',
'address_state' => 'setAddressState',
'address_zip' => 'setAddressZip',
'address_country' => 'setAddressCountry',
'description' => 'setDescription',
'name' => 'setName',
'company' => 'setCompany',
'phone' => 'setPhone',
'email' => 'setEmail',
'metadata' => 'setMetadata'
];
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'address_line1' => 'getAddressLine1',
'address_line2' => 'getAddressLine2',
'address_city' => 'getAddressCity',
'address_state' => 'getAddressState',
'address_zip' => 'getAddressZip',
'address_country' => 'getAddressCountry',
'description' => 'getDescription',
'name' => 'getName',
'company' => 'getCompany',
'phone' => 'getPhone',
'email' => 'getEmail',
'metadata' => 'getMetadata'
];
/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @return array
*/
public static function attributeMap()
{
return self::$attributeMap;
}
/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @return array
*/
public static function setters()
{
return self::$setters;
}
/**
* Array of attributes to getter functions (for serialization of requests)
*
* @return array
*/
public static function getters()
{
return self::$getters;
}
/**
* The original name of the model.
*
* @return string
*/
public function getModelName()
{
return self::$openAPIModelName;
}
/**
* Associative array for storing property values
*
* @var mixed[]
*/
protected $container = [];
/**
* Constructor
*
* @param mixed[]|null $data Associated array of property values
* initializing the model
*/
public function __construct(?array $data = null)
{
$this->container['address_line1'] = $data['address_line1'] ?? null;
$this->container['address_line2'] = $data['address_line2'] ?? null;
$this->container['address_city'] = $data['address_city'] ?? null;
$this->container['address_state'] = $data['address_state'] ?? null;
$this->container['address_zip'] = $data['address_zip'] ?? null;
$this->container['address_country'] = $data['address_country'] ?? null;
$this->container['description'] = $data['description'] ?? null;
$this->container['name'] = $data['name'] ?? null;
$this->container['company'] = $data['company'] ?? null;
$this->container['phone'] = $data['phone'] ?? null;
$this->container['email'] = $data['email'] ?? null;
$this->container['metadata'] = $data['metadata'] ?? null;
}
/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['address_line1']) && (mb_strlen($this->container['address_line1']) > 200)) {
$invalidProperties[] = "invalid value for 'address_line1', the character length must be smaller than or equal to 200.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['address_line2']) && (mb_strlen($this->container['address_line2']) > 200)) {
$invalidProperties[] = "invalid value for 'address_line2', the character length must be smaller than or equal to 200.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['address_city']) && (mb_strlen($this->container['address_city']) > 200)) {
$invalidProperties[] = "invalid value for 'address_city', the character length must be smaller than or equal to 200.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['address_state']) && (mb_strlen($this->container['address_state']) > 200)) {
$invalidProperties[] = "invalid value for 'address_state', the character length must be smaller than or equal to 200.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['address_zip']) && (mb_strlen($this->container['address_zip']) > 40)) {
$invalidProperties[] = "invalid value for 'address_zip', the character length must be smaller than or equal to 40.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 255)) {
$invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 255.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 40)) {
$invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 40.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['company']) && (mb_strlen($this->container['company']) > 40)) {
$invalidProperties[] = "invalid value for 'company', the character length must be smaller than or equal to 40.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['phone']) && (mb_strlen($this->container['phone']) > 40)) {
$invalidProperties[] = "invalid value for 'phone', the character length must be smaller than or equal to 40.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($this->container['email']) && (mb_strlen($this->container['email']) > 100)) {
$invalidProperties[] = "invalid value for 'email', the character length must be smaller than or equal to 100.";
}
}
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
}
return $invalidProperties;
}
/**
* Validate all the properties in the model
* return true if all passed
*
* @return bool True if all properties are valid
*/
public function valid()
{
return count($this->listInvalidProperties()) === 0;
}
/**
* Gets address_line1
*
* @return string|null
*/
public function getAddressLine1()
{
return $this->container['address_line1'];
}
/**
* Sets address_line1
*
* @param string|null $address_line1 The building number, street name, street suffix, and any street directionals. For US addresses, the max length is 64 characters.
*
* @return self
*/
public function setAddressLine1($address_line1)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($address_line1) && (mb_strlen($address_line1) > 200)) {
throw new \InvalidArgumentException('invalid length for $address_line1 when calling AddressEditable., must be smaller than or equal to 200.');
}
}
$this->container['address_line1'] = $address_line1;
return $this;
}
/**
* Gets address_line2
*
* @return string|null
*/
public function getAddressLine2()
{
return $this->container['address_line2'];
}
/**
* Sets address_line2
*
* @param string|null $address_line2 The suite or apartment number of the recipient address, if applicable. For US addresses, the max length is 64 characters.
*
* @return self
*/
public function setAddressLine2($address_line2)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($address_line2) && (mb_strlen($address_line2) > 200)) {
throw new \InvalidArgumentException('invalid length for $address_line2 when calling AddressEditable., must be smaller than or equal to 200.');
}
}
$this->container['address_line2'] = $address_line2;
return $this;
}
/**
* Gets address_city
*
* @return string|null
*/
public function getAddressCity()
{
return $this->container['address_city'];
}
/**
* Sets address_city
*
* @param string|null $address_city address_city
*
* @return self
*/
public function setAddressCity($address_city)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($address_city) && (mb_strlen($address_city) > 200)) {
throw new \InvalidArgumentException('invalid length for $address_city when calling AddressEditable., must be smaller than or equal to 200.');
}
}
$this->container['address_city'] = $address_city;
return $this;
}
/**
* Gets address_state
*
* @return string|null
*/
public function getAddressState()
{
return $this->container['address_state'];
}
/**
* Sets address_state
*
* @param string|null $address_state address_state
*
* @return self
*/
public function setAddressState($address_state)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($address_state) && (mb_strlen($address_state) > 200)) {
throw new \InvalidArgumentException('invalid length for $address_state when calling AddressEditable., must be smaller than or equal to 200.');
}
}
$this->container['address_state'] = $address_state;
return $this;
}
/**
* Gets address_zip
*
* @return string|null
*/
public function getAddressZip()
{
return $this->container['address_zip'];
}
/**
* Sets address_zip
*
* @param string|null $address_zip Optional postal code. For US addresses, must be either 5 or 9 digits.
*
* @return self
*/
public function setAddressZip($address_zip)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($address_zip) && (mb_strlen($address_zip) > 40)) {
throw new \InvalidArgumentException('invalid length for $address_zip when calling AddressEditable., must be smaller than or equal to 40.');
}
}
$this->container['address_zip'] = $address_zip;
return $this;
}
/**
* Gets address_country
*
* @return \OpenAPI\Client\Model\CountryExtended|null
*/
public function getAddressCountry()
{
return $this->container['address_country'];
}
/**
* Sets address_country
*
* @param \OpenAPI\Client\Model\CountryExtended|null $address_country address_country
*
* @return self
*/
public function setAddressCountry($address_country)
{
$this->container['address_country'] = $address_country;
return $this;
}
/**
* Gets description
*
* @return string|null
*/
public function getDescription()
{
return $this->container['description'];
}
/**
* Sets description
*
* @param string|null $description An internal description that identifies this resource. Must be no longer than 255 characters.
*
* @return self
*/
public function setDescription($description)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($description) && (mb_strlen($description) > 255)) {
throw new \InvalidArgumentException('invalid length for $description when calling AddressEditable., must be smaller than or equal to 255.');
}
}
$this->container['description'] = $description;
return $this;
}
/**
* Gets name
*
* @return string|null
*/
public function getName()
{
return $this->container['name'];
}
/**
* Sets name
*
* @param string|null $name name associated with address.
*
* @return self
*/
public function setName($name)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($name) && (mb_strlen($name) > 40)) {
throw new \InvalidArgumentException('invalid length for $name when calling AddressEditable., must be smaller than or equal to 40.');
}
}
$this->container['name'] = $name;
return $this;
}
/**
* Gets company
*
* @return string|null
*/
public function getCompany()
{
return $this->container['company'];
}
/**
* Sets company
*
* @param string|null $company Either `name` or `company` is required, you may also add both.
*
* @return self
*/
public function setCompany($company)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($company) && (mb_strlen($company) > 40)) {
throw new \InvalidArgumentException('invalid length for $company when calling AddressEditable., must be smaller than or equal to 40.');
}
}
$this->container['company'] = $company;
return $this;
}
/**
* Gets phone
*
* @return string|null
*/
public function getPhone()
{
return $this->container['phone'];
}
/**
* Sets phone
*
* @param string|null $phone Must be no longer than 40 characters.
*
* @return self
*/
public function setPhone($phone)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($phone) && (mb_strlen($phone) > 40)) {
throw new \InvalidArgumentException('invalid length for $phone when calling AddressEditable., must be smaller than or equal to 40.');
}
}
$this->container['phone'] = $phone;
return $this;
}
/**
* Gets email
*
* @return string|null
*/
public function getEmail()
{
return $this->container['email'];
}
/**
* Sets email
*
* @param string|null $email Must be no longer than 100 characters.
*
* @return self
*/
public function setEmail($email)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
if (!is_null($email) && (mb_strlen($email) > 100)) {
throw new \InvalidArgumentException('invalid length for $email when calling AddressEditable., must be smaller than or equal to 100.');
}
}
$this->container['email'] = $email;
return $this;
}
/**
* Gets metadata
*
* @return array<string,string>|null
*/
public function getMetadata()
{
return $this->container['metadata'];
}
/**
* Sets metadata
*
* @param array<string,string>|null $metadata Use metadata to store custom information for tagging and labeling back to your internal systems. Must be an object with up to 20 key-value pairs. Keys must be at most 40 characters and values must be at most 500 characters. Neither can contain the characters `\"` and `\\`. i.e. '{\"customer_id\" : \"NEWYORK2015\"}' Nested objects are not supported. See [Metadata](#section/Metadata) for more information.
*
* @return self
*/
public function setMetadata($metadata)
{
if (!method_exists($this, 'getId') || (!empty($this->getId()) && strpos($this->getId(), "fakeId") === False)) {
}
$this->container['metadata'] = $metadata;
return $this;
}
/**
* Returns true if offset exists. False otherwise.
*
* @param integer $offset Offset
*
* @return boolean
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->container[$offset]);
}
/**
* Gets offset.
*
* @param integer $offset Offset
*
* @return mixed|null
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->container[$offset] ?? null;
}
/**
* Sets value based on offset.
*
* @param int|null $offset Offset
* @param mixed $value Value to be set
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
/**
* Unsets offset.
*
* @param integer $offset Offset
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->container[$offset]);
}
/**
* Serializes the object to a value that can be serialized natively by json_encode().
* @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
*
* @return mixed Returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource.
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return ObjectSerializer::sanitizeForSerialization($this);
}
/**
* Gets the string presentation of the object
*
* @return string
*/
public function __toString()
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
JSON_PRETTY_PRINT
);
}
/**
* Gets a header-safe presentation of the object
*
* @return string
*/
public function toHeaderValue()
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
}