losant_rest 1.10.3 → 1.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/docs/_schemas.md +1375 -139
  3. data/docs/application.md +42 -0
  4. data/docs/applicationApiTokens.md +1 -1
  5. data/docs/applicationTemplate.md +46 -0
  6. data/docs/applicationTemplates.md +76 -1
  7. data/docs/device.md +6 -3
  8. data/docs/me.md +0 -36
  9. data/lib/losant_rest.rb +1 -0
  10. data/lib/losant_rest/application.rb +48 -0
  11. data/lib/losant_rest/application_api_tokens.rb +1 -1
  12. data/lib/losant_rest/application_template.rb +79 -0
  13. data/lib/losant_rest/application_templates.rb +89 -1
  14. data/lib/losant_rest/client.rb +6 -2
  15. data/lib/losant_rest/device.rb +9 -3
  16. data/lib/losant_rest/me.rb +0 -41
  17. data/lib/losant_rest/version.rb +1 -1
  18. data/schemas/application.json +8 -0
  19. data/schemas/applicationApiTokenPost.json +1 -0
  20. data/schemas/applicationApplyTemplatePatch.json +19 -0
  21. data/schemas/applicationCreationByTemplateResult.json +8 -0
  22. data/schemas/applicationPost.json +8 -0
  23. data/schemas/applicationTemplate.json +20 -0
  24. data/schemas/applicationTemplateCategories.json +43 -0
  25. data/schemas/applicationTemplateCategory.json +23 -0
  26. data/schemas/applicationTemplates.json +32 -0
  27. data/schemas/applications.json +8 -0
  28. data/schemas/changePassword.json +2 -2
  29. data/schemas/dashboard.json +145 -25
  30. data/schemas/dashboardPatch.json +145 -25
  31. data/schemas/dashboardPost.json +145 -25
  32. data/schemas/dashboards.json +145 -25
  33. data/schemas/dataExport.json +132 -1
  34. data/schemas/experienceLinkedResources.json +39 -0
  35. data/schemas/flow.json +13 -0
  36. data/schemas/flowPatch.json +13 -0
  37. data/schemas/flowPost.json +13 -0
  38. data/schemas/flowVersion.json +26 -0
  39. data/schemas/flowVersionPost.json +13 -0
  40. data/schemas/flowVersions.json +26 -0
  41. data/schemas/flows.json +13 -0
  42. data/schemas/flowsImportPost.json +26 -0
  43. data/schemas/flowsImportResult.json +39 -0
  44. data/schemas/githubLogin.json +7 -3
  45. data/schemas/me.json +0 -3
  46. data/schemas/mePatch.json +2 -2
  47. data/schemas/orgInviteInfo.json +3 -0
  48. data/schemas/orgInvitePost.json +3 -0
  49. data/schemas/orgInvites.json +3 -0
  50. data/schemas/passwordResetFinish.json +2 -2
  51. data/schemas/templateKeywords.json +14 -0
  52. data/schemas/timeSeriesData.json +12 -2
  53. data/schemas/timeSeriesQuery.json +94 -14
  54. data/schemas/userCredentials.json +5 -2
  55. data/schemas/userPost.json +13 -6
  56. metadata +11 -5
@@ -27,7 +27,7 @@ module LosantRest
27
27
  #
28
28
  # User API for accessing Losant data
29
29
  #
30
- # Built For Version 1.17.3
30
+ # Built For Version 1.17.4
31
31
  class Client
32
32
  attr_accessor :auth_token, :url
33
33
 
@@ -72,6 +72,10 @@ module LosantRest
72
72
  @application_keys ||= ApplicationKeys.new(self)
73
73
  end
74
74
 
75
+ def application_template
76
+ @application_template ||= ApplicationTemplate.new(self)
77
+ end
78
+
75
79
  def application_templates
76
80
  @application_templates ||= ApplicationTemplates.new(self)
77
81
  end
@@ -278,7 +282,7 @@ module LosantRest
278
282
 
279
283
  headers["Accept"] = "application/json"
280
284
  headers["Content-Type"] = "application/json"
281
- headers["Accept-Version"] = "^1.17.3"
285
+ headers["Accept-Version"] = "^1.17.4"
282
286
  headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
283
287
  path = self.url + options.fetch(:path, "")
284
288
 
@@ -192,8 +192,9 @@ module LosantRest
192
192
  # Parameters:
193
193
  # * {string} applicationId - ID associated with the application
