<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class InvoiceRecipient implements \JsonSerializable { private $customerId; private $givenName; private $familyName; private $emailAddress; private $address; private $phoneNumber; private $companyName; private $taxIds; public function getCustomerId(): ?string { return $this->customerId; } public function setCustomerId(?string $customerId): void { $this->customerId = $customerId; } public function getGivenName(): ?string { return $this->givenName; } public function setGivenName(?string $givenName): void { $this->givenName = $givenName; } public function getFamilyName(): ?string { return $this->familyName; } public function setFamilyName(?string $familyName): void { $this->familyName = $familyName; } public function getEmailAddress(): ?string { return $this->emailAddress; } public function setEmailAddress(?string $emailAddress): void { $this->emailAddress = $emailAddress; } public function getAddress(): ?Address { return $this->address; } public function setAddress(?Address $address): void { $this->address = $address; } public function getPhoneNumber(): ?string { return $this->phoneNumber; } public function setPhoneNumber(?string $phoneNumber): void { $this->phoneNumber = $phoneNumber; } public function getCompanyName(): ?string { return $this->companyName; } public function setCompanyName(?string $companyName): void { $this->companyName = $companyName; } public function getTaxIds(): ?InvoiceRecipientTaxIds { return $this->taxIds; } public function setTaxIds(?InvoiceRecipientTaxIds $taxIds): void { $this->taxIds = $taxIds; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->customerId)) { $json['customer_id'] = $this->customerId; } if (isset($this->givenName)) { $json['given_name'] = $this->givenName; } if (isset($this->familyName)) { $json['family_name'] = $this->familyName; } if (isset($this->emailAddress)) { $json['email_address'] = $this->emailAddress; } if (isset($this->address)) { $json['address'] = $this->address; } if (isset($this->phoneNumber)) { $json['phone_number'] = $this->phoneNumber; } if (isset($this->companyName)) { $json['company_name'] = $this->companyName; } if (isset($this->taxIds)) { $json['tax_ids'] = $this->taxIds; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 