<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyReward implements \JsonSerializable { private $id; private $status; private $loyaltyAccountId; private $rewardTierId; private $points; private $orderId; private $createdAt; private $updatedAt; private $redeemedAt; public function __construct(string $loyaltyAccountId, string $rewardTierId) { $this->loyaltyAccountId = $loyaltyAccountId; $this->rewardTierId = $rewardTierId; } public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getStatus(): ?string { return $this->status; } public function setStatus(?string $status): void { $this->status = $status; } public function getLoyaltyAccountId(): string { return $this->loyaltyAccountId; } public function setLoyaltyAccountId(string $loyaltyAccountId): void { $this->loyaltyAccountId = $loyaltyAccountId; } public function getRewardTierId(): string { return $this->rewardTierId; } public function setRewardTierId(string $rewardTierId): void { $this->rewardTierId = $rewardTierId; } public function getPoints(): ?int { return $this->points; } public function setPoints(?int $points): void { $this->points = $points; } public function getOrderId(): ?string { return $this->orderId; } public function setOrderId(?string $orderId): void { $this->orderId = $orderId; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getUpdatedAt(): ?string { return $this->updatedAt; } public function setUpdatedAt(?string $updatedAt): void { $this->updatedAt = $updatedAt; } public function getRedeemedAt(): ?string { return $this->redeemedAt; } public function setRedeemedAt(?string $redeemedAt): void { $this->redeemedAt = $redeemedAt; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->status)) { $json['status'] = $this->status; } $json['loyalty_account_id'] = $this->loyaltyAccountId; $json['reward_tier_id'] = $this->rewardTierId; if (isset($this->points)) { $json['points'] = $this->points; } if (isset($this->orderId)) { $json['order_id'] = $this->orderId; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->updatedAt)) { $json['updated_at'] = $this->updatedAt; } if (isset($this->redeemedAt)) { $json['redeemed_at'] = $this->redeemedAt; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 