194
194
  # * {string} deviceId - ID associated with the device
195
- # * {string} limit - Max command entries to return (ordered by time descending)
195
+ # * {string} limit - Maximum number of command entries to return
196
196
  # * {string} since - Look for command entries since this time (ms since epoch)
197
+ # * {string} sortDirection - Direction to sort the command entries (by time). Accepted values are: asc, desc
197
198
  # * {string} losantdomain - Domain scope of request (rarely needed)
198
199
  # * {boolean} _actions - Return resource actions in response
199
200
  # * {boolean} _links - Return resource link in response
@@ -216,6 +217,7 @@ module LosantRest
216
217
 
217
218
  query_params[:limit] = params[:limit] if params.has_key?(:limit)
218
219
  query_params[:since] = params[:since] if params.has_key?(:since)
220
+ query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
219
221
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
220
222
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
221
223
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
@@ -294,8 +296,9 @@ module LosantRest
294
296
  # Parameters:
295
297
  # * {string} applicationId - ID associated with the application
296
298
  # * {string} deviceId - ID associated with the device
297
- # * {string} limit - Max log entries to return (ordered by time descending)
299
+ # * {string} limit - Maximum number of log entries to return
298
300
  # * {string} since - Look for log entries since this time (ms since epoch)
301
+ # * {string} sortDirection - Direction to sort the log entries (by time). Accepted values are: asc, desc
299
302
  # * {string} losantdomain - Domain scope of request (rarely needed)
300
303
  # * {boolean} _actions - Return resource actions in response
301
304
  # * {boolean} _links - Return resource link in response
@@ -318,6 +321,7 @@ module LosantRest
318
321
 
319
322
  query_params[:limit] = params[:limit] if params.has_key?(:limit)
320
323
  query_params[:since] = params[:since] if params.has_key?(:since)
324
+ query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
321
325
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
322
326
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
323
327
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
@@ -344,8 +348,9 @@ module LosantRest
344
348
  # Parameters:
345
349
  # * {string} applicationId - ID associated with the application
346
350
  # * {string} deviceId - ID associated with the device
347
- # * {string} limit - Max state entries to return (ordered by time descending)
351
+ # * {string} limit - Maximum number of state entries to return
348
352
  # * {string} since - Look for state entries since this time (ms since epoch)
353
+ # * {string} sortDirection - Direction to sort the state entries (by time). Accepted values are: asc, desc
349
354
  # * {string} losantdomain - Domain scope of request (rarely needed)
350
355
  # * {boolean} _actions - Return resource actions in response
351
356
  # * {boolean} _links - Return resource link in response
@@ -368,6 +373,7 @@ module LosantRest
368
373
 
369
374
  query_params[:limit] = params[:limit] if params.has_key?(:limit)
370
375
  query_params[:since] = params[:since] if params.has_key?(:since)
376
+ query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
371
377
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
372
378
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
373
379
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
@@ -248,47 +248,6 @@ module LosantRest
248
248
  body: body)
249
249
  end
250
250
 
251
- # Disconnects the user from Twitter
252
- #
253
- # Authentication:
254
- # The client must be configured with a valid api
255
- # access token to call this action. The token
256
- # must include at least one of the following scopes:
257
- # all.User, me.*, or me.disconnectTwitter.
258
- #
259
- # Parameters:
260
- # * {string} losantdomain - Domain scope of request (rarely needed)
261
- # * {boolean} _actions - Return resource actions in response
262
- # * {boolean} _links - Return resource link in response
263
- # * {boolean} _embedded - Return embedded resources in response
264
- #
265
- # Responses:
266
- # * 200 - Updated user information (https://api.losant.com/#/definitions/me)
267
- #
268
- # Errors:
269
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
270
- def disconnect_twitter(params = {})
271
- params = Utils.symbolize_hash_keys(params)
272
- query_params = { _actions: false, _links: true, _embedded: true }
273
- headers = {}
274
- body = nil
275
-
276
-
277
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
278
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
279
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
280
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
281
-
282
- path = "/me/disconnectTwitter"
283
-
284
- @client.request(
285
- method: :patch,
286
- path: path,
287
- query: query_params,
288
- headers: headers,
289
- body: body)
290
- end
291
-
292
251
  # Enables two factor auth for the current user
293
252
  #
294
253
  # Authentication:
