<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyAccount implements \JsonSerializable { private $id; private $programId; private $balance; private $lifetimePoints; private $customerId; private $enrolledAt; private $createdAt; private $updatedAt; private $mapping; private $expiringPointDeadlines; public function __construct(string $programId) { $this->programId = $programId; } public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getProgramId(): string { return $this->programId; } public function setProgramId(string $programId): void { $this->programId = $programId; } public function getBalance(): ?int { return $this->balance; } public function setBalance(?int $balance): void { $this->balance = $balance; } public function getLifetimePoints(): ?int { return $this->lifetimePoints; } public function setLifetimePoints(?int $lifetimePoints): void { $this->lifetimePoints = $lifetimePoints; } public function getCustomerId(): ?string { return $this->customerId; } public function setCustomerId(?string $customerId): void { $this->customerId = $customerId; } public function getEnrolledAt(): ?string { return $this->enrolledAt; } public function setEnrolledAt(?string $enrolledAt): void { $this->enrolledAt = $enrolledAt; } 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 getMapping(): ?LoyaltyAccountMapping { return $this->mapping; } public function setMapping(?LoyaltyAccountMapping $mapping): void { $this->mapping = $mapping; } public function getExpiringPointDeadlines(): ?array { return $this->expiringPointDeadlines; } public function setExpiringPointDeadlines(?array $expiringPointDeadlines): void { $this->expiringPointDeadlines = $expiringPointDeadlines; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } $json['program_id'] = $this->programId; if (isset($this->balance)) { $json['balance'] = $this->balance; } if (isset($this->lifetimePoints)) { $json['lifetime_points'] = $this->lifetimePoints; } if (isset($this->customerId)) { $json['customer_id'] = $this->customerId; } if (isset($this->enrolledAt)) { $json['enrolled_at'] = $this->enrolledAt; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->updatedAt)) { $json['updated_at'] = $this->updatedAt; } if (isset($this->mapping)) { $json['mapping'] = $this->mapping; } if (isset($this->expiringPointDeadlines)) { $json['expiring_point_deadlines'] = $this->expiringPointDeadlines; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 