<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogPricingRule implements \JsonSerializable { private $name; private $timePeriodIds; private $discountId; private $matchProductsId; private $applyProductsId; private $excludeProductsId; private $validFromDate; private $validFromLocalTime; private $validUntilDate; private $validUntilLocalTime; private $excludeStrategy; private $minimumOrderSubtotalMoney; private $customerGroupIdsAny; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getTimePeriodIds(): ?array { return $this->timePeriodIds; } public function setTimePeriodIds(?array $timePeriodIds): void { $this->timePeriodIds = $timePeriodIds; } public function getDiscountId(): ?string { return $this->discountId; } public function setDiscountId(?string $discountId): void { $this->discountId = $discountId; } public function getMatchProductsId(): ?string { return $this->matchProductsId; } public function setMatchProductsId(?string $matchProductsId): void { $this->matchProductsId = $matchProductsId; } public function getApplyProductsId(): ?string { return $this->applyProductsId; } public function setApplyProductsId(?string $applyProductsId): void { $this->applyProductsId = $applyProductsId; } public function getExcludeProductsId(): ?string { return $this->excludeProductsId; } public function setExcludeProductsId(?string $excludeProductsId): void { $this->excludeProductsId = $excludeProductsId; } public function getValidFromDate(): ?string { return $this->validFromDate; } public function setValidFromDate(?string $validFromDate): void { $this->validFromDate = $validFromDate; } public function getValidFromLocalTime(): ?string { return $this->validFromLocalTime; } public function setValidFromLocalTime(?string $validFromLocalTime): void { $this->validFromLocalTime = $validFromLocalTime; } public function getValidUntilDate(): ?string { return $this->validUntilDate; } public function setValidUntilDate(?string $validUntilDate): void { $this->validUntilDate = $validUntilDate; } public function getValidUntilLocalTime(): ?string { return $this->validUntilLocalTime; } public function setValidUntilLocalTime(?string $validUntilLocalTime): void { $this->validUntilLocalTime = $validUntilLocalTime; } public function getExcludeStrategy(): ?string { return $this->excludeStrategy; } public function setExcludeStrategy(?string $excludeStrategy): void { $this->excludeStrategy = $excludeStrategy; } public function getMinimumOrderSubtotalMoney(): ?Money { return $this->minimumOrderSubtotalMoney; } public function setMinimumOrderSubtotalMoney(?Money $minimumOrderSubtotalMoney): void { $this->minimumOrderSubtotalMoney = $minimumOrderSubtotalMoney; } public function getCustomerGroupIdsAny(): ?array { return $this->customerGroupIdsAny; } public function setCustomerGroupIdsAny(?array $customerGroupIdsAny): void { $this->customerGroupIdsAny = $customerGroupIdsAny; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->timePeriodIds)) { $json['time_period_ids'] = $this->timePeriodIds; } if (isset($this->discountId)) { $json['discount_id'] = $this->discountId; } if (isset($this->matchProductsId)) { $json['match_products_id'] = $this->matchProductsId; } if (isset($this->applyProductsId)) { $json['apply_products_id'] = $this->applyProductsId; } if (isset($this->excludeProductsId)) { $json['exclude_products_id'] = $this->excludeProductsId; } if (isset($this->validFromDate)) { $json['valid_from_date'] = $this->validFromDate; } if (isset($this->validFromLocalTime)) { $json['valid_from_local_time'] = $this->validFromLocalTime; } if (isset($this->validUntilDate)) { $json['valid_until_date'] = $this->validUntilDate; } if (isset($this->validUntilLocalTime)) { $json['valid_until_local_time'] = $this->validUntilLocalTime; } if (isset($this->excludeStrategy)) { $json['exclude_strategy'] = $this->excludeStrategy; } if (isset($this->minimumOrderSubtotalMoney)) { $json['minimum_order_subtotal_money'] = $this->minimumOrderSubtotalMoney; } if (isset($this->customerGroupIdsAny)) { $json['customer_group_ids_any'] = $this->customerGroupIdsAny; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 