@@ -21,5 +21,5 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  module LosantRest
24
- VERSION = "1.10.3"
24
+ VERSION = "1.10.4"
25
25
  end
@@ -18,6 +18,14 @@
18
18
  "type": "string",
19
19
  "format": "date-time"
20
20
  },
21
+ "appliedTemplateIds": {
22
+ "type": "array",
23
+ "items": {
24
+ "type": "string",
25
+ "pattern": "^[A-Fa-f\\d]{24}$"
26
+ },
27
+ "maxItems": 1000
28
+ },
21
29
  "ownerId": {
22
30
  "type": "string",
23
31
  "pattern": "^[A-Fa-f\\d]{24}$"
@@ -73,6 +73,7 @@
73
73
  "notebooks.*",
74
74
  "webhook.*",
75
75
  "webhooks.*",
76
+ "application.applyTemplate",
76
77
  "application.archiveData",
77
78
  "application.backfillArchiveData",
78
79
  "application.clone",
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "templateId": {
6
+ "type": "string",
7
+ "pattern": "^[A-Fa-f\\d]{24}$"
8
+ },
9
+ "email": {
10
+ "type": "string",
11
+ "format": "email",
12
+ "maxLength": 1024
13
+ }
14
+ },
15
+ "required": [
16
+ "templateId"
17
+ ],
18
+ "additionalProperties": false
19
+ }
@@ -23,6 +23,14 @@
23
23
  "type": "string",
24
24
  "format": "date-time"
25
25
  },
26
+ "appliedTemplateIds": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string",
30
+ "pattern": "^[A-Fa-f\\d]{24}$"
31
+ },
32
+ "maxItems": 1000
33
+ },
26
34
  "ownerId": {
27
35
  "type": "string",
28
36
  "pattern": "^[A-Fa-f\\d]{24}$"
@@ -19,6 +19,14 @@
19
19
  "type": "string",
20
20
  "maxLength": 1024
21
21
  },
22
+ "appliedTemplateIds": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string",
26
+ "pattern": "^[A-Fa-f\\d]{24}$"
27
+ },
28
+ "maxItems": 1000
29
+ },
22
30
  "endpointSlug": {
23
31
  "type": "string",
24
32
  "minLength": 4,
@@ -19,6 +19,26 @@
19
19
  "minLength": 1,
20
20
  "maxLength": 255
21
21
  },
22
+ "readme": {
23
+ "type": "string",
24
+ "maxLength": 131072
25
+ },
26
+ "categoryIds": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string",
30
+ "pattern": "^[A-Fa-f\\d]{24}$"
31
+ },
32
+ "maxItems": 1000
33
+ },
34
+ "keywords": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "string",
38
+ "pattern": "^[0-9a-zA-Z_-]{1,255}$"
39
+ },
40
+ "maxItems": 100
41
+ },
22
42
  "description": {
23
43
  "type": "string",
24
44
  "maxLength": 1024
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "items": {
6
+ "type": "array",
7
+ "items": {
8
+ "title": "Application Template Category",
9
+ "description": "Schema for a single Application Template Category",
10
+ "type": "object",
11
+ "properties": {
12
+ "id": {
13
+ "type": "string",
14
+ "pattern": "^[A-Fa-f\\d]{24}$"
15
+ },
16
+ "parentId": {
17
+ "type": "string",
18
+ "pattern": "^[A-Fa-f\\d]{24}$"
19
+ },
20
+ "name": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 255
24
+ },
25
+ "description": {
26
+ "type": "string",
27
+ "maxLength": 32767
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "baseId": {
33
+ "type": "string",
34
+ "pattern": "^[A-Fa-f\\d]{24}$"
35
+ },
36
+ "count": {
37
+ "type": "integer"
38
+ },
39
+ "totalCount": {
40
+ "type": "integer"
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,23 @@
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
+ "parentId": {
10
+ "type": "string",
11
+ "pattern": "^[A-Fa-f\\d]{24}$"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "maxLength": 255
17
+ },
18
+ "description": {
19
+ "type": "string",
20
+ "maxLength": 32767
21
+ }
22
+ }
23
+ }
@@ -26,6 +26,26 @@
26
26
  "minLength": 1,
27
27
  "maxLength": 255
28
28
  },
29
+ "readme": {
30
+ "type": "string",
31
+ "maxLength": 131072
32
+ },
33
+ "categoryIds": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "string",
37
+ "pattern": "^[A-Fa-f\\d]{24}$"
38
+ },
39
+ "maxItems": 1000
40
+ },
41
+ "keywords": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "string",
45
+ "pattern": "^[0-9a-zA-Z_-]{1,255}$"
46
+ },
47
+ "maxItems": 100
48
+ },
29
49
  "description": {
30
50
  "type": "string",
31
51
  "maxLength": 1024
@@ -123,6 +143,18 @@
123
143
  "filterField": {
124
144
  "type": "string"
125
145
  },
146
+ "categoryId": {
147
+ "type": "string",
148
+ "pattern": "^[A-Fa-f\\d]{24}$"
149
+ },
150
+ "keywords": {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "string",
154
+ "pattern": "^[0-9a-zA-Z_-]{1,255}$"
155
+ },
156
+ "maxItems": 100
157
+ },
126
158
  "sortField": {
127
159
  "type": "string"
128
160
  },
