<?php
 declare(strict_types=1); namespace Square\Models; use Square\ApiHelper; use stdClass; class CustomAttributeDefinition implements \JsonSerializable { private $key; private $schema; private $name; private $description; private $sourceApplication; private $visibility; private $version; private $updatedAt; private $createdAt; public function getKey(): ?string { return $this->key; } public function setKey(?string $key): void { $this->key = $key; } public function getSchema() { return $this->schema; } public function setSchema($schema): void { $this->schema = $schema; } public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): void { $this->description = $description; } public function getSourceApplication(): ?SourceApplication { return $this->sourceApplication; } public function setSourceApplication(?SourceApplication $sourceApplication): void { $this->sourceApplication = $sourceApplication; } public function getVisibility(): ?string { return $this->visibility; } public function setVisibility(?string $visibility): void { $this->visibility = $visibility; } public function getVersion(): ?int { return $this->version; } public function setVersion(?int $version): void { $this->version = $version; } public function getUpdatedAt(): ?string { return $this->updatedAt; } public function setUpdatedAt(?string $updatedAt): void { $this->updatedAt = $updatedAt; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->key)) { $json['key'] = $this->key; } if (isset($this->schema)) { $json['schema'] = ApiHelper::decodeJson($this->schema, 'schema'); } if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->description)) { $json['description'] = $this->description; } if (isset($this->sourceApplication)) { $json['source_application'] = $this->sourceApplication; } if (isset($this->visibility)) { $json['visibility'] = $this->visibility; } if (isset($this->version)) { $json['version'] = $this->version; } if (isset($this->updatedAt)) { $json['updated_at'] = $this->updatedAt; } if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 