<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyProgramRewardTier implements \JsonSerializable { private $id; private $points; private $name; private $definition; private $createdAt; private $pricingRuleReference; public function __construct( string $id, int $points, string $name, LoyaltyProgramRewardDefinition $definition, string $createdAt ) { $this->id = $id; $this->points = $points; $this->name = $name; $this->definition = $definition; $this->createdAt = $createdAt; } public function getId(): string { return $this->id; } public function setId(string $id): void { $this->id = $id; } public function getPoints(): int { return $this->points; } public function setPoints(int $points): void { $this->points = $points; } public function getName(): string { return $this->name; } public function setName(string $name): void { $this->name = $name; } public function getDefinition(): LoyaltyProgramRewardDefinition { return $this->definition; } public function setDefinition(LoyaltyProgramRewardDefinition $definition): void { $this->definition = $definition; } public function getCreatedAt(): string { return $this->createdAt; } public function setCreatedAt(string $createdAt): void { $this->createdAt = $createdAt; } public function getPricingRuleReference(): ?CatalogObjectReference { return $this->pricingRuleReference; } public function setPricingRuleReference(?CatalogObjectReference $pricingRuleReference): void { $this->pricingRuleReference = $pricingRuleReference; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['id'] = $this->id; $json['points'] = $this->points; $json['name'] = $this->name; $json['definition'] = $this->definition; $json['created_at'] = $this->createdAt; if (isset($this->pricingRuleReference)) { $json['pricing_rule_reference'] = $this->pricingRuleReference; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 