losant_rest 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -0
  3. data/docs/_schemas.md +1805 -267
  4. data/docs/auth.md +1 -1
  5. data/docs/experienceEndpoint.md +130 -0
  6. data/docs/experienceEndpoints.md +131 -0
  7. data/docs/experienceGroup.md +130 -0
  8. data/docs/experienceGroups.md +91 -0
  9. data/docs/experienceUser.md +130 -0
  10. data/docs/experienceUsers.md +92 -0
  11. data/docs/flows.md +1 -0
  12. data/lib/losant_rest/client.rb +26 -2
  13. data/lib/losant_rest/experience_endpoint.rb +174 -0
  14. data/lib/losant_rest/experience_endpoints.rb +186 -0
  15. data/lib/losant_rest/experience_group.rb +174 -0
  16. data/lib/losant_rest/experience_groups.rb +136 -0
  17. data/lib/losant_rest/experience_user.rb +174 -0
  18. data/lib/losant_rest/experience_users.rb +138 -0
  19. data/lib/losant_rest/flows.rb +2 -0
  20. data/lib/losant_rest/version.rb +1 -1
  21. data/lib/losant_rest.rb +6 -0
  22. data/schemas/application.json +30 -5
  23. data/schemas/applicationApiTokenPost.json +22 -0
  24. data/schemas/applicationKey.json +4 -2
  25. data/schemas/applicationKeyPost.json +4 -2
  26. data/schemas/applicationKeys.json +4 -2
  27. data/schemas/applicationPatch.json +13 -0
  28. data/schemas/applicationPost.json +13 -0
  29. data/schemas/applications.json +30 -5
  30. data/schemas/auditLog.json +3 -0
  31. data/schemas/auditLogFilter.json +3 -0
  32. data/schemas/auditLogs.json +3 -0
  33. data/schemas/authedDevice.json +1 -2
  34. data/schemas/dashboard.json +4 -2
  35. data/schemas/dashboardPatch.json +4 -2
  36. data/schemas/dashboardPost.json +4 -2
  37. data/schemas/dashboards.json +4 -2
  38. data/schemas/device.json +5 -4
  39. data/schemas/devicePatch.json +5 -4
  40. data/schemas/devicePost.json +5 -4
  41. data/schemas/deviceRecipe.json +5 -4
  42. data/schemas/deviceRecipePatch.json +5 -4
  43. data/schemas/deviceRecipePost.json +5 -4
  44. data/schemas/deviceRecipes.json +5 -4
  45. data/schemas/deviceTagFilter.json +2 -1
  46. data/schemas/devices.json +5 -4
  47. data/schemas/experienceEndpoint.json +74 -0
  48. data/schemas/experienceEndpointPatch.json +46 -0
  49. data/schemas/experienceEndpointPost.json +50 -0
  50. data/schemas/experienceEndpointStats.json +21 -0
  51. data/schemas/experienceEndpoints.json +45 -0
  52. data/schemas/experienceGroup.json +51 -0
  53. data/schemas/experienceGroupPatch.json +32 -0
  54. data/schemas/experienceGroupPost.json +35 -0
  55. data/schemas/experienceGroups.json +93 -0
  56. data/schemas/experienceUser.json +83 -0
  57. data/schemas/experienceUserPatch.json +48 -0
  58. data/schemas/experienceUserPost.json +52 -0
  59. data/schemas/experienceUsers.json +129 -0
  60. data/schemas/flow.json +34 -10
  61. data/schemas/flowLog.json +2 -19
  62. data/schemas/flowPatch.json +34 -10
  63. data/schemas/flowPost.json +34 -10
  64. data/schemas/flowTriggerFilter.json +19 -0
  65. data/schemas/flows.json +34 -10
  66. data/schemas/lastValueQuery.json +4 -2
  67. data/schemas/me.json +39 -7
  68. data/schemas/multiDeviceCommand.json +4 -2
  69. data/schemas/org.json +41 -9
  70. data/schemas/orgs.json +41 -9
  71. data/schemas/payloadCounts.json +8 -0
  72. data/schemas/resourceTransfer.json +6 -3
  73. data/schemas/solution.json +3 -1
  74. data/schemas/solutionUser.json +2 -1
  75. data/schemas/solutionUserPatch.json +2 -1
  76. data/schemas/solutionUserPost.json +2 -1
  77. data/schemas/solutionUsers.json +2 -1
  78. data/schemas/solutions.json +3 -1
  79. data/schemas/timeSeriesQuery.json +4 -2
  80. metadata +28 -2
