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