Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
60.84% covered (warning)
60.84%
87 / 143
63.38% covered (warning)
63.38%
45 / 71
CRAP
0.00% covered (danger)
0.00%
0 / 1
RawDeviceAttributes
60.84% covered (warning)
60.84%
87 / 143
63.38% covered (warning)
63.38%
45 / 71
553.07
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
25 / 25
100.00% covered (success)
100.00%
1 / 1
1
 __toString
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 openAPITypes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 openAPIFormats
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isNullable
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isNullableSetToNull
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 attributeMap
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setters
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getters
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getModelName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 listInvalidProperties
60.00% covered (warning)
60.00%
6 / 10
0.00% covered (danger)
0.00%
0 / 1
14.18
 valid
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFontPreferences
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setFontPreferences
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getEmoji
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setEmoji
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getFonts
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setFonts
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getDeviceMemory
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDeviceMemory
75.00% covered (warning)
75.00%
3 / 4
0.00% covered (danger)
0.00%
0 / 1
2.06
 getTimezone
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTimezone
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getCanvas
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setCanvas
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getLanguages
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setLanguages
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getWebglExtensions
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setWebglExtensions
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getWebglBasics
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setWebglBasics
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getScreenResolution
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setScreenResolution
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
12
 getTouchSupport
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTouchSupport
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getOscpu
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setOscpu
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getArchitecture
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setArchitecture
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getCookiesEnabled
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setCookiesEnabled
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getHardwareConcurrency
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setHardwareConcurrency
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
 getDateTimeLocale
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDateTimeLocale
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getVendor
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setVendor
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getColorDepth
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setColorDepth
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getPlatform
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setPlatform
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getSessionStorage
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setSessionStorage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getLocalStorage
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setLocalStorage
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getAudio
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setAudio
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getPlugins
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setPlugins
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getIndexedDb
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setIndexedDb
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getMath
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setMath
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 offsetExists
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetGet
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 offsetSet
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
2
 offsetUnset
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 jsonSerialize
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 toHeaderValue
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 openAPINullables
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getOpenAPINullablesSetToNull
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setOpenAPINullablesSetToNull
n/a
0 / 0
n/a
0 / 0
1
 setIfExists
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
4
1<?php
2
3/**
4 * RawDeviceAttributes.
5 *
6 * @category Class
7 *
8 * @author   Fingerprint
9 *
10 * @see      https://fingerprint.com
11 */
12
13/**
14 * Server API.
15 *
16 * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
17 *
18 * The version of the OpenAPI document: 4
19 * Contact: support@fingerprint.com
20 * Generated by: https://openapi-generator.tech
21 * Generator version: 7.21.0
22 */
23
24/**
25 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 * https://openapi-generator.tech
27 * Do not edit the class manually.
28 */
29
30namespace Fingerprint\ServerSdk\Model;
31
32use Fingerprint\ServerSdk\ObjectSerializer;
33
34/**
35 * A curated subset of raw browser/device attributes that the API surface exposes. Each property contains a value or object with the data for the collected signal.
36 *
37 * @category Class
38 *
39 * @description A curated subset of raw browser/device attributes that the API surface exposes. Each property contains a value or object with the data for the collected signal.
40 *
41 * @author   Fingerprint
42 *
43 * @see      https://fingerprint.com
44 *
45 * @implements \ArrayAccess<string, mixed>
46 *
47 * @noinspection GrazieInspection
48 * @noinspection RedundantSuppression
49 */
50class RawDeviceAttributes implements ModelInterface, \ArrayAccess, \JsonSerializable
51{
52    public const DISCRIMINATOR = null;
53
54    /**
55     * The original name of the model.
56     *
57     */
58    protected static string $openAPIModelName = 'RawDeviceAttributes';
59
60    /**
61     * Array of property to type mappings. Used for (de)serialization.
62     *
63     * @var string[]
64     */
65    protected static array $openAPITypes = [
66        'font_preferences' => '\Fingerprint\ServerSdk\Model\FontPreferences',
67        'emoji' => '\Fingerprint\ServerSdk\Model\Emoji',
68        'fonts' => 'string[]',
69        'device_memory' => 'int',
70        'timezone' => 'string',
71        'canvas' => '\Fingerprint\ServerSdk\Model\Canvas',
72        'languages' => 'string[][]',
73        'webgl_extensions' => '\Fingerprint\ServerSdk\Model\WebGlExtensions',
74        'webgl_basics' => '\Fingerprint\ServerSdk\Model\WebGlBasics',
75        'screen_resolution' => 'int[]',
76        'touch_support' => '\Fingerprint\ServerSdk\Model\TouchSupport',
77        'oscpu' => 'string',
78        'architecture' => 'int',
79        'cookies_enabled' => 'bool',
80        'hardware_concurrency' => 'int',
81        'date_time_locale' => 'string',
82        'vendor' => 'string',
83        'color_depth' => 'int',
84        'platform' => 'string',
85        'session_storage' => 'bool',
86        'local_storage' => 'bool',
87        'audio' => 'float',
88        'plugins' => '\Fingerprint\ServerSdk\Model\PluginsInner[]',
89        'indexed_db' => 'bool',
90        'math' => 'string',
91    ];
92
93    /**
94     * Array of property to format mappings. Used for (de)serialization.
95     *
96     * @var string[]
97     *
98     * @phpstan-var array<string, string|null>
99     *
100     * @psalm-var array<string, string|null>
101     */
102    protected static array $openAPIFormats = [
103        'font_preferences' => null,
104        'emoji' => null,
105        'fonts' => null,
106        'device_memory' => 'int32',
107        'timezone' => null,
108        'canvas' => null,
109        'languages' => null,
110        'webgl_extensions' => null,
111        'webgl_basics' => null,
112        'screen_resolution' => 'int32',
113        'touch_support' => null,
114        'oscpu' => null,
115        'architecture' => 'int32',
116        'cookies_enabled' => null,
117        'hardware_concurrency' => 'int32',
118        'date_time_locale' => null,
119        'vendor' => null,
120        'color_depth' => 'int32',
121        'platform' => null,
122        'session_storage' => null,
123        'local_storage' => null,
124        'audio' => 'double',
125        'plugins' => null,
126        'indexed_db' => null,
127        'math' => null,
128    ];
129
130    /**
131     * Array of nullable properties. Used for (de)serialization.
132     *
133     * @var bool[]
134     */
135    protected static array $openAPINullables = [
136        'font_preferences' => false,
137        'emoji' => false,
138        'fonts' => false,
139        'device_memory' => false,
140        'timezone' => false,
141        'canvas' => false,
142        'languages' => false,
143        'webgl_extensions' => false,
144        'webgl_basics' => false,
145        'screen_resolution' => false,
146        'touch_support' => false,
147        'oscpu' => false,
148        'architecture' => false,
149        'cookies_enabled' => false,
150        'hardware_concurrency' => false,
151        'date_time_locale' => false,
152        'vendor' => false,
153        'color_depth' => false,
154        'platform' => false,
155        'session_storage' => false,
156        'local_storage' => false,
157        'audio' => false,
158        'plugins' => false,
159        'indexed_db' => false,
160        'math' => false,
161    ];
162
163    /**
164     * If a nullable field gets set to null, insert it here.
165     *
166     * @var bool[]
167     */
168    protected array $openAPINullablesSetToNull = [];
169
170    /**
171     * Array of attributes where the key is the local name,
172     * and the value is the original name.
173     *
174     * @var string[]
175     */
176    protected static array $attributeMap = [
177        'font_preferences' => 'font_preferences',
178        'emoji' => 'emoji',
179        'fonts' => 'fonts',
180        'device_memory' => 'device_memory',
181        'timezone' => 'timezone',
182        'canvas' => 'canvas',
183        'languages' => 'languages',
184        'webgl_extensions' => 'webgl_extensions',
185        'webgl_basics' => 'webgl_basics',
186        'screen_resolution' => 'screen_resolution',
187        'touch_support' => 'touch_support',
188        'oscpu' => 'oscpu',
189        'architecture' => 'architecture',
190        'cookies_enabled' => 'cookies_enabled',
191        'hardware_concurrency' => 'hardware_concurrency',
192        'date_time_locale' => 'date_time_locale',
193        'vendor' => 'vendor',
194        'color_depth' => 'color_depth',
195        'platform' => 'platform',
196        'session_storage' => 'session_storage',
197        'local_storage' => 'local_storage',
198        'audio' => 'audio',
199        'plugins' => 'plugins',
200        'indexed_db' => 'indexed_db',
201        'math' => 'math',
202    ];
203
204    /**
205     * Array of attributes to setter functions (for deserialization of responses).
206     *
207     * @var string[]
208     */
209    protected static array $setters = [
210        'font_preferences' => 'setFontPreferences',
211        'emoji' => 'setEmoji',
212        'fonts' => 'setFonts',
213        'device_memory' => 'setDeviceMemory',
214        'timezone' => 'setTimezone',
215        'canvas' => 'setCanvas',
216        'languages' => 'setLanguages',
217        'webgl_extensions' => 'setWebglExtensions',
218        'webgl_basics' => 'setWebglBasics',
219        'screen_resolution' => 'setScreenResolution',
220        'touch_support' => 'setTouchSupport',
221        'oscpu' => 'setOscpu',
222        'architecture' => 'setArchitecture',
223        'cookies_enabled' => 'setCookiesEnabled',
224        'hardware_concurrency' => 'setHardwareConcurrency',
225        'date_time_locale' => 'setDateTimeLocale',
226        'vendor' => 'setVendor',
227        'color_depth' => 'setColorDepth',
228        'platform' => 'setPlatform',
229        'session_storage' => 'setSessionStorage',
230        'local_storage' => 'setLocalStorage',
231        'audio' => 'setAudio',
232        'plugins' => 'setPlugins',
233        'indexed_db' => 'setIndexedDb',
234        'math' => 'setMath',
235    ];
236
237    /**
238     * Array of attributes to getter functions (for serialization of requests).
239     *
240     * @var string[]
241     */
242    protected static array $getters = [
243        'font_preferences' => 'getFontPreferences',
244        'emoji' => 'getEmoji',
245        'fonts' => 'getFonts',
246        'device_memory' => 'getDeviceMemory',
247        'timezone' => 'getTimezone',
248        'canvas' => 'getCanvas',
249        'languages' => 'getLanguages',
250        'webgl_extensions' => 'getWebglExtensions',
251        'webgl_basics' => 'getWebglBasics',
252        'screen_resolution' => 'getScreenResolution',
253        'touch_support' => 'getTouchSupport',
254        'oscpu' => 'getOscpu',
255        'architecture' => 'getArchitecture',
256        'cookies_enabled' => 'getCookiesEnabled',
257        'hardware_concurrency' => 'getHardwareConcurrency',
258        'date_time_locale' => 'getDateTimeLocale',
259        'vendor' => 'getVendor',
260        'color_depth' => 'getColorDepth',
261        'platform' => 'getPlatform',
262        'session_storage' => 'getSessionStorage',
263        'local_storage' => 'getLocalStorage',
264        'audio' => 'getAudio',
265        'plugins' => 'getPlugins',
266        'indexed_db' => 'getIndexedDb',
267        'math' => 'getMath',
268    ];
269
270    /**
271     * Associative array for storing property values.
272     */
273    protected array $container = [];
274
275    /**
276     * Constructor.
277     *
278     * @param array|null $data Associated array of property values
279     *                         initializing the model
280     *
281     * @noinspection DuplicatedCode
282     */
283    public function __construct(?array $data = null)
284    {
285        $this->setIfExists('font_preferences', $data ?? [], null);
286        $this->setIfExists('emoji', $data ?? [], null);
287        $this->setIfExists('fonts', $data ?? [], null);
288        $this->setIfExists('device_memory', $data ?? [], null);
289        $this->setIfExists('timezone', $data ?? [], null);
290        $this->setIfExists('canvas', $data ?? [], null);
291        $this->setIfExists('languages', $data ?? [], null);
292        $this->setIfExists('webgl_extensions', $data ?? [], null);
293        $this->setIfExists('webgl_basics', $data ?? [], null);
294        $this->setIfExists('screen_resolution', $data ?? [], null);
295        $this->setIfExists('touch_support', $data ?? [], null);
296        $this->setIfExists('oscpu', $data ?? [], null);
297        $this->setIfExists('architecture', $data ?? [], null);
298        $this->setIfExists('cookies_enabled', $data ?? [], null);
299        $this->setIfExists('hardware_concurrency', $data ?? [], null);
300        $this->setIfExists('date_time_locale', $data ?? [], null);
301        $this->setIfExists('vendor', $data ?? [], null);
302        $this->setIfExists('color_depth', $data ?? [], null);
303        $this->setIfExists('platform', $data ?? [], null);
304        $this->setIfExists('session_storage', $data ?? [], null);
305        $this->setIfExists('local_storage', $data ?? [], null);
306        $this->setIfExists('audio', $data ?? [], null);
307        $this->setIfExists('plugins', $data ?? [], null);
308        $this->setIfExists('indexed_db', $data ?? [], null);
309        $this->setIfExists('math', $data ?? [], null);
310    }
311
312    /**
313     * Gets the string presentation of the object.
314     *
315     */
316    public function __toString(): string
317    {
318        return json_encode(
319            ObjectSerializer::sanitizeForSerialization($this),
320            JSON_PRETTY_PRINT
321        );
322    }
323
324    /**
325     * Array of property to type mappings. Used for (de)serialization.
326     *
327     */
328    public static function openAPITypes(): array
329    {
330        return self::$openAPITypes;
331    }
332
333    /**
334     * Array of property to format mappings. Used for (de)serialization.
335     */
336    public static function openAPIFormats(): array
337    {
338        return self::$openAPIFormats;
339    }
340
341    /**
342     * Checks if a property is nullable.
343     *
344     */
345    public static function isNullable(string $property): bool
346    {
347        return self::openAPINullables()[$property] ?? false;
348    }
349
350    /**
351     * Checks if a nullable property is set to null.
352     *
353     */
354    public function isNullableSetToNull(string $property): bool
355    {
356        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
357    }
358
359    /**
360     * Array of attributes where the key is the local name,
361     * and the value is the original name.
362     *
363     */
364    public static function attributeMap(): array
365    {
366        return self::$attributeMap;
367    }
368
369    /**
370     * Array of attributes to setter functions (for deserialization of responses).
371     *
372     */
373    public static function setters(): array
374    {
375        return self::$setters;
376    }
377
378    /**
379     * Array of attributes to getter functions (for serialization of requests).
380     *
381     */
382    public static function getters(): array
383    {
384        return self::$getters;
385    }
386
387    /**
388     * The original name of the model.
389     *
390     */
391    public function getModelName(): string
392    {
393        return self::$openAPIModelName;
394    }
395
396    /**
397     * Show all the invalid properties with reasons.
398     *
399     * @return array invalid properties with reasons
400     */
401    public function listInvalidProperties(): array
402    {
403        $invalidProperties = [];
404
405        if (!is_null($this->container['device_memory']) && ($this->container['device_memory'] < 0)) {
406            $invalidProperties[] = "invalid value for 'device_memory', must be bigger than or equal to 0.";
407        }
408
409        if (!is_null($this->container['screen_resolution']) && (count($this->container['screen_resolution']) > 2)) {
410            $invalidProperties[] = "invalid value for 'screen_resolution', number of items must be less than or equal to 2.";
411        }
412
413        if (!is_null($this->container['screen_resolution']) && (count($this->container['screen_resolution']) < 2)) {
414            $invalidProperties[] = "invalid value for 'screen_resolution', number of items must be greater than or equal to 2.";
415        }
416
417        if (!is_null($this->container['hardware_concurrency']) && ($this->container['hardware_concurrency'] < 1)) {
418            $invalidProperties[] = "invalid value for 'hardware_concurrency', must be bigger than or equal to 1.";
419        }
420
421        return $invalidProperties;
422    }
423
424    /**
425     * Validate all the properties in the model
426     * return true if all passed.
427     *
428     * @return bool True if all properties are valid
429     */
430    public function valid(): bool
431    {
432        return 0 === count($this->listInvalidProperties());
433    }
434
435    /**
436     * Gets font_preferences.
437     *
438     */
439    public function getFontPreferences(): ?FontPreferences
440    {
441        return $this->container['font_preferences'];
442    }
443
444    /**
445     * Sets font_preferences.
446     *
447     * @param FontPreferences $font_preferences font_preferences
448     *
449     */
450    public function setFontPreferences(FontPreferences $font_preferences): self
451    {
452        $this->container['font_preferences'] = $font_preferences;
453
454        return $this;
455    }
456
457    /**
458     * Gets emoji.
459     *
460     */
461    public function getEmoji(): ?Emoji
462    {
463        return $this->container['emoji'];
464    }
465
466    /**
467     * Sets emoji.
468     *
469     * @param Emoji $emoji emoji
470     *
471     */
472    public function setEmoji(Emoji $emoji): self
473    {
474        $this->container['emoji'] = $emoji;
475
476        return $this;
477    }
478
479    /**
480     * Gets fonts.
481     *
482     * @return string[]|null
483     */
484    public function getFonts(): ?array
485    {
486        return $this->container['fonts'];
487    }
488
489    /**
490     * Sets fonts.
491     *
492     * @param string[] $fonts list of fonts detected on the device
493     *
494     */
495    public function setFonts(array $fonts): self
496    {
497        $this->container['fonts'] = $fonts;
498
499        return $this;
500    }
501
502    /**
503     * Gets device_memory.
504     *
505     */
506    public function getDeviceMemory(): ?int
507    {
508        return $this->container['device_memory'];
509    }
510
511    /**
512     * Sets device_memory.
513     *
514     * @param int $device_memory rounded amount of RAM (in gigabytes) reported by the browser
515     *
516     */
517    public function setDeviceMemory(int $device_memory): self
518    {
519        if ($device_memory < 0) {
520            throw new \InvalidArgumentException('invalid value for $device_memory when calling RawDeviceAttributes., must be bigger than or equal to 0.');
521        }
522
523        $this->container['device_memory'] = $device_memory;
524
525        return $this;
526    }
527
528    /**
529     * Gets timezone.
530     *
531     */
532    public function getTimezone(): ?string
533    {
534        return $this->container['timezone'];
535    }
536
537    /**
538     * Sets timezone.
539     *
540     * @param string $timezone timezone identifier detected on the client
541     *
542     */
543    public function setTimezone(string $timezone): self
544    {
545        $this->container['timezone'] = $timezone;
546
547        return $this;
548    }
549
550    /**
551     * Gets canvas.
552     *
553     */
554    public function getCanvas(): ?Canvas
555    {
556        return $this->container['canvas'];
557    }
558
559    /**
560     * Sets canvas.
561     *
562     * @param Canvas $canvas canvas
563     *
564     */
565    public function setCanvas(Canvas $canvas): self
566    {
567        $this->container['canvas'] = $canvas;
568
569        return $this;
570    }
571
572    /**
573     * Gets languages.
574     *
575     * @return string[][]|null
576     */
577    public function getLanguages(): ?array
578    {
579        return $this->container['languages'];
580    }
581
582    /**
583     * Sets languages.
584     *
585     * @param string[][] $languages Navigator languages reported by the agent including fallbacks. Each inner array represents ordered language preferences reported by different APIs.
586     *
587     */
588    public function setLanguages(array $languages): self
589    {
590        $this->container['languages'] = $languages;
591
592        return $this;
593    }
594
595    /**
596     * Gets webgl_extensions.
597     *
598     */
599    public function getWebglExtensions(): ?WebGlExtensions
600    {
601        return $this->container['webgl_extensions'];
602    }
603
604    /**
605     * Sets webgl_extensions.
606     *
607     * @param WebGlExtensions $webgl_extensions webgl_extensions
608     *
609     */
610    public function setWebglExtensions(WebGlExtensions $webgl_extensions): self
611    {
612        $this->container['webgl_extensions'] = $webgl_extensions;
613
614        return $this;
615    }
616
617    /**
618     * Gets webgl_basics.
619     *
620     */
621    public function getWebglBasics(): ?WebGlBasics
622    {
623        return $this->container['webgl_basics'];
624    }
625
626    /**
627     * Sets webgl_basics.
628     *
629     * @param WebGlBasics $webgl_basics webgl_basics
630     *
631     */
632    public function setWebglBasics(WebGlBasics $webgl_basics): self
633    {
634        $this->container['webgl_basics'] = $webgl_basics;
635
636        return $this;
637    }
638
639    /**
640     * Gets screen_resolution.
641     *
642     * @return int[]|null
643     */
644    public function getScreenResolution(): ?array
645    {
646        return $this->container['screen_resolution'];
647    }
648
649    /**
650     * Sets screen_resolution.
651     *
652     * @param int[] $screen_resolution current screen resolution
653     *
654     */
655    public function setScreenResolution(array $screen_resolution): self
656    {
657        if (count($screen_resolution) > 2) {
658            throw new \InvalidArgumentException('invalid value for $screen_resolution when calling RawDeviceAttributes., number of items must be less than or equal to 2.');
659        }
660        if (count($screen_resolution) < 2) {
661            throw new \InvalidArgumentException('invalid length for $screen_resolution when calling RawDeviceAttributes., number of items must be greater than or equal to 2.');
662        }
663        $this->container['screen_resolution'] = $screen_resolution;
664
665        return $this;
666    }
667
668    /**
669     * Gets touch_support.
670     *
671     */
672    public function getTouchSupport(): ?TouchSupport
673    {
674        return $this->container['touch_support'];
675    }
676
677    /**
678     * Sets touch_support.
679     *
680     * @param TouchSupport $touch_support touch_support
681     *
682     */
683    public function setTouchSupport(TouchSupport $touch_support): self
684    {
685        $this->container['touch_support'] = $touch_support;
686
687        return $this;
688    }
689
690    /**
691     * Gets oscpu.
692     *
693     */
694    public function getOscpu(): ?string
695    {
696        return $this->container['oscpu'];
697    }
698
699    /**
700     * Sets oscpu.
701     *
702     * @param string $oscpu navigator `oscpu` string
703     *
704     */
705    public function setOscpu(string $oscpu): self
706    {
707        $this->container['oscpu'] = $oscpu;
708
709        return $this;
710    }
711
712    /**
713     * Gets architecture.
714     *
715     */
716    public function getArchitecture(): ?int
717    {
718        return $this->container['architecture'];
719    }
720
721    /**
722     * Sets architecture.
723     *
724     * @param int $architecture integer representing the CPU architecture exposed by the browser
725     *
726     */
727    public function setArchitecture(int $architecture): self
728    {
729        $this->container['architecture'] = $architecture;
730
731        return $this;
732    }
733
734    /**
735     * Gets cookies_enabled.
736     *
737     */
738    public function getCookiesEnabled(): ?bool
739    {
740        return $this->container['cookies_enabled'];
741    }
742
743    /**
744     * Sets cookies_enabled.
745     *
746     * @param bool $cookies_enabled whether the cookies are enabled in the browser
747     *
748     */
749    public function setCookiesEnabled(bool $cookies_enabled): self
750    {
751        $this->container['cookies_enabled'] = $cookies_enabled;
752
753        return $this;
754    }
755
756    /**
757     * Gets hardware_concurrency.
758     *
759     */
760    public function getHardwareConcurrency(): ?int
761    {
762        return $this->container['hardware_concurrency'];
763    }
764
765    /**
766     * Sets hardware_concurrency.
767     *
768     * @param int $hardware_concurrency number of logical CPU cores reported by the browser
769     *
770     */
771    public function setHardwareConcurrency(int $hardware_concurrency): self
772    {
773        if ($hardware_concurrency < 1) {
774            throw new \InvalidArgumentException('invalid value for $hardware_concurrency when calling RawDeviceAttributes., must be bigger than or equal to 1.');
775        }
776
777        $this->container['hardware_concurrency'] = $hardware_concurrency;
778
779        return $this;
780    }
781
782    /**
783     * Gets date_time_locale.
784     *
785     */
786    public function getDateTimeLocale(): ?string
787    {
788        return $this->container['date_time_locale'];
789    }
790
791    /**
792     * Sets date_time_locale.
793     *
794     * @param string $date_time_locale Locale derived from the Intl.DateTimeFormat API. Negative values indicate known error states. The negative statuses can be: - \"-1\": A permanent status for browsers that don't support Intl API. - \"-2\": A permanent status for browsers that don't supportDateTimeFormat constructor. - \"-3\": A permanent status for browsers in which DateTimeFormat locale is undefined or null.
795     *
796     */
797    public function setDateTimeLocale(string $date_time_locale): self
798    {
799        $this->container['date_time_locale'] = $date_time_locale;
800
801        return $this;
802    }
803
804    /**
805     * Gets vendor.
806     *
807     */
808    public function getVendor(): ?string
809    {
810        return $this->container['vendor'];
811    }
812
813    /**
814     * Sets vendor.
815     *
816     * @param string $vendor navigator vendor string
817     *
818     */
819    public function setVendor(string $vendor): self
820    {
821        $this->container['vendor'] = $vendor;
822
823        return $this;
824    }
825
826    /**
827     * Gets color_depth.
828     *
829     */
830    public function getColorDepth(): ?int
831    {
832        return $this->container['color_depth'];
833    }
834
835    /**
836     * Sets color_depth.
837     *
838     * @param int $color_depth screen color depth in bits
839     *
840     */
841    public function setColorDepth(int $color_depth): self
842    {
843        $this->container['color_depth'] = $color_depth;
844
845        return $this;
846    }
847
848    /**
849     * Gets platform.
850     *
851     */
852    public function getPlatform(): ?string
853    {
854        return $this->container['platform'];
855    }
856
857    /**
858     * Sets platform.
859     *
860     * @param string $platform navigator platform string
861     *
862     */
863    public function setPlatform(string $platform): self
864    {
865        $this->container['platform'] = $platform;
866
867        return $this;
868    }
869
870    /**
871     * Gets session_storage.
872     *
873     */
874    public function getSessionStorage(): ?bool
875    {
876        return $this->container['session_storage'];
877    }
878
879    /**
880     * Sets session_storage.
881     *
882     * @param bool $session_storage whether sessionStorage is available
883     *
884     */
885    public function setSessionStorage(bool $session_storage): self
886    {
887        $this->container['session_storage'] = $session_storage;
888
889        return $this;
890    }
891
892    /**
893     * Gets local_storage.
894     *
895     */
896    public function getLocalStorage(): ?bool
897    {
898        return $this->container['local_storage'];
899    }
900
901    /**
902     * Sets local_storage.
903     *
904     * @param bool $local_storage whether localStorage is available
905     *
906     */
907    public function setLocalStorage(bool $local_storage): self
908    {
909        $this->container['local_storage'] = $local_storage;
910
911        return $this;
912    }
913
914    /**
915     * Gets audio.
916     *
917     */
918    public function getAudio(): ?float
919    {
920        return $this->container['audio'];
921    }
922
923    /**
924     * Sets audio.
925     *
926     * @param float $audio AudioContext fingerprint or negative status when unavailable. The negative statuses can be: - -1: A permanent status for those browsers which are known to always suspend audio context - -2: A permanent status for browsers that don't support the signal - -3: A temporary status that means that an unexpected timeout has happened
927     *
928     */
929    public function setAudio(float $audio): self
930    {
931        $this->container['audio'] = $audio;
932
933        return $this;
934    }
935
936    /**
937     * Gets plugins.
938     *
939     * @return PluginsInner[]|null
940     */
941    public function getPlugins(): ?array
942    {
943        return $this->container['plugins'];
944    }
945
946    /**
947     * Sets plugins.
948     *
949     * @param PluginsInner[] $plugins Browser plugins reported by `navigator.plugins`.
950     *
951     */
952    public function setPlugins(array $plugins): self
953    {
954        $this->container['plugins'] = $plugins;
955
956        return $this;
957    }
958
959    /**
960     * Gets indexed_db.
961     *
962     */
963    public function getIndexedDb(): ?bool
964    {
965        return $this->container['indexed_db'];
966    }
967
968    /**
969     * Sets indexed_db.
970     *
971     * @param bool $indexed_db whether IndexedDB is available
972     *
973     */
974    public function setIndexedDb(bool $indexed_db): self
975    {
976        $this->container['indexed_db'] = $indexed_db;
977
978        return $this;
979    }
980
981    /**
982     * Gets math.
983     *
984     */
985    public function getMath(): ?string
986    {
987        return $this->container['math'];
988    }
989
990    /**
991     * Sets math.
992     *
993     * @param string $math hash of Math APIs used for entropy collection
994     *
995     */
996    public function setMath(string $math): self
997    {
998        $this->container['math'] = $math;
999
1000        return $this;
1001    }
1002
1003    /**
1004     * Returns true if offset exists. False otherwise.
1005     *
1006     * @param int|string $offset Offset
1007     *
1008     */
1009    public function offsetExists(mixed $offset): bool
1010    {
1011        return isset($this->container[$offset]);
1012    }
1013
1014    /**
1015     * Gets offset.
1016     *
1017     * @param int|string $offset Offset
1018     *
1019     * @return mixed|null
1020     */
1021    #[\ReturnTypeWillChange]
1022    public function offsetGet(mixed $offset): mixed
1023    {
1024        return $this->container[$offset] ?? null;
1025    }
1026
1027    /**
1028     * Sets value based on offset.
1029     *
1030     * @param int|null $offset Offset
1031     * @param mixed    $value  Value to be set
1032     *
1033     */
1034    public function offsetSet(mixed $offset, mixed $value): void
1035    {
1036        if (is_null($offset)) {
1037            $this->container[] = $value;
1038        } else {
1039            $this->container[$offset] = $value;
1040        }
1041    }
1042
1043    /**
1044     * Unsets offset.
1045     *
1046     * @param int|string $offset Offset
1047     *
1048     */
1049    public function offsetUnset(mixed $offset): void
1050    {
1051        unset($this->container[$offset]);
1052    }
1053
1054    /**
1055     * Serializes the object to a value that can be serialized natively by json_encode().
1056     *
1057     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
1058     *
1059     * @return mixed returns data which can be serialized by json_encode(), which is a value
1060     *               of any type other than a resource
1061     */
1062    #[\ReturnTypeWillChange]
1063    public function jsonSerialize(): mixed
1064    {
1065        return ObjectSerializer::sanitizeForSerialization($this);
1066    }
1067
1068    /**
1069     * Gets a header-safe presentation of the object.
1070     *
1071     */
1072    public function toHeaderValue(): string
1073    {
1074        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
1075    }
1076
1077    /**
1078     * Array of nullable properties.
1079     */
1080    protected static function openAPINullables(): array
1081    {
1082        return self::$openAPINullables;
1083    }
1084
1085    /**
1086     * Array of nullable field names deliberately set to null.
1087     *
1088     * @return bool[]
1089     */
1090    private function getOpenAPINullablesSetToNull(): array
1091    {
1092        return $this->openAPINullablesSetToNull;
1093    }
1094
1095    /**
1096     * Setter - Array of nullable field names deliberately set to null.
1097     *
1098     * @param bool[] $openAPINullablesSetToNull
1099     *
1100     * @codeCoverageIgnore
1101     */
1102    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
1103    {
1104        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
1105    }
1106
1107    /**
1108     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
1109     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
1110     * $this->openAPINullablesSetToNull array.
1111     *
1112     * @noinspection PhpSameParameterValueInspection
1113     */
1114    private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
1115    {
1116        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
1117            $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore
1118        }
1119
1120        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
1121    }
1122}