Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 55
0.00% covered (danger)
0.00%
0 / 33
CRAP
0.00% covered (danger)
0.00%
0 / 1
Geolocation
0.00% covered (danger)
0.00%
0 / 55
0.00% covered (danger)
0.00%
0 / 33
1980
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
110
 __toString
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 swaggerTypes
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 swaggerFormats
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
 getAccuracyRadius
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setAccuracyRadius
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getLatitude
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setLatitude
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getLongitude
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setLongitude
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getPostalCode
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setPostalCode
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getTimezone
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setTimezone
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getCity
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setCity
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getCountry
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setCountry
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getContinent
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setContinent
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getSubdivisions
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setSubdivisions
0.00% covered (danger)
0.00%
0 / 2
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
6
 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
 toPrettyString
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Geolocation.
4 *
5 * @category Class
6 *
7 * @author   Swagger Codegen team
8 *
9 * @see     https://github.com/swagger-api/swagger-codegen
10 */
11
12/**
13 * Fingerprint Pro Server API.
14 *
15 * Fingerprint Pro Server API allows you to get information about visitors and about individual 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.
16 *
17 * OpenAPI spec version: 3
18 * Contact: support@fingerprint.com
19 * Generated by: https://github.com/swagger-api/swagger-codegen.git
20 * Swagger Codegen version: 3.0.34
21 */
22/**
23 * NOTE: This class is auto generated by the swagger code generator program.
24 * https://github.com/swagger-api/swagger-codegen
25 * Do not edit the class manually.
26 */
27
28namespace Fingerprint\ServerAPI\Model;
29
30use Fingerprint\ServerAPI\ObjectSerializer;
31
32/**
33 * Geolocation Class Doc Comment.
34 *
35 * @category Class
36 *
37 * @author   Swagger Codegen team
38 *
39 * @see     https://github.com/swagger-api/swagger-codegen
40 */
41class Geolocation implements ModelInterface, \ArrayAccess
42{
43    /**
44     * The original name of the model.
45     *
46     */
47    protected static string $swaggerModelName = 'Geolocation';
48
49    /**
50     * Array of property to type mappings. Used for (de)serialization.
51     *
52     * @var string[]
53     */
54    protected static array $swaggerTypes = [
55        'accuracy_radius' => 'int',
56        'latitude' => 'double',
57        'longitude' => 'double',
58        'postal_code' => 'string',
59        'timezone' => 'string',
60        'city' => '\Fingerprint\ServerAPI\Model\GeolocationCity',
61        'country' => '\Fingerprint\ServerAPI\Model\GeolocationCountry',
62        'continent' => '\Fingerprint\ServerAPI\Model\GeolocationContinent',
63        'subdivisions' => '\Fingerprint\ServerAPI\Model\GeolocationSubdivisions'];
64
65    /**
66     * Array of property to format mappings. Used for (de)serialization.
67     *
68     * @var string[]
69     */
70    protected static array $swaggerFormats = [
71        'accuracy_radius' => null,
72        'latitude' => 'double',
73        'longitude' => 'double',
74        'postal_code' => null,
75        'timezone' => 'timezone',
76        'city' => null,
77        'country' => null,
78        'continent' => null,
79        'subdivisions' => null];
80
81    /**
82     * Array of attributes where the key is the local name,
83     * and the value is the original name.
84     *
85     * @var string[]
86     */
87    protected static array $attributeMap = [
88        'accuracy_radius' => 'accuracyRadius',
89        'latitude' => 'latitude',
90        'longitude' => 'longitude',
91        'postal_code' => 'postalCode',
92        'timezone' => 'timezone',
93        'city' => 'city',
94        'country' => 'country',
95        'continent' => 'continent',
96        'subdivisions' => 'subdivisions'];
97
98    /**
99     * Array of attributes to setter functions (for deserialization of responses).
100     *
101     * @var string[]
102     */
103    protected static array $setters = [
104        'accuracy_radius' => 'setAccuracyRadius',
105        'latitude' => 'setLatitude',
106        'longitude' => 'setLongitude',
107        'postal_code' => 'setPostalCode',
108        'timezone' => 'setTimezone',
109        'city' => 'setCity',
110        'country' => 'setCountry',
111        'continent' => 'setContinent',
112        'subdivisions' => 'setSubdivisions'];
113
114    /**
115     * Array of attributes to getter functions (for serialization of requests).
116     *
117     * @var string[]
118     */
119    protected static array $getters = [
120        'accuracy_radius' => 'getAccuracyRadius',
121        'latitude' => 'getLatitude',
122        'longitude' => 'getLongitude',
123        'postal_code' => 'getPostalCode',
124        'timezone' => 'getTimezone',
125        'city' => 'getCity',
126        'country' => 'getCountry',
127        'continent' => 'getContinent',
128        'subdivisions' => 'getSubdivisions'];
129
130    /**
131     * Associative array for storing property values.
132     *
133     * @var mixed[]
134     */
135    protected array $container = [];
136
137    /**
138     * Constructor.
139     *
140     * @param mixed[] $data Associated array of property values
141     *                      initializing the model
142     */
143    public function __construct(?array $data = null)
144    {
145        $this->container['accuracy_radius'] = isset($data['accuracy_radius']) ? $data['accuracy_radius'] : null;
146        $this->container['latitude'] = isset($data['latitude']) ? $data['latitude'] : null;
147        $this->container['longitude'] = isset($data['longitude']) ? $data['longitude'] : null;
148        $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null;
149        $this->container['timezone'] = isset($data['timezone']) ? $data['timezone'] : null;
150        $this->container['city'] = isset($data['city']) ? $data['city'] : null;
151        $this->container['country'] = isset($data['country']) ? $data['country'] : null;
152        $this->container['continent'] = isset($data['continent']) ? $data['continent'] : null;
153        $this->container['subdivisions'] = isset($data['subdivisions']) ? $data['subdivisions'] : null;
154    }
155
156    /**
157     * Gets the string presentation of the object.
158     *
159     */
160    public function __toString(): string
161    {
162        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
163    }
164
165    /**
166     * Array of property to type mappings. Used for (de)serialization.
167     */
168    public static function swaggerTypes(): array
169    {
170        return self::$swaggerTypes;
171    }
172
173    /**
174     * Array of property to format mappings. Used for (de)serialization.
175     */
176    public static function swaggerFormats(): array
177    {
178        return self::$swaggerFormats;
179    }
180
181    /**
182     * Array of attributes where the key is the local name,
183     * and the value is the original name.
184     */
185    public static function attributeMap(): array
186    {
187        return self::$attributeMap;
188    }
189
190    /**
191     * Array of attributes to setter functions (for deserialization of responses).
192     */
193    public static function setters(): array
194    {
195        return self::$setters;
196    }
197
198    /**
199     * Array of attributes to getter functions (for serialization of requests).
200     */
201    public static function getters(): array
202    {
203        return self::$getters;
204    }
205
206    /**
207     * The original name of the model.
208     */
209    public function getModelName(): string
210    {
211        return self::$swaggerModelName;
212    }
213
214    /**
215     * Show all the invalid properties with reasons.
216     *
217     * @return array invalid properties with reasons
218     */
219    public function listInvalidProperties(): array
220    {
221        return [];
222    }
223
224    /**
225     * Validate all the properties in the model
226     * return true if all passed.
227     *
228     * @return bool True if all properties are valid
229     */
230    public function valid(): bool
231    {
232        return 0 === count($this->listInvalidProperties());
233    }
234
235    /**
236     * Gets accuracy_radius.
237     */
238    public function getAccuracyRadius(): ?int
239    {
240        return $this->container['accuracy_radius'];
241    }
242
243    /**
244     * Sets accuracy_radius.
245     *
246     * @param ?int $accuracy_radius the IP address is likely to be within this radius (in km) of the specified location
247     *
248     * @return $this
249     */
250    public function setAccuracyRadius(?int $accuracy_radius): self
251    {
252        $this->container['accuracy_radius'] = $accuracy_radius;
253
254        return $this;
255    }
256
257    /**
258     * Gets latitude.
259     *
260     * @return ?double
261     */
262    public function getLatitude(): ?float
263    {
264        return $this->container['latitude'];
265    }
266
267    /**
268     * Sets latitude.
269     *
270     * @param ?double $latitude latitude
271     *
272     * @return $this
273     */
274    public function setLatitude(?float $latitude): self
275    {
276        $this->container['latitude'] = $latitude;
277
278        return $this;
279    }
280
281    /**
282     * Gets longitude.
283     *
284     * @return ?double
285     */
286    public function getLongitude(): ?float
287    {
288        return $this->container['longitude'];
289    }
290
291    /**
292     * Sets longitude.
293     *
294     * @param ?double $longitude longitude
295     *
296     * @return $this
297     */
298    public function setLongitude(?float $longitude): self
299    {
300        $this->container['longitude'] = $longitude;
301
302        return $this;
303    }
304
305    /**
306     * Gets postal_code.
307     */
308    public function getPostalCode(): ?string
309    {
310        return $this->container['postal_code'];
311    }
312
313    /**
314     * Sets postal_code.
315     *
316     * @param ?string $postal_code postal_code
317     *
318     * @return $this
319     */
320    public function setPostalCode(?string $postal_code): self
321    {
322        $this->container['postal_code'] = $postal_code;
323
324        return $this;
325    }
326
327    /**
328     * Gets timezone.
329     */
330    public function getTimezone(): ?string
331    {
332        return $this->container['timezone'];
333    }
334
335    /**
336     * Sets timezone.
337     *
338     * @param ?string $timezone timezone
339     *
340     * @return $this
341     */
342    public function setTimezone(?string $timezone): self
343    {
344        $this->container['timezone'] = $timezone;
345
346        return $this;
347    }
348
349    /**
350     * Gets city.
351     */
352    public function getCity(): ?GeolocationCity
353    {
354        return $this->container['city'];
355    }
356
357    /**
358     * Sets city.
359     *
360     * @param ?\Fingerprint\ServerAPI\Model\GeolocationCity $city city
361     *
362     * @return $this
363     */
364    public function setCity(?GeolocationCity $city): self
365    {
366        $this->container['city'] = $city;
367
368        return $this;
369    }
370
371    /**
372     * Gets country.
373     */
374    public function getCountry(): ?GeolocationCountry
375    {
376        return $this->container['country'];
377    }
378
379    /**
380     * Sets country.
381     *
382     * @param ?\Fingerprint\ServerAPI\Model\GeolocationCountry $country country
383     *
384     * @return $this
385     */
386    public function setCountry(?GeolocationCountry $country): self
387    {
388        $this->container['country'] = $country;
389
390        return $this;
391    }
392
393    /**
394     * Gets continent.
395     */
396    public function getContinent(): ?GeolocationContinent
397    {
398        return $this->container['continent'];
399    }
400
401    /**
402     * Sets continent.
403     *
404     * @param ?\Fingerprint\ServerAPI\Model\GeolocationContinent $continent continent
405     *
406     * @return $this
407     */
408    public function setContinent(?GeolocationContinent $continent): self
409    {
410        $this->container['continent'] = $continent;
411
412        return $this;
413    }
414
415    /**
416     * Gets subdivisions.
417     */
418    public function getSubdivisions(): ?GeolocationSubdivisions
419    {
420        return $this->container['subdivisions'];
421    }
422
423    /**
424     * Sets subdivisions.
425     *
426     * @param ?\Fingerprint\ServerAPI\Model\GeolocationSubdivisions $subdivisions subdivisions
427     *
428     * @return $this
429     */
430    public function setSubdivisions(?GeolocationSubdivisions $subdivisions): self
431    {
432        $this->container['subdivisions'] = $subdivisions;
433
434        return $this;
435    }
436
437    /**
438     * Returns true if offset exists. False otherwise.
439     *
440     * @param int $offset Offset
441     */
442    public function offsetExists($offset): bool
443    {
444        return isset($this->container[$offset]);
445    }
446
447    /**
448     * Gets offset.
449     *
450     * @param int $offset Offset
451     */
452    public function offsetGet($offset): mixed
453    {
454        return isset($this->container[$offset]) ? $this->container[$offset] : null;
455    }
456
457    /**
458     * Sets value based on offset.
459     *
460     * @param int   $offset Offset
461     * @param mixed $value  Value to be set
462     */
463    public function offsetSet($offset, mixed $value): void
464    {
465        if (is_null($offset)) {
466            $this->container[] = $value;
467        } else {
468            $this->container[$offset] = $value;
469        }
470    }
471
472    /**
473     * Unsets offset.
474     *
475     * @param int $offset Offset
476     */
477    public function offsetUnset($offset): void
478    {
479        unset($this->container[$offset]);
480    }
481
482    /**
483     * Gets the string presentation of the object in a pretty JSON format.
484     *
485     */
486    public function toPrettyString(): string
487    {
488        return json_encode(
489            ObjectSerializer::sanitizeForSerialization($this),
490            JSON_PRETTY_PRINT
491        );
492    }
493}