Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 40
0.00% covered (danger)
0.00%
0 / 23
CRAP
0.00% covered (danger)
0.00%
0 / 1
IPInfoV6
0.00% covered (danger)
0.00%
0 / 40
0.00% covered (danger)
0.00%
0 / 23
992
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
30
 __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 / 6
0.00% covered (danger)
0.00%
0 / 1
12
 valid
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAddress
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setAddress
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getGeolocation
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setGeolocation
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getAsn
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setAsn
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getDatacenter
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setDatacenter
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 * IPInfoV6.
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 * IPInfoV6 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 IPInfoV6 implements ModelInterface, \ArrayAccess
42{
43    /**
44     * The original name of the model.
45     *
46     */
47    protected static string $swaggerModelName = 'IPInfoV6';
48
49    /**
50     * Array of property to type mappings. Used for (de)serialization.
51     *
52     * @var string[]
53     */
54    protected static array $swaggerTypes = [
55        'address' => 'string',
56        'geolocation' => '\Fingerprint\ServerAPI\Model\Geolocation',
57        'asn' => '\Fingerprint\ServerAPI\Model\IPInfoASN',
58        'datacenter' => '\Fingerprint\ServerAPI\Model\IPInfoDataCenter'];
59
60    /**
61     * Array of property to format mappings. Used for (de)serialization.
62     *
63     * @var string[]
64     */
65    protected static array $swaggerFormats = [
66        'address' => 'ipv6',
67        'geolocation' => null,
68        'asn' => null,
69        'datacenter' => null];
70
71    /**
72     * Array of attributes where the key is the local name,
73     * and the value is the original name.
74     *
75     * @var string[]
76     */
77    protected static array $attributeMap = [
78        'address' => 'address',
79        'geolocation' => 'geolocation',
80        'asn' => 'asn',
81        'datacenter' => 'datacenter'];
82
83    /**
84     * Array of attributes to setter functions (for deserialization of responses).
85     *
86     * @var string[]
87     */
88    protected static array $setters = [
89        'address' => 'setAddress',
90        'geolocation' => 'setGeolocation',
91        'asn' => 'setAsn',
92        'datacenter' => 'setDatacenter'];
93
94    /**
95     * Array of attributes to getter functions (for serialization of requests).
96     *
97     * @var string[]
98     */
99    protected static array $getters = [
100        'address' => 'getAddress',
101        'geolocation' => 'getGeolocation',
102        'asn' => 'getAsn',
103        'datacenter' => 'getDatacenter'];
104
105    /**
106     * Associative array for storing property values.
107     *
108     * @var mixed[]
109     */
110    protected array $container = [];
111
112    /**
113     * Constructor.
114     *
115     * @param mixed[] $data Associated array of property values
116     *                      initializing the model
117     */
118    public function __construct(?array $data = null)
119    {
120        $this->container['address'] = isset($data['address']) ? $data['address'] : null;
121        $this->container['geolocation'] = isset($data['geolocation']) ? $data['geolocation'] : null;
122        $this->container['asn'] = isset($data['asn']) ? $data['asn'] : null;
123        $this->container['datacenter'] = isset($data['datacenter']) ? $data['datacenter'] : null;
124    }
125
126    /**
127     * Gets the string presentation of the object.
128     *
129     */
130    public function __toString(): string
131    {
132        return json_encode(ObjectSerializer::sanitizeForSerialization($this));
133    }
134
135    /**
136     * Array of property to type mappings. Used for (de)serialization.
137     */
138    public static function swaggerTypes(): array
139    {
140        return self::$swaggerTypes;
141    }
142
143    /**
144     * Array of property to format mappings. Used for (de)serialization.
145     */
146    public static function swaggerFormats(): array
147    {
148        return self::$swaggerFormats;
149    }
150
151    /**
152     * Array of attributes where the key is the local name,
153     * and the value is the original name.
154     */
155    public static function attributeMap(): array
156    {
157        return self::$attributeMap;
158    }
159
160    /**
161     * Array of attributes to setter functions (for deserialization of responses).
162     */
163    public static function setters(): array
164    {
165        return self::$setters;
166    }
167
168    /**
169     * Array of attributes to getter functions (for serialization of requests).
170     */
171    public static function getters(): array
172    {
173        return self::$getters;
174    }
175
176    /**
177     * The original name of the model.
178     */
179    public function getModelName(): string
180    {
181        return self::$swaggerModelName;
182    }
183
184    /**
185     * Show all the invalid properties with reasons.
186     *
187     * @return array invalid properties with reasons
188     */
189    public function listInvalidProperties(): array
190    {
191        $invalidProperties = [];
192
193        if (null === $this->container['address']) {
194            $invalidProperties[] = "'address' can't be null";
195        }
196        if (null === $this->container['geolocation']) {
197            $invalidProperties[] = "'geolocation' can't be null";
198        }
199
200        return $invalidProperties;
201    }
202
203    /**
204     * Validate all the properties in the model
205     * return true if all passed.
206     *
207     * @return bool True if all properties are valid
208     */
209    public function valid(): bool
210    {
211        return 0 === count($this->listInvalidProperties());
212    }
213
214    /**
215     * Gets address.
216     */
217    public function getAddress(): string
218    {
219        return $this->container['address'];
220    }
221
222    /**
223     * Sets address.
224     *
225     * @param string $address address
226     *
227     * @return $this
228     */
229    public function setAddress(string $address): self
230    {
231        $this->container['address'] = $address;
232
233        return $this;
234    }
235
236    /**
237     * Gets geolocation.
238     */
239    public function getGeolocation(): Geolocation
240    {
241        return $this->container['geolocation'];
242    }
243
244    /**
245     * Sets geolocation.
246     *
247     * @param Geolocation $geolocation geolocation
248     *
249     * @return $this
250     */
251    public function setGeolocation(Geolocation $geolocation): self
252    {
253        $this->container['geolocation'] = $geolocation;
254
255        return $this;
256    }
257
258    /**
259     * Gets asn.
260     */
261    public function getAsn(): ?IPInfoASN
262    {
263        return $this->container['asn'];
264    }
265
266    /**
267     * Sets asn.
268     *
269     * @param ?\Fingerprint\ServerAPI\Model\IPInfoASN $asn asn
270     *
271     * @return $this
272     */
273    public function setAsn(?IPInfoASN $asn): self
274    {
275        $this->container['asn'] = $asn;
276
277        return $this;
278    }
279
280    /**
281     * Gets datacenter.
282     */
283    public function getDatacenter(): ?IPInfoDataCenter
284    {
285        return $this->container['datacenter'];
286    }
287
288    /**
289     * Sets datacenter.
290     *
291     * @param ?\Fingerprint\ServerAPI\Model\IPInfoDataCenter $datacenter datacenter
292     *
293     * @return $this
294     */
295    public function setDatacenter(?IPInfoDataCenter $datacenter): self
296    {
297        $this->container['datacenter'] = $datacenter;
298
299        return $this;
300    }
301
302    /**
303     * Returns true if offset exists. False otherwise.
304     *
305     * @param int $offset Offset
306     */
307    public function offsetExists($offset): bool
308    {
309        return isset($this->container[$offset]);
310    }
311
312    /**
313     * Gets offset.
314     *
315     * @param int $offset Offset
316     */
317    public function offsetGet($offset): mixed
318    {
319        return isset($this->container[$offset]) ? $this->container[$offset] : null;
320    }
321
322    /**
323     * Sets value based on offset.
324     *
325     * @param int   $offset Offset
326     * @param mixed $value  Value to be set
327     */
328    public function offsetSet($offset, mixed $value): void
329    {
330        if (is_null($offset)) {
331            $this->container[] = $value;
332        } else {
333            $this->container[$offset] = $value;
334        }
335    }
336
337    /**
338     * Unsets offset.
339     *
340     * @param int $offset Offset
341     */
342    public function offsetUnset($offset): void
343    {
344        unset($this->container[$offset]);
345    }
346
347    /**
348     * Gets the string presentation of the object in a pretty JSON format.
349     *
350     */
351    public function toPrettyString(): string
352    {
353        return json_encode(
354            ObjectSerializer::sanitizeForSerialization($this),
355            JSON_PRETTY_PRINT
356        );
357    }
358}