@@ -20,10 +20,25 @@
20
20
  "type": "object",
21
21
  "properties": {
22
22
  "key": {
23
- "type": "string"
23
+ "type": "string",
24
+ "maxLength": 1024
24
25
  },
25
26
  "type": {
26
- "type": "string"
27
+ "type": "string",
28
+ "enum": [
29
+ "deviceId",
30
+ "deviceTag",
31
+ "mqttTopic",
32
+ "webhook",
33
+ "timer",
34
+ "event",
35
+ "virtualButton",
36
+ "endpoint",
37
+ "deviceIdConnect",
38
+ "deviceIdDisconnect",
39
+ "deviceTagConnect",
40
+ "deviceTagDisconnect"
41
+ ]
27
42
  },
28
43
  "config": {
29
44
  "type": "object"
@@ -36,9 +51,12 @@
36
51
  "items": {
37
52
  "type": "array",
38
53
  "items": {
39
- "type": "string"
40
- }
41
- }
54
+ "type": "string",
55
+ "maxLength": 255
56
+ },
57
+ "maxItems": 100
58
+ },
59
+ "maxItems": 100
42
60
  }
43
61
  },
44
62
  "additionalProperties": false,
@@ -53,10 +71,13 @@
53
71
  "type": "object",
54
72
  "properties": {
55
73
  "id": {
56
- "type": "string"
74
+ "type": "string",
75
+ "maxLength": 1024
57
76
  },
58
77
  "type": {
59
- "type": "string"
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 1024
60
81
  },
61
82
  "config": {
62
83
  "type": "object"
@@ -69,9 +90,12 @@
69
90
  "items": {
70
91
  "type": "array",
71
92
  "items": {
72
- "type": "string"
73
- }
74
- }
93
+ "type": "string",
94
+ "maxLength": 255
95
+ },
96
+ "maxItems": 100
97
+ },
98
+ "maxItems": 100
75
99
  }
76
100
  },
77
101
  "additionalProperties": false,
@@ -20,10 +20,25 @@
20
20
  "type": "object",
21
21
  "properties": {
22
22
  "key": {
23
- "type": "string"
23
+ "type": "string",
24
+ "maxLength": 1024
24
25
  },
25
26
  "type": {
26
- "type": "string"
27
+ "type": "string",
28
+ "enum": [
29
+ "deviceId",
30
+ "deviceTag",
31
+ "mqttTopic",
32
+ "webhook",
33
+ "timer",
34
+ "event",
35
+ "virtualButton",
36
+ "endpoint",
37
+ "deviceIdConnect",
38
+ "deviceIdDisconnect",
39
+ "deviceTagConnect",
40
+ "deviceTagDisconnect"
41
+ ]
27
42
  },
28
43
  "config": {
29
44
  "type": "object"
@@ -36,9 +51,12 @@
36
51
  "items": {
37
52
  "type": "array",
38
53
  "items": {
39
- "type": "string"
40
- }
41
- }
54
+ "type": "string",
55
+ "maxLength": 255
56
+ },
57
+ "maxItems": 100
58
+ },
59
+ "maxItems": 100
42
60
  }
43
61
  },
44
62
  "additionalProperties": false,
@@ -53,10 +71,13 @@
53
71
  "type": "object",
