<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CloneOrderRequest implements \JsonSerializable { private $orderId; private $version; private $idempotencyKey; public function __construct(string $orderId) { $this->orderId = $orderId; } public function getOrderId(): string { return $this->orderId; } public function setOrderId(string $orderId): void { $this->orderId = $orderId; } public function getVersion(): ?int { return $this->version; } public function setVersion(?int $version): void { $this->version = $version; } public function getIdempotencyKey(): ?string { return $this->idempotencyKey; } public function setIdempotencyKey(?string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['order_id'] = $this->orderId; if (isset($this->version)) { $json['version'] = $this->version; } 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; } } 