<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SwapPlanRequest implements \JsonSerializable { private $newPlanId; public function __construct(string $newPlanId) { $this->newPlanId = $newPlanId; } public function getNewPlanId(): string { return $this->newPlanId; } public function setNewPlanId(string $newPlanId): void { $this->newPlanId = $newPlanId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['new_plan_id'] = $this->newPlanId; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 