54
72
  "properties": {
55
73
  "id": {
56
- "type": "string"
74
+ "type": "string",
75
+ "maxLength": 1024
57
76
  },
58
77
  "type": {
59
- "type": "string"
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 1024
60
81
  },
61
82
  "config": {
62
83
  "type": "object"
@@ -69,9 +90,12 @@
69
90
  "items": {
70
91
  "type": "array",
71
92
  "items": {
72
- "type": "string"
73
- }
74
- }
93
+ "type": "string",
94
+ "maxLength": 255
95
+ },
96
+ "maxItems": 100
97
+ },
98
+ "maxItems": 100
75
99
  }
76
100
  },
77
101
  "additionalProperties": false,
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "array",
4
+ "items": {
5
+ "type": "object",
6
+ "properties": {
7
+ "key": {
8
+ "type": "string",
9
+ "maxLength": 1024
10
+ },
11
+ "type": {
12
+ "type": "string",
13
+ "maxLength": 1024
14
+ }
15
+ },
16
+ "additionalProperties": false
17
+ },
18
+ "maxItems": 100
19
+ }
data/schemas/flows.json CHANGED
@@ -47,10 +47,25 @@
47
47
  "type": "object",
48
48
  "properties": {
49
49
  "key": {
50
- "type": "string"
50
+ "type": "string",
51
+ "maxLength": 1024
51
52
  },
52
53
  "type": {
53
- "type": "string"
54
+ "type": "string",
55
+ "enum": [
56
+ "deviceId",
57
+ "deviceTag",
58
+ "mqttTopic",
59
+ "webhook",
60
+ "timer",
61
+ "event",
62
+ "virtualButton",
63
+ "endpoint",
64
+ "deviceIdConnect",
65
+ "deviceIdDisconnect",
66
+ "deviceTagConnect",
67
+ "deviceTagDisconnect"
68
+ ]
54
69
  },
55
70
  "config": {
56
71
  "type": "object"
@@ -63,9 +78,12 @@
63
78
  "items": {
64
79
  "type": "array",
65
80
  "items": {
66
- "type": "string"
67
- }
68
- }
81
+ "type": "string",
82
+ "maxLength": 255
83
+ },
84
+ "maxItems": 100
85
+ },
86
+ "maxItems": 100
69
87
  }
70
88
  },
71
89
  "additionalProperties": false,
@@ -80,10 +98,13 @@
80
98
  "type": "object",
81
99
  "properties": {
82
100
  "id": {
83
- "type": "string"
101
+ "type": "string",
102
+ "maxLength": 1024
84
103
  },
85
104
  "type": {
86
- "type": "string"
105
+ "type": "string",
106
+ "minLength": 1,
107
+ "maxLength": 1024
87
108
  },
88
109
  "config": {
89
110
  "type": "object"
@@ -96,9 +117,12 @@
96
117
  "items": {
97
118
  "type": "array",
98
119
  "items": {
99
- "type": "string"
100
- }
101
- }
120
+ "type": "string",
121
+ "maxLength": 255
122
+ },
123
+ "maxItems": 100
124
+ },
125
+ "maxItems": 100
102
126
  }
103
127
  },
104
128
  "additionalProperties": false,
@@ -22,14 +22,16 @@
22
22
  }
23
23
  },
24
24
  "additionalProperties": false
25
- }
25
+ },
26
+ "maxItems": 100
26
27
  },
27
28
  "deviceIds": {
28
29
  "type": "array",
29
30
  "items": {
30
31
  "type": "string",
31
32
  "pattern": "^[A-Fa-f\\d]{24}$"
32
- }
33
+ },
34
+ "maxItems": 1000
33
35
  }
34
36
  },
35
37
  "additionalProperties": false
data/schemas/me.json CHANGED
@@ -73,6 +73,9 @@
73
73
  "format": "url"
74
74
  },
