# plausible-analytics/trunk/src/Client/lib/Model/TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration.php

Plausible Analytics, version trunk. 587 lines.

- Page: https://pluginprobe.com/plugins/plausible-analytics/trunk/code/src/Client/lib/Model/TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration.php
- Raw: https://pluginprobe.com/plugins/plausible-analytics/trunk/raw/src/Client/lib/Model/TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration.php
- Modified: 2026-02-05T13:58:52+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/plausible-analytics/trunk/code/src/Client/lib/Model/TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration.php#L10-L20`.

```php
<?php
/**
 * TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration
 *
 * PHP version 7.4
 *
 * @category Class
 * @package  Plausible\Analytics\WP\Client
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 */

/**
 * Plausible Plugins API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0-rc
 * Generated by: https://openapi-generator.tech
 * OpenAPI Generator version: 7.0.1
 */

/**
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

namespace Plausible\Analytics\WP\Client\Model;

use \ArrayAccess;
use \Plausible\Analytics\WP\Client\ObjectSerializer;

/**
 * TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration Class Doc Comment
 *
 * @category Class
 * @package  Plausible\Analytics\WP\Client
 * @author   OpenAPI Generator team
 * @link     https://openapi-generator.tech
 * @implements \ArrayAccess<string, mixed>
 */
class TrackerScriptConfigurationUpdateRequestTrackerScriptConfiguration implements ModelInterface, ArrayAccess, \JsonSerializable
{
    public const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      *
      * @var string
      */
    protected static $openAPIModelName = 'TrackerScriptConfiguration_UpdateRequest_tracker_script_configuration';

    /**
      * Array of property to type mappings. Used for (de)serialization
      *
      * @var string[]
      */
    protected static $openAPITypes = [
        'file_downloads' => 'bool',
        'form_submissions' => 'bool',
        'hash_based_routing' => 'bool',
        'installation_type' => 'string',
        'outbound_links' => 'bool'
    ];

    /**
      * Array of property to format mappings. Used for (de)serialization
      *
      * @var string[]
      * @phpstan-var array<string, string|null>
      * @psalm-var array<string, string|null>
      */
    protected static $openAPIFormats = [
        'file_downloads' => null,
        'form_submissions' => null,
        'hash_based_routing' => null,
        'installation_type' => null,
        'outbound_links' => null
    ];

    /**
      * Array of nullable properties. Used for (de)serialization
      *
      * @var boolean[]
      */
    protected static array $openAPINullables = [
        'file_downloads' => false,
		'form_submissions' => false,
		'hash_based_routing' => false,
		'installation_type' => false,
		'outbound_links' => false
    ];

    /**
      * If a nullable field gets set to null, insert it here
      *
      * @var boolean[]
      */
    protected array $openAPINullablesSetToNull = [];

    /**
     * Array of property to type mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPITypes()
    {
        return self::$openAPITypes;
    }

    /**
     * Array of property to format mappings. Used for (de)serialization
     *
     * @return array
     */
    public static function openAPIFormats()
    {
        return self::$openAPIFormats;
    }

    /**
     * Array of nullable properties
     *
     * @return array
     */
    protected static function openAPINullables(): array
    {
        return self::$openAPINullables;
    }

    /**
     * Array of nullable field names deliberately set to null
     *
     * @return boolean[]
     */
    private function getOpenAPINullablesSetToNull(): array
    {
        return $this->openAPINullablesSetToNull;
    }

    /**
     * Setter - Array of nullable field names deliberately set to null
     *
     * @param boolean[] $openAPINullablesSetToNull
     */
    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
    {
        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
    }

    /**
     * Checks if a property is nullable
     *
     * @param string $property
     * @return bool
     */
    public static function isNullable(string $property): bool
    {
        return self::openAPINullables()[$property] ?? false;
    }

    /**
     * Checks if a nullable property is set to null.
     *
     * @param string $property
     * @return bool
     */
    public function isNullableSetToNull(string $property): bool
    {
        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
    }

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @var string[]
     */
    protected static $attributeMap = [
        'file_downloads' => 'file_downloads',
        'form_submissions' => 'form_submissions',
        'hash_based_routing' => 'hash_based_routing',
        'installation_type' => 'installation_type',
        'outbound_links' => 'outbound_links'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @var string[]
     */
    protected static $setters = [
        'file_downloads' => 'setFileDownloads',
        'form_submissions' => 'setFormSubmissions',
        'hash_based_routing' => 'setHashBasedRouting',
        'installation_type' => 'setInstallationType',
        'outbound_links' => 'setOutboundLinks'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @var string[]
     */
    protected static $getters = [
        'file_downloads' => 'getFileDownloads',
        'form_submissions' => 'getFormSubmissions',
        'hash_based_routing' => 'getHashBasedRouting',
        'installation_type' => 'getInstallationType',
        'outbound_links' => 'getOutboundLinks'
    ];

    /**
     * Array of attributes where the key is the local name,
     * and the value is the original name
     *
     * @return array
     */
    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     *
     * @return array
     */
    public static function setters()
    {
        return self::$setters;
    }

    /**
     * Array of attributes to getter functions (for serialization of requests)
     *
     * @return array
     */
    public static function getters()
    {
        return self::$getters;
    }

    /**
     * The original name of the model.
     *
     * @return string
     */
    public function getModelName()
    {
        return self::$openAPIModelName;
    }

    public const INSTALLATION_TYPE_MANUAL = 'manual';
    public const INSTALLATION_TYPE_WORDPRESS = 'wordpress';
    public const INSTALLATION_TYPE_GTM = 'gtm';
    public const INSTALLATION_TYPE_NPM = 'npm';

    /**
     * Gets allowable values of the enum
     *
     * @return string[]
     */
    public function getInstallationTypeAllowableValues()
    {
        return [
            self::INSTALLATION_TYPE_MANUAL,
            self::INSTALLATION_TYPE_WORDPRESS,
            self::INSTALLATION_TYPE_GTM,
            self::INSTALLATION_TYPE_NPM,
        ];
    }

    /**
     * Associative array for storing property values
     *
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     *
     * @param mixed[]|null $data Associated array of property values
     *                      initializing the model
     */
	public function __construct( ?array $data = null )
    {
        $this->setIfExists('file_downloads', $data ?? [], null);
        $this->setIfExists('form_submissions', $data ?? [], null);
        $this->setIfExists('hash_based_routing', $data ?? [], null);
        $this->setIfExists('installation_type', $data ?? [], null);
        $this->setIfExists('outbound_links', $data ?? [], null);
    }

    /**
    * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
    * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
    * $this->openAPINullablesSetToNull array
    *
    * @param string $variableName
    * @param array  $fields
    * @param mixed  $defaultValue
    */
    private function setIfExists(string $variableName, array $fields, $defaultValue): void
    {
        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
            $this->openAPINullablesSetToNull[] = $variableName;
        }

        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
    }

    /**
     * Show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalidProperties = [];

        if ($this->container['installation_type'] === null) {
            $invalidProperties[] = "'installation_type' can't be null";
        }
        $allowedValues = $this->getInstallationTypeAllowableValues();
        if (!is_null($this->container['installation_type']) && !in_array($this->container['installation_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value '%s' for 'installation_type', must be one of '%s'",
                $this->container['installation_type'],
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }

    /**
     * Validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {
        return count($this->listInvalidProperties()) === 0;
    }


    /**
     * Gets file_downloads
     *
     * @return bool|null
     */
    public function getFileDownloads()
    {
        return $this->container['file_downloads'];
    }

    /**
     * Sets file_downloads
     *
     * @param bool|null $file_downloads Track File Downloads
     *
     * @return self
     */
    public function setFileDownloads($file_downloads)
    {
        if (is_null($file_downloads)) {
            throw new \InvalidArgumentException('non-nullable file_downloads cannot be null');
        }
        $this->container['file_downloads'] = $file_downloads;

        return $this;
    }

    /**
     * Gets form_submissions
     *
     * @return bool|null
     */
    public function getFormSubmissions()
    {
        return $this->container['form_submissions'];
    }

    /**
     * Sets form_submissions
     *
     * @param bool|null $form_submissions Track Form Submissions
     *
     * @return self
     */
    public function setFormSubmissions($form_submissions)
    {
        if (is_null($form_submissions)) {
            throw new \InvalidArgumentException('non-nullable form_submissions cannot be null');
        }
        $this->container['form_submissions'] = $form_submissions;

        return $this;
    }

    /**
     * Gets hash_based_routing
     *
     * @return bool|null
     */
    public function getHashBasedRouting()
    {
        return $this->container['hash_based_routing'];
    }

    /**
     * Sets hash_based_routing
     *
     * @param bool|null $hash_based_routing Hash Based Routing
     *
     * @return self
     */
    public function setHashBasedRouting($hash_based_routing)
    {
        if (is_null($hash_based_routing)) {
            throw new \InvalidArgumentException('non-nullable hash_based_routing cannot be null');
        }
        $this->container['hash_based_routing'] = $hash_based_routing;

        return $this;
    }

    /**
     * Gets installation_type
     *
     * @return string
     */
    public function getInstallationType()
    {
        return $this->container['installation_type'];
    }

    /**
     * Sets installation_type
     *
     * @param string $installation_type Tracker Script Installation Type
     *
     * @return self
     */
    public function setInstallationType($installation_type)
    {
        if (is_null($installation_type)) {
            throw new \InvalidArgumentException('non-nullable installation_type cannot be null');
        }
        $allowedValues = $this->getInstallationTypeAllowableValues();
        if (!in_array($installation_type, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value '%s' for 'installation_type', must be one of '%s'",
                    $installation_type,
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['installation_type'] = $installation_type;

        return $this;
    }

    /**
     * Gets outbound_links
     *
     * @return bool|null
     */
    public function getOutboundLinks()
    {
        return $this->container['outbound_links'];
    }

    /**
     * Sets outbound_links
     *
     * @param bool|null $outbound_links Track Outbound Links
     *
     * @return self
     */
    public function setOutboundLinks($outbound_links)
    {
        if (is_null($outbound_links)) {
            throw new \InvalidArgumentException('non-nullable outbound_links cannot be null');
        }
        $this->container['outbound_links'] = $outbound_links;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     *
     * @param integer $offset Offset
     *
     * @return boolean
     */
    public function offsetExists($offset): bool
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     *
     * @param integer $offset Offset
     *
     * @return mixed|null
     */
    #[\ReturnTypeWillChange]
    public function offsetGet($offset)
    {
        return $this->container[$offset] ?? null;
    }

    /**
     * Sets value based on offset.
     *
     * @param int|null $offset Offset
     * @param mixed    $value  Value to be set
     *
     * @return void
     */
    public function offsetSet($offset, $value): void
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     *
     * @param integer $offset Offset
     *
     * @return void
     */
    public function offsetUnset($offset): void
    {
        unset($this->container[$offset]);
    }

    /**
     * Serializes the object to a value that can be serialized natively by json_encode().
     * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
     *
     * @return mixed Returns data which can be serialized by json_encode(), which is a value
     * of any type other than a resource.
     */
    #[\ReturnTypeWillChange]
    public function jsonSerialize()
    {
       return ObjectSerializer::sanitizeForSerialization($this);
    }

    /**
     * Gets the string presentation of the object
     *
     * @return string
     */
    public function __toString()
    {
        return json_encode(
            ObjectSerializer::sanitizeForSerialization($this),
            JSON_PRETTY_PRINT
        );
    }

    /**
     * Gets a header-safe presentation of the object
     *
     * @return string
     */
    public function toHeaderValue()
    {
        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
    }
}



```
