Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
90.24% covered (success)
90.24%
37 / 41
88.89% covered (warning)
88.89%
24 / 27
CRAP
0.00% covered (danger)
0.00%
0 / 1
PluginsInner
90.24% covered (success)
90.24%
37 / 41
88.89% covered (warning)
88.89%
24 / 27
34.01
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
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%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
 valid
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getName
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setName
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getDescription
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setDescription
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getMimeTypes
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setMimeTypes
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 * PluginsInner.
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 * PluginsInner Class.
36 *
37 * @category Class
38 *
39 * @author   Fingerprint
40 *
41 * @see      https://fingerprint.com
42 *
43 * @implements \ArrayAccess<string, mixed>
44 *
45 * @noinspection GrazieInspection
46 * @noinspection RedundantSuppression
47 */
48class PluginsInner implements ModelInterface, \ArrayAccess, \JsonSerializable
49{
50    public const DISCRIMINATOR = null;
51
52    /**
53     * The original name of the model.
54     *
55     */
56    protected static string $openAPIModelName = 'Plugins_inner';
57
58    /**
59     * Array of property to type mappings. Used for (de)serialization.
60     *
61     * @var string[]
62     */
63    protected static array $openAPITypes = [
64        'name' => 'string',
65        'description' => 'string',
66        'mime_types' => '\Fingerprint\ServerSdk\Model\PluginsInnerMimeTypesInner[]',
67    ];
68
69    /**
70     * Array of property to format mappings. Used for (de)serialization.
71     *
72     * @var string[]
73     *
74     * @phpstan-var array<string, string|null>
75     *
76     * @psalm-var array<string, string|null>
77     */
78    protected static array $openAPIFormats = [
79        'name' => null,
80        'description' => null,
81        'mime_types' => null,
82    ];
83
84    /**
85     * Array of nullable properties. Used for (de)serialization.
86     *
87     * @var bool[]
88     */
89    protected static array $openAPINullables = [
90        'name' => false,
91        'description' => false,
92        'mime_types' => false,
93    ];
94
95    /**
96     * If a nullable field gets set to null, insert it here.
97     *
98     * @var bool[]
99     */
100    protected array $openAPINullablesSetToNull = [];
101
102    /**
103     * Array of attributes where the key is the local name,
104     * and the value is the original name.
105     *
106     * @var string[]
107     */
108    protected static array $attributeMap = [
109        'name' => 'name',
110        'description' => 'description',
111        'mime_types' => 'mimeTypes',
112    ];
113
114    /**
115     * Array of attributes to setter functions (for deserialization of responses).
116     *
117     * @var string[]
118     */
119    protected static array $setters = [
120        'name' => 'setName',
121        'description' => 'setDescription',
122        'mime_types' => 'setMimeTypes',
123    ];
124
125    /**
126     * Array of attributes to getter functions (for serialization of requests).
127     *
128     * @var string[]
129     */
130    protected static array $getters = [
131        'name' => 'getName',
132        'description' => 'getDescription',
133        'mime_types' => 'getMimeTypes',
134    ];
135
136    /**
137     * Associative array for storing property values.
138     */
139    protected array $container = [];
140
141    /**
142     * Constructor.
143     *
144     * @param array|null $data Associated array of property values
145     *                         initializing the model
146     *
147     * @noinspection DuplicatedCode
148     */
149    public function __construct(?array $data = null)
150    {
151        $this->setIfExists('name', $data ?? [], null);
152        $this->setIfExists('description', $data ?? [], null);
153        $this->setIfExists('mime_types', $data ?? [], null);
154    }
155
156    /**
157     * Gets the string presentation of the object.
158     *
159     */
160    public function __toString(): string
161    {
162        return json_encode(
163            ObjectSerializer::sanitizeForSerialization($this),
164            JSON_PRETTY_PRINT
165        );
166    }
167
168    /**
169     * Array of property to type mappings. Used for (de)serialization.
170     *
171     */
172    public static function openAPITypes(): array
173    {
174        return self::$openAPITypes;
175    }
176
177    /**
178     * Array of property to format mappings. Used for (de)serialization.
179     */
180    public static function openAPIFormats(): array
181    {
182        return self::$openAPIFormats;
183    }
184
185    /**
186     * Checks if a property is nullable.
187     *
188     */
189    public static function isNullable(string $property): bool
190    {
191        return self::openAPINullables()[$property] ?? false;
192    }
193
194    /**
195     * Checks if a nullable property is set to null.
196     *
197     */
198    public function isNullableSetToNull(string $property): bool
199    {
200        return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
201    }
202
203    /**
204     * Array of attributes where the key is the local name,
205     * and the value is the original name.
206     *
207     */
208    public static function attributeMap(): array
209    {
210        return self::$attributeMap;
211    }
212
213    /**
214     * Array of attributes to setter functions (for deserialization of responses).
215     *
216     */
217    public static function setters(): array
218    {
219        return self::$setters;
220    }
221
222    /**
223     * Array of attributes to getter functions (for serialization of requests).
224     *
225     */
226    public static function getters(): array
227    {
228        return self::$getters;
229    }
230
231    /**
232     * The original name of the model.
233     *
234     */
235    public function getModelName(): string
236    {
237        return self::$openAPIModelName;
238    }
239
240    /**
241     * Show all the invalid properties with reasons.
242     *
243     * @return array invalid properties with reasons
244     */
245    public function listInvalidProperties(): array
246    {
247        $invalidProperties = [];
248
249        if (null === $this->container['name']) {
250            $invalidProperties[] = "'name' can't be null";
251        }
252
253        return $invalidProperties;
254    }
255
256    /**
257     * Validate all the properties in the model
258     * return true if all passed.
259     *
260     * @return bool True if all properties are valid
261     */
262    public function valid(): bool
263    {
264        return 0 === count($this->listInvalidProperties());
265    }
266
267    /**
268     * Gets name.
269     *
270     */
271    public function getName(): ?string
272    {
273        return $this->container['name'];
274    }
275
276    /**
277     * Sets name.
278     *
279     * @param string $name name
280     *
281     */
282    public function setName(string $name): self
283    {
284        $this->container['name'] = $name;
285
286        return $this;
287    }
288
289    /**
290     * Gets description.
291     *
292     */
293    public function getDescription(): ?string
294    {
295        return $this->container['description'];
296    }
297
298    /**
299     * Sets description.
300     *
301     * @param string $description description
302     *
303     */
304    public function setDescription(string $description): self
305    {
306        $this->container['description'] = $description;
307
308        return $this;
309    }
310
311    /**
312     * Gets mime_types.
313     *
314     * @return PluginsInnerMimeTypesInner[]|null
315     */
316    public function getMimeTypes(): ?array
317    {
318        return $this->container['mime_types'];
319    }
320
321    /**
322     * Sets mime_types.
323     *
324     * @param PluginsInnerMimeTypesInner[] $mime_types mime_types
325     *
326     */
327    public function setMimeTypes(array $mime_types): self
328    {
329        $this->container['mime_types'] = $mime_types;
330
331        return $this;
332    }
333
334    /**
335     * Returns true if offset exists. False otherwise.
336     *
337     * @param int|string $offset Offset
338     *
339     */
340    public function offsetExists(mixed $offset): bool
341    {
342        return isset($this->container[$offset]);
343    }
344
345    /**
346     * Gets offset.
347     *
348     * @param int|string $offset Offset
349     *
350     * @return mixed|null
351     */
352    #[\ReturnTypeWillChange]
353    public function offsetGet(mixed $offset): mixed
354    {
355        return $this->container[$offset] ?? null;
356    }
357
358    /**
359     * Sets value based on offset.
360     *
361     * @param int|null $offset Offset
362     * @param mixed    $value  Value to be set
363     *
364     */
365    public function offsetSet(mixed $offset, mixed $value): void
366    {
367        if (is_null($offset)) {
368            $this->container[] = $value;
369        } else {
370            $this->container[$offset] = $value;
371        }
372    }
373
374    /**
375     * Unsets offset.
376     *
377     * @param int|string $offset Offset
378     *
379     */
380    public function offsetUnset(mixed $offset): void
381    {
382        unset($this->container[$offset]);
383    }
384
385    /**
386     * Serializes the object to a value that can be serialized natively by json_encode().
387     *
388     * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php
389     *
390     * @return mixed returns data which can be serialized by json_encode(), which is a value
391     *               of any type other than a resource
392     */
393    #[\ReturnTypeWillChange]
394    public function jsonSerialize(): mixed
395    {
396        return ObjectSerializer::sanitizeForSerialization($this);
397    }
398
399    /**
400     * Gets a header-safe presentation of the object.
401     *
402     */
403    public function toHeaderValue(): string
404    {
405        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
406    }
407
408    /**
409     * Array of nullable properties.
410     */
411    protected static function openAPINullables(): array
412    {
413        return self::$openAPINullables;
414    }
415
416    /**
417     * Array of nullable field names deliberately set to null.
418     *
419     * @return bool[]
420     */
421    private function getOpenAPINullablesSetToNull(): array
422    {
423        return $this->openAPINullablesSetToNull;
424    }
425
426    /**
427     * Setter - Array of nullable field names deliberately set to null.
428     *
429     * @param bool[] $openAPINullablesSetToNull
430     *
431     * @codeCoverageIgnore
432     */
433    private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
434    {
435        $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
436    }
437
438    /**
439     * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
440     * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
441     * $this->openAPINullablesSetToNull array.
442     *
443     * @noinspection PhpSameParameterValueInspection
444     */
445    private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void
446    {
447        if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
448            $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore
449        }
450
451        $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
452    }
453}