@@ -25,6 +25,14 @@
25
25
  "type": "string",
26
26
  "format": "date-time"
27
27
  },
28
+ "appliedTemplateIds": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "string",
32
+ "pattern": "^[A-Fa-f\\d]{24}$"
33
+ },
34
+ "maxItems": 1000
35
+ },
28
36
  "ownerId": {
29
37
  "type": "string",
30
38
  "pattern": "^[A-Fa-f\\d]{24}$"
@@ -13,9 +13,9 @@
13
13
  },
14
14
  "newPassword": {
15
15
  "type": "string",
16
- "minLength": 8,
16
+ "minLength": 12,
17
17
  "maxLength": 2048,
18
- "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$"
18
+ "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{12,}$"
19
19
  },
20
20
  "invalidateExistingTokens": {
21
21
  "type": "boolean"
@@ -349,8 +349,18 @@
349
349
  "type": "object",
350
350
  "properties": {
351
351
  "value": {
352
- "type": "string",
353
- "maxLength": 255
352
+ "oneOf": [
353
+ {
354
+ "type": "string",
355
+ "maxLength": 255
356
+ },
357
+ {
358
+ "type": "number"
359
+ },
360
+ {
361
+ "type": "boolean"
362
+ }
363
+ ]
354
364
  }
355
365
  },
356
366
  "additionalProperties": false,
@@ -603,8 +613,18 @@
603
613
  "type": "object",
604
614
  "properties": {
605
615
  "value": {
606
- "type": "string",
607
- "maxLength": 255
616
+ "oneOf": [
617
+ {
618
+ "type": "string",
619
+ "maxLength": 255
620
+ },
621
+ {
622
+ "type": "number"
623
+ },
624
+ {
625
+ "type": "boolean"
626
+ }
627
+ ]
608
628
  }
609
629
  },
610
630
  "additionalProperties": false,
@@ -766,8 +786,18 @@
766
786
  "type": "object",
767
787
  "properties": {
768
788
  "value": {
769
- "type": "string",
770
- "maxLength": 255
789
+ "oneOf": [
790
+ {
791
+ "type": "string",
792
+ "maxLength": 255
793
+ },
794
+ {
795
+ "type": "number"
796
+ },
797
+ {
798
+ "type": "boolean"
799
+ }
800
+ ]
771
801
  }
772
802
  },
773
803
  "additionalProperties": false,
@@ -1748,8 +1778,18 @@
1748
1778
  "type": "object",
1749
1779
  "properties": {
1750
1780
  "value": {
1751
- "type": "string",
1752
- "maxLength": 255
1781
+ "oneOf": [
1782
+ {
1783
+ "type": "string",
1784
+ "maxLength": 255
1785
+ },
1786
+ {
1787
+ "type": "number"
1788
+ },
1789
+ {
1790
+ "type": "boolean"
1791
+ }
1792
+ ]
1753
1793
  }
1754
1794
  },
1755
1795
  "additionalProperties": false,
@@ -2038,8 +2078,18 @@
2038
2078
  "type": "object",
2039
2079
  "properties": {
2040
2080
  "value": {
2041
- "type": "string",
2042
- "maxLength": 255
2081
+ "oneOf": [
2082
+ {
2083
+ "type": "string",
2084
+ "maxLength": 255
2085
+ },
2086
+ {
2087
+ "type": "number"
2088
+ },
2089
+ {
2090
+ "type": "boolean"
2091
+ }
2092
+ ]
2043
2093
  }
2044
2094
  },
2045
2095
  "additionalProperties": false,
@@ -2524,7 +2574,7 @@
2524
2574
  },
