<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyEvent implements \JsonSerializable { private $id; private $type; private $createdAt; private $accumulatePoints; private $createReward; private $redeemReward; private $deleteReward; private $adjustPoints; private $loyaltyAccountId; private $locationId; private $source; private $expirePoints; private $otherEvent; public function __construct(string $id, string $type, string $createdAt, string $loyaltyAccountId, string $source) { $this->id = $id; $this->type = $type; $this->createdAt = $createdAt; $this->loyaltyAccountId = $loyaltyAccountId; $this->source = $source; } public function getId(): string { return $this->id; } public function setId(string $id): void { $this->id = $id; } public function getType(): string { return $this->type; } public function setType(string $type): void { $this->type = $type; } public function getCreatedAt(): string { return $this->createdAt; } public function setCreatedAt(string $createdAt): void { $this->createdAt = $createdAt; } public function getAccumulatePoints(): ?LoyaltyEventAccumulatePoints { return $this->accumulatePoints; } public function setAccumulatePoints(?LoyaltyEventAccumulatePoints $accumulatePoints): void { $this->accumulatePoints = $accumulatePoints; } public function getCreateReward(): ?LoyaltyEventCreateReward { return $this->createReward; } public function setCreateReward(?LoyaltyEventCreateReward $createReward): void { $this->createReward = $createReward; } public function getRedeemReward(): ?LoyaltyEventRedeemReward { return $this->redeemReward; } public function setRedeemReward(?LoyaltyEventRedeemReward $redeemReward): void { $this->redeemReward = $redeemReward; } public function getDeleteReward(): ?LoyaltyEventDeleteReward { return $this->deleteReward; } public function setDeleteReward(?LoyaltyEventDeleteReward $deleteReward): void { $this->deleteReward = $deleteReward; } public function getAdjustPoints(): ?LoyaltyEventAdjustPoints { return $this->adjustPoints; } public function setAdjustPoints(?LoyaltyEventAdjustPoints $adjustPoints): void { $this->adjustPoints = $adjustPoints; } public function getLoyaltyAccountId(): string { return $this->loyaltyAccountId; } public function setLoyaltyAccountId(string $loyaltyAccountId): void { $this->loyaltyAccountId = $loyaltyAccountId; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getSource(): string { return $this->source; } public function setSource(string $source): void { $this->source = $source; } public function getExpirePoints(): ?LoyaltyEventExpirePoints { return $this->expirePoints; } public function setExpirePoints(?LoyaltyEventExpirePoints $expirePoints): void { $this->expirePoints = $expirePoints; } public function getOtherEvent(): ?LoyaltyEventOther { return $this->otherEvent; } public function setOtherEvent(?LoyaltyEventOther $otherEvent): void { $this->otherEvent = $otherEvent; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['id'] = $this->id; $json['type'] = $this->type; $json['created_at'] = $this->createdAt; if (isset($this->accumulatePoints)) { $json['accumulate_points'] = $this->accumulatePoints; } if (isset($this->createReward)) { $json['create_reward'] = $this->createReward; } if (isset($this->redeemReward)) { $json['redeem_reward'] = $this->redeemReward; } if (isset($this->deleteReward)) { $json['delete_reward'] = $this->deleteReward; } if (isset($this->adjustPoints)) { $json['adjust_points'] = $this->adjustPoints; } $json['loyalty_account_id'] = $this->loyaltyAccountId; if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } $json['source'] = $this->source; if (isset($this->expirePoints)) { $json['expire_points'] = $this->expirePoints; } if (isset($this->otherEvent)) { $json['other_event'] = $this->otherEvent; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 