<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyProgram implements \JsonSerializable { private $id; private $status; private $rewardTiers; private $expirationPolicy; private $terminology; private $locationIds; private $createdAt; private $updatedAt; private $accrualRules; public function __construct( string $id, string $status, array $rewardTiers, LoyaltyProgramTerminology $terminology, array $locationIds, string $createdAt, string $updatedAt, array $accrualRules ) { $this->id = $id; $this->status = $status; $this->rewardTiers = $rewardTiers; $this->terminology = $terminology; $this->locationIds = $locationIds; $this->createdAt = $createdAt; $this->updatedAt = $updatedAt; $this->accrualRules = $accrualRules; } 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 getRewardTiers(): array { return $this->rewardTiers; } public function setRewardTiers(array $rewardTiers): void { $this->rewardTiers = $rewardTiers; } public function getExpirationPolicy(): ?LoyaltyProgramExpirationPolicy { return $this->expirationPolicy; } public function setExpirationPolicy(?LoyaltyProgramExpirationPolicy $expirationPolicy): void { $this->expirationPolicy = $expirationPolicy; } public function getTerminology(): LoyaltyProgramTerminology { return $this->terminology; } public function setTerminology(LoyaltyProgramTerminology $terminology): void { $this->terminology = $terminology; } public function getLocationIds(): array { return $this->locationIds; } public function setLocationIds(array $locationIds): void { $this->locationIds = $locationIds; } 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 getAccrualRules(): array { return $this->accrualRules; } public function setAccrualRules(array $accrualRules): void { $this->accrualRules = $accrualRules; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['id'] = $this->id; $json['status'] = $this->status; $json['reward_tiers'] = $this->rewardTiers; if (isset($this->expirationPolicy)) { $json['expiration_policy'] = $this->expirationPolicy; } $json['terminology'] = $this->terminology; $json['location_ids'] = $this->locationIds; $json['created_at'] = $this->createdAt; $json['updated_at'] = $this->updatedAt; $json['accrual_rules'] = $this->accrualRules; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 