Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
42.19% |
27 / 64 |
|
41.94% |
13 / 31 |
CRAP | |
0.00% |
0 / 1 |
| Botd | |
42.19% |
27 / 64 |
|
41.94% |
13 / 31 |
473.84 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
9 | |||
| __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 / 14 |
|
0.00% |
0 / 1 |
56 | |||
| valid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBot | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setBot | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getMeta | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setMeta | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getLinkedId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setLinkedId | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getUrl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setUrl | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getIp | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setIp | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getTime | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setTime | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getUserAgent | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setUserAgent | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getRequestId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setRequestId | |
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 | * Botd. |
| 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 | * Botd Class Doc Comment. |
| 34 | * |
| 35 | * @category Class |
| 36 | * |
| 37 | * @description Contains all the information from Bot Detection product |
| 38 | * |
| 39 | * @author Swagger Codegen team |
| 40 | * |
| 41 | * @see https://github.com/swagger-api/swagger-codegen |
| 42 | */ |
| 43 | class Botd implements ModelInterface, \ArrayAccess |
| 44 | { |
| 45 | /** |
| 46 | * The original name of the model. |
| 47 | * |
| 48 | */ |
| 49 | protected static string $swaggerModelName = 'Botd'; |
| 50 | |
| 51 | /** |
| 52 | * Array of property to type mappings. Used for (de)serialization. |
| 53 | * |
| 54 | * @var string[] |
| 55 | */ |
| 56 | protected static array $swaggerTypes = [ |
| 57 | 'bot' => '\Fingerprint\ServerAPI\Model\BotdBot', |
| 58 | 'meta' => 'array', |
| 59 | 'linked_id' => 'string', |
| 60 | 'url' => 'string', |
| 61 | 'ip' => 'string', |
| 62 | 'time' => '\DateTime', |
| 63 | 'user_agent' => 'string', |
| 64 | 'request_id' => 'string']; |
| 65 | |
| 66 | /** |
| 67 | * Array of property to format mappings. Used for (de)serialization. |
| 68 | * |
| 69 | * @var string[] |
| 70 | */ |
| 71 | protected static array $swaggerFormats = [ |
| 72 | 'bot' => null, |
| 73 | 'meta' => null, |
| 74 | 'linked_id' => null, |
| 75 | 'url' => null, |
| 76 | 'ip' => null, |
| 77 | 'time' => 'date-time', |
| 78 | 'user_agent' => null, |
| 79 | 'request_id' => 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 | 'bot' => 'bot', |
| 89 | 'meta' => 'meta', |
| 90 | 'linked_id' => 'linkedId', |
| 91 | 'url' => 'url', |
| 92 | 'ip' => 'ip', |
| 93 | 'time' => 'time', |
| 94 | 'user_agent' => 'userAgent', |
| 95 | 'request_id' => 'requestId']; |
| 96 | |
| 97 | /** |
| 98 | * Array of attributes to setter functions (for deserialization of responses). |
| 99 | * |
| 100 | * @var string[] |
| 101 | */ |
| 102 | protected static array $setters = [ |
| 103 | 'bot' => 'setBot', |
| 104 | 'meta' => 'setMeta', |
| 105 | 'linked_id' => 'setLinkedId', |
| 106 | 'url' => 'setUrl', |
| 107 | 'ip' => 'setIp', |
| 108 | 'time' => 'setTime', |
| 109 | 'user_agent' => 'setUserAgent', |
| 110 | 'request_id' => 'setRequestId']; |
| 111 | |
| 112 | /** |
| 113 | * Array of attributes to getter functions (for serialization of requests). |
| 114 | * |
| 115 | * @var string[] |
| 116 | */ |
| 117 | protected static array $getters = [ |
| 118 | 'bot' => 'getBot', |
| 119 | 'meta' => 'getMeta', |
| 120 | 'linked_id' => 'getLinkedId', |
| 121 | 'url' => 'getUrl', |
| 122 | 'ip' => 'getIp', |
| 123 | 'time' => 'getTime', |
| 124 | 'user_agent' => 'getUserAgent', |
| 125 | 'request_id' => 'getRequestId']; |
| 126 | |
| 127 | /** |
| 128 | * Associative array for storing property values. |
| 129 | * |
| 130 | * @var mixed[] |
| 131 | */ |
| 132 | protected array $container = []; |
| 133 | |
| 134 | /** |
| 135 | * Constructor. |
| 136 | * |
| 137 | * @param mixed[] $data Associated array of property values |
| 138 | * initializing the model |
| 139 | */ |
| 140 | public function __construct(?array $data = null) |
| 141 | { |
| 142 | $this->container['bot'] = isset($data['bot']) ? $data['bot'] : null; |
| 143 | $this->container['meta'] = isset($data['meta']) ? $data['meta'] : null; |
| 144 | $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; |
| 145 | $this->container['url'] = isset($data['url']) ? $data['url'] : null; |
| 146 | $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; |
| 147 | $this->container['time'] = isset($data['time']) ? $data['time'] : null; |
| 148 | $this->container['user_agent'] = isset($data['user_agent']) ? $data['user_agent'] : null; |
| 149 | $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Gets the string presentation of the object. |
| 154 | * |
| 155 | */ |
| 156 | public function __toString(): string |
| 157 | { |
| 158 | return json_encode(ObjectSerializer::sanitizeForSerialization($this)); |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Array of property to type mappings. Used for (de)serialization. |
| 163 | */ |
| 164 | public static function swaggerTypes(): array |
| 165 | { |
| 166 | return self::$swaggerTypes; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Array of property to format mappings. Used for (de)serialization. |
| 171 | */ |
| 172 | public static function swaggerFormats(): array |
| 173 | { |
| 174 | return self::$swaggerFormats; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Array of attributes where the key is the local name, |
| 179 | * and the value is the original name. |
| 180 | */ |
| 181 | public static function attributeMap(): array |
| 182 | { |
| 183 | return self::$attributeMap; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Array of attributes to setter functions (for deserialization of responses). |
| 188 | */ |
| 189 | public static function setters(): array |
| 190 | { |
| 191 | return self::$setters; |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * Array of attributes to getter functions (for serialization of requests). |
| 196 | */ |
| 197 | public static function getters(): array |
| 198 | { |
| 199 | return self::$getters; |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * The original name of the model. |
| 204 | */ |
| 205 | public function getModelName(): string |
| 206 | { |
| 207 | return self::$swaggerModelName; |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * Show all the invalid properties with reasons. |
| 212 | * |
| 213 | * @return array invalid properties with reasons |
| 214 | */ |
| 215 | public function listInvalidProperties(): array |
| 216 | { |
| 217 | $invalidProperties = []; |
| 218 | |
| 219 | if (null === $this->container['bot']) { |
| 220 | $invalidProperties[] = "'bot' can't be null"; |
| 221 | } |
| 222 | if (null === $this->container['url']) { |
| 223 | $invalidProperties[] = "'url' can't be null"; |
| 224 | } |
| 225 | if (null === $this->container['ip']) { |
| 226 | $invalidProperties[] = "'ip' can't be null"; |
| 227 | } |
| 228 | if (null === $this->container['time']) { |
| 229 | $invalidProperties[] = "'time' can't be null"; |
| 230 | } |
| 231 | if (null === $this->container['user_agent']) { |
| 232 | $invalidProperties[] = "'user_agent' can't be null"; |
| 233 | } |
| 234 | if (null === $this->container['request_id']) { |
| 235 | $invalidProperties[] = "'request_id' can't be null"; |
| 236 | } |
| 237 | |
| 238 | return $invalidProperties; |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * Validate all the properties in the model |
| 243 | * return true if all passed. |
| 244 | * |
| 245 | * @return bool True if all properties are valid |
| 246 | */ |
| 247 | public function valid(): bool |
| 248 | { |
| 249 | return 0 === count($this->listInvalidProperties()); |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Gets bot. |
| 254 | */ |
| 255 | public function getBot(): BotdBot |
| 256 | { |
| 257 | return $this->container['bot']; |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * Sets bot. |
| 262 | * |
| 263 | * @param BotdBot $bot bot |
| 264 | * |
| 265 | * @return $this |
| 266 | */ |
| 267 | public function setBot(BotdBot $bot): self |
| 268 | { |
| 269 | $this->container['bot'] = $bot; |
| 270 | |
| 271 | return $this; |
| 272 | } |
| 273 | |
| 274 | /** |
| 275 | * Gets meta. |
| 276 | */ |
| 277 | public function getMeta(): ?array |
| 278 | { |
| 279 | return $this->container['meta']; |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Sets meta. |
| 284 | * |
| 285 | * @param ?array $meta meta |
| 286 | * |
| 287 | * @return $this |
| 288 | */ |
| 289 | public function setMeta(?array $meta): self |
| 290 | { |
| 291 | $this->container['meta'] = $meta; |
| 292 | |
| 293 | return $this; |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * Gets linked_id. |
| 298 | */ |
| 299 | public function getLinkedId(): ?string |
| 300 | { |
| 301 | return $this->container['linked_id']; |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * Sets linked_id. |
| 306 | * |
| 307 | * @param ?string $linked_id a customer-provided id that was sent with the request |
| 308 | * |
| 309 | * @return $this |
| 310 | */ |
| 311 | public function setLinkedId(?string $linked_id): self |
| 312 | { |
| 313 | $this->container['linked_id'] = $linked_id; |
| 314 | |
| 315 | return $this; |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * Gets url. |
| 320 | */ |
| 321 | public function getUrl(): string |
| 322 | { |
| 323 | return $this->container['url']; |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Sets url. |
| 328 | * |
| 329 | * @param string $url page URL from which the request was sent |
| 330 | * |
| 331 | * @return $this |
| 332 | */ |
| 333 | public function setUrl(string $url): self |
| 334 | { |
| 335 | $this->container['url'] = $url; |
| 336 | |
| 337 | return $this; |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Gets ip. |
| 342 | */ |
| 343 | public function getIp(): string |
| 344 | { |
| 345 | return $this->container['ip']; |
| 346 | } |
| 347 | |
| 348 | /** |
| 349 | * Sets ip. |
| 350 | * |
| 351 | * @param string $ip IP address of the requesting browser or bot |
| 352 | * |
| 353 | * @return $this |
| 354 | */ |
| 355 | public function setIp(string $ip): self |
| 356 | { |
| 357 | $this->container['ip'] = $ip; |
| 358 | |
| 359 | return $this; |
| 360 | } |
| 361 | |
| 362 | /** |
| 363 | * Gets time. |
| 364 | */ |
| 365 | public function getTime(): \DateTime |
| 366 | { |
| 367 | return $this->container['time']; |
| 368 | } |
| 369 | |
| 370 | /** |
| 371 | * Sets time. |
| 372 | * |
| 373 | * @param \DateTime $time Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. |
| 374 | * |
| 375 | * @return $this |
| 376 | */ |
| 377 | public function setTime(\DateTime $time): self |
| 378 | { |
| 379 | $this->container['time'] = $time; |
| 380 | |
| 381 | return $this; |
| 382 | } |
| 383 | |
| 384 | /** |
| 385 | * Gets user_agent. |
| 386 | */ |
| 387 | public function getUserAgent(): string |
| 388 | { |
| 389 | return $this->container['user_agent']; |
| 390 | } |
| 391 | |
| 392 | /** |
| 393 | * Sets user_agent. |
| 394 | * |
| 395 | * @param string $user_agent user_agent |
| 396 | * |
| 397 | * @return $this |
| 398 | */ |
| 399 | public function setUserAgent(string $user_agent): self |
| 400 | { |
| 401 | $this->container['user_agent'] = $user_agent; |
| 402 | |
| 403 | return $this; |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Gets request_id. |
| 408 | */ |
| 409 | public function getRequestId(): string |
| 410 | { |
| 411 | return $this->container['request_id']; |
| 412 | } |
| 413 | |
| 414 | /** |
| 415 | * Sets request_id. |
| 416 | * |
| 417 | * @param string $request_id unique identifier of the user's request |
| 418 | * |
| 419 | * @return $this |
| 420 | */ |
| 421 | public function setRequestId(string $request_id): self |
| 422 | { |
| 423 | $this->container['request_id'] = $request_id; |
| 424 | |
| 425 | return $this; |
| 426 | } |
| 427 | |
| 428 | /** |
| 429 | * Returns true if offset exists. False otherwise. |
| 430 | * |
| 431 | * @param int $offset Offset |
| 432 | */ |
| 433 | public function offsetExists($offset): bool |
| 434 | { |
| 435 | return isset($this->container[$offset]); |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Gets offset. |
| 440 | * |
| 441 | * @param int $offset Offset |
| 442 | */ |
| 443 | public function offsetGet($offset): mixed |
| 444 | { |
| 445 | return isset($this->container[$offset]) ? $this->container[$offset] : null; |
| 446 | } |
| 447 | |
| 448 | /** |
| 449 | * Sets value based on offset. |
| 450 | * |
| 451 | * @param int $offset Offset |
| 452 | * @param mixed $value Value to be set |
| 453 | */ |
| 454 | public function offsetSet($offset, mixed $value): void |
| 455 | { |
| 456 | if (is_null($offset)) { |
| 457 | $this->container[] = $value; |
| 458 | } else { |
| 459 | $this->container[$offset] = $value; |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | /** |
| 464 | * Unsets offset. |
| 465 | * |
| 466 | * @param int $offset Offset |
| 467 | */ |
| 468 | public function offsetUnset($offset): void |
| 469 | { |
| 470 | unset($this->container[$offset]); |
| 471 | } |
| 472 | |
| 473 | /** |
| 474 | * Gets the string presentation of the object in a pretty JSON format. |
| 475 | * |
| 476 | */ |
| 477 | public function toPrettyString(): string |
| 478 | { |
| 479 | return json_encode( |
| 480 | ObjectSerializer::sanitizeForSerialization($this), |
| 481 | JSON_PRETTY_PRINT |
| 482 | ); |
| 483 | } |
| 484 | } |