<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class DeviceCode implements \JsonSerializable { private $id; private $name; private $code; private $deviceId; private $productType; private $locationId; private $status; private $pairBy; private $createdAt; private $statusChangedAt; private $pairedAt; public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getCode(): ?string { return $this->code; } public function setCode(?string $code): void { $this->code = $code; } public function getDeviceId(): ?string { return $this->deviceId; } public function setDeviceId(?string $deviceId): void { $this->deviceId = $deviceId; } public function getProductType(): string { return $this->productType; } public function setProductType(string $productType): void { $this->productType = $productType; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getStatus(): ?string { return $this->status; } public function setStatus(?string $status): void { $this->status = $status; } public function getPairBy(): ?string { return $this->pairBy; } public function setPairBy(?string $pairBy): void { $this->pairBy = $pairBy; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getStatusChangedAt(): ?string { return $this->statusChangedAt; } public function setStatusChangedAt(?string $statusChangedAt): void { $this->statusChangedAt = $statusChangedAt; } public function getPairedAt(): ?string { return $this->pairedAt; } public function setPairedAt(?string $pairedAt): void { $this->pairedAt = $pairedAt; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->code)) { $json['code'] = $this->code; } if (isset($this->deviceId)) { $json['device_id'] = $this->deviceId; } $json['product_type'] = $this->productType; if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->status)) { $json['status'] = $this->status; } if (isset($this->pairBy)) { $json['pair_by'] = $this->pairBy; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->statusChangedAt)) { $json['status_changed_at'] = $this->statusChangedAt; } if (isset($this->pairedAt)) { $json['paired_at'] = $this->pairedAt; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 