<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Subscription implements \JsonSerializable { private $id; private $locationId; private $planId; private $customerId; private $startDate; private $canceledDate; private $chargedThroughDate; private $status; private $taxPercentage; private $invoiceIds; private $priceOverrideMoney; private $version; private $createdAt; private $cardId; private $timezone; private $source; private $actions; public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getPlanId(): ?string { return $this->planId; } public function setPlanId(?string $planId): void { $this->planId = $planId; } public function getCustomerId(): ?string { return $this->customerId; } public function setCustomerId(?string $customerId): void { $this->customerId = $customerId; } public function getStartDate(): ?string { return $this->startDate; } public function setStartDate(?string $startDate): void { $this->startDate = $startDate; } public function getCanceledDate(): ?string { return $this->canceledDate; } public function setCanceledDate(?string $canceledDate): void { $this->canceledDate = $canceledDate; } public function getChargedThroughDate(): ?string { return $this->chargedThroughDate; } public function setChargedThroughDate(?string $chargedThroughDate): void { $this->chargedThroughDate = $chargedThroughDate; } public function getStatus(): ?string { return $this->status; } public function setStatus(?string $status): void { $this->status = $status; } public function getTaxPercentage(): ?string { return $this->taxPercentage; } public function setTaxPercentage(?string $taxPercentage): void { $this->taxPercentage = $taxPercentage; } public function getInvoiceIds(): ?array { return $this->invoiceIds; } public function setInvoiceIds(?array $invoiceIds): void { $this->invoiceIds = $invoiceIds; } public function getPriceOverrideMoney(): ?Money { return $this->priceOverrideMoney; } public function setPriceOverrideMoney(?Money $priceOverrideMoney): void { $this->priceOverrideMoney = $priceOverrideMoney; } public function getVersion(): ?int { return $this->version; } public function setVersion(?int $version): void { $this->version = $version; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getCardId(): ?string { return $this->cardId; } public function setCardId(?string $cardId): void { $this->cardId = $cardId; } public function getTimezone(): ?string { return $this->timezone; } public function setTimezone(?string $timezone): void { $this->timezone = $timezone; } public function getSource(): ?SubscriptionSource { return $this->source; } public function setSource(?SubscriptionSource $source): void { $this->source = $source; } public function getActions(): ?array { return $this->actions; } public function setActions(?array $actions): void { $this->actions = $actions; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->planId)) { $json['plan_id'] = $this->planId; } if (isset($this->customerId)) { $json['customer_id'] = $this->customerId; } if (isset($this->startDate)) { $json['start_date'] = $this->startDate; } if (isset($this->canceledDate)) { $json['canceled_date'] = $this->canceledDate; } if (isset($this->chargedThroughDate)) { $json['charged_through_date'] = $this->chargedThroughDate; } if (isset($this->status)) { $json['status'] = $this->status; } if (isset($this->taxPercentage)) { $json['tax_percentage'] = $this->taxPercentage; } if (isset($this->invoiceIds)) { $json['invoice_ids'] = $this->invoiceIds; } if (isset($this->priceOverrideMoney)) { $json['price_override_money'] = $this->priceOverrideMoney; } if (isset($this->version)) { $json['version'] = $this->version; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->cardId)) { $json['card_id'] = $this->cardId; } if (isset($this->timezone)) { $json['timezone'] = $this->timezone; } if (isset($this->source)) { $json['source'] = $this->source; } if (isset($this->actions)) { $json['actions'] = $this->actions; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 