<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyEventRedeemReward implements \JsonSerializable { private $loyaltyProgramId; private $rewardId; private $orderId; public function __construct(string $loyaltyProgramId) { $this->loyaltyProgramId = $loyaltyProgramId; } public function getLoyaltyProgramId(): string { return $this->loyaltyProgramId; } public function setLoyaltyProgramId(string $loyaltyProgramId): void { $this->loyaltyProgramId = $loyaltyProgramId; } public function getRewardId(): ?string { return $this->rewardId; } public function setRewardId(?string $rewardId): void { $this->rewardId = $rewardId; } public function getOrderId(): ?string { return $this->orderId; } public function setOrderId(?string $orderId): void { $this->orderId = $orderId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['loyalty_program_id'] = $this->loyaltyProgramId; if (isset($this->rewardId)) { $json['reward_id'] = $this->rewardId; } if (isset($this->orderId)) { $json['order_id'] = $this->orderId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 