Address.php
| 1 | <?php |
| 2 | /** |
| 3 | * NOTE: This class is auto generated by the swagger code generator program. |
| 4 | * https://github.com/swagger-api/swagger-codegen |
| 5 | * Do not edit the class manually. |
| 6 | */ |
| 7 | |
| 8 | namespace SquareConnect\Model; |
| 9 | |
| 10 | use \ArrayAccess; |
| 11 | /** |
| 12 | * Address Class Doc Comment |
| 13 | * |
| 14 | * @category Class |
| 15 | * @package SquareConnect |
| 16 | * @author Square Inc. |
| 17 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License v2 |
| 18 | * @link https://squareup.com/developers |
| 19 | */ |
| 20 | class Address implements ArrayAccess |
| 21 | { |
| 22 | /** |
| 23 | * Array of property to type mappings. Used for (de)serialization |
| 24 | * @var string[] |
| 25 | */ |
| 26 | static $swaggerTypes = array( |
| 27 | 'address_line_1' => 'string', |
| 28 | 'address_line_2' => 'string', |
| 29 | 'address_line_3' => 'string', |
| 30 | 'locality' => 'string', |
| 31 | 'sublocality' => 'string', |
| 32 | 'sublocality_2' => 'string', |
| 33 | 'sublocality_3' => 'string', |
| 34 | 'administrative_district_level_1' => 'string', |
| 35 | 'administrative_district_level_2' => 'string', |
| 36 | 'administrative_district_level_3' => 'string', |
| 37 | 'postal_code' => 'string', |
| 38 | 'country' => 'string', |
| 39 | 'first_name' => 'string', |
| 40 | 'last_name' => 'string', |
| 41 | 'organization' => 'string' |
| 42 | ); |
| 43 | |
| 44 | /** |
| 45 | * Array of attributes where the key is the local name, and the value is the original name |
| 46 | * @var string[] |
| 47 | */ |
| 48 | static $attributeMap = array( |
| 49 | 'address_line_1' => 'address_line_1', |
| 50 | 'address_line_2' => 'address_line_2', |
| 51 | 'address_line_3' => 'address_line_3', |
| 52 | 'locality' => 'locality', |
| 53 | 'sublocality' => 'sublocality', |
| 54 | 'sublocality_2' => 'sublocality_2', |
| 55 | 'sublocality_3' => 'sublocality_3', |
| 56 | 'administrative_district_level_1' => 'administrative_district_level_1', |
| 57 | 'administrative_district_level_2' => 'administrative_district_level_2', |
| 58 | 'administrative_district_level_3' => 'administrative_district_level_3', |
| 59 | 'postal_code' => 'postal_code', |
| 60 | 'country' => 'country', |
| 61 | 'first_name' => 'first_name', |
| 62 | 'last_name' => 'last_name', |
| 63 | 'organization' => 'organization' |
| 64 | ); |
| 65 | |
| 66 | /** |
| 67 | * Array of attributes to setter functions (for deserialization of responses) |
| 68 | * @var string[] |
| 69 | */ |
| 70 | static $setters = array( |
| 71 | 'address_line_1' => 'setAddressLine1', |
| 72 | 'address_line_2' => 'setAddressLine2', |
| 73 | 'address_line_3' => 'setAddressLine3', |
| 74 | 'locality' => 'setLocality', |
| 75 | 'sublocality' => 'setSublocality', |
| 76 | 'sublocality_2' => 'setSublocality2', |
| 77 | 'sublocality_3' => 'setSublocality3', |
| 78 | 'administrative_district_level_1' => 'setAdministrativeDistrictLevel1', |
| 79 | 'administrative_district_level_2' => 'setAdministrativeDistrictLevel2', |
| 80 | 'administrative_district_level_3' => 'setAdministrativeDistrictLevel3', |
| 81 | 'postal_code' => 'setPostalCode', |
| 82 | 'country' => 'setCountry', |
| 83 | 'first_name' => 'setFirstName', |
| 84 | 'last_name' => 'setLastName', |
| 85 | 'organization' => 'setOrganization' |
| 86 | ); |
| 87 | |
| 88 | /** |
| 89 | * Array of attributes to getter functions (for serialization of requests) |
| 90 | * @var string[] |
| 91 | */ |
| 92 | static $getters = array( |
| 93 | 'address_line_1' => 'getAddressLine1', |
| 94 | 'address_line_2' => 'getAddressLine2', |
| 95 | 'address_line_3' => 'getAddressLine3', |
| 96 | 'locality' => 'getLocality', |
| 97 | 'sublocality' => 'getSublocality', |
| 98 | 'sublocality_2' => 'getSublocality2', |
| 99 | 'sublocality_3' => 'getSublocality3', |
| 100 | 'administrative_district_level_1' => 'getAdministrativeDistrictLevel1', |
| 101 | 'administrative_district_level_2' => 'getAdministrativeDistrictLevel2', |
| 102 | 'administrative_district_level_3' => 'getAdministrativeDistrictLevel3', |
| 103 | 'postal_code' => 'getPostalCode', |
| 104 | 'country' => 'getCountry', |
| 105 | 'first_name' => 'getFirstName', |
| 106 | 'last_name' => 'getLastName', |
| 107 | 'organization' => 'getOrganization' |
| 108 | ); |
| 109 | |
| 110 | /** |
| 111 | * $address_line_1 The first line of the address. Fields that start with `address_line` provide the address's most specific details, like street number, street name, and building name. They do *not* provide less specific details like city, state/province, or country (these details are provided in other fields). |
| 112 | * @var string |
| 113 | */ |
| 114 | protected $address_line_1; |
| 115 | /** |
| 116 | * $address_line_2 The second line of the address, if any. |
| 117 | * @var string |
| 118 | */ |
| 119 | protected $address_line_2; |
| 120 | /** |
| 121 | * $address_line_3 The third line of the address, if any. |
| 122 | * @var string |
| 123 | */ |
| 124 | protected $address_line_3; |
| 125 | /** |
| 126 | * $locality The city or town of the address. |
| 127 | * @var string |
| 128 | */ |
| 129 | protected $locality; |
| 130 | /** |
| 131 | * $sublocality A civil region within the address's `locality`, if any. |
| 132 | * @var string |
| 133 | */ |
| 134 | protected $sublocality; |
| 135 | /** |
| 136 | * $sublocality_2 A civil region within the address's `sublocality`, if any. |
| 137 | * @var string |
| 138 | */ |
| 139 | protected $sublocality_2; |
| 140 | /** |
| 141 | * $sublocality_3 A civil region within the address's `sublocality_2`, if any. |
| 142 | * @var string |
| 143 | */ |
| 144 | protected $sublocality_3; |
| 145 | /** |
| 146 | * $administrative_district_level_1 A civil entity within the address's country. In the US, this is the state. |
| 147 | * @var string |
| 148 | */ |
| 149 | protected $administrative_district_level_1; |
| 150 | /** |
| 151 | * $administrative_district_level_2 A civil entity within the address's `administrative_district_level_1`. In the US, this is the county. |
| 152 | * @var string |
| 153 | */ |
| 154 | protected $administrative_district_level_2; |
| 155 | /** |
| 156 | * $administrative_district_level_3 A civil entity within the address's `administrative_district_level_2`, if any. |
| 157 | * @var string |
| 158 | */ |
| 159 | protected $administrative_district_level_3; |
| 160 | /** |
| 161 | * $postal_code The address's postal code. |
| 162 | * @var string |
| 163 | */ |
| 164 | protected $postal_code; |
| 165 | /** |
| 166 | * $country The address's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values |
| 167 | * @var string |
| 168 | */ |
| 169 | protected $country; |
| 170 | /** |
| 171 | * $first_name Optional first name when it's representing recipient. |
| 172 | * @var string |
| 173 | */ |
| 174 | protected $first_name; |
| 175 | /** |
| 176 | * $last_name Optional last name when it's representing recipient. |
| 177 | * @var string |
| 178 | */ |
| 179 | protected $last_name; |
| 180 | /** |
| 181 | * $organization Optional organization name when it's representing recipient. |
| 182 | * @var string |
| 183 | */ |
| 184 | protected $organization; |
| 185 | |
| 186 | /** |
| 187 | * Constructor |
| 188 | * @param mixed[] $data Associated array of property value initializing the model |
| 189 | */ |
| 190 | public function __construct(array $data = null) |
| 191 | { |
| 192 | if ($data != null) { |
| 193 | if (isset($data["address_line_1"])) { |
| 194 | $this->address_line_1 = $data["address_line_1"]; |
| 195 | } else { |
| 196 | $this->address_line_1 = null; |
| 197 | } |
| 198 | if (isset($data["address_line_2"])) { |
| 199 | $this->address_line_2 = $data["address_line_2"]; |
| 200 | } else { |
| 201 | $this->address_line_2 = null; |
| 202 | } |
| 203 | if (isset($data["address_line_3"])) { |
| 204 | $this->address_line_3 = $data["address_line_3"]; |
| 205 | } else { |
| 206 | $this->address_line_3 = null; |
| 207 | } |
| 208 | if (isset($data["locality"])) { |
| 209 | $this->locality = $data["locality"]; |
| 210 | } else { |
| 211 | $this->locality = null; |
| 212 | } |
| 213 | if (isset($data["sublocality"])) { |
| 214 | $this->sublocality = $data["sublocality"]; |
| 215 | } else { |
| 216 | $this->sublocality = null; |
| 217 | } |
| 218 | if (isset($data["sublocality_2"])) { |
| 219 | $this->sublocality_2 = $data["sublocality_2"]; |
| 220 | } else { |
| 221 | $this->sublocality_2 = null; |
| 222 | } |
| 223 | if (isset($data["sublocality_3"])) { |
| 224 | $this->sublocality_3 = $data["sublocality_3"]; |
| 225 | } else { |
| 226 | $this->sublocality_3 = null; |
| 227 | } |
| 228 | if (isset($data["administrative_district_level_1"])) { |
| 229 | $this->administrative_district_level_1 = $data["administrative_district_level_1"]; |
| 230 | } else { |
| 231 | $this->administrative_district_level_1 = null; |
| 232 | } |
| 233 | if (isset($data["administrative_district_level_2"])) { |
| 234 | $this->administrative_district_level_2 = $data["administrative_district_level_2"]; |
| 235 | } else { |
| 236 | $this->administrative_district_level_2 = null; |
| 237 | } |
| 238 | if (isset($data["administrative_district_level_3"])) { |
| 239 | $this->administrative_district_level_3 = $data["administrative_district_level_3"]; |
| 240 | } else { |
| 241 | $this->administrative_district_level_3 = null; |
| 242 | } |
| 243 | if (isset($data["postal_code"])) { |
| 244 | $this->postal_code = $data["postal_code"]; |
| 245 | } else { |
| 246 | $this->postal_code = null; |
| 247 | } |
| 248 | if (isset($data["country"])) { |
| 249 | $this->country = $data["country"]; |
| 250 | } else { |
| 251 | $this->country = null; |
| 252 | } |
| 253 | if (isset($data["first_name"])) { |
| 254 | $this->first_name = $data["first_name"]; |
| 255 | } else { |
| 256 | $this->first_name = null; |
| 257 | } |
| 258 | if (isset($data["last_name"])) { |
| 259 | $this->last_name = $data["last_name"]; |
| 260 | } else { |
| 261 | $this->last_name = null; |
| 262 | } |
| 263 | if (isset($data["organization"])) { |
| 264 | $this->organization = $data["organization"]; |
| 265 | } else { |
| 266 | $this->organization = null; |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | /** |
| 271 | * Gets address_line_1 |
| 272 | * @return string |
| 273 | */ |
| 274 | public function getAddressLine1() |
| 275 | { |
| 276 | return $this->address_line_1; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Sets address_line_1 |
| 281 | * @param string $address_line_1 The first line of the address. Fields that start with `address_line` provide the address's most specific details, like street number, street name, and building name. They do *not* provide less specific details like city, state/province, or country (these details are provided in other fields). |
| 282 | * @return $this |
| 283 | */ |
| 284 | public function setAddressLine1($address_line_1) |
| 285 | { |
| 286 | $this->address_line_1 = $address_line_1; |
| 287 | return $this; |
| 288 | } |
| 289 | /** |
| 290 | * Gets address_line_2 |
| 291 | * @return string |
| 292 | */ |
| 293 | public function getAddressLine2() |
| 294 | { |
| 295 | return $this->address_line_2; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Sets address_line_2 |
| 300 | * @param string $address_line_2 The second line of the address, if any. |
| 301 | * @return $this |
| 302 | */ |
| 303 | public function setAddressLine2($address_line_2) |
| 304 | { |
| 305 | $this->address_line_2 = $address_line_2; |
| 306 | return $this; |
| 307 | } |
| 308 | /** |
| 309 | * Gets address_line_3 |
| 310 | * @return string |
| 311 | */ |
| 312 | public function getAddressLine3() |
| 313 | { |
| 314 | return $this->address_line_3; |
| 315 | } |
| 316 | |
| 317 | /** |
| 318 | * Sets address_line_3 |
| 319 | * @param string $address_line_3 The third line of the address, if any. |
| 320 | * @return $this |
| 321 | */ |
| 322 | public function setAddressLine3($address_line_3) |
| 323 | { |
| 324 | $this->address_line_3 = $address_line_3; |
| 325 | return $this; |
| 326 | } |
| 327 | /** |
| 328 | * Gets locality |
| 329 | * @return string |
| 330 | */ |
| 331 | public function getLocality() |
| 332 | { |
| 333 | return $this->locality; |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Sets locality |
| 338 | * @param string $locality The city or town of the address. |
| 339 | * @return $this |
| 340 | */ |
| 341 | public function setLocality($locality) |
| 342 | { |
| 343 | $this->locality = $locality; |
| 344 | return $this; |
| 345 | } |
| 346 | /** |
| 347 | * Gets sublocality |
| 348 | * @return string |
| 349 | */ |
| 350 | public function getSublocality() |
| 351 | { |
| 352 | return $this->sublocality; |
| 353 | } |
| 354 | |
| 355 | /** |
| 356 | * Sets sublocality |
| 357 | * @param string $sublocality A civil region within the address's `locality`, if any. |
| 358 | * @return $this |
| 359 | */ |
| 360 | public function setSublocality($sublocality) |
| 361 | { |
| 362 | $this->sublocality = $sublocality; |
| 363 | return $this; |
| 364 | } |
| 365 | /** |
| 366 | * Gets sublocality_2 |
| 367 | * @return string |
| 368 | */ |
| 369 | public function getSublocality2() |
| 370 | { |
| 371 | return $this->sublocality_2; |
| 372 | } |
| 373 | |
| 374 | /** |
| 375 | * Sets sublocality_2 |
| 376 | * @param string $sublocality_2 A civil region within the address's `sublocality`, if any. |
| 377 | * @return $this |
| 378 | */ |
| 379 | public function setSublocality2($sublocality_2) |
| 380 | { |
| 381 | $this->sublocality_2 = $sublocality_2; |
| 382 | return $this; |
| 383 | } |
| 384 | /** |
| 385 | * Gets sublocality_3 |
| 386 | * @return string |
| 387 | */ |
| 388 | public function getSublocality3() |
| 389 | { |
| 390 | return $this->sublocality_3; |
| 391 | } |
| 392 | |
| 393 | /** |
| 394 | * Sets sublocality_3 |
| 395 | * @param string $sublocality_3 A civil region within the address's `sublocality_2`, if any. |
| 396 | * @return $this |
| 397 | */ |
| 398 | public function setSublocality3($sublocality_3) |
| 399 | { |
| 400 | $this->sublocality_3 = $sublocality_3; |
| 401 | return $this; |
| 402 | } |
| 403 | /** |
| 404 | * Gets administrative_district_level_1 |
| 405 | * @return string |
| 406 | */ |
| 407 | public function getAdministrativeDistrictLevel1() |
| 408 | { |
| 409 | return $this->administrative_district_level_1; |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * Sets administrative_district_level_1 |
| 414 | * @param string $administrative_district_level_1 A civil entity within the address's country. In the US, this is the state. |
| 415 | * @return $this |
| 416 | */ |
| 417 | public function setAdministrativeDistrictLevel1($administrative_district_level_1) |
| 418 | { |
| 419 | $this->administrative_district_level_1 = $administrative_district_level_1; |
| 420 | return $this; |
| 421 | } |
| 422 | /** |
| 423 | * Gets administrative_district_level_2 |
| 424 | * @return string |
| 425 | */ |
| 426 | public function getAdministrativeDistrictLevel2() |
| 427 | { |
| 428 | return $this->administrative_district_level_2; |
| 429 | } |
| 430 | |
| 431 | /** |
| 432 | * Sets administrative_district_level_2 |
| 433 | * @param string $administrative_district_level_2 A civil entity within the address's `administrative_district_level_1`. In the US, this is the county. |
| 434 | * @return $this |
| 435 | */ |
| 436 | public function setAdministrativeDistrictLevel2($administrative_district_level_2) |
| 437 | { |
| 438 | $this->administrative_district_level_2 = $administrative_district_level_2; |
| 439 | return $this; |
| 440 | } |
| 441 | /** |
| 442 | * Gets administrative_district_level_3 |
| 443 | * @return string |
| 444 | */ |
| 445 | public function getAdministrativeDistrictLevel3() |
| 446 | { |
| 447 | return $this->administrative_district_level_3; |
| 448 | } |
| 449 | |
| 450 | /** |
| 451 | * Sets administrative_district_level_3 |
| 452 | * @param string $administrative_district_level_3 A civil entity within the address's `administrative_district_level_2`, if any. |
| 453 | * @return $this |
| 454 | */ |
| 455 | public function setAdministrativeDistrictLevel3($administrative_district_level_3) |
| 456 | { |
| 457 | $this->administrative_district_level_3 = $administrative_district_level_3; |
| 458 | return $this; |
| 459 | } |
| 460 | /** |
| 461 | * Gets postal_code |
| 462 | * @return string |
| 463 | */ |
| 464 | public function getPostalCode() |
| 465 | { |
| 466 | return $this->postal_code; |
| 467 | } |
| 468 | |
| 469 | /** |
| 470 | * Sets postal_code |
| 471 | * @param string $postal_code The address's postal code. |
| 472 | * @return $this |
| 473 | */ |
| 474 | public function setPostalCode($postal_code) |
| 475 | { |
| 476 | $this->postal_code = $postal_code; |
| 477 | return $this; |
| 478 | } |
| 479 | /** |
| 480 | * Gets country |
| 481 | * @return string |
| 482 | */ |
| 483 | public function getCountry() |
| 484 | { |
| 485 | return $this->country; |
| 486 | } |
| 487 | |
| 488 | /** |
| 489 | * Sets country |
| 490 | * @param string $country The address's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values |
| 491 | * @return $this |
| 492 | */ |
| 493 | public function setCountry($country) |
| 494 | { |
| 495 | $this->country = $country; |
| 496 | return $this; |
| 497 | } |
| 498 | /** |
| 499 | * Gets first_name |
| 500 | * @return string |
| 501 | */ |
| 502 | public function getFirstName() |
| 503 | { |
| 504 | return $this->first_name; |
| 505 | } |
| 506 | |
| 507 | /** |
| 508 | * Sets first_name |
| 509 | * @param string $first_name Optional first name when it's representing recipient. |
| 510 | * @return $this |
| 511 | */ |
| 512 | public function setFirstName($first_name) |
| 513 | { |
| 514 | $this->first_name = $first_name; |
| 515 | return $this; |
| 516 | } |
| 517 | /** |
| 518 | * Gets last_name |
| 519 | * @return string |
| 520 | */ |
| 521 | public function getLastName() |
| 522 | { |
| 523 | return $this->last_name; |
| 524 | } |
| 525 | |
| 526 | /** |
| 527 | * Sets last_name |
| 528 | * @param string $last_name Optional last name when it's representing recipient. |
| 529 | * @return $this |
| 530 | */ |
| 531 | public function setLastName($last_name) |
| 532 | { |
| 533 | $this->last_name = $last_name; |
| 534 | return $this; |
| 535 | } |
| 536 | /** |
| 537 | * Gets organization |
| 538 | * @return string |
| 539 | */ |
| 540 | public function getOrganization() |
| 541 | { |
| 542 | return $this->organization; |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * Sets organization |
| 547 | * @param string $organization Optional organization name when it's representing recipient. |
| 548 | * @return $this |
| 549 | */ |
| 550 | public function setOrganization($organization) |
| 551 | { |
| 552 | $this->organization = $organization; |
| 553 | return $this; |
| 554 | } |
| 555 | /** |
| 556 | * Returns true if offset exists. False otherwise. |
| 557 | * @param integer $offset Offset |
| 558 | * @return boolean |
| 559 | */ |
| 560 | public function offsetExists($offset) |
| 561 | { |
| 562 | return isset($this->$offset); |
| 563 | } |
| 564 | |
| 565 | /** |
| 566 | * Gets offset. |
| 567 | * @param integer $offset Offset |
| 568 | * @return mixed |
| 569 | */ |
| 570 | public function offsetGet($offset) |
| 571 | { |
| 572 | return $this->$offset; |
| 573 | } |
| 574 | |
| 575 | /** |
| 576 | * Sets value based on offset. |
| 577 | * @param integer $offset Offset |
| 578 | * @param mixed $value Value to be set |
| 579 | * @return void |
| 580 | */ |
| 581 | public function offsetSet($offset, $value) |
| 582 | { |
| 583 | $this->$offset = $value; |
| 584 | } |
| 585 | |
| 586 | /** |
| 587 | * Unsets offset. |
| 588 | * @param integer $offset Offset |
| 589 | * @return void |
| 590 | */ |
| 591 | public function offsetUnset($offset) |
| 592 | { |
| 593 | unset($this->$offset); |
| 594 | } |
| 595 | |
| 596 | /** |
| 597 | * Gets the string presentation of the object |
| 598 | * @return string |
| 599 | */ |
| 600 | public function __toString() |
| 601 | { |
| 602 | if (defined('JSON_PRETTY_PRINT')) { |
| 603 | return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); |
| 604 | } else { |
| 605 | return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this)); |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 |