forked from alexjustesen/speedtest-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResultSchema.php
More file actions
123 lines (120 loc) · 6.23 KB
/
ResultSchema.php
File metadata and controls
123 lines (120 loc) · 6.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
namespace App\OpenApi\Schemas;
use OpenApi\Attributes as OA;
#[OA\Schema(
schema: 'Result',
type: 'object',
description: 'Speedtest result entry',
properties: [
new OA\Property(property: 'id', type: 'integer'),
new OA\Property(property: 'service', type: 'string'),
new OA\Property(property: 'ping', type: 'number'),
new OA\Property(property: 'download', type: 'integer'),
new OA\Property(property: 'upload', type: 'integer'),
new OA\Property(property: 'download_bits', type: 'integer'),
new OA\Property(property: 'upload_bits', type: 'integer'),
new OA\Property(property: 'download_bits_human', type: 'string'),
new OA\Property(property: 'upload_bits_human', type: 'string'),
new OA\Property(property: 'benchmarks', type: 'array', nullable: true, items: new OA\Items(type: 'object')),
new OA\Property(property: 'healthy', type: 'boolean', nullable: true),
new OA\Property(property: 'status', type: 'string'),
new OA\Property(property: 'scheduled', type: 'boolean'),
new OA\Property(property: 'comments', type: 'string', nullable: true),
new OA\Property(
property: 'data',
type: 'object',
description: 'Nested speedtest data payload',
properties: [
new OA\Property(property: 'isp', type: 'string'),
new OA\Property(
property: 'ping',
type: 'object',
properties: [
new OA\Property(property: 'low', type: 'number', format: 'float'),
new OA\Property(property: 'high', type: 'number', format: 'float'),
new OA\Property(property: 'jitter', type: 'number', format: 'float'),
new OA\Property(property: 'latency', type: 'number', format: 'float'),
]
),
new OA\Property(property: 'type', type: 'string'),
new OA\Property(
property: 'result',
type: 'object',
properties: [
new OA\Property(property: 'id', type: 'string'),
new OA\Property(property: 'url', type: 'string', format: 'uri'),
new OA\Property(property: 'persisted', type: 'boolean'),
]
),
new OA\Property(
property: 'server',
type: 'object',
properties: [
new OA\Property(property: 'id', type: 'integer'),
new OA\Property(property: 'ip', type: 'string', format: 'ipv4'),
new OA\Property(property: 'host', type: 'string'),
new OA\Property(property: 'name', type: 'string'),
new OA\Property(property: 'port', type: 'integer'),
new OA\Property(property: 'country', type: 'string'),
new OA\Property(property: 'location', type: 'string'),
]
),
new OA\Property(
property: 'upload',
type: 'object',
properties: [
new OA\Property(property: 'bytes', type: 'integer'),
new OA\Property(property: 'elapsed', type: 'integer'),
new OA\Property(
property: 'latency',
type: 'object',
properties: [
new OA\Property(property: 'iqm', type: 'number', format: 'float'),
new OA\Property(property: 'low', type: 'number', format: 'float'),
new OA\Property(property: 'high', type: 'number', format: 'float'),
new OA\Property(property: 'jitter', type: 'number', format: 'float'),
]
),
new OA\Property(property: 'bandwidth', type: 'integer'),
]
),
new OA\Property(
property: 'download',
type: 'object',
properties: [
new OA\Property(property: 'bytes', type: 'integer'),
new OA\Property(property: 'elapsed', type: 'integer'),
new OA\Property(
property: 'latency',
type: 'object',
properties: [
new OA\Property(property: 'iqm', type: 'number', format: 'float'),
new OA\Property(property: 'low', type: 'number', format: 'float'),
new OA\Property(property: 'high', type: 'number', format: 'float'),
new OA\Property(property: 'jitter', type: 'number', format: 'float'),
]
),
new OA\Property(property: 'bandwidth', type: 'integer'),
]
),
new OA\Property(
property: 'interface',
type: 'object',
properties: [
new OA\Property(property: 'name', type: 'string'),
new OA\Property(property: 'isVpn', type: 'boolean'),
new OA\Property(property: 'macAddr', type: 'string', pattern: '^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$'),
new OA\Property(property: 'externalIp', type: 'string', format: 'ipv4'),
new OA\Property(property: 'internalIp', type: 'string', format: 'ipv4'),
]
),
new OA\Property(property: 'timestamp', type: 'string', format: 'date-time'),
new OA\Property(property: 'packetLoss', type: 'number'),
]
),
new OA\Property(property: 'created_at', type: 'string', format: 'date-time'),
new OA\Property(property: 'updated_at', type: 'string', format: 'date-time'),
],
additionalProperties: false
)]
class ResultSchema {}