losant_rest 1.19.4 → 1.19.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +9 -9
  4. data/docs/_schemas.md +1142 -63
  5. data/docs/instanceAuditLog.md +49 -0
  6. data/docs/instanceAuditLogs.md +53 -0
  7. data/examples/auth.rb +1 -1
  8. data/examples/list_devices.rb +1 -1
  9. data/lib/platform_rest/application.rb +1 -1
  10. data/lib/platform_rest/application_api_token.rb +1 -1
  11. data/lib/platform_rest/application_api_tokens.rb +1 -1
  12. data/lib/platform_rest/application_certificate.rb +1 -1
  13. data/lib/platform_rest/application_certificate_authorities.rb +1 -1
  14. data/lib/platform_rest/application_certificate_authority.rb +1 -1
  15. data/lib/platform_rest/application_certificates.rb +1 -1
  16. data/lib/platform_rest/application_dashboard.rb +1 -1
  17. data/lib/platform_rest/application_dashboards.rb +1 -1
  18. data/lib/platform_rest/application_key.rb +1 -1
  19. data/lib/platform_rest/application_keys.rb +1 -1
  20. data/lib/platform_rest/application_template.rb +1 -1
  21. data/lib/platform_rest/application_templates.rb +1 -1
  22. data/lib/platform_rest/applications.rb +1 -1
  23. data/lib/platform_rest/audit_log.rb +1 -1
  24. data/lib/platform_rest/audit_logs.rb +1 -1
  25. data/lib/platform_rest/auth.rb +1 -1
  26. data/lib/platform_rest/client.rb +11 -3
  27. data/lib/platform_rest/credential.rb +1 -1
  28. data/lib/platform_rest/credentials.rb +1 -1
  29. data/lib/platform_rest/dashboard.rb +1 -1
  30. data/lib/platform_rest/dashboards.rb +1 -1
  31. data/lib/platform_rest/data.rb +1 -1
  32. data/lib/platform_rest/data_table.rb +1 -1
  33. data/lib/platform_rest/data_table_row.rb +1 -1
  34. data/lib/platform_rest/data_table_rows.rb +1 -1
  35. data/lib/platform_rest/data_tables.rb +1 -1
  36. data/lib/platform_rest/device.rb +1 -1
  37. data/lib/platform_rest/device_recipe.rb +1 -1
  38. data/lib/platform_rest/device_recipes.rb +1 -1
  39. data/lib/platform_rest/devices.rb +1 -1
  40. data/lib/platform_rest/edge_deployment.rb +1 -1
  41. data/lib/platform_rest/edge_deployments.rb +1 -1
  42. data/lib/platform_rest/embedded_deployment.rb +1 -1
  43. data/lib/platform_rest/embedded_deployments.rb +1 -1
  44. data/lib/platform_rest/error.rb +1 -1
  45. data/lib/platform_rest/event.rb +1 -1
  46. data/lib/platform_rest/events.rb +1 -1
  47. data/lib/platform_rest/experience.rb +1 -1
  48. data/lib/platform_rest/experience_domain.rb +1 -1
  49. data/lib/platform_rest/experience_domains.rb +1 -1
  50. data/lib/platform_rest/experience_endpoint.rb +1 -1
  51. data/lib/platform_rest/experience_endpoints.rb +1 -1
  52. data/lib/platform_rest/experience_group.rb +1 -1
  53. data/lib/platform_rest/experience_groups.rb +1 -1
  54. data/lib/platform_rest/experience_slug.rb +1 -1
  55. data/lib/platform_rest/experience_slugs.rb +1 -1
  56. data/lib/platform_rest/experience_user.rb +1 -1
  57. data/lib/platform_rest/experience_users.rb +1 -1
  58. data/lib/platform_rest/experience_version.rb +1 -1
  59. data/lib/platform_rest/experience_versions.rb +1 -1
  60. data/lib/platform_rest/experience_view.rb +1 -1
  61. data/lib/platform_rest/experience_views.rb +1 -1
  62. data/lib/platform_rest/file.rb +1 -1
  63. data/lib/platform_rest/files.rb +1 -1
  64. data/lib/platform_rest/flow.rb +1 -1
  65. data/lib/platform_rest/flow_version.rb +1 -1
  66. data/lib/platform_rest/flow_versions.rb +1 -1
  67. data/lib/platform_rest/flows.rb +1 -1
  68. data/lib/platform_rest/instance.rb +1 -1
  69. data/lib/platform_rest/instance_api_token.rb +1 -1
  70. data/lib/platform_rest/instance_api_tokens.rb +1 -1
  71. data/lib/{losant_rest/application_template.rb → platform_rest/instance_audit_log.rb} +13 -11
  72. data/lib/{losant_rest/audit_logs.rb → platform_rest/instance_audit_logs.rb} +12 -12
  73. data/lib/platform_rest/instance_custom_node.rb +1 -1
  74. data/lib/platform_rest/instance_custom_nodes.rb +1 -1
  75. data/lib/platform_rest/instance_member.rb +1 -1
  76. data/lib/platform_rest/instance_members.rb +1 -1
  77. data/lib/platform_rest/instance_org.rb +1 -1
  78. data/lib/platform_rest/instance_org_invite.rb +1 -1
  79. data/lib/platform_rest/instance_org_invites.rb +1 -1
  80. data/lib/platform_rest/instance_org_member.rb +1 -1
  81. data/lib/platform_rest/instance_org_members.rb +1 -1
  82. data/lib/platform_rest/instance_orgs.rb +1 -1
  83. data/lib/platform_rest/instance_sandbox.rb +1 -1
  84. data/lib/platform_rest/instance_sandboxes.rb +1 -1
  85. data/lib/platform_rest/instances.rb +1 -1
  86. data/lib/platform_rest/integration.rb +1 -1
  87. data/lib/platform_rest/integrations.rb +1 -1
  88. data/lib/platform_rest/me.rb +1 -1
  89. data/lib/platform_rest/notebook.rb +1 -1
  90. data/lib/platform_rest/notebooks.rb +1 -1
  91. data/lib/platform_rest/org.rb +1 -1
  92. data/lib/platform_rest/org_invites.rb +1 -1
  93. data/lib/platform_rest/orgs.rb +1 -1
  94. data/lib/platform_rest/resource_job.rb +1 -1
  95. data/lib/platform_rest/resource_jobs.rb +1 -1
  96. data/lib/platform_rest/user_api_token.rb +1 -1
  97. data/lib/platform_rest/user_api_tokens.rb +1 -1
  98. data/lib/platform_rest/utils.rb +1 -1
  99. data/lib/{losant_rest → platform_rest}/version.rb +3 -3
  100. data/lib/platform_rest/webhook.rb +1 -1
  101. data/lib/platform_rest/webhooks.rb +1 -1
  102. data/lib/platform_rest.rb +3 -1
  103. data/losant_rest.gemspec +2 -2
  104. data/schemas/apiTokenPost.json +9 -1
  105. data/schemas/auditLog.json +3 -2
  106. data/schemas/auditLogFilter.json +3 -2
  107. data/schemas/auditLogs.json +3 -2
  108. data/schemas/credential.json +50 -1
  109. data/schemas/credentialLinkedResources.json +81 -4
  110. data/schemas/credentialPatch.json +56 -0
  111. data/schemas/credentialPost.json +71 -1
  112. data/schemas/credentials.json +50 -1
  113. data/schemas/deviceConnectionStatus.json +6 -2
  114. data/schemas/devicesHistoricalImportPost.json +25 -0
  115. data/schemas/experienceLinkedResources.json +7 -5
  116. data/schemas/experienceView.json +1 -2
  117. data/schemas/experienceViewPatch.json +1 -2
  118. data/schemas/experienceViewPost.json +2 -4
  119. data/schemas/experienceViews.json +1 -2
  120. data/schemas/flow.json +2 -1
  121. data/schemas/flowPatch.json +2 -1
  122. data/schemas/flowPost.json +2 -1
  123. data/schemas/flowVersion.json +4 -2
  124. data/schemas/flowVersionPost.json +2 -1
  125. data/schemas/flowVersions.json +4 -2
  126. data/schemas/flows.json +2 -1
  127. data/schemas/flowsImportPost.json +4 -2
  128. data/schemas/flowsImportResult.json +6 -3
  129. data/schemas/githubLogin.json +9 -1
  130. data/schemas/instance.json +1 -4
  131. data/schemas/instanceAuditLog.json +94 -0
  132. data/schemas/instanceAuditLogFilter.json +106 -0
  133. data/schemas/instanceAuditLogs.json +41 -0
  134. data/schemas/instanceCustomNodePatch.json +2 -1
  135. data/schemas/instanceCustomNodePost.json +2 -1
  136. data/schemas/instanceOrgMember.json +4 -1
  137. data/schemas/instances.json +1 -4
  138. data/schemas/integration.json +75 -1
  139. data/schemas/integrationPatch.json +73 -0
  140. data/schemas/integrationPost.json +75 -1
  141. data/schemas/integrations.json +75 -1
  142. data/schemas/mePatch.json +18 -0
  143. data/schemas/samlResponse.json +9 -1
  144. data/schemas/userCredentials.json +9 -1
  145. data/schemas/userPost.json +9 -1
  146. data/test/basic_test.rb +6 -6
  147. data/test/test_helper.rb +1 -1
  148. metadata +11 -94
  149. data/lib/losant_rest/application.rb +0 -932
  150. data/lib/losant_rest/application_api_token.rb +0 -176
  151. data/lib/losant_rest/application_api_tokens.rb +0 -136
  152. data/lib/losant_rest/application_certificate.rb +0 -176
  153. data/lib/losant_rest/application_certificate_authorities.rb +0 -138
  154. data/lib/losant_rest/application_certificate_authority.rb +0 -176
  155. data/lib/losant_rest/application_certificates.rb +0 -138
  156. data/lib/losant_rest/application_dashboard.rb +0 -225
  157. data/lib/losant_rest/application_dashboards.rb +0 -138
  158. data/lib/losant_rest/application_key.rb +0 -176
  159. data/lib/losant_rest/application_keys.rb +0 -141
  160. data/lib/losant_rest/application_templates.rb +0 -176
  161. data/lib/losant_rest/applications.rb +0 -142
  162. data/lib/losant_rest/audit_log.rb +0 -81
  163. data/lib/losant_rest/auth.rb +0 -245
  164. data/lib/losant_rest/client.rb +0 -410
  165. data/lib/losant_rest/credential.rb +0 -224
  166. data/lib/losant_rest/credentials.rb +0 -138
  167. data/lib/losant_rest/dashboard.rb +0 -268
  168. data/lib/losant_rest/dashboards.rb +0 -136
  169. data/lib/losant_rest/data.rb +0 -176
  170. data/lib/losant_rest/data_table.rb +0 -274
  171. data/lib/losant_rest/data_table_row.rb +0 -182
  172. data/lib/losant_rest/data_table_rows.rb +0 -343
  173. data/lib/losant_rest/data_tables.rb +0 -138
  174. data/lib/losant_rest/device.rb +0 -749
  175. data/lib/losant_rest/device_recipe.rb +0 -234
  176. data/lib/losant_rest/device_recipes.rb +0 -146
  177. data/lib/losant_rest/devices.rb +0 -707
  178. data/lib/losant_rest/edge_deployment.rb +0 -81
  179. data/lib/losant_rest/edge_deployments.rb +0 -236
  180. data/lib/losant_rest/embedded_deployment.rb +0 -81
  181. data/lib/losant_rest/embedded_deployments.rb +0 -280
  182. data/lib/losant_rest/error.rb +0 -34
  183. data/lib/losant_rest/event.rb +0 -176
  184. data/lib/losant_rest/events.rb +0 -341
  185. data/lib/losant_rest/experience.rb +0 -142
  186. data/lib/losant_rest/experience_domain.rb +0 -176
  187. data/lib/losant_rest/experience_domains.rb +0 -126
  188. data/lib/losant_rest/experience_endpoint.rb +0 -230
  189. data/lib/losant_rest/experience_endpoints.rb +0 -200
  190. data/lib/losant_rest/experience_group.rb +0 -180
  191. data/lib/losant_rest/experience_groups.rb +0 -141
  192. data/lib/losant_rest/experience_slug.rb +0 -176
  193. data/lib/losant_rest/experience_slugs.rb +0 -126
  194. data/lib/losant_rest/experience_user.rb +0 -176
  195. data/lib/losant_rest/experience_users.rb +0 -142
  196. data/lib/losant_rest/experience_version.rb +0 -176
  197. data/lib/losant_rest/experience_versions.rb +0 -138
  198. data/lib/losant_rest/experience_view.rb +0 -228
  199. data/lib/losant_rest/experience_views.rb +0 -142
  200. data/lib/losant_rest/file.rb +0 -226
  201. data/lib/losant_rest/files.rb +0 -144
  202. data/lib/losant_rest/flow.rb +0 -580
  203. data/lib/losant_rest/flow_version.rb +0 -352
  204. data/lib/losant_rest/flow_versions.rb +0 -201
  205. data/lib/losant_rest/flows.rb +0 -310
  206. data/lib/losant_rest/instance.rb +0 -377
  207. data/lib/losant_rest/instance_api_token.rb +0 -176
  208. data/lib/losant_rest/instance_api_tokens.rb +0 -136
  209. data/lib/losant_rest/instance_custom_node.rb +0 -282
  210. data/lib/losant_rest/instance_custom_nodes.rb +0 -136
  211. data/lib/losant_rest/instance_member.rb +0 -176
  212. data/lib/losant_rest/instance_members.rb +0 -134
  213. data/lib/losant_rest/instance_org.rb +0 -336
  214. data/lib/losant_rest/instance_org_invite.rb +0 -182
  215. data/lib/losant_rest/instance_org_invites.rb +0 -138
  216. data/lib/losant_rest/instance_org_member.rb +0 -182
  217. data/lib/losant_rest/instance_org_members.rb +0 -138
  218. data/lib/losant_rest/instance_orgs.rb +0 -139
  219. data/lib/losant_rest/instance_sandbox.rb +0 -181
  220. data/lib/losant_rest/instance_sandboxes.rb +0 -98
  221. data/lib/losant_rest/instances.rb +0 -88
  222. data/lib/losant_rest/integration.rb +0 -178
  223. data/lib/losant_rest/integrations.rb +0 -138
  224. data/lib/losant_rest/me.rb +0 -790
  225. data/lib/losant_rest/notebook.rb +0 -423
  226. data/lib/losant_rest/notebooks.rb +0 -138
  227. data/lib/losant_rest/org.rb +0 -663
  228. data/lib/losant_rest/org_invites.rb +0 -124
  229. data/lib/losant_rest/orgs.rb +0 -140
  230. data/lib/losant_rest/resource_job.rb +0 -326
  231. data/lib/losant_rest/resource_jobs.rb +0 -138
  232. data/lib/losant_rest/user_api_token.rb +0 -170
  233. data/lib/losant_rest/user_api_tokens.rb +0 -132
  234. data/lib/losant_rest/utils.rb +0 -44
  235. data/lib/losant_rest/webhook.rb +0 -178
  236. data/lib/losant_rest/webhooks.rb +0 -138
  237. data/lib/losant_rest.rb +0 -129
