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
@@ -14,6 +14,19 @@
14
14
  "description": {
15
15
  "type": "string",
16
16
  "maxLength": 32767
17
+ },
18
+ "endpointSlug": {
19
+ "type": "string",
20
+ "minLength": 4,
21
+ "maxLength": 255,
22
+ "pattern": "^[0-9a-z_-]*$"
23
+ },
24
+ "expUserTokenCutoff": {
25
+ "type": "string",
26
+ "format": "date-time"
27
+ },
28
+ "endpointDefaultCors": {
29
+ "type": "boolean"
17
30
  }
18
31
  },
19
32
  "additionalProperties": false,
@@ -45,25 +45,50 @@
45
45
  "type": "string",
46
46
  "maxLength": 32767
47
47
  },
48
+ "endpointSlug": {
49
+ "type": "string",
50
+ "minLength": 4,
51
+ "maxLength": 255,
52
+ "pattern": "^[0-9a-z_-]*$"
53
+ },
54
+ "expUserTokenCutoff": {
55
+ "type": "string",
56
+ "format": "date-time"
57
+ },
58
+ "endpointDefaultCors": {
59
+ "type": "boolean"
60
+ },
48
61
  "summary": {
49
62
  "type": "object",
50
63
  "properties": {
51
- "deviceCount": {
64
+ "apiTokenCount": {
52
65
  "type": "number"
53
66
  },
54
- "flowCount": {
67
+ "keyCount": {
55
68
  "type": "number"
56
69
  },
57
- "webhookCount": {
70
+ "deviceCount": {
71
+ "type": "number"
72
+ },
73
+ "deviceRecipeCount": {
58
74
  "type": "number"
59
75
  },
60
76
  "eventCount": {
61
77
  "type": "number"
62
78
  },
63
- "keyCount": {
79
+ "experienceEndpointCount": {
64
80
  "type": "number"
65
81
  },
66
- "deviceRecipeCount": {
82
+ "experienceGroupCount": {
83
+ "type": "number"
84
+ },
85
+ "experienceUserCount": {
86
+ "type": "number"
87
+ },
88
+ "flowCount": {
89
+ "type": "number"
90
+ },
91
+ "webhookCount": {
67
92
  "type": "number"
68
93
  }
69
94
  }
@@ -47,6 +47,9 @@
47
47
  "Device",
48
48
  "DeviceRecipe",
49
49
  "Event",
50
+ "ExperienceEndpoint",
51
+ "ExperienceGroup",
52
+ "ExperienceUser",
50
53
  "Flow",
51
54
  "SolutionUser",
52
55
  "Webhook"
@@ -45,6 +45,9 @@
45
45
  "Device",
46
46
  "DeviceRecipe",
47
47
  "Event",
48
+ "ExperienceEndpoint",
49
+ "ExperienceGroup",
50
+ "ExperienceUser",
48
51
  "Flow",
49
52
  "SolutionUser",
50
53
  "Webhook"
@@ -54,6 +54,9 @@
54
54
  "Device",
55
55
  "DeviceRecipe",
56
56
  "Event",
57
+ "ExperienceEndpoint",
58
+ "ExperienceGroup",
59
+ "ExperienceUser",
57
60
  "Flow",
58
61
  "SolutionUser",
59
62
  "Webhook"
@@ -16,8 +16,7 @@
16
16
  "standalone",
17
17
  "gateway",
18
18
  "peripheral",
19
- "floating",
20
- "virtual"
19
+ "floating"
21
20
  ]
22
21
  },
23
22
  "token": {
@@ -150,7 +150,8 @@
150
150
  "items": {
151
151
  "type": "string",
152
152
  "pattern": "^[A-Fa-f\\d]{24}$"
153
- }
153
+ },
154
+ "maxItems": 1000
154
155
  },
155
156
  "deviceTags": {
156
157
  "type": "array",
@@ -168,7 +169,8 @@
168
169
  }
169
170
  },
170
171
  "additionalProperties": false
171
- }
172
+ },
173
+ "maxItems": 100
172
174
  }
