<?php

declare(strict_types = 1);

namespace PSX\Model\SchemaOrg;

use PSX\Schema\Attribute\Description;

#[Description('An agent tracks an object for updates.<br/><br/>

Related actions:<br/><br/>

<ul>
<li><a class="localLink" href="http://schema.org/FollowAction">FollowAction</a>: Unlike FollowAction, TrackAction refers to the interest on the location of innanimates objects.</li>
<li><a class="localLink" href="http://schema.org/SubscribeAction">SubscribeAction</a>: Unlike SubscribeAction, TrackAction refers to  the interest on the location of innanimate objects.</li>
</ul>
')]
class TrackAction extends FindAction implements \JsonSerializable
{
    protected Thing|DeliveryMethod|null $deliveryMethod = null;
    public function setDeliveryMethod(Thing|DeliveryMethod|null $deliveryMethod) : void
    {
        $this->deliveryMethod = $deliveryMethod;
    }
    public function getDeliveryMethod() : Thing|DeliveryMethod|null
    {
        return $this->deliveryMethod;
    }
    public function jsonSerialize() : object
    {
        return (object) array_merge((array) parent::jsonSerialize(), array_filter(array('deliveryMethod' => $this->deliveryMethod), static function ($value) : bool {
            return $value !== null;
        }));
    }
}

