Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
38.71% |
24 / 62 |
|
37.93% |
11 / 29 |
CRAP | |
0.00% |
0 / 1 |
| Velocity | |
38.71% |
24 / 62 |
|
37.93% |
11 / 29 |
511.23 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
8 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| swaggerTypes | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| swaggerFormats | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| attributeMap | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setters | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getters | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getModelName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| listInvalidProperties | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
72 | |||
| valid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getDistinctIp | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDistinctIp | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDistinctLinkedId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDistinctLinkedId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDistinctCountry | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDistinctCountry | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getEvents | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setEvents | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getIpEvents | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setIpEvents | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDistinctIpByLinkedId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDistinctIpByLinkedId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDistinctVisitorIdByLinkedId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setDistinctVisitorIdByLinkedId | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| offsetExists | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| offsetGet | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |||
| offsetSet | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| offsetUnset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| toPrettyString | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Velocity. |
| 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 Server API. |
| 14 | * |
| 15 | * Fingerprint Server API allows you to search, update, and delete identification 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 | |
| 28 | namespace Fingerprint\ServerAPI\Model; |
| 29 | |
| 30 | use Fingerprint\ServerAPI\ObjectSerializer; |
| 31 | |
| 32 | /** |
| 33 | * Velocity Class Doc Comment. |
| 34 | * |
| 35 | * @category Class |
| 36 | * |
| 37 | * @description Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor ID. - Number of distinct linked IDs associated with the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked ID. - Number of distinct visitor IDs associated with the provided linked ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. |
| 38 | * |
| 39 | * @author Swagger Codegen team |
| 40 | * |
| 41 | * @see https://github.com/swagger-api/swagger-codegen |
| 42 | */ |
| 43 | class Velocity implements ModelInterface, \ArrayAccess |
| 44 | { |
| 45 | /** |
| 46 | * The original name of the model. |
| 47 | * |
| 48 | */ |
| 49 | protected static string $swaggerModelName = 'Velocity'; |
| 50 | |
| 51 | /** |
| 52 | * Array of property to type mappings. Used for (de)serialization. |
| 53 | * |
| 54 | * @var string[] |
| 55 | */ |
| 56 | protected static array $swaggerTypes = [ |
| 57 | 'distinct_ip' => '\Fingerprint\ServerAPI\Model\VelocityData', |
| 58 | 'distinct_linked_id' => '\Fingerprint\ServerAPI\Model\VelocityData', |
| 59 | 'distinct_country' => '\Fingerprint\ServerAPI\Model\VelocityData', |
| 60 | 'events' => '\Fingerprint\ServerAPI\Model\VelocityData', |
| 61 | 'ip_events' => '\Fingerprint\ServerAPI\Model\VelocityData', |
| 62 | 'distinct_ip_by_linked_id' => '\Fingerprint\ServerAPI\Model\VelocityData', |
| 63 | 'distinct_visitor_id_by_linked_id' => '\Fingerprint\ServerAPI\Model\VelocityData']; |
| 64 | |
| 65 | /** |
| 66 | * Array of property to format mappings. Used for (de)serialization. |
| 67 | * |
| 68 | * @var string[] |
| 69 | */ |
| 70 | protected static array $swaggerFormats = [ |
| 71 | 'distinct_ip' => null, |
| 72 | 'distinct_linked_id' => null, |
| 73 | 'distinct_country' => null, |
| 74 | 'events' => null, |
| 75 | 'ip_events' => null, |
| 76 | 'distinct_ip_by_linked_id' => null, |
| 77 | 'distinct_visitor_id_by_linked_id' => null]; |
| 78 | |
| 79 | /** |
| 80 | * Array of attributes where the key is the local name, |
| 81 | * and the value is the original name. |
| 82 | * |
| 83 | * @var string[] |
| 84 | */ |
| 85 | protected static array $attributeMap = [ |
| 86 | 'distinct_ip' => 'distinctIp', |
| 87 | 'distinct_linked_id' => 'distinctLinkedId', |
| 88 | 'distinct_country' => 'distinctCountry', |
| 89 | 'events' => 'events', |
| 90 | 'ip_events' => 'ipEvents', |
| 91 | 'distinct_ip_by_linked_id' => 'distinctIpByLinkedId', |
| 92 | 'distinct_visitor_id_by_linked_id' => 'distinctVisitorIdByLinkedId']; |
| 93 | |
| 94 | /** |
| 95 | * Array of attributes to setter functions (for deserialization of responses). |
| 96 | * |
| 97 | * @var string[] |
| 98 | */ |
| 99 | protected static array $setters = [ |
| 100 | 'distinct_ip' => 'setDistinctIp', |
| 101 | 'distinct_linked_id' => 'setDistinctLinkedId', |
| 102 | 'distinct_country' => 'setDistinctCountry', |
| 103 | 'events' => 'setEvents', |
| 104 | 'ip_events' => 'setIpEvents', |
| 105 | 'distinct_ip_by_linked_id' => 'setDistinctIpByLinkedId', |
| 106 | 'distinct_visitor_id_by_linked_id' => 'setDistinctVisitorIdByLinkedId']; |
| 107 | |
| 108 | /** |
| 109 | * Array of attributes to getter functions (for serialization of requests). |
| 110 | * |
| 111 | * @var string[] |
| 112 | */ |
| 113 | protected static array $getters = [ |
| 114 | 'distinct_ip' => 'getDistinctIp', |
| 115 | 'distinct_linked_id' => 'getDistinctLinkedId', |
| 116 | 'distinct_country' => 'getDistinctCountry', |
| 117 | 'events' => 'getEvents', |
| 118 | 'ip_events' => 'getIpEvents', |
| 119 | 'distinct_ip_by_linked_id' => 'getDistinctIpByLinkedId', |
| 120 | 'distinct_visitor_id_by_linked_id' => 'getDistinctVisitorIdByLinkedId']; |
| 121 | |
| 122 | /** |
| 123 | * Associative array for storing property values. |
| 124 | * |
| 125 | * @var mixed[] |
| 126 | */ |
| 127 | protected array $container = []; |
| 128 | |
| 129 | /** |
| 130 | * Constructor. |
| 131 | * |
| 132 | * @param mixed[] $data Associated array of property values |
| 133 | * initializing the model |
| 134 | */ |
| 135 | public function __construct(?array $data = null) |
| 136 | { |
| 137 | $this->container['distinct_ip'] = isset($data['distinct_ip']) ? $data['distinct_ip'] : null; |
| 138 | $this->container['distinct_linked_id'] = isset($data['distinct_linked_id']) ? $data['distinct_linked_id'] : null; |
| 139 | $this->container['distinct_country'] = isset($data['distinct_country']) ? $data['distinct_country'] : null; |
| 140 | $this->container['events'] = isset($data['events']) ? $data['events'] : null; |
| 141 | $this->container['ip_events'] = isset($data['ip_events']) ? $data['ip_events'] : null; |
| 142 | $this->container['distinct_ip_by_linked_id'] = isset($data['distinct_ip_by_linked_id']) ? $data['distinct_ip_by_linked_id'] : null; |
| 143 | $this->container['distinct_visitor_id_by_linked_id'] = isset($data['distinct_visitor_id_by_linked_id']) ? $data['distinct_visitor_id_by_linked_id'] : null; |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Gets the string presentation of the object. |
| 148 | * |
| 149 | */ |
| 150 | public function __toString(): string |
| 151 | { |
| 152 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Array of property to type mappings. Used for (de)serialization. |
| 157 | */ |
| 158 | public static function swaggerTypes(): array |
| 159 | { |
| 160 | return self::$swaggerTypes; |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Array of property to format mappings. Used for (de)serialization. |
| 165 | */ |
| 166 | public static function swaggerFormats(): array |
| 167 | { |
| 168 | return self::$swaggerFormats; |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Array of attributes where the key is the local name, |
| 173 | * and the value is the original name. |
| 174 | */ |
| 175 | public static function attributeMap(): array |
| 176 | { |
| 177 | return self::$attributeMap; |
| 178 | } |
| 179 | |
| 180 | /** |
| 181 | * Array of attributes to setter functions (for deserialization of responses). |
| 182 | */ |
| 183 | public static function setters(): array |
| 184 | { |
| 185 | return self::$setters; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Array of attributes to getter functions (for serialization of requests). |
| 190 | */ |
| 191 | public static function getters(): array |
| 192 | { |
| 193 | return self::$getters; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * The original name of the model. |
| 198 | */ |
| 199 | public function getModelName(): string |
| 200 | { |
| 201 | return self::$swaggerModelName; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * Show all the invalid properties with reasons. |
| 206 | * |
| 207 | * @return array invalid properties with reasons |
| 208 | */ |
| 209 | public function listInvalidProperties(): array |
| 210 | { |
| 211 | $invalidProperties = []; |
| 212 | |
| 213 | if (null === $this->container['distinct_ip']) { |
| 214 | $invalidProperties[] = "'distinct_ip' can't be null"; |
| 215 | } |
| 216 | if (null === $this->container['distinct_linked_id']) { |
| 217 | $invalidProperties[] = "'distinct_linked_id' can't be null"; |
| 218 | } |
| 219 | if (null === $this->container['distinct_country']) { |
| 220 | $invalidProperties[] = "'distinct_country' can't be null"; |
| 221 | } |
| 222 | if (null === $this->container['events']) { |
| 223 | $invalidProperties[] = "'events' can't be null"; |
| 224 | } |
| 225 | if (null === $this->container['ip_events']) { |
| 226 | $invalidProperties[] = "'ip_events' can't be null"; |
| 227 | } |
| 228 | if (null === $this->container['distinct_ip_by_linked_id']) { |
| 229 | $invalidProperties[] = "'distinct_ip_by_linked_id' can't be null"; |
| 230 | } |
| 231 | if (null === $this->container['distinct_visitor_id_by_linked_id']) { |
| 232 | $invalidProperties[] = "'distinct_visitor_id_by_linked_id' can't be null"; |
| 233 | } |
| 234 | |
| 235 | return $invalidProperties; |
| 236 | } |
| 237 | |
| 238 | /** |
| 239 | * Validate all the properties in the model |
| 240 | * return true if all passed. |
| 241 | * |
| 242 | * @return bool True if all properties are valid |
| 243 | */ |
| 244 | public function valid(): bool |
| 245 | { |
| 246 | return 0 === count($this->listInvalidProperties()); |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Gets distinct_ip. |
| 251 | */ |
| 252 | public function getDistinctIp(): VelocityData |
| 253 | { |
| 254 | return $this->container['distinct_ip']; |
| 255 | } |
| 256 | |
| 257 | /** |
| 258 | * Sets distinct_ip. |
| 259 | * |
| 260 | * @param VelocityData $distinct_ip distinct_ip |
| 261 | * |
| 262 | * @return $this |
| 263 | */ |
| 264 | public function setDistinctIp(VelocityData $distinct_ip): self |
| 265 | { |
| 266 | $this->container['distinct_ip'] = $distinct_ip; |
| 267 | |
| 268 | return $this; |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * Gets distinct_linked_id. |
| 273 | */ |
| 274 | public function getDistinctLinkedId(): VelocityData |
| 275 | { |
| 276 | return $this->container['distinct_linked_id']; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Sets distinct_linked_id. |
| 281 | * |
| 282 | * @param VelocityData $distinct_linked_id distinct_linked_id |
| 283 | * |
| 284 | * @return $this |
| 285 | */ |
| 286 | public function setDistinctLinkedId(VelocityData $distinct_linked_id): self |
| 287 | { |
| 288 | $this->container['distinct_linked_id'] = $distinct_linked_id; |
| 289 | |
| 290 | return $this; |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Gets distinct_country. |
| 295 | */ |
| 296 | public function getDistinctCountry(): VelocityData |
| 297 | { |
| 298 | return $this->container['distinct_country']; |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * Sets distinct_country. |
| 303 | * |
| 304 | * @param VelocityData $distinct_country distinct_country |
| 305 | * |
| 306 | * @return $this |
| 307 | */ |
| 308 | public function setDistinctCountry(VelocityData $distinct_country): self |
| 309 | { |
| 310 | $this->container['distinct_country'] = $distinct_country; |
| 311 | |
| 312 | return $this; |
| 313 | } |
| 314 | |
| 315 | /** |
| 316 | * Gets events. |
| 317 | */ |
| 318 | public function getEvents(): VelocityData |
| 319 | { |
| 320 | return $this->container['events']; |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * Sets events. |
| 325 | * |
| 326 | * @param VelocityData $events events |
| 327 | * |
| 328 | * @return $this |
| 329 | */ |
| 330 | public function setEvents(VelocityData $events): self |
| 331 | { |
| 332 | $this->container['events'] = $events; |
| 333 | |
| 334 | return $this; |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * Gets ip_events. |
| 339 | */ |
| 340 | public function getIpEvents(): VelocityData |
| 341 | { |
| 342 | return $this->container['ip_events']; |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Sets ip_events. |
| 347 | * |
| 348 | * @param VelocityData $ip_events ip_events |
| 349 | * |
| 350 | * @return $this |
| 351 | */ |
| 352 | public function setIpEvents(VelocityData $ip_events): self |
| 353 | { |
| 354 | $this->container['ip_events'] = $ip_events; |
| 355 | |
| 356 | return $this; |
| 357 | } |
| 358 | |
| 359 | /** |
| 360 | * Gets distinct_ip_by_linked_id. |
| 361 | */ |
| 362 | public function getDistinctIpByLinkedId(): VelocityData |
| 363 | { |
| 364 | return $this->container['distinct_ip_by_linked_id']; |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * Sets distinct_ip_by_linked_id. |
| 369 | * |
| 370 | * @param VelocityData $distinct_ip_by_linked_id distinct_ip_by_linked_id |
| 371 | * |
| 372 | * @return $this |
| 373 | */ |
| 374 | public function setDistinctIpByLinkedId(VelocityData $distinct_ip_by_linked_id): self |
| 375 | { |
| 376 | $this->container['distinct_ip_by_linked_id'] = $distinct_ip_by_linked_id; |
| 377 | |
| 378 | return $this; |
| 379 | } |
| 380 | |
| 381 | /** |
| 382 | * Gets distinct_visitor_id_by_linked_id. |
| 383 | */ |
| 384 | public function getDistinctVisitorIdByLinkedId(): VelocityData |
| 385 | { |
| 386 | return $this->container['distinct_visitor_id_by_linked_id']; |
| 387 | } |
| 388 | |
| 389 | /** |
| 390 | * Sets distinct_visitor_id_by_linked_id. |
| 391 | * |
| 392 | * @param VelocityData $distinct_visitor_id_by_linked_id distinct_visitor_id_by_linked_id |
| 393 | * |
| 394 | * @return $this |
| 395 | */ |
| 396 | public function setDistinctVisitorIdByLinkedId(VelocityData $distinct_visitor_id_by_linked_id): self |
| 397 | { |
| 398 | $this->container['distinct_visitor_id_by_linked_id'] = $distinct_visitor_id_by_linked_id; |
| 399 | |
| 400 | return $this; |
| 401 | } |
| 402 | |
| 403 | /** |
| 404 | * Returns true if offset exists. False otherwise. |
| 405 | * |
| 406 | * @param int $offset Offset |
| 407 | */ |
| 408 | public function offsetExists($offset): bool |
| 409 | { |
| 410 | return isset($this->container[$offset]); |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * Gets offset. |
| 415 | * |
| 416 | * @param int $offset Offset |
| 417 | */ |
| 418 | public function offsetGet($offset): mixed |
| 419 | { |
| 420 | return isset($this->container[$offset]) ? $this->container[$offset] : null; |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * Sets value based on offset. |
| 425 | * |
| 426 | * @param int $offset Offset |
| 427 | * @param mixed $value Value to be set |
| 428 | */ |
| 429 | public function offsetSet($offset, mixed $value): void |
| 430 | { |
| 431 | if (is_null($offset)) { |
| 432 | $this->container[] = $value; |
| 433 | } else { |
| 434 | $this->container[$offset] = $value; |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Unsets offset. |
| 440 | * |
| 441 | * @param int $offset Offset |
| 442 | */ |
| 443 | public function offsetUnset($offset): void |
| 444 | { |
| 445 | unset($this->container[$offset]); |
| 446 | } |
| 447 | |
| 448 | /** |
| 449 | * Gets the string presentation of the object in a pretty JSON format. |
| 450 | * |
| 451 | */ |
| 452 | public function toPrettyString(): string |
| 453 | { |
| 454 | return json_encode( |
| 455 | ObjectSerializer::sanitizeForSerialization($this), |
| 456 | JSON_PRETTY_PRINT |
| 457 | ); |
| 458 | } |
| 459 | } |