<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CreateOrderRequest implements \JsonSerializable { private $order; private $idempotencyKey; public function getOrder(): ?Order { return $this->order; } public function setOrder(?Order $order): void { $this->order = $order; } public function getIdempotencyKey(): ?string { return $this->idempotencyKey; } public function setIdempotencyKey(?string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->order)) { $json['order'] = $this->order; } if (isset($this->idempotencyKey)) { $json['idempotency_key'] = $this->idempotencyKey; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 