2525
2575
  "segments": {
2526
2576
  "type": "array",
2527
- "maxItems": 100,
2577
+ "maxItems": 300,
2528
2578
  "items": {
2529
2579
  "oneOf": [
2530
2580
  {
@@ -2620,8 +2670,18 @@
2620
2670
  "type": "object",
2621
2671
  "properties": {
2622
2672
  "value": {
2623
- "type": "string",
2624
- "maxLength": 255
2673
+ "oneOf": [
2674
+ {
2675
+ "type": "string",
2676
+ "maxLength": 255
2677
+ },
2678
+ {
2679
+ "type": "number"
2680
+ },
2681
+ {
2682
+ "type": "boolean"
2683
+ }
2684
+ ]
2625
2685
  }
2626
2686
  },
2627
2687
  "additionalProperties": false,
@@ -3214,8 +3274,18 @@
3214
3274
  "type": "object",
3215
3275
  "properties": {
3216
3276
  "value": {
3217
- "type": "string",
3218
- "maxLength": 255
3277
+ "oneOf": [
3278
+ {
3279
+ "type": "string",
3280
+ "maxLength": 255
3281
+ },
3282
+ {
3283
+ "type": "number"
3284
+ },
3285
+ {
3286
+ "type": "boolean"
3287
+ }
3288
+ ]
3219
3289
  }
3220
3290
  },
3221
3291
  "additionalProperties": false,
@@ -3561,8 +3631,18 @@
3561
3631
  "type": "object",
3562
3632
  "properties": {
3563
3633
  "value": {
3564
- "type": "string",
3565
- "maxLength": 255
3634
+ "oneOf": [
3635
+ {
3636
+ "type": "string",
3637
+ "maxLength": 255
3638
+ },
3639
+ {
3640
+ "type": "number"
3641
+ },
3642
+ {
3643
+ "type": "boolean"
3644
+ }
3645
+ ]
3566
3646
  }
3567
3647
  },
3568
3648
  "additionalProperties": false,
@@ -3785,8 +3865,18 @@
3785
3865
  "type": "object",
3786
3866
  "properties": {
3787
3867
  "value": {
3788
- "type": "string",
3789
- "maxLength": 255
3868
+ "oneOf": [
3869
+ {
3870
+ "type": "string",
3871
+ "maxLength": 255
3872
+ },
3873
+ {
3874
+ "type": "number"
3875
+ },
3876
+ {
3877
+ "type": "boolean"
3878
+ }
3879
+ ]
3790
3880
  }
3791
3881
  },
3792
3882
  "additionalProperties": false,
@@ -3964,8 +4054,18 @@
3964
4054
  "type": "object",
3965
4055
  "properties": {
3966
4056
  "value": {
3967
- "type": "string",
3968
- "maxLength": 255
4057
+ "oneOf": [
4058
+ {
4059
+ "type": "string",
4060
+ "maxLength": 255
4061
+ },
4062
+ {
4063
+ "type": "number"
4064
+ },
4065
+ {
4066
+ "type": "boolean"
4067
+ }
4068
+ ]
3969
4069
  }
3970
4070
  },
3971
4071
  "additionalProperties": false,
@@ -4144,8 +4244,18 @@
4144
4244
  "type": "object",
4145
4245
  "properties": {
4146
4246
  "value": {
4147
- "type": "string",
4148
- "maxLength": 255
4247
+ "oneOf": [
4248
+ {
4249
+ "type": "string",
4250
+ "maxLength": 255
4251
+ },
4252
+ {
4253
+ "type": "number"
4254
+ },
4255
+ {
4256
+ "type": "boolean"
4257
+ }
4258
+ ]
4149
4259
  }
4150
4260
  },
4151
4261
  "additionalProperties": false,
@@ -4794,8 +4904,18 @@
4794
4904
  "type": "object",
4795
4905
  "properties": {
4796
4906
  "value": {
4797
- "type": "string",
4798
- "maxLength": 255
4907
+ "oneOf": [
4908
+ {
4909
+ "type": "string",
4910
+ "maxLength": 255
4911
+ },
4912
+ {
4913
+ "type": "number"
4914
+ },
4915
+ {
4916
+ "type": "boolean"
4917
+ }
4918
+ ]
4799
4919
  }
4800
4920
  },
4801
4921
  "additionalProperties": false,