173
175
  },
174
176
  "additionalProperties": false
@@ -126,7 +126,8 @@
126
126
  "items": {
127
127
  "type": "string",
128
128
  "pattern": "^[A-Fa-f\\d]{24}$"
129
- }
129
+ },
130
+ "maxItems": 1000
130
131
  },
131
132
  "deviceTags": {
132
133
  "type": "array",
@@ -144,7 +145,8 @@
144
145
  }
145
146
  },
146
147
  "additionalProperties": false
147
- }
148
+ },
149
+ "maxItems": 100
148
150
  }
149
151
  },
150
152
  "additionalProperties": false
@@ -130,7 +130,8 @@
130
130
  "items": {
131
131
  "type": "string",
132
132
  "pattern": "^[A-Fa-f\\d]{24}$"
133
- }
133
+ },
134
+ "maxItems": 1000
134
135
  },
135
136
  "deviceTags": {
136
137
  "type": "array",
@@ -148,7 +149,8 @@
148
149
  }
149
150
  },
150
151
  "additionalProperties": false
151
- }
152
+ },
153
+ "maxItems": 100
152
154
  }
153
155
  },
154
156
  "additionalProperties": false
@@ -157,7 +157,8 @@
157
157
  "items": {
158
158
  "type": "string",
159
159
  "pattern": "^[A-Fa-f\\d]{24}$"
160
- }
160
+ },
161
+ "maxItems": 1000
161
162
  },
162
163
  "deviceTags": {
163
164
  "type": "array",
@@ -175,7 +176,8 @@
175
176
  }
176
177
  },
177
178
  "additionalProperties": false
178
- }
179
+ },
180
+ "maxItems": 100
179
181
  }
180
182
  },
181
183
  "additionalProperties": false
data/schemas/device.json CHANGED
@@ -51,7 +51,8 @@
51
51
  "value"
52
52
  ],
53
53
  "additionalProperties": false
54
- }
54
+ },
55
+ "maxItems": 100
55
56
  },
56
57
  "attributes": {
57
58
  "type": "array",
@@ -77,7 +78,8 @@
77
78
  "dataType"
78
79
  ],
79
80
  "additionalProperties": false
80
- }
81
+ },
82
+ "maxItems": 100
81
83
  },
82
84
  "deviceClass": {
83
85
  "type": "string",
@@ -85,8 +87,7 @@
85
87
  "standalone",
86
88
  "gateway",
87
89
  "peripheral",
88
- "floating",
89
- "virtual"
90
+ "floating"
90
91
  ]
91
92
  },
92
93
  "gatewayId": {
@@ -31,7 +31,8 @@
31
31
  "value"
32
32
  ],
33
33
  "additionalProperties": false
34
- }
34
+ },
35
+ "maxItems": 100
35
36
  },
36
37
  "attributes": {
37
38
  "type": "array",
@@ -57,7 +58,8 @@
57
58
  "dataType"
58
59
  ],
59
60
  "additionalProperties": false
60
- }
61
+ },
62
+ "maxItems": 100
61
63
  },
62
64
  "deviceClass": {
63
65
  "type": "string",
@@ -65,8 +67,7 @@
65
67
  "standalone",
66
68
  "gateway",
67
69
  "peripheral",
68
- "floating",
69
- "virtual"
70
+ "floating"
70
71
  ]
71
72
  },
72
73
  "gatewayId": {
@@ -31,7 +31,8 @@
31
31
  "value"
32
32
  ],
33
33
  "additionalProperties": false
34
- }
34
+ },
35
+ "maxItems": 100
35
36
  },
36
37
  "attributes": {
37
38
  "type": "array",
@@ -57,7 +58,8 @@
57
58
  "dataType"
58
59
  ],
59
60
  "additionalProperties": false
60
- }
61
+ },
62
+ "maxItems": 100
61
63
  },
62
64
  "deviceClass": {
63
65
  "type": "string",
@@ -65,8 +67,7 @@
65
67
  "standalone",
66
68
  "gateway",
67
69
  "peripheral",
68
- "floating",
69
- "virtual"
70
+ "floating"
70
71
  ]
