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