<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogCustomAttributeDefinition implements \JsonSerializable { private $type; private $name; private $description; private $sourceApplication; private $allowedObjectTypes; private $sellerVisibility; private $appVisibility; private $stringConfig; private $numberConfig; private $selectionConfig; private $customAttributeUsageCount; private $key; public function __construct(string $type, string $name, array $allowedObjectTypes) { $this->type = $type; $this->name = $name; $this->allowedObjectTypes = $allowedObjectTypes; } public function getType(): string { return $this->type; } public function setType(string $type): void { $this->type = $type; } 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 getAllowedObjectTypes(): array { return $this->allowedObjectTypes; } public function setAllowedObjectTypes(array $allowedObjectTypes): void { $this->allowedObjectTypes = $allowedObjectTypes; } public function getSellerVisibility(): ?string { return $this->sellerVisibility; } public function setSellerVisibility(?string $sellerVisibility): void { $this->sellerVisibility = $sellerVisibility; } public function getAppVisibility(): ?string { return $this->appVisibility; } public function setAppVisibility(?string $appVisibility): void { $this->appVisibility = $appVisibility; } public function getStringConfig(): ?CatalogCustomAttributeDefinitionStringConfig { return $this->stringConfig; } public function setStringConfig(?CatalogCustomAttributeDefinitionStringConfig $stringConfig): void { $this->stringConfig = $stringConfig; } public function getNumberConfig(): ?CatalogCustomAttributeDefinitionNumberConfig { return $this->numberConfig; } public function setNumberConfig(?CatalogCustomAttributeDefinitionNumberConfig $numberConfig): void { $this->numberConfig = $numberConfig; } public function getSelectionConfig(): ?CatalogCustomAttributeDefinitionSelectionConfig { return $this->selectionConfig; } public function setSelectionConfig(?CatalogCustomAttributeDefinitionSelectionConfig $selectionConfig): void { $this->selectionConfig = $selectionConfig; } public function getCustomAttributeUsageCount(): ?int { return $this->customAttributeUsageCount; } public function setCustomAttributeUsageCount(?int $customAttributeUsageCount): void { $this->customAttributeUsageCount = $customAttributeUsageCount; } public function getKey(): ?string { return $this->key; } public function setKey(?string $key): void { $this->key = $key; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['type'] = $this->type; $json['name'] = $this->name; if (isset($this->description)) { $json['description'] = $this->description; } if (isset($this->sourceApplication)) { $json['source_application'] = $this->sourceApplication; } $json['allowed_object_types'] = $this->allowedObjectTypes; if (isset($this->sellerVisibility)) { $json['seller_visibility'] = $this->sellerVisibility; } if (isset($this->appVisibility)) { $json['app_visibility'] = $this->appVisibility; } if (isset($this->stringConfig)) { $json['string_config'] = $this->stringConfig; } if (isset($this->numberConfig)) { $json['number_config'] = $this->numberConfig; } if (isset($this->selectionConfig)) { $json['selection_config'] = $this->selectionConfig; } if (isset($this->customAttributeUsageCount)) { $json['custom_attribute_usage_count'] = $this->customAttributeUsageCount; } if (isset($this->key)) { $json['key'] = $this->key; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 