<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class DeviceDetails implements \JsonSerializable { private $deviceId; private $deviceInstallationId; private $deviceName; public function getDeviceId(): ?string { return $this->deviceId; } public function setDeviceId(?string $deviceId): void { $this->deviceId = $deviceId; } public function getDeviceInstallationId(): ?string { return $this->deviceInstallationId; } public function setDeviceInstallationId(?string $deviceInstallationId): void { $this->deviceInstallationId = $deviceInstallationId; } public function getDeviceName(): ?string { return $this->deviceName; } public function setDeviceName(?string $deviceName): void { $this->deviceName = $deviceName; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->deviceId)) { $json['device_id'] = $this->deviceId; } if (isset($this->deviceInstallationId)) { $json['device_installation_id'] = $this->deviceInstallationId; } if (isset($this->deviceName)) { $json['device_name'] = $this->deviceName; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 