71
72
  },
72
73
  "gatewayId": {
@@ -60,7 +60,8 @@
60
60
  "value"
61
61
  ],
62
62
  "additionalProperties": false
63
- }
63
+ },
64
+ "maxItems": 100
64
65
  },
65
66
  "attributes": {
66
67
  "type": "array",
@@ -86,7 +87,8 @@
86
87
  "dataType"
87
88
  ],
88
89
  "additionalProperties": false
89
- }
90
+ },
91
+ "maxItems": 100
90
92
  },
91
93
  "deviceClass": {
92
94
  "type": "string",
@@ -94,8 +96,7 @@
94
96
  "standalone",
95
97
  "gateway",
96
98
  "peripheral",
97
- "floating",
98
- "virtual"
99
+ "floating"
99
100
  ]
100
101
  },
101
102
  "gatewayId": {
@@ -40,7 +40,8 @@
40
40
  "value"
41
41
  ],
42
42
  "additionalProperties": false
43
- }
43
+ },
44
+ "maxItems": 100
44
45
  },
45
46
  "attributes": {
46
47
  "type": "array",
@@ -66,7 +67,8 @@
66
67
  "dataType"
67
68
  ],
68
69
  "additionalProperties": false
69
- }
70
+ },
71
+ "maxItems": 100
70
72
  },
71
73
  "deviceClass": {
72
74
  "type": "string",
@@ -74,8 +76,7 @@
74
76
  "standalone",
75
77
  "gateway",
76
78
  "peripheral",
77
- "floating",
78
- "virtual"
79
+ "floating"
79
80
  ]
80
81
  },
81
82
  "gatewayId": {
@@ -40,7 +40,8 @@
40
40
  "value"
41
41
  ],
42
42
  "additionalProperties": false
43
- }
43
+ },
44
+ "maxItems": 100
44
45
  },
45
46
  "attributes": {
46
47
  "type": "array",
@@ -66,7 +67,8 @@
66
67
  "dataType"
67
68
  ],
68
69
  "additionalProperties": false
69
- }
70
+ },
71
+ "maxItems": 100
70
72
  },
71
73
  "deviceClass": {
72
74
  "type": "string",
@@ -74,8 +76,7 @@
74
76
  "standalone",
75
77
  "gateway",
76
78
  "peripheral",
77
- "floating",
78
- "virtual"
79
+ "floating"
79
80
  ]
80
81
  },
81
82
  "gatewayId": {
@@ -67,7 +67,8 @@
67
67
  "value"
68
68
  ],
69
69
  "additionalProperties": false
70
- }
70
+ },
71
+ "maxItems": 100
71
72
  },
72
73
  "attributes": {
73
74
  "type": "array",
@@ -93,7 +94,8 @@
93
94
  "dataType"
94
95
  ],
95
96
  "additionalProperties": false
96
- }
97
+ },
98
+ "maxItems": 100
97
99
  },
98
100
  "deviceClass": {
99
101
  "type": "string",
@@ -101,8 +103,7 @@
101
103
  "standalone",
102
104
  "gateway",
103
105
  "peripheral",
104
- "floating",
105
- "virtual"
106
+ "floating"
106
107
  ]
107
108
  },
108
109
  "gatewayId": {
@@ -15,5 +15,6 @@
15
15
  }
16
16
  },
17
17
  "additionalProperties": false
18
- }
18
+ },
19
+ "maxItems": 100
19
20
  }
data/schemas/devices.json CHANGED
@@ -58,7 +58,8 @@
58
58
  "value"
59
59
  ],
60
60
  "additionalProperties": false
61
- }
61
+ },
62
+ "maxItems": 100
62
63
  },
63
64
  "attributes": {
64
65
  "type": "array",
@@ -84,7 +85,8 @@
84
85
  "dataType"
85
86
  ],
86
87
  "additionalProperties": false
87
- }
88
+ },
89
+ "maxItems": 100
88
90
  },
