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