75
75
  "limits": {
76
+ "apitoken": {
77
+ "type": "number"
78
+ },
76
79
  "application": {
77
80
  "type": "number"
78
81
  },
@@ -88,6 +91,15 @@
88
91
  "devicerecipe": {
89
92
  "type": "number"
90
93
  },
94
+ "experienceendpoint": {
95
+ "type": "number"
96
+ },
97
+ "experiencegroup": {
98
+ "type": "number"
99
+ },
100
+ "experienceuser": {
101
+ "type": "number"
102
+ },
91
103
  "flow": {
92
104
  "type": "number"
93
105
  },
@@ -218,33 +230,42 @@
218
230
  "summary": {
219
231
  "type": "object",
220
232
  "properties": {
233
+ "apiTokenCount": {
234
+ "type": "number"
235
+ },
221
236
  "appCount": {
222
237
  "type": "number"
223
238
  },
224
- "dashCount": {
239
+ "keyCount": {
225
240
  "type": "number"
226
241
  },
227
- "orgCount": {
242
+ "dashCount": {
228
243
  "type": "number"
229
244
  },
230
245
  "deviceCount": {
231
246
  "type": "number"
232
247
  },
233
- "flowCount": {
248
+ "deviceRecipeCount": {
234
249
  "type": "number"
235
250
  },
236
- "webhookCount": {
251
+ "experienceEndpointCount": {
237
252
  "type": "number"
238
253
  },
239
- "keyCount": {
254
+ "experienceGroupCount": {
240
255
  "type": "number"
241
256
  },
242
- "deviceRecipeCount": {
257
+ "experienceUserCount": {
258
+ "type": "number"
259
+ },
260
+ "flowCount": {
261
+ "type": "number"
262
+ },
263
+ "orgCount": {
243
264
  "type": "number"
244
265
  },
245
266
  "payloadCount": {
246
267
  "title": "Payload Counts",
247
- "description": "Schema the result of a payload count request",
268
+ "description": "Schema for the result of a payload count request",
248
269
  "type": "object",
249
270
  "properties": {
250
271
  "mqttOut": {
@@ -326,8 +347,19 @@
326
347
  "type": "number"
327
348
  }
328
349
  }
350
+ },
351
+ "endpoint": {
352
+ "type": "object",
353
+ "patternProperties": {
354
+ ".*": {
355
+ "type": "number"
356
+ }
357
+ }
329
358
  }
330
359
  }
360
+ },
361
+ "webhookCount": {
362
+ "type": "number"
331
363
  }
332
364
  }
333
365
  },
@@ -46,14 +46,16 @@
46
46
  }
47
47
  },
48
48
  "additionalProperties": false
49
- }
49
+ },
50
+ "maxItems": 100
50
51
  },
51
52
  "deviceIds": {
52
53
  "type": "array",
53
54
  "items": {
54
55
  "type": "string",
55
56
  "pattern": "^[A-Fa-f\\d]{24}$"
56
- }
57
+ },
58
+ "maxItems": 1000
57
59
  }
58
60
  },
59
61
  "required": [
data/schemas/org.json CHANGED
@@ -70,6 +70,9 @@
70
70
  }
71
71
  },
