<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class UpdateSubscriptionRequest implements \JsonSerializable { private $subscription; public function getSubscription(): ?Subscription { return $this->subscription; } public function setSubscription(?Subscription $subscription): void { $this->subscription = $subscription; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->subscription)) { $json['subscription'] = $this->subscription; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 