Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
96.00% covered (success)
96.00%
48 / 50
93.94% covered (success)
93.94%
31 / 33
CRAP
0.00% covered (danger)
0.00%
0 / 1
WebGlBasics
96.00% covered (success)
96.00%
48 / 50
93.94% covered (success)
93.94%
31 / 33
38
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
6 / 6
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
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 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
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 valid
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getVersion
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setVersion
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getVendor
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setVendor
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getVendorUnmasked
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setVendorUnmasked
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getRenderer
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRenderer
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getRendererUnmasked
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRendererUnmasked
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getShadingLanguageVersion
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setShadingLanguageVersion
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 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 * WebGlBasics.
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 * Render and vendor strings reported by the WebGL context.
36 *
37 * @category Class
38 *
39 * @description Render and vendor strings reported by the WebGL context.
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 WebGlBasics 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 = 'WebGlBasics';
59
60    /**
61     * Array of property to type mappings. Used for (de)serialization.
62     *
63     * @var string[]
64     */
65    protected static array $openAPITypes = [
66        'version' => 'string',
67        'vendor' => 'string',
68        'vendor_unmasked' => 'string',
69        'renderer' => 'string',
70        'renderer_unmasked' => 'string',
71        'shading_language_version' => 'string',
72    ];
73
74    /**
75     * Array of property to format mappings. Used for (de)serialization.
76     *
77     * @var string[]
78     *
79     * @phpstan-var array<string, string|null>
80     *
81     * @psalm-var array<string, string|null>
82     */
83    protected static array $openAPIFormats = [
84        'version' => null,
85        'vendor' => null,
86        'vendor_unmasked' => null,
87        'renderer' => null,
88        'renderer_unmasked' => null,
89        'shading_language_version' => null,
90    ];
91
92    /**
93     * Array of nullable properties. Used for (de)serialization.
94     *
95     * @var bool[]
96     */
97    protected static array $openAPINullables = [
98        'version' => false,
99        'vendor' => false,
100        'vendor_unmasked' => false,
101        'renderer' => false,
102        'renderer_unmasked' => false,
103        'shading_language_version' => false,
104    ];
105
106    /**
107     * If a nullable field gets set to null, insert it here.
108     *
109     * @var bool[]
110     */
111    protected array $openAPINullablesSetToNull = [];
112
113    /**
114     * Array of attributes where the key is the local name,
115     * and the value is the original name.
116     *
117     * @var string[]
118     */
119    protected static array $attributeMap = [
120        'version' => 'version',
121        'vendor' => 'vendor',
122        'vendor_unmasked' => 'vendor_unmasked',
123        'renderer' => 'renderer',
124        'renderer_unmasked' => 'renderer_unmasked',
125        'shading_language_version' => 'shading_language_version',
126    ];
127
128    /**
129     * Array of attributes to setter functions (for deserialization of responses).
130     *
131     * @var string[]
132     */
133    protected static array $setters = [
134        'version' => 'setVersion',
135        'vendor' => 'setVendor',
136        'vendor_unmasked' => 'setVendorUnmasked',
137        'renderer' => 'setRenderer',
138        'renderer_unmasked' => 'setRendererUnmasked',
139        'shading_language_version' => 'setShadingLanguageVersion',
140    ];
141
142    /**
143     * Array of attributes to getter functions (for serialization of requests).
144     *
145     * @var string[]
146     */
147    protected static array $getters = [
148        'version' => 'getVersion',
149        'vendor' => 'getVendor',
150        'vendor_unmasked' => 'getVendorUnmasked',
151        'renderer' => 'getRenderer',
152        'renderer_unmasked' => 'getRendererUnmasked',
153        'shading_language_version' => 'getShadingLanguageVersion',
154    ];
155
156    /**
157     * Associative array for storing property values.
158     */
159    protected array $container = [];
160
161    /**
162     * Constructor.
163     *
164     * @param array|null $data Associated array of property values
165     *                         initializing the model
166     *
167     * @noinspection DuplicatedCode
168     */
169    public function __construct(?array $data = null)
170    {
171        $this->setIfExists('version', $data ?? [], null);
172        $this->setIfExists('vendor', $data ?? [], null);
173        $this->setIfExists('vendor_unmasked', $data ?? [], null);
174        $this->setIfExists('renderer', $data ?? [], null);
175        $this->setIfExists('renderer_unmasked', $data ?? [], null);
176        $this->setIfExists('shading_language_version', $data ?? [], null);
177    }
178
179    /**
180     * Gets the string presentation of the object.
181     *
182     */
183    public function __toString(): string
184    {
185        return json_encode(
186            ObjectSerializer::sanitizeForSerialization($this),
187            JSON_PRETTY_PRINT
188        );
189    }
190
191    /**
192     * Array of property to type mappings. Used for (de)serialization.
193     *
194     */
195    public static function openAPITypes(): array
196    {
197        return self::$openAPITypes;
198    }
199
200    /**
201     * Array of property to format mappings. Used for (de)serialization.
202     */
203    public static function openAPIFormats(): array
204    {
205        return self::$openAPIFormats;
206    }
207
208    /**
209     * Checks if a property is nullable.
210     *
211     */
212    public static function isNullable(string $property): bool
213    {
214        return self::openAPINullables()[$property] ?? false;
215    }
216
217    /**
218     * Checks if a nullable property is set to null.
219     *
220     */
221    public function isNullableSetToNull(string $property): bool
222    {
223        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
224    }
225
226    /**
227     * Array of attributes where the key is the local name,
228     * and the value is the original name.
229     *
230     */
231    public static function attributeMap(): array
232    {
233        return self::$attributeMap;
234    }
235
236    /**
237     * Array of attributes to setter functions (for deserialization of responses).
238     *
239     */
240    public static function setters(): array
241    {
242        return self::$setters;
243    }
244
245    /**
246     * Array of attributes to getter functions (for serialization of requests).
247     *
248     */
249    public static function getters(): array
250    {
251        return self::$getters;
252    }
253
254    /**
255     * The original name of the model.
256     *
257     */
258    public function getModelName(): string
259    {
260        return self::$openAPIModelName;
261    }
262
263    /**
264     * Show all the invalid properties with reasons.
265     *
266     * @return array invalid properties with reasons
267     */
268    public function listInvalidProperties(): array
269    {
270        return [];
271    }
272
273    /**
274     * Validate all the properties in the model
275     * return true if all passed.
276     *
277     * @return bool True if all properties are valid
278     */
279    public function valid(): bool
280    {
281        return 0 === count($this->listInvalidProperties());
282    }
283
284    /**
285     * Gets version.
286     *
287     */
288    public function getVersion(): ?string
289    {
290        return $this->container['version'];
291    }
292
293    /**
294     * Sets version.
295     *
296     * @param string $version version
297     *
298     */
299    public function setVersion(string $version): self
300    {
301        $this->container['version'] = $version;
302
303        return $this;
304    }
305
306    /**
307     * Gets vendor.
308     *
309     */
310    public function getVendor(): ?string
311    {
312        return $this->container['vendor'];
313    }
314
315    /**
316     * Sets vendor.
317     *
318     * @param string $vendor vendor
319     *
320     */
321    public function setVendor(string $vendor): self
322    {
323        $this->container['vendor'] = $vendor;
324
325        return $this;
326    }
327
328    /**
329     * Gets vendor_unmasked.
330     *
331     */
332    public function getVendorUnmasked(): ?string
333    {
334        return $this->container['vendor_unmasked'];
335    }
336
337    /**
338     * Sets vendor_unmasked.
339     *
340     * @param string $vendor_unmasked vendor_unmasked
341     *
342     */
343    public function setVendorUnmasked(string $vendor_unmasked): self
344    {
345        $this->container['vendor_unmasked'] = $vendor_unmasked;
346
347        return $this;
348    }
349
350    /**
351     * Gets renderer.
352     *
353     */
354    public function getRenderer(): ?string
355    {
356        return $this->container['renderer'];
357    }
358
359    /**
360     * Sets renderer.
361     *
362     * @param string $renderer renderer
363     *
364     */
365    public function setRenderer(string $renderer): self
366    {
367        $this->container['renderer'] = $renderer;
368
369        return $this;
370    }
371
372    /**
373     * Gets renderer_unmasked.
374     *
375     */
376    public function getRendererUnmasked(): ?string
377    {
378        return $this->container['renderer_unmasked'];
379    }
380
381    /**
382     * Sets renderer_unmasked.
383     *
384     * @param string $renderer_unmasked renderer_unmasked
385     *
386     */
387    public function setRendererUnmasked(string $renderer_unmasked): self
388    {
389        $this->container['renderer_unmasked'] = $renderer_unmasked;
390
391        return $this;
392    }
393
394    /**
395     * Gets shading_language_version.
396     *
397     */
398    public function getShadingLanguageVersion(): ?string
399    {
400        return $this->container['shading_language_version'];
401    }
402
403    /**
404     * Sets shading_language_version.
405     *
406     * @param string $shading_language_version shading_language_version
407     *
408     */
409    public function setShadingLanguageVersion(string $shading_language_version): self
410    {
411        $this->container['shading_language_version'] = $shading_language_version;
412
413        return $this;
414    }
415
416    /**
417     * Returns true if offset exists. False otherwise.
418     *
419     * @param int|string $offset Offset
420     *
421     */
422    public function offsetExists(mixed $offset): bool
423    {
424        return isset($this->container[$offset]);
425    }
426
427    /**
428     * Gets offset.
429     *
430     * @param int|string $offset Offset
431     *
432     * @return mixed|null
433     */
434    #[\ReturnTypeWillChange]
435    public function offsetGet(mixed $offset): mixed
436    {
437        return $this->container[$offset] ?? null;
438    }
439
440    /**
441     * Sets value based on offset.
442     *
443     * @param int|null $offset Offset
444     * @param mixed    $value  Value to be set
445     *
446     */
447    public function offsetSet(mixed $offset, mixed $value): void
448    {
449        if (is_null($offset)) {
450            $this->container[] = $value;
451        } else {
452            $this->container[$offset] = $value;
453        }
454    }
455
456    /**
457     * Unsets offset.
458     *
459     * @param int|string $offset Offset
460     *
461     */
462    public function offsetUnset(mixed $offset): void
463    {
464        unset($this->container[$offset]);
465    }
466
467    /**
468     * Serializes the object to a value that can be serialized natively by json_encode().
469     *
470     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
471     *
472     * @return mixed returns data which can be serialized by json_encode(), which is a value
473     *               of any type other than a resource
474     */
475    #[\ReturnTypeWillChange]
476    public function jsonSerialize(): mixed
477    {
478        return ObjectSerializer::sanitizeForSerialization($this);
479    }
480
481    /**
482     * Gets a header-safe presentation of the object.
483     *
484     */
485    public function toHeaderValue(): string
486    {
487        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
488    }
489
490    /**
491     * Array of nullable properties.
492     */
493    protected static function openAPINullables(): array
494    {
495        return self::$openAPINullables;
496    }
497
498    /**
499     * Array of nullable field names deliberately set to null.
500     *
501     * @return bool[]
502     */
503    private function getOpenAPINullablesSetToNull(): array
504    {
505        return $this->openAPINullablesSetToNull;
506    }
507
508    /**
509     * Setter - Array of nullable field names deliberately set to null.
510     *
511     * @param bool[] $openAPINullablesSetToNull
512     *
513     * @codeCoverageIgnore
514     */
515    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
516    {
517        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
518    }
519
520    /**
521     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
522     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
523     * $this->openAPINullablesSetToNull array.
524     *
525     * @noinspection PhpSameParameterValueInspection
526     */
527    private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
528    {
529        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
530            $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore
531        }
532
533        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
534    }
535}