<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class GiftCard implements \JsonSerializable { private $id; private $type; private $ganSource; private $state; private $balanceMoney; private $gan; private $createdAt; private $customerIds; public function __construct(string $type) { $this->type = $type; } 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 getGanSource(): ?string { return $this->ganSource; } public function setGanSource(?string $ganSource): void { $this->ganSource = $ganSource; } public function getState(): ?string { return $this->state; } public function setState(?string $state): void { $this->state = $state; } public function getBalanceMoney(): ?Money { return $this->balanceMoney; } public function setBalanceMoney(?Money $balanceMoney): void { $this->balanceMoney = $balanceMoney; } public function getGan(): ?string { return $this->gan; } public function setGan(?string $gan): void { $this->gan = $gan; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getCustomerIds(): ?array { return $this->customerIds; } public function setCustomerIds(?array $customerIds): void { $this->customerIds = $customerIds; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } $json['type'] = $this->type; if (isset($this->ganSource)) { $json['gan_source'] = $this->ganSource; } if (isset($this->state)) { $json['state'] = $this->state; } if (isset($this->balanceMoney)) { $json['balance_money'] = $this->balanceMoney; } if (isset($this->gan)) { $json['gan'] = $this->gan; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->customerIds)) { $json['customer_ids'] = $this->customerIds; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 