<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class PaymentLink implements \JsonSerializable { private $id; private $version; private $description; private $orderId; private $checkoutOptions; private $prePopulatedData; private $url; private $createdAt; private $updatedAt; private $paymentNote; public function __construct(int $version) { $this->version = $version; } public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getVersion(): int { return $this->version; } public function setVersion(int $version): void { $this->version = $version; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): void { $this->description = $description; } public function getOrderId(): ?string { return $this->orderId; } public function setOrderId(?string $orderId): void { $this->orderId = $orderId; } public function getCheckoutOptions(): ?CheckoutOptions { return $this->checkoutOptions; } public function setCheckoutOptions(?CheckoutOptions $checkoutOptions): void { $this->checkoutOptions = $checkoutOptions; } public function getPrePopulatedData(): ?PrePopulatedData { return $this->prePopulatedData; } public function setPrePopulatedData(?PrePopulatedData $prePopulatedData): void { $this->prePopulatedData = $prePopulatedData; } public function getUrl(): ?string { return $this->url; } public function setUrl(?string $url): void { $this->url = $url; } 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 getPaymentNote(): ?string { return $this->paymentNote; } public function setPaymentNote(?string $paymentNote): void { $this->paymentNote = $paymentNote; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } $json['version'] = $this->version; if (isset($this->description)) { $json['description'] = $this->description; } if (isset($this->orderId)) { $json['order_id'] = $this->orderId; } if (isset($this->checkoutOptions)) { $json['checkout_options'] = $this->checkoutOptions; } if (isset($this->prePopulatedData)) { $json['pre_populated_data'] = $this->prePopulatedData; } if (isset($this->url)) { $json['url'] = $this->url; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->updatedAt)) { $json['updated_at'] = $this->updatedAt; } if (isset($this->paymentNote)) { $json['payment_note'] = $this->paymentNote; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 