@@ -1,580 +0,0 @@
1
- # The MIT License (MIT)
2
- #
3
- # Copyright (c) 2023 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 Flow Resource
28
- class Flow
29
-
30
- def initialize(client)
31
- @client = client
32
- end
33
-
34
- # Clear all storage entries
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, flow.*, or flow.clearStorageEntries.
41
- #
42
- # Parameters:
43
- # * {string} applicationId - ID associated with the application
44
- # * {string} flowId - ID associated with the flow
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 - The current storage entries (https://api.losant.com/#/definitions/flowStorageEntries)
52
- #
53
- # Errors:
54
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
55
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
56
- def clear_storage_entries(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("applicationId is required") unless params.has_key?(:applicationId)
63
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
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]}/flows/#{params[:flowId]}/storage"
71
-
72
- @client.request(
73
- method: :delete,
74
- path: path,
75
- query: query_params,
76
- headers: headers,
77
- body: body)
78
- end
79
-
80
- # Deletes a flow
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.Organization, all.User, flow.*, or flow.delete.
87
- #
88
- # Parameters:
89
- # * {string} applicationId - ID associated with the application
90
- # * {string} flowId - ID associated with the flow
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 - If flow was successfully deleted (https://api.losant.com/#/definitions/success)
98
- #
99
- # Errors:
100
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
101
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
102
- def delete(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("applicationId is required") unless params.has_key?(:applicationId)
109
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
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]}/flows/#{params[:flowId]}"
117
-
118
- @client.request(
119
- method: :delete,
120
- path: path,
121
- query: query_params,
122
- headers: headers,
123
- body: body)
124
- end
125
-
126
- # Get information about errors that occurred during runs of this workflow
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.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.errors.
133
- #
134
- # Parameters:
135
- # * {string} applicationId - ID associated with the application
136
- # * {string} flowId - ID associated with the flow
137
- # * {string} duration - Duration of time range in milliseconds
138
- # * {string} end - End of time range in milliseconds since epoch
139
- # * {string} limit - Maximum number of errors to return
140
- # * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
141
- # * {string} flowVersion - Flow version name or ID. When not included, will be errors for all versions. Pass develop for just the develop version.
142
- # * {string} deviceId - For edge or embedded workflows, the Device ID for which to return workflow errors. When not included, will be errors for all device IDs.
143
- # * {string} losantdomain - Domain scope of request (rarely needed)
144
- # * {boolean} _actions - Return resource actions in response
145
- # * {boolean} _links - Return resource link in response
146
- # * {boolean} _embedded - Return embedded resources in response
147
- #
148
- # Responses:
149
- # * 200 - Workflow error information (https://api.losant.com/#/definitions/flowErrors)
150
- #
151
- # Errors:
152
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
153
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
154
- def errors(params = {})
155
- params = Utils.symbolize_hash_keys(params)
156
- query_params = { _actions: false, _links: true, _embedded: true }
157
- headers = {}
158
- body = nil
159
-
160
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
161
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
162
-
163
- query_params[:duration] = params[:duration] if params.has_key?(:duration)
164
- query_params[:end] = params[:end] if params.has_key?(:end)
165
- query_params[:limit] = params[:limit] if params.has_key?(:limit)
166
- query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
167
- query_params[:flowVersion] = params[:flowVersion] if params.has_key?(:flowVersion)
168
- query_params[:deviceId] = params[:deviceId] if params.has_key?(:deviceId)
169
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
170
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
171
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
172
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
173
-
174
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/errors"
175
-
176
- @client.request(
177
- method: :get,
178
- path: path,
179
- query: query_params,
180
- headers: headers,
181
- body: body)
182
- end
183
-
184
- # Retrieves information on a flow
185
- #
186
- # Authentication:
187
- # The client must be configured with a valid api
188
- # access token to call this action. The token
189
- # must include at least one of the following scopes:
190
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.get.
191
- #
192
- # Parameters:
193
- # * {string} applicationId - ID associated with the application
194
- # * {string} flowId - ID associated with the flow
195
- # * {string} includeCustomNodes - If the result of the request should also include the details of any custom nodes referenced by the returned workflows
196
- # * {string} losantdomain - Domain scope of request (rarely needed)
197
- # * {boolean} _actions - Return resource actions in response
198
- # * {boolean} _links - Return resource link in response
199
- # * {boolean} _embedded - Return embedded resources in response
200
- #
201
- # Responses:
202
- # * 200 - Flow information (https://api.losant.com/#/definitions/flow)
203
- #
204
- # Errors:
205
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
206
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
207
- def get(params = {})
208
- params = Utils.symbolize_hash_keys(params)
209
- query_params = { _actions: false, _links: true, _embedded: true }
210
- headers = {}
211
- body = nil
212
-
213
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
214
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
215
-
216
- query_params[:includeCustomNodes] = params[:includeCustomNodes] if params.has_key?(:includeCustomNodes)
217
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
218
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
219
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
220
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
221
-
222
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}"
223
-
224
- @client.request(
225
- method: :get,
226
- path: path,
227
- query: query_params,
228
- headers: headers,
229
- body: body)
230
- end
231
-
232
- # Retrieve the recent log entries about runs of this workflow
233
- #
234
- # Authentication:
235
- # The client must be configured with a valid api
236
- # access token to call this action. The token
237
- # must include at least one of the following scopes:
238
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.log.
239
- #
240
- # Parameters:
241
- # * {string} applicationId - ID associated with the application
242
- # * {string} flowId - ID associated with the flow
243
- # * {string} limit - Max log entries to return (ordered by time descending)
244
- # * {string} since - Look for log entries since this time (ms since epoch)
245
- # * {string} losantdomain - Domain scope of request (rarely needed)
246
- # * {boolean} _actions - Return resource actions in response
247
- # * {boolean} _links - Return resource link in response
248
- # * {boolean} _embedded - Return embedded resources in response
249
- #
250
- # Responses:
251
- # * 200 - Recent log entries (https://api.losant.com/#/definitions/flowLog)
252
- #
253
- # Errors:
254
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
255
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
256
- def get_log_entries(params = {})
257
- params = Utils.symbolize_hash_keys(params)
258
- query_params = { _actions: false, _links: true, _embedded: true }
259
- headers = {}
260
- body = nil
261
-
262
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
263
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
264
-
265
- query_params[:limit] = params[:limit] if params.has_key?(:limit)
266
- query_params[:since] = params[:since] if params.has_key?(:since)
267
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
268
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
269
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
270
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
271
-
272
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/logs"
273
-
274
- @client.request(
275
- method: :get,
276
- path: path,
277
- query: query_params,
278
- headers: headers,
279
- body: body)
280
- end
281
-
282
- # Gets the current values in persistent storage
283
- #
284
- # Authentication:
285
- # The client must be configured with a valid api
286
- # access token to call this action. The token
287
- # must include at least one of the following scopes:
288
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.getStorageEntries.
289
- #
290
- # Parameters:
291
- # * {string} applicationId - ID associated with the application
292
- # * {string} flowId - ID associated with the flow
293
- # * {string} losantdomain - Domain scope of request (rarely needed)
294
- # * {boolean} _actions - Return resource actions in response
295
- # * {boolean} _links - Return resource link in response
296
- # * {boolean} _embedded - Return embedded resources in response
297
- #
298
- # Responses:
299
- # * 200 - The current storage entries (https://api.losant.com/#/definitions/flowStorageEntries)
300
- #
301
- # Errors:
302
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
303
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
304
- def get_storage_entries(params = {})
305
- params = Utils.symbolize_hash_keys(params)
306
- query_params = { _actions: false, _links: true, _embedded: true }
307
- headers = {}
308
- body = nil
309
-
310
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
311
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
312
-
313
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
314
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
315
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
316
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
317
-
318
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/storage"
319
-
320
- @client.request(
321
- method: :get,
322
- path: path,
323
- query: query_params,
324
- headers: headers,
325
- body: body)
326
- end
327
-
328
- # Gets metadata about storage for this flow
329
- #
330
- # Authentication:
331
- # The client must be configured with a valid api
332
- # access token to call this action. The token
333
- # must include at least one of the following scopes:
334
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.getStorageEntriesMetadata.
335
- #
336
- # Parameters:
337
- # * {string} applicationId - ID associated with the application
338
- # * {string} flowId - ID associated with the flow
339
- # * {string} losantdomain - Domain scope of request (rarely needed)
340
- # * {boolean} _actions - Return resource actions in response
341
- # * {boolean} _links - Return resource link in response
342
- # * {boolean} _embedded - Return embedded resources in response
343
- #
344
- # Responses:
345
- # * 200 - The meta data for the current storage entries (https://api.losant.com/#/definitions/flowStorageMetadata)
346
- #
347
- # Errors:
348
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
349
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
350
- def get_storage_entries_metadata(params = {})
351
- params = Utils.symbolize_hash_keys(params)
352
- query_params = { _actions: false, _links: true, _embedded: true }
353
- headers = {}
354
- body = nil
355
-
356
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
357
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
358
-
359
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
360
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
361
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
362
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
363
-
364
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/storage-metadata"
365
-
366
- @client.request(
367
- method: :get,
368
- path: path,
369
- query: query_params,
370
- headers: headers,
371
- body: body)
372
- end
373
-
374
- # Updates information about a flow
375
- #
376
- # Authentication:
377
- # The client must be configured with a valid api
378
- # access token to call this action. The token
379
- # must include at least one of the following scopes:
380
- # all.Application, all.Organization, all.User, flow.*, or flow.patch.
381
- #
382
- # Parameters:
383
- # * {string} applicationId - ID associated with the application
384
- # * {string} flowId - ID associated with the flow
385
- # * {string} includeCustomNodes - If the result of the request should also include the details of any custom nodes referenced by the returned workflows
386
- # * {hash} flow - Object containing new properties of the flow (https://api.losant.com/#/definitions/flowPatch)
387
- # * {string} losantdomain - Domain scope of request (rarely needed)
388
- # * {boolean} _actions - Return resource actions in response
389
- # * {boolean} _links - Return resource link in response
390
- # * {boolean} _embedded - Return embedded resources in response
391
- #
392
- # Responses:
393
- # * 200 - Updated flow information (https://api.losant.com/#/definitions/flow)
394
- #
395
- # Errors:
396
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
397
- # * 404 - Error if flow is not found (https://api.losant.com/#/definitions/error)
398
- def patch(params = {})
399
- params = Utils.symbolize_hash_keys(params)
400
- query_params = { _actions: false, _links: true, _embedded: true }
401
- headers = {}
402
- body = nil
403
-
404
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
405
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
406
- raise ArgumentError.new("flow is required") unless params.has_key?(:flow)
407
-
408
- query_params[:includeCustomNodes] = params[:includeCustomNodes] if params.has_key?(:includeCustomNodes)
409
- body = params[:flow] if params.has_key?(:flow)
410
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
411
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
412
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
413
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
414
-
415
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}"
416
-
417
- @client.request(
418
- method: :patch,
419
- path: path,
420
- query: query_params,
421
- headers: headers,
422
- body: body)
423
- end
424
-
425
- # Presses the specified virtual button on the flow
426
- #
427
- # Authentication:
428
- # The client must be configured with a valid api
429
- # access token to call this action. The token
430
- # must include at least one of the following scopes:
431
- # all.Application, all.Organization, all.User, flow.*, or flow.pressVirtualButton.
432
- #
433
- # Parameters:
434
- # * {string} applicationId - ID associated with the application
435
- # * {string} flowId - ID associated with the flow
436
- # * {hash} button - Object containing button key and payload (https://api.losant.com/#/definitions/virtualButtonPress)
437
- # * {string} losantdomain - Domain scope of request (rarely needed)
438
- # * {boolean} _actions - Return resource actions in response
439
- # * {boolean} _links - Return resource link in response
440
- # * {boolean} _embedded - Return embedded resources in response
441
- #
442
- # Responses:
443
- # * 200 - Virtual button was pressed (https://api.losant.com/#/definitions/success)
444
- #
445
- # Errors:
446
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
447
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
448
- def press_virtual_button(params = {})
449
- params = Utils.symbolize_hash_keys(params)
450
- query_params = { _actions: false, _links: true, _embedded: true }
451
- headers = {}
452
- body = nil
453
-
454
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
455
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
456
- raise ArgumentError.new("button is required") unless params.has_key?(:button)
457
-
458
- body = params[:button] if params.has_key?(:button)
459
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
460
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
461
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
462
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
463
-
464
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/virtualButton"
465
-
466
- @client.request(
467
- method: :post,
468
- path: path,
469
- query: query_params,
470
- headers: headers,
471
- body: body)
472
- end
473
-
474
- # Sets a storage value
475
- #
476
- # Authentication:
477
- # The client must be configured with a valid api
478
- # access token to call this action. The token
479
- # must include at least one of the following scopes:
480
- # all.Application, all.Organization, all.User, flow.*, or flow.setStorageEntry.
481
- #
482
- # Parameters:
483
- # * {string} applicationId - ID associated with the application
484
- # * {string} flowId - ID associated with the flow
485
- # * {hash} entry - Object containing storage entry (https://api.losant.com/#/definitions/flowStorageEntry)
486
- # * {string} losantdomain - Domain scope of request (rarely needed)
487
- # * {boolean} _actions - Return resource actions in response
488
- # * {boolean} _links - Return resource link in response
489
- # * {boolean} _embedded - Return embedded resources in response
490
- #
491
- # Responses:
492
- # * 200 - Value was successfully stored (https://api.losant.com/#/definitions/success)
493
- #
494
- # Errors:
495
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
496
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
497
- def set_storage_entry(params = {})
498
- params = Utils.symbolize_hash_keys(params)
499
- query_params = { _actions: false, _links: true, _embedded: true }
500
- headers = {}
501
- body = nil
502
-
503
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
504
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
505
- raise ArgumentError.new("entry is required") unless params.has_key?(:entry)
506
-
507
- body = params[:entry] if params.has_key?(:entry)
508
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
509
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
510
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
511
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
512
-
513
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/storage"
514
-
515
- @client.request(
516
- method: :patch,
517
- path: path,
518
- query: query_params,
519
- headers: headers,
520
- body: body)
521
- end
522
-
523
- # Get statistics about workflow runs for this workflow
524
- #
525
- # Authentication:
526
- # The client must be configured with a valid api
527
- # access token to call this action. The token
528
- # must include at least one of the following scopes:
529
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.stats.
530
- #
531
- # Parameters:
532
- # * {string} applicationId - ID associated with the application
533
- # * {string} flowId - ID associated with the flow
534
- # * {string} duration - Duration of time range in milliseconds
535
- # * {string} end - End of time range in milliseconds since epoch
536
- # * {string} resolution - Resolution in milliseconds
537
- # * {string} flowVersion - Flow version name or ID. When not included, will be aggregate for all versions. Pass develop for just the develop version.
538
- # * {string} deviceId - For edge or embedded workflows, the device ID to return workflow stats for. When not included, will be aggregate for all device IDs.
539
- # * {string} losantdomain - Domain scope of request (rarely needed)
540
- # * {boolean} _actions - Return resource actions in response
541
- # * {boolean} _links - Return resource link in response
542
- # * {boolean} _embedded - Return embedded resources in response
543
- #
544
- # Responses:
545
- # * 200 - Statistics for workflow runs (https://api.losant.com/#/definitions/flowStats)
546
- #
547
- # Errors:
548
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
549
- # * 404 - Error if flow was not found (https://api.losant.com/#/definitions/error)
550
- def stats(params = {})
551
- params = Utils.symbolize_hash_keys(params)
552
- query_params = { _actions: false, _links: true, _embedded: true }
553
- headers = {}
554
- body = nil
555
-
556
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
557
- raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
558
-
559
- query_params[:duration] = params[:duration] if params.has_key?(:duration)
560
- query_params[:end] = params[:end] if params.has_key?(:end)
561
- query_params[:resolution] = params[:resolution] if params.has_key?(:resolution)
562
- query_params[:flowVersion] = params[:flowVersion] if params.has_key?(:flowVersion)
563
- query_params[:deviceId] = params[:deviceId] if params.has_key?(:deviceId)
564
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
565
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
566
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
567
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
568
-
569
- path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/stats"
570
-
571
- @client.request(
572
- method: :get,
573
- path: path,
574
- query: query_params,
575
- headers: headers,
576
- body: body)
577
- end
578
-
579
- end
580
- end