Customer.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 | * Customer 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 Customer implements ArrayAccess |
| 21 | { |
| 22 | /** |
| 23 | * Array of property to type mappings. Used for (de)serialization |
| 24 | * @var string[] |
| 25 | */ |
| 26 | static $swaggerTypes = array( |
| 27 | 'id' => 'string', |
| 28 | 'created_at' => 'string', |
| 29 | 'updated_at' => 'string', |
| 30 | 'cards' => '\SquareConnect\Model\Card[]', |
| 31 | 'given_name' => 'string', |
| 32 | 'family_name' => 'string', |
| 33 | 'nickname' => 'string', |
| 34 | 'company_name' => 'string', |
| 35 | 'email_address' => 'string', |
| 36 | 'address' => '\SquareConnect\Model\Address', |
| 37 | 'phone_number' => 'string', |
| 38 | 'birthday' => 'string', |
| 39 | 'reference_id' => 'string', |
| 40 | 'note' => 'string', |
| 41 | 'preferences' => '\SquareConnect\Model\CustomerPreferences', |
| 42 | 'groups' => '\SquareConnect\Model\CustomerGroupInfo[]', |
| 43 | 'creation_source' => 'string' |
| 44 | ); |
| 45 | |
| 46 | /** |
| 47 | * Array of attributes where the key is the local name, and the value is the original name |
| 48 | * @var string[] |
| 49 | */ |
| 50 | static $attributeMap = array( |
| 51 | 'id' => 'id', |
| 52 | 'created_at' => 'created_at', |
| 53 | 'updated_at' => 'updated_at', |
| 54 | 'cards' => 'cards', |
| 55 | 'given_name' => 'given_name', |
| 56 | 'family_name' => 'family_name', |
| 57 | 'nickname' => 'nickname', |
| 58 | 'company_name' => 'company_name', |
| 59 | 'email_address' => 'email_address', |
| 60 | 'address' => 'address', |
| 61 | 'phone_number' => 'phone_number', |
| 62 | 'birthday' => 'birthday', |
| 63 | 'reference_id' => 'reference_id', |
| 64 | 'note' => 'note', |
| 65 | 'preferences' => 'preferences', |
| 66 | 'groups' => 'groups', |
| 67 | 'creation_source' => 'creation_source' |
| 68 | ); |
| 69 | |
| 70 | /** |
| 71 | * Array of attributes to setter functions (for deserialization of responses) |
| 72 | * @var string[] |
| 73 | */ |
| 74 | static $setters = array( |
| 75 | 'id' => 'setId', |
| 76 | 'created_at' => 'setCreatedAt', |
| 77 | 'updated_at' => 'setUpdatedAt', |
| 78 | 'cards' => 'setCards', |
| 79 | 'given_name' => 'setGivenName', |
| 80 | 'family_name' => 'setFamilyName', |
| 81 | 'nickname' => 'setNickname', |
| 82 | 'company_name' => 'setCompanyName', |
| 83 | 'email_address' => 'setEmailAddress', |
| 84 | 'address' => 'setAddress', |
| 85 | 'phone_number' => 'setPhoneNumber', |
| 86 | 'birthday' => 'setBirthday', |
| 87 | 'reference_id' => 'setReferenceId', |
| 88 | 'note' => 'setNote', |
| 89 | 'preferences' => 'setPreferences', |
| 90 | 'groups' => 'setGroups', |
| 91 | 'creation_source' => 'setCreationSource' |
| 92 | ); |
| 93 | |
| 94 | /** |
| 95 | * Array of attributes to getter functions (for serialization of requests) |
| 96 | * @var string[] |
| 97 | */ |
| 98 | static $getters = array( |
| 99 | 'id' => 'getId', |
| 100 | 'created_at' => 'getCreatedAt', |
| 101 | 'updated_at' => 'getUpdatedAt', |
| 102 | 'cards' => 'getCards', |
| 103 | 'given_name' => 'getGivenName', |
| 104 | 'family_name' => 'getFamilyName', |
| 105 | 'nickname' => 'getNickname', |
| 106 | 'company_name' => 'getCompanyName', |
| 107 | 'email_address' => 'getEmailAddress', |
| 108 | 'address' => 'getAddress', |
| 109 | 'phone_number' => 'getPhoneNumber', |
| 110 | 'birthday' => 'getBirthday', |
| 111 | 'reference_id' => 'getReferenceId', |
| 112 | 'note' => 'getNote', |
| 113 | 'preferences' => 'getPreferences', |
| 114 | 'groups' => 'getGroups', |
| 115 | 'creation_source' => 'getCreationSource' |
| 116 | ); |
| 117 | |
| 118 | /** |
| 119 | * $id The customer's unique ID. |
| 120 | * @var string |
| 121 | */ |
| 122 | protected $id; |
| 123 | /** |
| 124 | * $created_at The time when the customer was created, in RFC 3339 format. |
| 125 | * @var string |
| 126 | */ |
| 127 | protected $created_at; |
| 128 | /** |
| 129 | * $updated_at The time when the customer was last updated, in RFC 3339 format. |
| 130 | * @var string |
| 131 | */ |
| 132 | protected $updated_at; |
| 133 | /** |
| 134 | * $cards The payment details of the customer's cards on file. |
| 135 | * @var \SquareConnect\Model\Card[] |
| 136 | */ |
| 137 | protected $cards; |
| 138 | /** |
| 139 | * $given_name The customer's given (i.e., first) name. |
| 140 | * @var string |
| 141 | */ |
| 142 | protected $given_name; |
| 143 | /** |
| 144 | * $family_name The customer's family (i.e., last) name. |
| 145 | * @var string |
| 146 | */ |
| 147 | protected $family_name; |
| 148 | /** |
| 149 | * $nickname The customer's nickname. |
| 150 | * @var string |
| 151 | */ |
| 152 | protected $nickname; |
| 153 | /** |
| 154 | * $company_name The name of the customer's company. |
| 155 | * @var string |
| 156 | */ |
| 157 | protected $company_name; |
| 158 | /** |
| 159 | * $email_address The customer's email address. |
| 160 | * @var string |
| 161 | */ |
| 162 | protected $email_address; |
| 163 | /** |
| 164 | * $address The customer's physical address. |
| 165 | * @var \SquareConnect\Model\Address |
| 166 | */ |
| 167 | protected $address; |
| 168 | /** |
| 169 | * $phone_number The customer's phone number. |
| 170 | * @var string |
| 171 | */ |
| 172 | protected $phone_number; |
| 173 | /** |
| 174 | * $birthday The customer's birthday in RFC-3339 format. Year is optional, timezone and times are not allowed. Example: `0000-09-01T00:00:00-00:00` for a birthday on September 1st. `1998-09-01T00:00:00-00:00` for a birthday on September 1st 1998. |
| 175 | * @var string |
| 176 | */ |
| 177 | protected $birthday; |
| 178 | /** |
| 179 | * $reference_id A second ID you can set to associate the customer with an entity in another system. |
| 180 | * @var string |
| 181 | */ |
| 182 | protected $reference_id; |
| 183 | /** |
| 184 | * $note A note to associate with the customer. |
| 185 | * @var string |
| 186 | */ |
| 187 | protected $note; |
| 188 | /** |
| 189 | * $preferences The customer's preferences. |
| 190 | * @var \SquareConnect\Model\CustomerPreferences |
| 191 | */ |
| 192 | protected $preferences; |
| 193 | /** |
| 194 | * $groups The groups the customer belongs to. |
| 195 | * @var \SquareConnect\Model\CustomerGroupInfo[] |
| 196 | */ |
| 197 | protected $groups; |
| 198 | /** |
| 199 | * $creation_source A creation source represents the method used to create the customer profile. See [CustomerCreationSource](#type-customercreationsource) for possible values |
| 200 | * @var string |
| 201 | */ |
| 202 | protected $creation_source; |
| 203 | |
| 204 | /** |
| 205 | * Constructor |
| 206 | * @param mixed[] $data Associated array of property value initializing the model |
| 207 | */ |
| 208 | public function __construct(array $data = null) |
| 209 | { |
| 210 | if ($data != null) { |
| 211 | if (isset($data["id"])) { |
| 212 | $this->id = $data["id"]; |
| 213 | } else { |
| 214 | $this->id = null; |
| 215 | } |
| 216 | if (isset($data["created_at"])) { |
| 217 | $this->created_at = $data["created_at"]; |
| 218 | } else { |
| 219 | $this->created_at = null; |
| 220 | } |
| 221 | if (isset($data["updated_at"])) { |
| 222 | $this->updated_at = $data["updated_at"]; |
| 223 | } else { |
| 224 | $this->updated_at = null; |
| 225 | } |
| 226 | if (isset($data["cards"])) { |
| 227 | $this->cards = $data["cards"]; |
| 228 | } else { |
| 229 | $this->cards = null; |
| 230 | } |
| 231 | if (isset($data["given_name"])) { |
| 232 | $this->given_name = $data["given_name"]; |
| 233 | } else { |
| 234 | $this->given_name = null; |
| 235 | } |
| 236 | if (isset($data["family_name"])) { |
| 237 | $this->family_name = $data["family_name"]; |
| 238 | } else { |
| 239 | $this->family_name = null; |
| 240 | } |
| 241 | if (isset($data["nickname"])) { |
| 242 | $this->nickname = $data["nickname"]; |
| 243 | } else { |
| 244 | $this->nickname = null; |
| 245 | } |
| 246 | if (isset($data["company_name"])) { |
| 247 | $this->company_name = $data["company_name"]; |
| 248 | } else { |
| 249 | $this->company_name = null; |
| 250 | } |
| 251 | if (isset($data["email_address"])) { |
| 252 | $this->email_address = $data["email_address"]; |
| 253 | } else { |
| 254 | $this->email_address = null; |
| 255 | } |
| 256 | if (isset($data["address"])) { |
| 257 | $this->address = $data["address"]; |
| 258 | } else { |
| 259 | $this->address = null; |
| 260 | } |
| 261 | if (isset($data["phone_number"])) { |
| 262 | $this->phone_number = $data["phone_number"]; |
| 263 | } else { |
| 264 | $this->phone_number = null; |
| 265 | } |
| 266 | if (isset($data["birthday"])) { |
| 267 | $this->birthday = $data["birthday"]; |
| 268 | } else { |
| 269 | $this->birthday = null; |
| 270 | } |
| 271 | if (isset($data["reference_id"])) { |
| 272 | $this->reference_id = $data["reference_id"]; |
| 273 | } else { |
| 274 | $this->reference_id = null; |
| 275 | } |
| 276 | if (isset($data["note"])) { |
| 277 | $this->note = $data["note"]; |
| 278 | } else { |
| 279 | $this->note = null; |
| 280 | } |
| 281 | if (isset($data["preferences"])) { |
| 282 | $this->preferences = $data["preferences"]; |
| 283 | } else { |
| 284 | $this->preferences = null; |
| 285 | } |
| 286 | if (isset($data["groups"])) { |
| 287 | $this->groups = $data["groups"]; |
| 288 | } else { |
| 289 | $this->groups = null; |
| 290 | } |
| 291 | if (isset($data["creation_source"])) { |
| 292 | $this->creation_source = $data["creation_source"]; |
| 293 | } else { |
| 294 | $this->creation_source = null; |
| 295 | } |
| 296 | } |
| 297 | } |
| 298 | /** |
| 299 | * Gets id |
| 300 | * @return string |
| 301 | */ |
| 302 | public function getId() |
| 303 | { |
| 304 | return $this->id; |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * Sets id |
| 309 | * @param string $id The customer's unique ID. |
| 310 | * @return $this |
| 311 | */ |
| 312 | public function setId($id) |
| 313 | { |
| 314 | $this->id = $id; |
| 315 | return $this; |
| 316 | } |
| 317 | /** |
| 318 | * Gets created_at |
| 319 | * @return string |
| 320 | */ |
| 321 | public function getCreatedAt() |
| 322 | { |
| 323 | return $this->created_at; |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Sets created_at |
| 328 | * @param string $created_at The time when the customer was created, in RFC 3339 format. |
| 329 | * @return $this |
| 330 | */ |
| 331 | public function setCreatedAt($created_at) |
| 332 | { |
| 333 | $this->created_at = $created_at; |
| 334 | return $this; |
| 335 | } |
| 336 | /** |
| 337 | * Gets updated_at |
| 338 | * @return string |
| 339 | */ |
| 340 | public function getUpdatedAt() |
| 341 | { |
| 342 | return $this->updated_at; |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Sets updated_at |
| 347 | * @param string $updated_at The time when the customer was last updated, in RFC 3339 format. |
| 348 | * @return $this |
| 349 | */ |
| 350 | public function setUpdatedAt($updated_at) |
| 351 | { |
| 352 | $this->updated_at = $updated_at; |
| 353 | return $this; |
| 354 | } |
| 355 | /** |
| 356 | * Gets cards |
| 357 | * @return \SquareConnect\Model\Card[] |
| 358 | */ |
| 359 | public function getCards() |
| 360 | { |
| 361 | return $this->cards; |
| 362 | } |
| 363 | |
| 364 | /** |
| 365 | * Sets cards |
| 366 | * @param \SquareConnect\Model\Card[] $cards The payment details of the customer's cards on file. |
| 367 | * @return $this |
| 368 | */ |
| 369 | public function setCards($cards) |
| 370 | { |
| 371 | $this->cards = $cards; |
| 372 | return $this; |
| 373 | } |
| 374 | /** |
| 375 | * Gets given_name |
| 376 | * @return string |
| 377 | */ |
| 378 | public function getGivenName() |
| 379 | { |
| 380 | return $this->given_name; |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * Sets given_name |
| 385 | * @param string $given_name The customer's given (i.e., first) name. |
| 386 | * @return $this |
| 387 | */ |
| 388 | public function setGivenName($given_name) |
| 389 | { |
| 390 | $this->given_name = $given_name; |
| 391 | return $this; |
| 392 | } |
| 393 | /** |
| 394 | * Gets family_name |
| 395 | * @return string |
| 396 | */ |
| 397 | public function getFamilyName() |
| 398 | { |
| 399 | return $this->family_name; |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Sets family_name |
| 404 | * @param string $family_name The customer's family (i.e., last) name. |
| 405 | * @return $this |
| 406 | */ |
| 407 | public function setFamilyName($family_name) |
| 408 | { |
| 409 | $this->family_name = $family_name; |
| 410 | return $this; |
| 411 | } |
| 412 | /** |
| 413 | * Gets nickname |
| 414 | * @return string |
| 415 | */ |
| 416 | public function getNickname() |
| 417 | { |
| 418 | return $this->nickname; |
| 419 | } |
| 420 | |
| 421 | /** |
| 422 | * Sets nickname |
| 423 | * @param string $nickname The customer's nickname. |
| 424 | * @return $this |
| 425 | */ |
| 426 | public function setNickname($nickname) |
| 427 | { |
| 428 | $this->nickname = $nickname; |
| 429 | return $this; |
| 430 | } |
| 431 | /** |
| 432 | * Gets company_name |
| 433 | * @return string |
| 434 | */ |
| 435 | public function getCompanyName() |
| 436 | { |
| 437 | return $this->company_name; |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Sets company_name |
| 442 | * @param string $company_name The name of the customer's company. |
| 443 | * @return $this |
| 444 | */ |
| 445 | public function setCompanyName($company_name) |
| 446 | { |
| 447 | $this->company_name = $company_name; |
| 448 | return $this; |
| 449 | } |
| 450 | /** |
| 451 | * Gets email_address |
| 452 | * @return string |
| 453 | */ |
| 454 | public function getEmailAddress() |
| 455 | { |
| 456 | return $this->email_address; |
| 457 | } |
| 458 | |
| 459 | /** |
| 460 | * Sets email_address |
| 461 | * @param string $email_address The customer's email address. |
| 462 | * @return $this |
| 463 | */ |
| 464 | public function setEmailAddress($email_address) |
| 465 | { |
| 466 | $this->email_address = $email_address; |
| 467 | return $this; |
| 468 | } |
| 469 | /** |
| 470 | * Gets address |
| 471 | * @return \SquareConnect\Model\Address |
| 472 | */ |
| 473 | public function getAddress() |
| 474 | { |
| 475 | return $this->address; |
| 476 | } |
| 477 | |
| 478 | /** |
| 479 | * Sets address |
| 480 | * @param \SquareConnect\Model\Address $address The customer's physical address. |
| 481 | * @return $this |
| 482 | */ |
| 483 | public function setAddress($address) |
| 484 | { |
| 485 | $this->address = $address; |
| 486 | return $this; |
| 487 | } |
| 488 | /** |
| 489 | * Gets phone_number |
| 490 | * @return string |
| 491 | */ |
| 492 | public function getPhoneNumber() |
| 493 | { |
| 494 | return $this->phone_number; |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * Sets phone_number |
| 499 | * @param string $phone_number The customer's phone number. |
| 500 | * @return $this |
| 501 | */ |
| 502 | public function setPhoneNumber($phone_number) |
| 503 | { |
| 504 | $this->phone_number = $phone_number; |
| 505 | return $this; |
| 506 | } |
| 507 | /** |
| 508 | * Gets birthday |
| 509 | * @return string |
| 510 | */ |
| 511 | public function getBirthday() |
| 512 | { |
| 513 | return $this->birthday; |
| 514 | } |
| 515 | |
| 516 | /** |
| 517 | * Sets birthday |
| 518 | * @param string $birthday The customer's birthday in RFC-3339 format. Year is optional, timezone and times are not allowed. Example: `0000-09-01T00:00:00-00:00` for a birthday on September 1st. `1998-09-01T00:00:00-00:00` for a birthday on September 1st 1998. |
| 519 | * @return $this |
| 520 | */ |
| 521 | public function setBirthday($birthday) |
| 522 | { |
| 523 | $this->birthday = $birthday; |
| 524 | return $this; |
| 525 | } |
| 526 | /** |
| 527 | * Gets reference_id |
| 528 | * @return string |
| 529 | */ |
| 530 | public function getReferenceId() |
| 531 | { |
| 532 | return $this->reference_id; |
| 533 | } |
| 534 | |
| 535 | /** |
| 536 | * Sets reference_id |
| 537 | * @param string $reference_id A second ID you can set to associate the customer with an entity in another system. |
| 538 | * @return $this |
| 539 | */ |
| 540 | public function setReferenceId($reference_id) |
| 541 | { |
| 542 | $this->reference_id = $reference_id; |
| 543 | return $this; |
| 544 | } |
| 545 | /** |
| 546 | * Gets note |
| 547 | * @return string |
| 548 | */ |
| 549 | public function getNote() |
| 550 | { |
| 551 | return $this->note; |
| 552 | } |
| 553 | |
| 554 | /** |
| 555 | * Sets note |
| 556 | * @param string $note A note to associate with the customer. |
| 557 | * @return $this |
| 558 | */ |
| 559 | public function setNote($note) |
| 560 | { |
| 561 | $this->note = $note; |
| 562 | return $this; |
| 563 | } |
| 564 | /** |
| 565 | * Gets preferences |
| 566 | * @return \SquareConnect\Model\CustomerPreferences |
| 567 | */ |
| 568 | public function getPreferences() |
| 569 | { |
| 570 | return $this->preferences; |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * Sets preferences |
| 575 | * @param \SquareConnect\Model\CustomerPreferences $preferences The customer's preferences. |
| 576 | * @return $this |
| 577 | */ |
| 578 | public function setPreferences($preferences) |
| 579 | { |
| 580 | $this->preferences = $preferences; |
| 581 | return $this; |
| 582 | } |
| 583 | /** |
| 584 | * Gets groups |
| 585 | * @return \SquareConnect\Model\CustomerGroupInfo[] |
| 586 | */ |
| 587 | public function getGroups() |
| 588 | { |
| 589 | return $this->groups; |
| 590 | } |
| 591 | |
| 592 | /** |
| 593 | * Sets groups |
| 594 | * @param \SquareConnect\Model\CustomerGroupInfo[] $groups The groups the customer belongs to. |
| 595 | * @return $this |
| 596 | */ |
| 597 | public function setGroups($groups) |
| 598 | { |
| 599 | $this->groups = $groups; |
| 600 | return $this; |
| 601 | } |
| 602 | /** |
| 603 | * Gets creation_source |
| 604 | * @return string |
| 605 | */ |
| 606 | public function getCreationSource() |
| 607 | { |
| 608 | return $this->creation_source; |
| 609 | } |
| 610 | |
| 611 | /** |
| 612 | * Sets creation_source |
| 613 | * @param string $creation_source A creation source represents the method used to create the customer profile. See [CustomerCreationSource](#type-customercreationsource) for possible values |
| 614 | * @return $this |
| 615 | */ |
| 616 | public function setCreationSource($creation_source) |
| 617 | { |
| 618 | $this->creation_source = $creation_source; |
| 619 | return $this; |
| 620 | } |
| 621 | /** |
| 622 | * Returns true if offset exists. False otherwise. |
| 623 | * @param integer $offset Offset |
| 624 | * @return boolean |
| 625 | */ |
| 626 | public function offsetExists($offset) |
| 627 | { |
| 628 | return isset($this->$offset); |
| 629 | } |
| 630 | |
| 631 | /** |
| 632 | * Gets offset. |
| 633 | * @param integer $offset Offset |
| 634 | * @return mixed |
| 635 | */ |
| 636 | public function offsetGet($offset) |
| 637 | { |
| 638 | return $this->$offset; |
| 639 | } |
| 640 | |
| 641 | /** |
| 642 | * Sets value based on offset. |
| 643 | * @param integer $offset Offset |
| 644 | * @param mixed $value Value to be set |
| 645 | * @return void |
| 646 | */ |
| 647 | public function offsetSet($offset, $value) |
| 648 | { |
| 649 | $this->$offset = $value; |
| 650 | } |
| 651 | |
| 652 | /** |
| 653 | * Unsets offset. |
| 654 | * @param integer $offset Offset |
| 655 | * @return void |
| 656 | */ |
| 657 | public function offsetUnset($offset) |
| 658 | { |
| 659 | unset($this->$offset); |
| 660 | } |
| 661 | |
| 662 | /** |
| 663 | * Gets the string presentation of the object |
| 664 | * @return string |
| 665 | */ |
| 666 | public function __toString() |
| 667 | { |
| 668 | if (defined('JSON_PRETTY_PRINT')) { |
| 669 | return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); |
| 670 | } else { |
| 671 | return json_encode(\SquareConnect\ObjectSerializer::sanitizeForSerialization($this)); |
| 672 | } |
| 673 | } |
| 674 | } |
| 675 |