89
91
  "deviceClass": {
90
92
  "type": "string",
@@ -92,8 +94,7 @@
92
94
  "standalone",
93
95
  "gateway",
94
96
  "peripheral",
95
- "floating",
96
- "virtual"
97
+ "floating"
97
98
  ]
98
99
  },
99
100
  "gatewayId": {
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string",
7
+ "pattern": "^[A-Fa-f\\d]{24}$"
8
+ },
9
+ "experienceEndpointId": {
10
+ "type": "string",
11
+ "pattern": "^[A-Fa-f\\d]{24}$"
12
+ },
13
+ "applicationId": {
14
+ "type": "string",
15
+ "pattern": "^[A-Fa-f\\d]{24}$"
16
+ },
17
+ "creationDate": {
18
+ "type": "string",
19
+ "format": "date-time"
20
+ },
21
+ "lastUpdated": {
22
+ "type": "string",
23
+ "format": "date-time"
24
+ },
25
+ "description": {
26
+ "type": "string",
27
+ "maxLength": 32767
28
+ },
29
+ "route": {
30
+ "type": "string",
31
+ "minLength": 1,
32
+ "maxLength": 1024
33
+ },
34
+ "enabled": {
35
+ "type": "boolean"
36
+ },
37
+ "method": {
38
+ "type": "string",
39
+ "enum": [
40
+ "delete",
41
+ "get",
42
+ "options",
43
+ "patch",
44
+ "post",
45
+ "put"
46
+ ]
47
+ },
48
+ "access": {
49
+ "type": "string",
50
+ "enum": [
51
+ "public",
52
+ "authenticated",
53
+ "group"
54
+ ]
55
+ },
56
+ "experienceGroups": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "properties": {
61
+ "name": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "maxLength": 255
65
+ },
66
+ "id": {
67
+ "type": "string",
68
+ "pattern": "^[A-Fa-f\\d]{24}$"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "description": {
6
+ "type": "string",
7
+ "maxLength": 32767
8
+ },
9
+ "route": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "maxLength": 1024
13
+ },
14
+ "enabled": {
15
+ "type": "boolean"
16
+ },
17
+ "method": {
18
+ "type": "string",
19
+ "enum": [
20
+ "delete",
21
+ "get",
22
+ "options",
23
+ "patch",
24
+ "post",
25
+ "put"
26
+ ]
27
+ },
28
+ "access": {
29
+ "type": "string",
30
+ "enum": [
31
+ "public",
32
+ "authenticated",
33
+ "group"
34
+ ]
35
+ },
36
+ "experienceGroupIds": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string",
40
+ "pattern": "^[A-Fa-f\\d]{24}$"
41
+ },
42
+ "maxItems": 1000
43
+ }
44
+ },
45
+ "additionalProperties": false
46
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "description": {
6
+ "type": "string",
7
+ "maxLength": 32767
8
+ },
9
+ "route": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "maxLength": 1024
13
+ },
14
+ "enabled": {
15
+ "type": "boolean"
16
+ },
17
+ "method": {
18
+ "type": "string",
19
+ "enum": [
20
+ "delete",
21
+ "get",
22
+ "options",
23
+ "patch",
24
+ "post",
25
+ "put"
26
+ ]
27
+ },
28
+ "access": {
29
+ "type": "string",
30
+ "enum": [
31
+ "public",
32
+ "authenticated",
33
+ "group"
34
+ ]
35
+ },
36
+ "experienceGroupIds": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "string",
40
+ "pattern": "^[A-Fa-f\\d]{24}$"
41
+ },
42
+ "maxItems": 1000
43
+ }
44
+ },
45
+ "additionalProperties": false,
46
+ "required": [
47
+ "route",
48
+ "method"
49
+ ]
50
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "patternProperties": {
5
+ ".*": {
6
+ "type": "array",
7
+ "items": {
8
+ "type": "object",
9
+ "properties": {
10
+ "time": {
11
+ "type": "string",
12
+ "format": "date-time"
13
+ },
14
+ "count": {
15
+ "type": "number"
16
+ }
17
+ }
18
+ }
19
+ }
20
+ }
21
+ }