losant_rest 1.10.2 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/docs/_schemas.md +21561 -8561
  4. data/docs/application.md +83 -0
  5. data/docs/applicationApiTokens.md +2 -2
  6. data/docs/applicationCertificateAuthorities.md +1 -1
  7. data/docs/applicationCertificates.md +1 -1
  8. data/docs/applicationDashboard.md +133 -0
  9. data/docs/applicationDashboards.md +93 -0
  10. data/docs/applicationKeys.md +4 -3
  11. data/docs/applicationTemplate.md +46 -0
  12. data/docs/applicationTemplates.md +77 -2
  13. data/docs/applications.md +1 -1
  14. data/docs/auditLogs.md +1 -1
  15. data/docs/dashboards.md +1 -1
  16. data/docs/dataTables.md +1 -1
  17. data/docs/device.md +6 -3
  18. data/docs/deviceRecipes.md +1 -1
  19. data/docs/devices.md +130 -4
  20. data/docs/edgeDeployments.md +1 -1
  21. data/docs/events.md +1 -1
  22. data/docs/experienceEndpoint.md +1 -0
  23. data/docs/experienceEndpoints.md +1 -0
  24. data/docs/experienceGroups.md +1 -1
  25. data/docs/experienceUsers.md +1 -1
  26. data/docs/experienceVersions.md +1 -1
  27. data/docs/experienceViews.md +1 -1
  28. data/docs/file.md +4 -4
  29. data/docs/files.md +1 -1
  30. data/docs/flow.md +94 -1
  31. data/docs/flowVersion.md +96 -1
  32. data/docs/flowVersions.md +2 -1
  33. data/docs/flows.md +5 -2
  34. data/docs/integration.md +1 -0
  35. data/docs/integrations.md +1 -1
  36. data/docs/me.md +0 -36
  37. data/docs/notebooks.md +1 -1
  38. data/docs/orgs.md +1 -1
  39. data/docs/webhook.md +1 -0
  40. data/docs/webhooks.md +1 -1
  41. data/lib/losant_rest.rb +3 -0
  42. data/lib/losant_rest/application.rb +95 -0
  43. data/lib/losant_rest/application_api_tokens.rb +1 -1
  44. data/lib/losant_rest/application_dashboard.rb +176 -0
  45. data/lib/losant_rest/application_dashboards.rb +138 -0
  46. data/lib/losant_rest/application_keys.rb +3 -0
  47. data/lib/losant_rest/application_template.rb +79 -0
  48. data/lib/losant_rest/application_templates.rb +89 -1
  49. data/lib/losant_rest/client.rb +14 -2
  50. data/lib/losant_rest/device.rb +9 -3
  51. data/lib/losant_rest/devices.rb +154 -1
  52. data/lib/losant_rest/experience_endpoint.rb +2 -0
  53. data/lib/losant_rest/experience_endpoints.rb +2 -0
  54. data/lib/losant_rest/file.rb +3 -3
  55. data/lib/losant_rest/flow.rb +115 -1
  56. data/lib/losant_rest/flow_version.rb +115 -1
  57. data/lib/losant_rest/flow_versions.rb +3 -0
  58. data/lib/losant_rest/flows.rb +8 -0
  59. data/lib/losant_rest/integration.rb +2 -0
  60. data/lib/losant_rest/me.rb +0 -41
  61. data/lib/losant_rest/version.rb +1 -1
  62. data/lib/losant_rest/webhook.rb +2 -0
  63. data/schemas/advancedApplicationKeyQuery.json +1082 -0
  64. data/schemas/advancedFlowByVersionQuery.json +665 -0
  65. data/schemas/advancedFlowQuery.json +883 -0
  66. data/schemas/advancedFlowVersionQuery.json +925 -0
  67. data/schemas/application.json +8 -0
  68. data/schemas/applicationApiTokenPost.json +16 -1
  69. data/schemas/applicationApplyTemplatePatch.json +19 -0
  70. data/schemas/applicationCreationByTemplateResult.json +8 -0
  71. data/schemas/applicationDashboardPost.json +5665 -0
  72. data/schemas/applicationGlobalPatch.json +33 -0
  73. data/schemas/applicationPost.json +8 -0
  74. data/schemas/applicationTemplate.json +20 -0
  75. data/schemas/applicationTemplateCategories.json +43 -0
  76. data/schemas/applicationTemplateCategory.json +23 -0
  77. data/schemas/applicationTemplates.json +32 -0
  78. data/schemas/applications.json +8 -0
  79. data/schemas/attributeNamesResponse.json +14 -0
  80. data/schemas/authedUser.json +3 -0
  81. data/schemas/changePassword.json +2 -2
  82. data/schemas/dashboard.json +195 -26
  83. data/schemas/dashboardPatch.json +195 -26
  84. data/schemas/dashboardPost.json +195 -26
  85. data/schemas/dashboards.json +195 -26
  86. data/schemas/dataExport.json +132 -1
  87. data/schemas/deviceAttributeDataTypeFilter.json +29 -0
  88. data/schemas/deviceClassFilter.json +1 -2
  89. data/schemas/eventPost.json +22 -0
  90. data/schemas/experienceDomain.json +1 -1
  91. data/schemas/experienceDomainPatch.json +1 -1
  92. data/schemas/experienceDomainPost.json +1 -1
  93. data/schemas/experienceDomains.json +1 -1
  94. data/schemas/experienceLinkedResources.json +96 -0
  95. data/schemas/experienceVersion.json +10 -1
  96. data/schemas/experienceVersionPatch.json +9 -0
  97. data/schemas/experienceVersions.json +10 -1
  98. data/schemas/files.json +3 -0
  99. data/schemas/flow.json +32 -0
  100. data/schemas/flowErrors.json +87 -0
  101. data/schemas/flowPatch.json +32 -0
  102. data/schemas/flowPost.json +32 -0
  103. data/schemas/flowStats.json +54 -0
  104. data/schemas/flowVersion.json +64 -0
  105. data/schemas/flowVersionPost.json +32 -0
  106. data/schemas/flowVersions.json +64 -0
  107. data/schemas/flows.json +32 -0
  108. data/schemas/flowsImportPost.json +64 -0
  109. data/schemas/flowsImportResult.json +96 -0
  110. data/schemas/githubLogin.json +33 -4
  111. data/schemas/instance.json +132 -0
  112. data/schemas/instanceOrg.json +119 -0
  113. data/schemas/instanceOrgPatch.json +103 -0
  114. data/schemas/instanceOrgPost.json +114 -0
  115. data/schemas/instanceOrgs.json +160 -0
  116. data/schemas/instances.json +43 -0
  117. data/schemas/integration.json +3 -0
  118. data/schemas/integrationPatch.json +3 -0
  119. data/schemas/integrationPost.json +3 -0
  120. data/schemas/integrations.json +3 -0
  121. data/schemas/me.json +3 -3
  122. data/schemas/mePatch.json +2 -2
  123. data/schemas/notebook.json +96 -0
  124. data/schemas/notebookExecutionLogs.json +7 -0
  125. data/schemas/notebookPatch.json +96 -0
  126. data/schemas/notebookPost.json +96 -0
  127. data/schemas/notebooks.json +96 -0
  128. data/schemas/org.json +1 -1
  129. data/schemas/orgInviteInfo.json +3 -0
  130. data/schemas/orgInvitePost.json +3 -0
  131. data/schemas/orgInvites.json +3 -0
  132. data/schemas/orgPatch.json +1 -1
  133. data/schemas/orgs.json +1 -1
  134. data/schemas/passwordResetFinish.json +2 -2
  135. data/schemas/samlResponse.json +1 -1
  136. data/schemas/tagKeysResponse.json +14 -0
  137. data/schemas/tagValuesResponse.json +19 -0
  138. data/schemas/templateKeywords.json +14 -0
  139. data/schemas/timeSeriesData.json +12 -2
  140. data/schemas/timeSeriesQuery.json +94 -14
  141. data/schemas/userCredentials.json +31 -3
  142. data/schemas/userPost.json +39 -7
  143. metadata +34 -6