72
72
  "limits": {
73
+ "apitoken": {
74
+ "type": "number"
75
+ },
73
76
  "application": {
74
77
  "type": "number"
75
78
  },
@@ -85,6 +88,15 @@
85
88
  "devicerecipe": {
86
89
  "type": "number"
87
90
  },
91
+ "experienceendpoint": {
92
+ "type": "number"
93
+ },
94
+ "experiencegroup": {
95
+ "type": "number"
96
+ },
97
+ "experienceuser": {
98
+ "type": "number"
99
+ },
88
100
  "flow": {
89
101
  "type": "number"
90
102
  },
@@ -107,33 +119,45 @@
107
119
  "summary": {
108
120
  "type": "object",
109
121
  "properties": {
122
+ "apiTokenCount": {
123
+ "type": "number"
124
+ },
110
125
  "appCount": {
111
126
  "type": "number"
112
127
  },
113
- "dashCount": {
128
+ "keyCount": {
114
129
  "type": "number"
115
130
  },
116
- "solutionCount": {
131
+ "dashCount": {
117
132
  "type": "number"
118
133
  },
119
134
  "deviceCount": {
120
135
  "type": "number"
121
136
  },
122
- "flowCount": {
137
+ "deviceRecipeCount": {
123
138
  "type": "number"
124
139
  },
125
- "webhookCount": {
140
+ "experienceEndpointCount": {
126
141
  "type": "number"
127
142
  },
128
- "keyCount": {
143
+ "experienceGroupCount": {
129
144
  "type": "number"
130
145
  },
131
- "deviceRecipeCount": {
146
+ "experienceUserCount": {
147
+ "type": "number"
148
+ },
149
+ "flowCount": {
150
+ "type": "number"
151
+ },
152
+ "memberCount": {
153
+ "type": "number"
154
+ },
155
+ "pendingInviteCount": {
132
156
  "type": "number"
133
157
  },
134
158
  "payloadCount": {
135
159
  "title": "Payload Counts",
136
- "description": "Schema the result of a payload count request",
160
+ "description": "Schema for the result of a payload count request",
137
161
  "type": "object",
138
162
  "properties": {
139
163
  "mqttOut": {
@@ -215,13 +239,21 @@
215
239
  "type": "number"
216
240
  }
217
241
  }
242
+ },
243
+ "endpoint": {
244
+ "type": "object",
245
+ "patternProperties": {
246
+ ".*": {
247
+ "type": "number"
248
+ }
249
+ }
218
250
  }
219
251
  }
220
252
  },
221
- "pendingInviteCount": {
253
+ "solutionCount": {
222
254
  "type": "number"
223
255
  },
224
- "memberCount": {
256
+ "webhookCount": {
225
257
  "type": "number"
226
258
  }
227
259
  }
data/schemas/orgs.json CHANGED
@@ -77,6 +77,9 @@
77
77
  }
78
78
  },
79
79
  "limits": {
80
+ "apitoken": {
81
+ "type": "number"
82
+ },
80
83
  "application": {
81
84
  "type": "number"
82
85
  },
@@ -92,6 +95,15 @@
92
95
  "devicerecipe": {
93
96
  "type": "number"
94
97
  },
98
+ "experienceendpoint": {
99
+ "type": "number"
100
+ },
101
+ "experiencegroup": {
102
+ "type": "number"
103
+ },
104
+ "experienceuser": {
105
+ "type": "number"
106
+ },
95
107
  "flow": {
96
108
  "type": "number"
97
109
  },
@@ -114,33 +126,45 @@
114
126
  "summary": {
115
127
  "type": "object",
116
128
  "properties": {
129
+ "apiTokenCount": {
130
+ "type": "number"
131
+ },
117
132
  "appCount": {
118
133
  "type": "number"
119
134
  },
120
- "dashCount": {
135
+ "keyCount": {
121
136
  "type": "number"
122
137
  },
123
- "solutionCount": {
138
+ "dashCount": {
124
139
  "type": "number"
125
140
  },
126
141
  "deviceCount": {
127
142
  "type": "number"
128
143
  },
129
- "flowCount": {
144
+ "deviceRecipeCount": {
130
145
  "type": "number"
131
146
  },
132
- "webhookCount": {
147
+ "experienceEndpointCount": {
133
148
  "type": "number"
134
149
  },
135
- "keyCount": {
150
+ "experienceGroupCount": {
136
151
  "type": "number"
137
152
  },
138
- "deviceRecipeCount": {
153
+ "experienceUserCount": {
154
+ "type": "number"
155
+ },
156
+ "flowCount": {
157
+ "type": "number"
158
+ },
159
+ "memberCount": {
160
+ "type": "number"
161
+ },
162
+ "pendingInviteCount": {
139
163
  "type": "number"
140
164
  },
141
165
  "payloadCount": {
142
166
  "title": "Payload Counts",
143
- "description": "Schema the result of a payload count request",
167
+ "description": "Schema for the result of a payload count request",
144
168
  "type": "object",
145
169
  "properties": {
146
170
  "mqttOut": {
@@ -222,13 +246,21 @@
222
246
  "type": "number"
223
247
  }
224
248
  }
249
+ },
250
+ "endpoint": {
251
+ "type": "object",
252
+ "patternProperties": {
253
+ ".*": {
254
+ "type": "number"
255
+ }
256
+ }
225
257
  }
226
258
  }
227
259
  },
228
- "pendingInviteCount": {
260
+ "solutionCount": {
229
261
  "type": "number"
230
262
  },
231
- "memberCount": {
263
+ "webhookCount": {
232
264
  "type": "number"
233
265
  }
234
266
  }
@@ -81,6 +81,14 @@
81
81
  "type": "number"
82
82
  }
83
83
  }
84
+ },
85
+ "endpoint": {
86
+ "type": "object",
87
+ "patternProperties": {
88
+ ".*": {
89
+ "type": "number"
90
+ }
91
+ }
84
92
  }
85
93
  }
86
94
  }
@@ -18,21 +18,24 @@
18
18
  "items": {
19
19
  "type": "string",
20
20
  "pattern": "^[A-Fa-f\\d]{24}$"
21
- }
21
+ },
22
+ "maxItems": 1000
22
23
  },
23
24
  "dashboardIds": {
24
25
  "type": "array",
25
26
  "items": {
26
27
  "type": "string",
27
28
  "pattern": "^[A-Fa-f\\d]{24}$"
28
- }
29
+ },
30
+ "maxItems": 1000
29
31
  },
30
32
  "solutionIds": {
31
33
  "type": "array",
32
34
  "items": {
33
35
  "type": "string",
34
36
  "pattern": "^[A-Fa-f\\d]{24}$"
35
- }
37
+ },
38
+ "maxItems": 1000
36
39
  },
37
40
  "strict": {
38
41
  "type": "boolean"
@@ -33,7 +33,9 @@
33
33
  },
34
34
  "slug": {
35
35
  "type": "string",
36
- "pattern": "^[0-9a-z_-]{1,255}$"
36
+ "minLength": 4,
37
+ "maxLength": 255,
38
+ "pattern": "^[0-9a-z_-]*$"
37
39
  },
38
40
  "allowSelfDeletion": {
39
41
  "type": "boolean"
@@ -86,7 +86,8 @@
86
86
  "items": {
87
87
  "type": "string",
88
88
  "pattern": "^[A-Fa-f\\d]{24}$"
89
- }
89
+ },
90
+ "maxItems": 1000
90
91
  }
91
92
  }
92
93
  }
@@ -54,7 +54,8 @@
54
54
  "items": {
55
55
  "type": "string",
56
56
  "pattern": "^[A-Fa-f\\d]{24}$"
57
- }
57
+ },
58
+ "maxItems": 1000
58
59
  },
59
60
  "additionalProperties": false
60
61
  }
@@ -54,7 +54,8 @@
54
54
  "items": {
55
55
  "type": "string",
56
56
  "pattern": "^[A-Fa-f\\d]{24}$"
57
- }
57
+ },
58
+ "maxItems": 1000
58
59
  },
59
60
  "additionalProperties": false
60
61
  }
@@ -93,7 +93,8 @@
93
93
  "items": {
94
94
  "type": "string",
95
95
  "pattern": "^[A-Fa-f\\d]{24}$"
96
- }
96
+ },
97
+ "maxItems": 1000
97
98
  }
98
99
  }
99
100
  }