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
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "items": {
6
+ "type": "array",
7
+ "items": {
8
+ "$ref": "#/definitions/experienceEndpoints"
9
+ }
10
+ },
11
+ "count": {
12
+ "type": "integer"
13
+ },
14
+ "totalCount": {
15
+ "type": "integer"
16
+ },
17
+ "filter": {
18
+ "type": "string"
19
+ },
20
+ "filterField": {
21
+ "type": "string"
22
+ },
23
+ "sortField": {
24
+ "type": "string"
25
+ },
26
+ "sortDirection": {
27
+ "type": "string",
28
+ "enum": [
29
+ "asc",
30
+ "desc"
31
+ ]
32
+ },
33
+ "applicationId": {
34
+ "type": "string",
35
+ "pattern": "^[A-Fa-f\\d]{24}$"
36
+ },
37
+ "experienceGroupId": {
38
+ "type": "string",
39
+ "pattern": "^[A-Fa-f\\d]{24}$"
40
+ },
41
+ "notFoundRequestCount": {
42
+ "type": "number"
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,51 @@
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
+ "experienceGroupId": {
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
+ "name": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 255
29
+ },
30
+ "description": {
31
+ "type": "string",
32
+ "maxLength": 32767
33
+ },
34
+ "experienceUserIds": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "string",
38
+ "pattern": "^[A-Fa-f\\d]{24}$"
39
+ },
40
+ "maxItems": 1000
41
+ },
42
+ "experienceEndpointIds": {
43
+ "type": "array",
44
+ "items": {
45
+ "type": "string",
46
+ "pattern": "^[A-Fa-f\\d]{24}$"
47
+ },
48
+ "maxItems": 1000
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "name": {
6
+ "type": "string",
7
+ "minLength": 1,
8
+ "maxLength": 255
9
+ },
10
+ "description": {
11
+ "type": "string",
12
+ "maxLength": 32767
13
+ },
14
+ "experienceUserIds": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "string",
18
+ "pattern": "^[A-Fa-f\\d]{24}$"
19
+ },
20
+ "maxItems": 1000
21
+ },
22
+ "experienceEndpointIds": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string",
26
+ "pattern": "^[A-Fa-f\\d]{24}$"
27
+ },
28
+ "maxItems": 1000
29
+ }
30
+ },
31
+ "additionalProperties": false
32
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "name": {
6
+ "type": "string",
7
+ "minLength": 1,
8
+ "maxLength": 255
9
+ },
10
+ "description": {
11
+ "type": "string",
12
+ "maxLength": 32767
13
+ },
14
+ "experienceUserIds": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "string",
18
+ "pattern": "^[A-Fa-f\\d]{24}$"
19
+ },
20
+ "maxItems": 1000
21
+ },
22
+ "experienceEndpointIds": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string",
26
+ "pattern": "^[A-Fa-f\\d]{24}$"
27
+ },
28
+ "maxItems": 1000
29
+ }
30
+ },
31
+ "additionalProperties": false,
32
+ "required": [
33
+ "name"
34
+ ]
35
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "items": {
6
+ "type": "array",
7
+ "items": {
8
+ "title": "Experience Group",
9
+ "description": "Schema for a single Experience Group",
10
+ "type": "object",
11
+ "properties": {
12
+ "id": {
13
+ "type": "string",
14
+ "pattern": "^[A-Fa-f\\d]{24}$"
15
+ },
16
+ "experienceGroupId": {
17
+ "type": "string",
18
+ "pattern": "^[A-Fa-f\\d]{24}$"
19
+ },
20
+ "applicationId": {
21
+ "type": "string",
22
+ "pattern": "^[A-Fa-f\\d]{24}$"
23
+ },
24
+ "creationDate": {
25
+ "type": "string",
26
+ "format": "date-time"
27
+ },
28
+ "lastUpdated": {
29
+ "type": "string",
30
+ "format": "date-time"
31
+ },
32
+ "name": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 255
36
+ },
37
+ "description": {
38
+ "type": "string",
39
+ "maxLength": 32767
40
+ },
41
+ "experienceUserIds": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "string",
45
+ "pattern": "^[A-Fa-f\\d]{24}$"
46
+ },
47
+ "maxItems": 1000
48
+ },
49
+ "experienceEndpointIds": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string",
53
+ "pattern": "^[A-Fa-f\\d]{24}$"
54
+ },
55
+ "maxItems": 1000
56
+ }
57
+ }
58
+ }
59
+ },
60
+ "count": {
61
+ "type": "integer"
62
+ },
63
+ "totalCount": {
64
+ "type": "integer"
65
+ },
66
+ "perPage": {
67
+ "type": "integer"
68
+ },
69
+ "page": {
70
+ "type": "integer"
71
+ },
72
+ "filter": {
73
+ "type": "string"
74
+ },
75
+ "filterField": {
76
+ "type": "string"
77
+ },
78
+ "sortField": {
79
+ "type": "string"
80
+ },
81
+ "sortDirection": {
82
+ "type": "string",
83
+ "enum": [
84
+ "asc",
85
+ "desc"
86
+ ]
87
+ },
88
+ "applicationId": {
89
+ "type": "string",
90
+ "pattern": "^[A-Fa-f\\d]{24}$"
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,83 @@
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
+ "experienceUserId": {
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
+ "passwordLastUpdated": {
26
+ "type": "string",
27
+ "format": "date-time"
28
+ },
29
+ "lastLogin": {
30
+ "type": "string",
31
+ "format": "date-time"
32
+ },
33
+ "email": {
34
+ "type": "string",
35
+ "format": "email",
36
+ "maxLength": 1024
37
+ },
38
+ "firstName": {
39
+ "type": "string",
40
+ "maxLength": 1024
41
+ },
42
+ "lastName": {
43
+ "type": "string",
44
+ "maxLength": 1024
45
+ },
46
+ "avatarUrl": {
47
+ "type": "string",
48
+ "format": "url"
49
+ },
50
+ "tokenCutoff": {
51
+ "type": "string",
52
+ "format": "date-time"
53
+ },
54
+ "userTags": {
55
+ "type": "object",
56
+ "patternProperties": {
57
+ "^[0-9a-zA-Z_-]{1,255}$": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "maxLength": 255
61
+ }
62
+ },
63
+ "additionalProperties": false
64
+ },
65
+ "experienceGroups": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "object",
69
+ "properties": {
70
+ "name": {
71
+ "type": "string",
72
+ "minLength": 1,
73
+ "maxLength": 255
74
+ },
75
+ "id": {
76
+ "type": "string",
77
+ "pattern": "^[A-Fa-f\\d]{24}$"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "email": {
6
+ "type": "string",
7
+ "format": "email",
8
+ "maxLength": 1024
9
+ },
10
+ "firstName": {
11
+ "type": "string",
12
+ "maxLength": 1024
13
+ },
14
+ "lastName": {
15
+ "type": "string",
16
+ "maxLength": 1024
17
+ },
18
+ "password": {
19
+ "type": "string",
20
+ "minLength": 8,
21
+ "maxLength": 2048
22
+ },
23
+ "tokenCutoff": {
24
+ "type": "string",
25
+ "format": "date-time"
26
+ },
27
+ "userTags": {
28
+ "type": "object",
29
+ "patternProperties": {
30
+ "^[0-9a-zA-Z_-]{1,255}$": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 255
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "experienceGroupIds": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string",
42
+ "pattern": "^[A-Fa-f\\d]{24}$"
43
+ },
44
+ "maxItems": 1000
45
+ }
46
+ },
47
+ "additionalProperties": false
48
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "email": {
6
+ "type": "string",
7
+ "format": "email",
8
+ "maxLength": 1024
9
+ },
10
+ "firstName": {
11
+ "type": "string",
12
+ "maxLength": 1024
13
+ },
14
+ "lastName": {
15
+ "type": "string",
16
+ "maxLength": 1024
17
+ },
18
+ "password": {
19
+ "type": "string",
20
+ "minLength": 8,
21
+ "maxLength": 2048
22
+ },
23
+ "tokenCutoff": {
24
+ "type": "string",
25
+ "format": "date-time"
26
+ },
27
+ "userTags": {
28
+ "type": "object",
29
+ "patternProperties": {
30
+ "^[0-9a-zA-Z_-]{1,255}$": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 255
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "experienceGroupIds": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string",
42
+ "pattern": "^[A-Fa-f\\d]{24}$"
43
+ },
44
+ "maxItems": 1000
45
+ }
46
+ },
47
+ "additionalProperties": false,
48
+ "required": [
49
+ "email",
50
+ "password"
51
+ ]
52
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "items": {
6
+ "type": "array",
7
+ "items": {
8
+ "title": "Experience User",
9
+ "description": "Schema for a single Experience User",
10
+ "type": "object",
11
+ "properties": {
12
+ "id": {
13
+ "type": "string",
14
+ "pattern": "^[A-Fa-f\\d]{24}$"
15
+ },
16
+ "experienceUserId": {
17
+ "type": "string",
18
+ "pattern": "^[A-Fa-f\\d]{24}$"
19
+ },
20
+ "applicationId": {
21
+ "type": "string",
22
+ "pattern": "^[A-Fa-f\\d]{24}$"
23
+ },
24
+ "creationDate": {
25
+ "type": "string",
26
+ "format": "date-time"
27
+ },
28
+ "lastUpdated": {
29
+ "type": "string",
30
+ "format": "date-time"
31
+ },
32
+ "passwordLastUpdated": {
33
+ "type": "string",
34
+ "format": "date-time"
35
+ },
36
+ "lastLogin": {
37
+ "type": "string",
38
+ "format": "date-time"
39
+ },
40
+ "email": {
41
+ "type": "string",
42
+ "format": "email",
43
+ "maxLength": 1024
44
+ },
45
+ "firstName": {
46
+ "type": "string",
47
+ "maxLength": 1024
48
+ },
49
+ "lastName": {
50
+ "type": "string",
51
+ "maxLength": 1024
52
+ },
53
+ "avatarUrl": {
54
+ "type": "string",
55
+ "format": "url"
56
+ },
57
+ "tokenCutoff": {
58
+ "type": "string",
59
+ "format": "date-time"
60
+ },
61
+ "userTags": {
62
+ "type": "object",
63
+ "patternProperties": {
64
+ "^[0-9a-zA-Z_-]{1,255}$": {
65
+ "type": "string",
66
+ "minLength": 1,
67
+ "maxLength": 255
68
+ }
69
+ },
70
+ "additionalProperties": false
71
+ },
72
+ "experienceGroups": {
73
+ "type": "array",
74
+ "items": {
75
+ "type": "object",
76
+ "properties": {
77
+ "name": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 255
81
+ },
82
+ "id": {
83
+ "type": "string",
84
+ "pattern": "^[A-Fa-f\\d]{24}$"
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ },
92
+ "count": {
93
+ "type": "integer"
94
+ },
95
+ "totalCount": {
96
+ "type": "integer"
97
+ },
98
+ "perPage": {
99
+ "type": "integer"
100
+ },
101
+ "page": {
102
+ "type": "integer"
103
+ },
104
+ "filter": {
105
+ "type": "string"
106
+ },
107
+ "filterField": {
108
+ "type": "string"
109
+ },
110
+ "sortField": {
111
+ "type": "string"
112
+ },
113
+ "sortDirection": {
114
+ "type": "string",
115
+ "enum": [
116
+ "asc",
117
+ "desc"
118
+ ]
119
+ },
120
+ "applicationId": {
121
+ "type": "string",
122
+ "pattern": "^[A-Fa-f\\d]{24}$"
123
+ },
124
+ "experienceGroupId": {
125
+ "type": "string",
126
+ "pattern": "^[A-Fa-f\\d]{24}$"
127
+ }
128
+ }
129
+ }
data/schemas/flow.json CHANGED
@@ -40,10 +40,25 @@
40
40
  "type": "object",
41
41
  "properties": {
42
42
  "key": {
43
- "type": "string"
43
+ "type": "string",
44
+ "maxLength": 1024
44
45
  },
45
46
  "type": {
46
- "type": "string"
47
+ "type": "string",
48
+ "enum": [
49
+ "deviceId",
50
+ "deviceTag",
51
+ "mqttTopic",
52
+ "webhook",
53
+ "timer",
54
+ "event",
55
+ "virtualButton",
56
+ "endpoint",
57
+ "deviceIdConnect",
58
+ "deviceIdDisconnect",
59
+ "deviceTagConnect",
60
+ "deviceTagDisconnect"
61
+ ]
47
62
  },
48
63
  "config": {
49
64
  "type": "object"
@@ -56,9 +71,12 @@
56
71
  "items": {
57
72
  "type": "array",
58
73
  "items": {
59
- "type": "string"
60
- }
61
- }
74
+ "type": "string",
75
+ "maxLength": 255
76
+ },
77
+ "maxItems": 100
78
+ },
79
+ "maxItems": 100
62
80
  }
63
81
  },
64
82
  "additionalProperties": false,
@@ -73,10 +91,13 @@
73
91
  "type": "object",
74
92
  "properties": {
75
93
  "id": {
76
- "type": "string"
94
+ "type": "string",
95
+ "maxLength": 1024
77
96
  },
78
97
  "type": {
79
- "type": "string"
98
+ "type": "string",
99
+ "minLength": 1,
100
+ "maxLength": 1024
80
101
  },
81
102
  "config": {
82
103
  "type": "object"
@@ -89,9 +110,12 @@
89
110
  "items": {
90
111
  "type": "array",
91
112
  "items": {
92
- "type": "string"
93
- }
94
- }
113
+ "type": "string",
114
+ "maxLength": 255
115
+ },
116
+ "maxItems": 100
117
+ },
118
+ "maxItems": 100
95
119
  }
96
120
  },
97
121
  "additionalProperties": false,
data/schemas/flowLog.json CHANGED
@@ -8,35 +8,18 @@
8
8
  "type": "string",
9
9
  "format": "date-time"
10
10
  },
11
- "errorCount": {
11
+ "pathsFailed": {
12
12
  "type": "number"
13
13
  },
14
14
  "pathsCompleted": {
15
15
  "type": "number"
16
16
  },
17
- "totalCount": {
18
- "type": "number"
19
- },
20
- "totalTime": {
17
+ "runCount": {
21
18
  "type": "number"
22
19
  },
23
20
  "wallTime": {
24
21
  "type": "number"
25
22
  },
26
- "nodes": {
27
- "type": "object",
28
- "additionalProperties": {
29
- "type": "object",
30
- "properties": {
31
- "time": {
32
- "type": "number"
33
- },
34
- "count": {
35
- "type": "number"
36
- }
37
- }
38
- }
39
- },
40
23
  "errors": {
41
24
  "type": "array",
42
25
  "items": {}