<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class RevokeTokenRequest implements \JsonSerializable { private $clientId; private $accessToken; private $merchantId; private $revokeOnlyAccessToken; public function getClientId(): ?string { return $this->clientId; } public function setClientId(?string $clientId): void { $this->clientId = $clientId; } public function getAccessToken(): ?string { return $this->accessToken; } public function setAccessToken(?string $accessToken): void { $this->accessToken = $accessToken; } public function getMerchantId(): ?string { return $this->merchantId; } public function setMerchantId(?string $merchantId): void { $this->merchantId = $merchantId; } public function getRevokeOnlyAccessToken(): ?bool { return $this->revokeOnlyAccessToken; } public function setRevokeOnlyAccessToken(?bool $revokeOnlyAccessToken): void { $this->revokeOnlyAccessToken = $revokeOnlyAccessToken; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->clientId)) { $json['client_id'] = $this->clientId; } if (isset($this->accessToken)) { $json['access_token'] = $this->accessToken; } if (isset($this->merchantId)) { $json['merchant_id'] = $this->merchantId; } if (isset($this->revokeOnlyAccessToken)) { $json['revoke_only_access_token'] = $this->revokeOnlyAccessToken; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 