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