<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class ObtainTokenResponse implements \JsonSerializable { private $accessToken; private $tokenType; private $expiresAt; private $merchantId; private $subscriptionId; private $planId; private $idToken; private $refreshToken; private $shortLived; private $errors; public function getAccessToken(): ?string { return $this->accessToken; } public function setAccessToken(?string $accessToken): void { $this->accessToken = $accessToken; } public function getTokenType(): ?string { return $this->tokenType; } public function setTokenType(?string $tokenType): void { $this->tokenType = $tokenType; } public function getExpiresAt(): ?string { return $this->expiresAt; } public function setExpiresAt(?string $expiresAt): void { $this->expiresAt = $expiresAt; } public function getMerchantId(): ?string { return $this->merchantId; } public function setMerchantId(?string $merchantId): void { $this->merchantId = $merchantId; } public function getSubscriptionId(): ?string { return $this->subscriptionId; } public function setSubscriptionId(?string $subscriptionId): void { $this->subscriptionId = $subscriptionId; } public function getPlanId(): ?string { return $this->planId; } public function setPlanId(?string $planId): void { $this->planId = $planId; } public function getIdToken(): ?string { return $this->idToken; } public function setIdToken(?string $idToken): void { $this->idToken = $idToken; } public function getRefreshToken(): ?string { return $this->refreshToken; } public function setRefreshToken(?string $refreshToken): void { $this->refreshToken = $refreshToken; } public function getShortLived(): ?bool { return $this->shortLived; } public function setShortLived(?bool $shortLived): void { $this->shortLived = $shortLived; } public function getErrors(): ?array { return $this->errors; } public function setErrors(?array $errors): void { $this->errors = $errors; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->accessToken)) { $json['access_token'] = $this->accessToken; } if (isset($this->tokenType)) { $json['token_type'] = $this->tokenType; } if (isset($this->expiresAt)) { $json['expires_at'] = $this->expiresAt; } if (isset($this->merchantId)) { $json['merchant_id'] = $this->merchantId; } if (isset($this->subscriptionId)) { $json['subscription_id'] = $this->subscriptionId; } if (isset($this->planId)) { $json['plan_id'] = $this->planId; } if (isset($this->idToken)) { $json['id_token'] = $this->idToken; } if (isset($this->refreshToken)) { $json['refresh_token'] = $this->refreshToken; } if (isset($this->shortLived)) { $json['short_lived'] = $this->shortLived; } if (isset($this->errors)) { $json['errors'] = $this->errors; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 