data/docs/flowVersion.md CHANGED
@@ -7,9 +7,11 @@ parameters and the potential responses.
7
7
  ##### Contents
8
8
 
9
9
  * [Delete](#delete)
10
+ * [Errors](#errors)
10
11
  * [Get](#get)
11
12
  * [Get Log Entries](#get-log-entries)
12
13
  * [Patch](#patch)
14
+ * [Stats](#stats)
13
15
 
14
16
  <br/>
15
17
 
@@ -55,6 +57,53 @@ all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.delet
55
57
 
56
58
  <br/>
57
59
 
60
+ ## Errors
61
+
62
+ Get information about errors that occurred during runs of this workflow version
63
+
64
+ ```ruby
65
+ result = client.flow_version.errors(
66
+ applicationId: my_application_id,
67
+ flowId: my_flow_id,
68
+ flowVersionId: my_flow_version_id)
69
+
70
+ puts result
71
+ ```
72
+
73
+ #### Authentication
74
+ The client must be configured with a valid api access token to call this
75
+ action. The token must include at least one of the following scopes:
76
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.errors.
77
+
78
+ #### Available Parameters
79
+
80
+ | Name | Type | Required | Description | Default | Example |
81
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
82
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
83
+ | flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
84
+ | flowVersionId | string | Y | Version ID or version name associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
85
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
86
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
87
+ | limit | string | N | Maximum number of errors to return | 25 | 25 |
88
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | desc |
89
+ | deviceId | string | N | For edge workflows, the Device ID to return workflow errors for. When not included, will be errors for all device IDs. | | 575ed18f7ae143cd83dc4bb6 |
90
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
91
+
92
+ #### Successful Responses
93
+
94
+ | Code | Type | Description |
95
+ | ---- | ---- | ----------- |
96
+ | 200 | [Workflow Errors](_schemas.md#workflow-errors) | Workflow error information |
97
+
98
+ #### Error Responses
99
+
100
+ | Code | Type | Description |
101
+ | ---- | ---- | ----------- |
102
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
103
+ | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
104
+
105
+ <br/>
106
+
58
107
  ## Get
59
108
 
60
109
  Retrieves information on a flow version
@@ -138,7 +187,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
138
187
  | Code | Type | Description |
139
188
  | ---- | ---- | ----------- |
140
189
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
141
- | 404 | [Error](_schemas.md#error) | Error if device was not found |
190
+ | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
142
191
 
143
192
  <br/>
144
193
 
@@ -184,3 +233,49 @@ all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.patch
184
233
  | ---- | ---- | ----------- |
185
234
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
186
235
  | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
236
+
237
+ <br/>
238
+
239
+ ## Stats
240
+
241
+ Get statistics about workflow runs for this workflow version
242
+
243
+ ```ruby
244
+ result = client.flow_version.stats(
245
+ applicationId: my_application_id,
246
+ flowId: my_flow_id,
247
+ flowVersionId: my_flow_version_id)
248
+
249
+ puts result
250
+ ```
251
+
252
+ #### Authentication
253
+ The client must be configured with a valid api access token to call this
254
+ action. The token must include at least one of the following scopes:
255
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.stats.
256
+
257
+ #### Available Parameters
258
+
259
+ | Name | Type | Required | Description | Default | Example |
260
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
261
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
262
+ | flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
263
+ | flowVersionId | string | Y | Version ID or version name associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
264
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
265
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
266
+ | resolution | string | N | Resolution in milliseconds | 3600000 | 3600000 |
267
+ | deviceId | string | N | For edge workflows, the device ID to return workflow stats for. When not included, will be aggregate for all device IDs. | | 575ed18f7ae143cd83dc4bb6 |
268
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
269
+
270
+ #### Successful Responses
271
+
272
+ | Code | Type | Description |
273
+ | ---- | ---- | ----------- |
274
+ | 200 | [Workflow Statistics](_schemas.md#workflow-statistics) | Statistics for workflow runs |
275
+
276
+ #### Error Responses
277
+
278
+ | Code | Type | Description |
279
+ | ---- | ---- | ----------- |
280
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
281
+ | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
data/docs/flowVersions.md CHANGED
@@ -37,10 +37,11 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
37
37
  | sortField | string | N | Field to sort the results by. Accepted values are: version, id, creationDate, lastUpdated | version | version |
38
38
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
39
39
  | page | string | N | Which page of results to return | 0 | 0 |
40
- | perPage | string | N | How many items to return per page | 1000 | 10 |
40
+ | perPage | string | N | How many items to return per page | 100 | 10 |
41
41
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: version | | version |
42
42
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*version |
43
43
  | includeCustomNodes | string | N | If the result of the request should also include the details of any custom nodes referenced by the returned workflows | false | true |
44
+ | query | [Advanced Workflow Version Query](_schemas.md#advanced-workflow-version-query) | N | Workflow filter JSON object which overrides the filterField and filter parameters. | | [Advanced Workflow Version Query Example](_schemas.md#advanced-workflow-version-query-example) |
44
45
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
45
46
 
46
47
  #### Successful Responses
data/docs/flows.md CHANGED
@@ -36,12 +36,14 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
36
36
  | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | name | name |
37
37
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
38
38
  | page | string | N | Which page of results to return | 0 | 0 |
39
- | perPage | string | N | How many items to return per page | 1000 | 10 |
39
+ | perPage | string | N | How many items to return per page | 100 | 10 |
40
40
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
41
41
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*flow |
42
42
  | flowClass | string | N | Filter the workflows by the given flow class. Accepted values are: edge, cloud, customNode, experience | cloud | cloud |
43
43
  | triggerFilter | [Workflow Trigger Filter](_schemas.md#workflow-trigger-filter) | N | Array of triggers to filter by - always filters against default flow version. | | [Workflow Trigger Filter Example](_schemas.md#workflow-trigger-filter-example) |
44
44
  | includeCustomNodes | string | N | If the result of the request should also include the details of any custom nodes referenced by the returned workflows | false | true |
45
+ | query | [Advanced Workflow Query](_schemas.md#advanced-workflow-query) | N | Workflow filter JSON object which overrides the filterField, filter, triggerFilter, and flowClass parameters. | | [Advanced Workflow Query Example](_schemas.md#advanced-workflow-query-example) |
46
+ | allVersions | string | N | If the request should also return flows with matching versions. Only applicable for requests with an advanced query. | false | true |
45
47
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
46
48
 
47
49
  #### Successful Responses
@@ -84,13 +86,14 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
84
86
  | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | name | name |
85
87
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
86
88
  | page | string | N | Which page of results to return | 0 | 0 |
87
- | perPage | string | N | How many items to return per page | 1000 | 10 |
89
+ | perPage | string | N | How many items to return per page | 100 | 10 |
88
90
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
89
91
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*flow |
90
92
  | flowClass | string | N | Filter the workflows by the given flow class. Accepted values are: edge, cloud, customNode, experience | cloud | cloud |
91
93
  | version | string | Y | Return the workflow versions for the given version. | | myVersion |
92
94
  | triggerFilter | [Workflow Trigger Filter](_schemas.md#workflow-trigger-filter) | N | Array of triggers to filter by - always filters against default flow version. | | [Workflow Trigger Filter Example](_schemas.md#workflow-trigger-filter-example) |
93
95
  | includeCustomNodes | string | N | If the result of the request should also include the details of any custom nodes referenced by the returned workflows | false | true |
96
+ | query | [Advanced Workflow By Version Query](_schemas.md#advanced-workflow-by-version-query) | N | Workflow filter JSON object which overrides the filterField, filter, triggerFilter, and flowClass parameters. | | [Advanced Workflow By Version Query Example](_schemas.md#advanced-workflow-by-version-query-example) |
94
97
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
95
98
 
96
99
  #### Successful Responses
data/docs/integration.md CHANGED
@@ -35,6 +35,7 @@ all.Application, all.Organization, all.User, integration.*, or integration.delet
35
35
  | ---- | ---- | -------- | ----------- | ------- | ------- |
36
36
  | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
37
37
  | integrationId | string | Y | ID associated with the integration | | 575ed78e7ae143cd83dc4aab |
38
+ | includeWorkflows | string | N | If the workflows that utilize this integration should also be deleted. | | true |
38
39
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
39
40
 
40
41
  #### Successful Responses
data/docs/integrations.md CHANGED
@@ -34,7 +34,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
34
34
  | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, integrationType, lastUpdated | name | name |
35
35
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
36
36
  | page | string | N | Which page of results to return | 0 | 0 |
37
- | perPage | string | N | How many items to return per page | 1000 | 10 |
37
+ | perPage | string | N | How many items to return per page | 100 | 10 |
38
38
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name, integrationType | | integrationType |
39
39
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*integration |
40
40
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
data/docs/me.md CHANGED
@@ -11,7 +11,6 @@ parameters and the potential responses.
11
11
  * [Delete](#delete)
12
12
  * [Disable Two Factor Auth](#disable-two-factor-auth)
13
13
  * [Disconnect Github](#disconnect-github)
14
- * [Disconnect Twitter](#disconnect-twitter)
15
14
  * [Enable Two Factor Auth](#enable-two-factor-auth)
16
15
  * [Fetch Recent Items](#fetch-recent-items)
17
16
  * [Get](#get)
@@ -202,41 +201,6 @@ all.User, me.*, or me.disconnectGithub.
202
201
 
203
202
  <br/>
204
203
 
205
- ## Disconnect Twitter
206
-
207
- Disconnects the user from Twitter
208
-
209
- ```ruby
210
- result = client.me.disconnect_twitter(optional_params)
211
-
212
- puts result
213
- ```
214
-
215
- #### Authentication
216
- The client must be configured with a valid api access token to call this
217
- action. The token must include at least one of the following scopes:
218
- all.User, me.*, or me.disconnectTwitter.
219
-
220
- #### Available Parameters
221
-
222
- | Name | Type | Required | Description | Default | Example |
223
- | ---- | ---- | -------- | ----------- | ------- | ------- |
224
- | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
225
-
226
- #### Successful Responses
227
-
228
- | Code | Type | Description |
229
- | ---- | ---- | ----------- |
230
- | 200 | [Me](_schemas.md#me) | Updated user information |
231
-
232
- #### Error Responses
233
-
234
- | Code | Type | Description |
235
- | ---- | ---- | ----------- |
236
- | 400 | [Error](_schemas.md#error) | Error if malformed request |
237
-
238
- <br/>
239
-
240
204
  ## Enable Two Factor Auth
241
205
 
242
206
  Enables two factor auth for the current user
data/docs/notebooks.md CHANGED
@@ -34,7 +34,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
34
34
  | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | name | name |
35
35
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
36
36
  | page | string | N | Which page of results to return | 0 | 0 |
37
- | perPage | string | N | How many items to return per page | 1000 | 10 |
37
+ | perPage | string | N | How many items to return per page | 100 | 10 |
38
38
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
39
39
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*notebook |
40
40
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
data/docs/orgs.md CHANGED
@@ -33,7 +33,7 @@ all.User, all.User.read, orgs.*, or orgs.get.
33
33
  | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | name | name |
34
34
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
35
35
  | page | string | N | Which page of results to return | 0 | 0 |
36
- | perPage | string | N | How many items to return per page | 1000 | 10 |
36
+ | perPage | string | N | How many items to return per page | 100 | 10 |
37
37
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
38
38
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*org |
39
39
  | summaryExclude | string | N | Comma-separated list of summary fields to exclude from org summaries | | payloadCount |
data/docs/webhook.md CHANGED
@@ -35,6 +35,7 @@ all.Application, all.Organization, all.User, webhook.*, or webhook.delete.
35
35
  | ---- | ---- | -------- | ----------- | ------- | ------- |
36
36
  | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
37
37
  | webhookId | string | Y | ID associated with the webhook | | 575ed78e7ae143cd83dc4aab |
38
+ | includeWorkflows | string | N | If the workflows that utilize this webhook should also be deleted. | | true |
38
39
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
39
40
 
40
41
  #### Successful Responses
data/docs/webhooks.md CHANGED
@@ -34,7 +34,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
34
34
  | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | name | name |
35
35
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
36
36
  | page | string | N | Which page of results to return | 0 | 0 |
37
- | perPage | string | N | How many items to return per page | 1000 | 10 |
37
+ | perPage | string | N | How many items to return per page | 100 | 10 |
38
38
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
39
39
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*webhook |
40
40
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
data/lib/losant_rest.rb CHANGED
@@ -30,8 +30,11 @@ require_relative "losant_rest/application_certificate"
30
30
  require_relative "losant_rest/application_certificate_authorities"
31
31
  require_relative "losant_rest/application_certificate_authority"
32
32
  require_relative "losant_rest/application_certificates"
33
+ require_relative "losant_rest/application_dashboard"
34
+ require_relative "losant_rest/application_dashboards"
33
35
  require_relative "losant_rest/application_key"
34
36
  require_relative "losant_rest/application_keys"
37
+ require_relative "losant_rest/application_template"
35
38
  require_relative "losant_rest/application_templates"
36
39
  require_relative "losant_rest/applications"
37
40
  require_relative "losant_rest/audit_log"
@@ -31,6 +31,54 @@ module LosantRest
31
31
  @client = client
32
32
  end
33
33
 
34
+ # Add resources to an application via an application template
35
+ #
36
+ # Authentication:
37
+ # The client must be configured with a valid api
38
+ # access token to call this action. The token
39
+ # must include at least one of the following scopes:
40
+ # all.Application, all.Organization, all.User, application.*, or application.applyTemplate.
41
+ #
42
+ # Parameters:
43
+ # * {string} applicationId - ID of the associated application
44
+ # * {hash} options - Object containing template import options (https://api.losant.com/#/definitions/applicationApplyTemplatePatch)
45
+ # * {string} losantdomain - Domain scope of request (rarely needed)
46
+ # * {boolean} _actions - Return resource actions in response
47
+ # * {boolean} _links - Return resource link in response
48
+ # * {boolean} _embedded - Return embedded resources in response
49
+ #
50
+ # Responses:
51
+ # * 200 - Updated application information (https://api.losant.com/#/definitions/application)
52
+ # * 202 - If a job was enqueued for the resources to be imported into the application (https://api.losant.com/#/definitions/jobEnqueuedResult)
53
+ #
54
+ # Errors:
55
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
56
+ # * 404 - Error if application is not found (https://api.losant.com/#/definitions/error)
57
+ def apply_template(params = {})
58
+ params = Utils.symbolize_hash_keys(params)
59
+ query_params = { _actions: false, _links: true, _embedded: true }
60
+ headers = {}
61
+ body = nil
62
+
63
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
64
+ raise ArgumentError.new("options is required") unless params.has_key?(:options)
65
+
66
+ body = params[:options] if params.has_key?(:options)
67
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
68
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
69
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
70
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
71
+
72
+ path = "/applications/#{params[:applicationId]}/applyTemplate"
73
+
74
+ @client.request(
75
+ method: :patch,
76
+ path: path,
77
+ query: query_params,
78
+ headers: headers,
79
+ body: body)
80
+ end
81
+
34
82
  # Returns success when a job has been enqueued to archive this application's device data for a given day
35
83
  #
36
84
  # Authentication:
@@ -399,6 +447,53 @@ module LosantRest
399
447
  body: body)
400
448
  end
401
449
 
450
+ # Updates an application global at the given key
451
+ #
452
+ # Authentication:
453
+ # The client must be configured with a valid api
454
+ # access token to call this action. The token
455
+ # must include at least one of the following scopes:
456
+ # all.Application, all.Organization, all.User, application.*, or application.patch.
457
+ #
458
+ # Parameters:
459
+ # * {string} applicationId - ID of the associated application
460
+ # * {hash} globals - Array of objects containing new application global information (https://api.losant.com/#/definitions/applicationGlobalPatch)
461
+ # * {string} losantdomain - Domain scope of request (rarely needed)
462
+ # * {boolean} _actions - Return resource actions in response
463
+ # * {boolean} _links - Return resource link in response
464
+ # * {boolean} _embedded - Return embedded resources in response
465
+ #
466
+ # Responses:
467
+ # * 200 - Updated application information (https://api.losant.com/#/definitions/application)
468
+ #
469
+ # Errors:
470
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
471
+ # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
472
+ def globals(params = {})
473
+ params = Utils.symbolize_hash_keys(params)
474
+ query_params = { _actions: false, _links: true, _embedded: true }
475
+ headers = {}
476
+ body = nil
477
+
478
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
479
+ raise ArgumentError.new("globals is required") unless params.has_key?(:globals)
480
+
481
+ body = params[:globals] if params.has_key?(:globals)
482
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
483
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
484
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
485
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
486
+
487
+ path = "/applications/#{params[:applicationId]}/globals"
488
+
489
+ @client.request(
490
+ method: :patch,
491
+ path: path,
492
+ query: query_params,
493
+ headers: headers,
494
+ body: body)
495
+ end
496
+
402
497
  # Publishes the given message to the given MQTT topic
403
498
  #
404
499
  # Authentication:
@@ -41,7 +41,7 @@ module LosantRest
41
41
  #
42
42
  # Parameters:
43
43
  # * {string} applicationId - ID associated with the application
44
- # * {string} sortField - Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated
44
+ # * {string} sortField - Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated, expirationDate
45
45
  # * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
46
46
  # * {string} page - Which page of results to return
47
47
  # * {string} perPage - How many items to return per page
@@ -0,0 +1,176 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require "json"
24
+
25
+ module LosantRest
26
+
27
+ # Class containing all the actions for the Application Dashboard Resource
28
+ class ApplicationDashboard
29
+
30
+ def initialize(client)
31
+ @client = client
32
+ end
33
+
34
+ # Deletes a dashboard
35
+ #
36
+ # Authentication:
37
+ # The client must be configured with a valid api
38
+ # access token to call this action. The token
39
+ # must include at least one of the following scopes:
40
+ # all.Application, all.Organization, all.User, applicationDashboard.*, or applicationDashboard.delete.
41
+ #
42
+ # Parameters:
43
+ # * {string} dashboardId - ID of the associated dashboard
44
+ # * {string} applicationId - ID of the associated application
45
+ # * {string} losantdomain - Domain scope of request (rarely needed)
46
+ # * {boolean} _actions - Return resource actions in response
47
+ # * {boolean} _links - Return resource link in response
48
+ # * {boolean} _embedded - Return embedded resources in response
49
+ #
50
+ # Responses:
51
+ # * 200 - If dashboard was successfully deleted (https://api.losant.com/#/definitions/success)
52
+ #
53
+ # Errors:
54
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
55
+ # * 404 - Error if dashboard was not found (https://api.losant.com/#/definitions/error)
56
+ def delete(params = {})
57
+ params = Utils.symbolize_hash_keys(params)
58
+ query_params = { _actions: false, _links: true, _embedded: true }
59
+ headers = {}
60
+ body = nil
61
+
62
+ raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
63
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
64
+
65
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
66
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
67
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
68
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
69
+
70
+ path = "/applications/#{params[:applicationId]}/dashboards/#{params[:dashboardId]}"
71
+
72
+ @client.request(
73
+ method: :delete,
74
+ path: path,
75
+ query: query_params,
76
+ headers: headers,
77
+ body: body)
78
+ end
79
+
80
+ # Retrieves information on a dashboard
81
+ #
82
+ # Authentication:
83
+ # The client must be configured with a valid api
84
+ # access token to call this action. The token
85
+ # must include at least one of the following scopes:
86
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationDashboard.*, or applicationDashboard.get.
87
+ #
88
+ # Parameters:
89
+ # * {string} dashboardId - ID of the associated dashboard
90
+ # * {string} applicationId - ID of the associated application
91
+ # * {string} losantdomain - Domain scope of request (rarely needed)
92
+ # * {boolean} _actions - Return resource actions in response
93
+ # * {boolean} _links - Return resource link in response
94
+ # * {boolean} _embedded - Return embedded resources in response
95
+ #
96
+ # Responses:
97
+ # * 200 - Dashboard information (https://api.losant.com/#/definitions/dashboard)
98
+ #
99
+ # Errors:
100
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
101
+ # * 404 - Error if dashboard was not found (https://api.losant.com/#/definitions/error)
102
+ def get(params = {})
103
+ params = Utils.symbolize_hash_keys(params)
104
+ query_params = { _actions: false, _links: true, _embedded: true }
105
+ headers = {}
106
+ body = nil
107
+
108
+ raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
109
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
110
+
111
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
112
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
113
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
114
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
115
+
116
+ path = "/applications/#{params[:applicationId]}/dashboards/#{params[:dashboardId]}"
117
+
118
+ @client.request(
119
+ method: :get,
120
+ path: path,
121
+ query: query_params,
122
+ headers: headers,
123
+ body: body)
124
+ end
125
+
126
+ # Updates information about a dashboard
127
+ #
128
+ # Authentication:
129
+ # The client must be configured with a valid api
130
+ # access token to call this action. The token
131
+ # must include at least one of the following scopes:
132
+ # all.Application, all.Organization, all.User, applicationDashboard.*, or applicationDashboard.patch.
133
+ #
134
+ # Parameters:
135
+ # * {string} dashboardId - ID of the associated dashboard
136
+ # * {string} applicationId - ID of the associated application
137
+ # * {hash} dashboard - Object containing new dashboard properties (https://api.losant.com/#/definitions/dashboardPatch)
138
+ # * {string} losantdomain - Domain scope of request (rarely needed)
139
+ # * {boolean} _actions - Return resource actions in response
140
+ # * {boolean} _links - Return resource link in response
141
+ # * {boolean} _embedded - Return embedded resources in response
142
+ #
143
+ # Responses:
144
+ # * 200 - Update dashboard information (https://api.losant.com/#/definitions/dashboard)
145
+ #
146
+ # Errors:
147
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
148
+ # * 404 - Error if dashboard was not found (https://api.losant.com/#/definitions/error)
149
+ def patch(params = {})
150
+ params = Utils.symbolize_hash_keys(params)
151
+ query_params = { _actions: false, _links: true, _embedded: true }
152
+ headers = {}
153
+ body = nil
154
+
155
+ raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
156
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
157
+ raise ArgumentError.new("dashboard is required") unless params.has_key?(:dashboard)
158
+
159
+ body = params[:dashboard] if params.has_key?(:dashboard)
160
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
161
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
162
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
163
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
164
+
165
+ path = "/applications/#{params[:applicationId]}/dashboards/#{params[:dashboardId]}"
166
+
167
+ @client.request(
168
+ method: :patch,
169
+ path: path,
170
+ query: query_params,
171
+ headers: headers,
172
+ body: body)
173
+ end
174
+
175
+ end
176
+ end