losant_rest 1.19.4 → 1.19.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +9 -9
  4. data/docs/_schemas.md +7090 -2334
  5. data/docs/experienceUsers.md +1 -0
  6. data/docs/instanceAuditLog.md +49 -0
  7. data/docs/instanceAuditLogs.md +53 -0
  8. data/examples/auth.rb +1 -1
  9. data/examples/list_devices.rb +1 -1
  10. data/lib/platform_rest/application.rb +1 -1
  11. data/lib/platform_rest/application_api_token.rb +1 -1
  12. data/lib/platform_rest/application_api_tokens.rb +1 -1
  13. data/lib/platform_rest/application_certificate.rb +1 -1
  14. data/lib/platform_rest/application_certificate_authorities.rb +1 -1
  15. data/lib/platform_rest/application_certificate_authority.rb +1 -1
  16. data/lib/platform_rest/application_certificates.rb +1 -1
  17. data/lib/platform_rest/application_dashboard.rb +1 -1
  18. data/lib/platform_rest/application_dashboards.rb +1 -1
  19. data/lib/platform_rest/application_key.rb +1 -1
  20. data/lib/platform_rest/application_keys.rb +1 -1
  21. data/lib/platform_rest/application_template.rb +1 -1
  22. data/lib/platform_rest/application_templates.rb +1 -1
  23. data/lib/platform_rest/applications.rb +1 -1
  24. data/lib/platform_rest/audit_log.rb +1 -1
  25. data/lib/platform_rest/audit_logs.rb +1 -1
  26. data/lib/platform_rest/auth.rb +1 -1
  27. data/lib/platform_rest/client.rb +11 -3
  28. data/lib/platform_rest/credential.rb +1 -1
  29. data/lib/platform_rest/credentials.rb +1 -1
  30. data/lib/platform_rest/dashboard.rb +1 -1
  31. data/lib/platform_rest/dashboards.rb +1 -1
  32. data/lib/platform_rest/data.rb +1 -1
  33. data/lib/platform_rest/data_table.rb +1 -1
  34. data/lib/platform_rest/data_table_row.rb +1 -1
  35. data/lib/platform_rest/data_table_rows.rb +1 -1
  36. data/lib/platform_rest/data_tables.rb +1 -1
  37. data/lib/platform_rest/device.rb +1 -1
  38. data/lib/platform_rest/device_recipe.rb +1 -1
  39. data/lib/platform_rest/device_recipes.rb +1 -1
  40. data/lib/platform_rest/devices.rb +1 -1
  41. data/lib/platform_rest/edge_deployment.rb +1 -1
  42. data/lib/platform_rest/edge_deployments.rb +1 -1
  43. data/lib/platform_rest/embedded_deployment.rb +1 -1
  44. data/lib/platform_rest/embedded_deployments.rb +1 -1
  45. data/lib/platform_rest/error.rb +1 -1
  46. data/lib/platform_rest/event.rb +1 -1
  47. data/lib/platform_rest/events.rb +1 -1
  48. data/lib/platform_rest/experience.rb +1 -1
  49. data/lib/platform_rest/experience_domain.rb +1 -1
  50. data/lib/platform_rest/experience_domains.rb +1 -1
  51. data/lib/platform_rest/experience_endpoint.rb +1 -1
  52. data/lib/platform_rest/experience_endpoints.rb +1 -1
  53. data/lib/platform_rest/experience_group.rb +1 -1
  54. data/lib/platform_rest/experience_groups.rb +1 -1
  55. data/lib/platform_rest/experience_slug.rb +1 -1
  56. data/lib/platform_rest/experience_slugs.rb +1 -1
  57. data/lib/platform_rest/experience_user.rb +1 -1
  58. data/lib/platform_rest/experience_users.rb +4 -1
  59. data/lib/platform_rest/experience_version.rb +1 -1
  60. data/lib/platform_rest/experience_versions.rb +1 -1
  61. data/lib/platform_rest/experience_view.rb +1 -1
  62. data/lib/platform_rest/experience_views.rb +1 -1
  63. data/lib/platform_rest/file.rb +1 -1
  64. data/lib/platform_rest/files.rb +1 -1
  65. data/lib/platform_rest/flow.rb +1 -1
  66. data/lib/platform_rest/flow_version.rb +1 -1
  67. data/lib/platform_rest/flow_versions.rb +1 -1
  68. data/lib/platform_rest/flows.rb +1 -1
  69. data/lib/platform_rest/instance.rb +1 -1
  70. data/lib/platform_rest/instance_api_token.rb +1 -1
  71. data/lib/platform_rest/instance_api_tokens.rb +1 -1
  72. data/lib/{losant_rest/application_template.rb → platform_rest/instance_audit_log.rb} +13 -11
  73. data/lib/{losant_rest/audit_logs.rb → platform_rest/instance_audit_logs.rb} +12 -12
  74. data/lib/platform_rest/instance_custom_node.rb +1 -1
  75. data/lib/platform_rest/instance_custom_nodes.rb +1 -1
  76. data/lib/platform_rest/instance_member.rb +1 -1
  77. data/lib/platform_rest/instance_members.rb +1 -1
  78. data/lib/platform_rest/instance_org.rb +1 -1
  79. data/lib/platform_rest/instance_org_invite.rb +1 -1
  80. data/lib/platform_rest/instance_org_invites.rb +1 -1
  81. data/lib/platform_rest/instance_org_member.rb +1 -1
  82. data/lib/platform_rest/instance_org_members.rb +1 -1
  83. data/lib/platform_rest/instance_orgs.rb +1 -1
  84. data/lib/platform_rest/instance_sandbox.rb +1 -1
  85. data/lib/platform_rest/instance_sandboxes.rb +1 -1
  86. data/lib/platform_rest/instances.rb +1 -1
  87. data/lib/platform_rest/integration.rb +1 -1
  88. data/lib/platform_rest/integrations.rb +1 -1
  89. data/lib/platform_rest/me.rb +1 -1
  90. data/lib/platform_rest/notebook.rb +1 -1
  91. data/lib/platform_rest/notebooks.rb +1 -1
  92. data/lib/platform_rest/org.rb +1 -1
  93. data/lib/platform_rest/org_invites.rb +1 -1
  94. data/lib/platform_rest/orgs.rb +1 -1
  95. data/lib/platform_rest/resource_job.rb +1 -1
  96. data/lib/platform_rest/resource_jobs.rb +1 -1
  97. data/lib/platform_rest/user_api_token.rb +1 -1
  98. data/lib/platform_rest/user_api_tokens.rb +1 -1
  99. data/lib/platform_rest/utils.rb +1 -1
  100. data/lib/{losant_rest → platform_rest}/version.rb +3 -3
  101. data/lib/platform_rest/webhook.rb +1 -1
  102. data/lib/platform_rest/webhooks.rb +1 -1
  103. data/lib/platform_rest.rb +3 -1
  104. data/losant_rest.gemspec +2 -2
  105. data/schemas/advancedExperienceUserQuery.json +1068 -0
  106. data/schemas/apiTokenPost.json +9 -1
  107. data/schemas/auditLog.json +3 -2
  108. data/schemas/auditLogFilter.json +3 -2
  109. data/schemas/auditLogs.json +3 -2
  110. data/schemas/credential.json +95 -1
  111. data/schemas/credentialLinkedResources.json +417 -19
  112. data/schemas/credentialPatch.json +107 -0
  113. data/schemas/credentialPost.json +129 -1
  114. data/schemas/credentials.json +95 -1
  115. data/schemas/deviceConnectionStatus.json +6 -2
  116. data/schemas/devicesHistoricalImportPost.json +25 -0
  117. data/schemas/experienceLinkedResources.json +343 -20
  118. data/schemas/experienceVersion.json +64 -0
  119. data/schemas/experienceVersionPatch.json +64 -0
  120. data/schemas/experienceVersionPost.json +64 -0
  121. data/schemas/experienceVersions.json +64 -0
  122. data/schemas/experienceView.json +1 -2
  123. data/schemas/experienceViewPatch.json +1 -2
  124. data/schemas/experienceViewPost.json +2 -4
  125. data/schemas/experienceViews.json +1 -2
  126. data/schemas/flow.json +114 -6
  127. data/schemas/flowPatch.json +114 -6
  128. data/schemas/flowPost.json +114 -6
  129. data/schemas/flowVersion.json +228 -12
  130. data/schemas/flowVersionPost.json +114 -6
  131. data/schemas/flowVersions.json +228 -12
  132. data/schemas/flows.json +114 -6
  133. data/schemas/flowsImportPost.json +228 -12
  134. data/schemas/flowsImportResult.json +342 -18
  135. data/schemas/githubLogin.json +9 -1
  136. data/schemas/instance.json +1 -4
  137. data/schemas/instanceAuditLog.json +94 -0
  138. data/schemas/instanceAuditLogFilter.json +106 -0
  139. data/schemas/instanceAuditLogs.json +41 -0
  140. data/schemas/instanceCustomNode.json +2 -1
  141. data/schemas/instanceCustomNodePatch.json +2 -7
  142. data/schemas/instanceCustomNodePost.json +2 -7
  143. data/schemas/instanceCustomNodes.json +2 -1
  144. data/schemas/instanceOrgMember.json +4 -1
  145. data/schemas/instances.json +1 -4
  146. data/schemas/integration.json +75 -1
  147. data/schemas/integrationPatch.json +73 -0
  148. data/schemas/integrationPost.json +75 -1
  149. data/schemas/integrations.json +75 -1
  150. data/schemas/mePatch.json +18 -0
  151. data/schemas/resourceJob.json +2 -1
  152. data/schemas/resourceJobExecutionLogs.json +2 -1
  153. data/schemas/resourceJobPost.json +2 -1
  154. data/schemas/resourceJobs.json +2 -1
  155. data/schemas/samlResponse.json +9 -1
  156. data/schemas/userCredentials.json +9 -1
  157. data/schemas/userPost.json +9 -1
  158. data/test/basic_test.rb +6 -6
  159. data/test/test_helper.rb +1 -1
  160. metadata +12 -94
  161. data/lib/losant_rest/application.rb +0 -932
  162. data/lib/losant_rest/application_api_token.rb +0 -176
  163. data/lib/losant_rest/application_api_tokens.rb +0 -136
  164. data/lib/losant_rest/application_certificate.rb +0 -176
  165. data/lib/losant_rest/application_certificate_authorities.rb +0 -138
  166. data/lib/losant_rest/application_certificate_authority.rb +0 -176
  167. data/lib/losant_rest/application_certificates.rb +0 -138
  168. data/lib/losant_rest/application_dashboard.rb +0 -225
  169. data/lib/losant_rest/application_dashboards.rb +0 -138
  170. data/lib/losant_rest/application_key.rb +0 -176
  171. data/lib/losant_rest/application_keys.rb +0 -141
  172. data/lib/losant_rest/application_templates.rb +0 -176
  173. data/lib/losant_rest/applications.rb +0 -142
  174. data/lib/losant_rest/audit_log.rb +0 -81
  175. data/lib/losant_rest/auth.rb +0 -245
  176. data/lib/losant_rest/client.rb +0 -410
  177. data/lib/losant_rest/credential.rb +0 -224
  178. data/lib/losant_rest/credentials.rb +0 -138
  179. data/lib/losant_rest/dashboard.rb +0 -268
  180. data/lib/losant_rest/dashboards.rb +0 -136
  181. data/lib/losant_rest/data.rb +0 -176
  182. data/lib/losant_rest/data_table.rb +0 -274
  183. data/lib/losant_rest/data_table_row.rb +0 -182
  184. data/lib/losant_rest/data_table_rows.rb +0 -343
  185. data/lib/losant_rest/data_tables.rb +0 -138
  186. data/lib/losant_rest/device.rb +0 -749
  187. data/lib/losant_rest/device_recipe.rb +0 -234
  188. data/lib/losant_rest/device_recipes.rb +0 -146
  189. data/lib/losant_rest/devices.rb +0 -707
  190. data/lib/losant_rest/edge_deployment.rb +0 -81
  191. data/lib/losant_rest/edge_deployments.rb +0 -236
  192. data/lib/losant_rest/embedded_deployment.rb +0 -81
  193. data/lib/losant_rest/embedded_deployments.rb +0 -280
  194. data/lib/losant_rest/error.rb +0 -34
  195. data/lib/losant_rest/event.rb +0 -176
  196. data/lib/losant_rest/events.rb +0 -341
  197. data/lib/losant_rest/experience.rb +0 -142
  198. data/lib/losant_rest/experience_domain.rb +0 -176
  199. data/lib/losant_rest/experience_domains.rb +0 -126
  200. data/lib/losant_rest/experience_endpoint.rb +0 -230
  201. data/lib/losant_rest/experience_endpoints.rb +0 -200
  202. data/lib/losant_rest/experience_group.rb +0 -180
  203. data/lib/losant_rest/experience_groups.rb +0 -141
  204. data/lib/losant_rest/experience_slug.rb +0 -176
  205. data/lib/losant_rest/experience_slugs.rb +0 -126
  206. data/lib/losant_rest/experience_user.rb +0 -176
  207. data/lib/losant_rest/experience_users.rb +0 -142
  208. data/lib/losant_rest/experience_version.rb +0 -176
  209. data/lib/losant_rest/experience_versions.rb +0 -138
  210. data/lib/losant_rest/experience_view.rb +0 -228
  211. data/lib/losant_rest/experience_views.rb +0 -142
  212. data/lib/losant_rest/file.rb +0 -226
  213. data/lib/losant_rest/files.rb +0 -144
  214. data/lib/losant_rest/flow.rb +0 -580
  215. data/lib/losant_rest/flow_version.rb +0 -352
  216. data/lib/losant_rest/flow_versions.rb +0 -201
  217. data/lib/losant_rest/flows.rb +0 -310
  218. data/lib/losant_rest/instance.rb +0 -377
  219. data/lib/losant_rest/instance_api_token.rb +0 -176
  220. data/lib/losant_rest/instance_api_tokens.rb +0 -136
  221. data/lib/losant_rest/instance_custom_node.rb +0 -282
  222. data/lib/losant_rest/instance_custom_nodes.rb +0 -136
  223. data/lib/losant_rest/instance_member.rb +0 -176
  224. data/lib/losant_rest/instance_members.rb +0 -134
  225. data/lib/losant_rest/instance_org.rb +0 -336
  226. data/lib/losant_rest/instance_org_invite.rb +0 -182
  227. data/lib/losant_rest/instance_org_invites.rb +0 -138
  228. data/lib/losant_rest/instance_org_member.rb +0 -182
  229. data/lib/losant_rest/instance_org_members.rb +0 -138
  230. data/lib/losant_rest/instance_orgs.rb +0 -139
  231. data/lib/losant_rest/instance_sandbox.rb +0 -181
  232. data/lib/losant_rest/instance_sandboxes.rb +0 -98
  233. data/lib/losant_rest/instances.rb +0 -88
  234. data/lib/losant_rest/integration.rb +0 -178
  235. data/lib/losant_rest/integrations.rb +0 -138
  236. data/lib/losant_rest/me.rb +0 -790
  237. data/lib/losant_rest/notebook.rb +0 -423
  238. data/lib/losant_rest/notebooks.rb +0 -138
  239. data/lib/losant_rest/org.rb +0 -663
  240. data/lib/losant_rest/org_invites.rb +0 -124
  241. data/lib/losant_rest/orgs.rb +0 -140
  242. data/lib/losant_rest/resource_job.rb +0 -326
  243. data/lib/losant_rest/resource_jobs.rb +0 -138
  244. data/lib/losant_rest/user_api_token.rb +0 -170
  245. data/lib/losant_rest/user_api_tokens.rb +0 -132
  246. data/lib/losant_rest/utils.rb +0 -44
  247. data/lib/losant_rest/webhook.rb +0 -178
  248. data/lib/losant_rest/webhooks.rb +0 -138
  249. data/lib/losant_rest.rb +0 -129
@@ -1,932 +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 Application Resource
28
- class Application
29
-
30
- def initialize(client)
31
- @client = client
32
- end
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
-
82
- # Returns success when a job has been enqueued to archive this application's device data for a given day
83
- #
84
- # Authentication:
85
- # The client must be configured with a valid api
86
- # access token to call this action. The token
87
- # must include at least one of the following scopes:
88
- # all.Application, all.Organization, all.User, application.*, or application.archiveData.
89
- #
90
- # Parameters:
91
- # * {string} applicationId - ID of the associated application
92
- # * {string} date - The date to archive data (ms since epoch), it must be within the archive time range older than 31 days and newer than the organizations dataTTL
93
- # * {string} losantdomain - Domain scope of request (rarely needed)
94
- # * {boolean} _actions - Return resource actions in response
95
- # * {boolean} _links - Return resource link in response
96
- # * {boolean} _embedded - Return embedded resources in response
97
- #
98
- # Responses:
99
- # * 202 - Enqueued a job to archive this applications device data (https://api.losant.com/#/definitions/jobEnqueuedResult)
100
- #
101
- # Errors:
102
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
103
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
104
- def archive_data(params = {})
105
- params = Utils.symbolize_hash_keys(params)
106
- query_params = { _actions: false, _links: true, _embedded: true }
107
- headers = {}
108
- body = nil
109
-
110
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
111
- raise ArgumentError.new("date is required") unless params.has_key?(:date)
112
-
113
- query_params[:date] = params[:date] if params.has_key?(:date)
114
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
115
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
116
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
117
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
118
-
119
- path = "/applications/#{params[:applicationId]}/archiveData"
120
-
121
- @client.request(
122
- method: :get,
123
- path: path,
124
- query: query_params,
125
- headers: headers,
126
- body: body)
127
- end
128
-
129
- # Returns success when a job has been enqueued to backfill all current data to its archive
130
- #
131
- # Authentication:
132
- # The client must be configured with a valid api
133
- # access token to call this action. The token
134
- # must include at least one of the following scopes:
135
- # all.Application, all.Organization, all.User, application.*, or application.backfillArchiveData.
136
- #
137
- # Parameters:
138
- # * {string} applicationId - ID of the associated application
139
- # * {string} losantdomain - Domain scope of request (rarely needed)
140
- # * {boolean} _actions - Return resource actions in response
141
- # * {boolean} _links - Return resource link in response
142
- # * {boolean} _embedded - Return embedded resources in response
143
- #
144
- # Responses:
145
- # * 202 - Enqueued a job to backfill device data to this application archive location (https://api.losant.com/#/definitions/jobEnqueuedResult)
146
- #
147
- # Errors:
148
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
149
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
150
- def backfill_archive_data(params = {})
151
- params = Utils.symbolize_hash_keys(params)
152
- query_params = { _actions: false, _links: true, _embedded: true }
153
- headers = {}
154
- body = nil
155
-
156
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
157
-
158
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
159
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
160
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
161
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
162
-
163
- path = "/applications/#{params[:applicationId]}/backfillArchiveData"
164
-
165
- @client.request(
166
- method: :get,
167
- path: path,
168
- query: query_params,
169
- headers: headers,
170
- body: body)
171
- end
172
-
173
- # Copy an application into a new application
174
- #
175
- # Authentication:
176
- # The client must be configured with a valid api
177
- # access token to call this action. The token
178
- # must include at least one of the following scopes:
179
- # all.Application, all.Organization, all.User, application.*, or application.clone.
180
- #
181
- # Parameters:
182
- # * {string} applicationId - ID of the associated application
183
- # * {hash} options - Object containing optional clone fields (https://api.losant.com/#/definitions/applicationClonePost)
184
- # * {string} losantdomain - Domain scope of request (rarely needed)
185
- # * {boolean} _actions - Return resource actions in response
186
- # * {boolean} _links - Return resource link in response
187
- # * {boolean} _embedded - Return embedded resources in response
188
- #
189
- # Responses:
190
- # * 200 - if dryRun is set and successful, then return success (https://api.losant.com/#/definitions/applicationCloneDryRunResult)
191
- # * 201 - If application was successfully cloned (https://api.losant.com/#/definitions/applicationCreationByTemplateResult)
192
- # * 202 - If application was enqueued to be cloned (https://api.losant.com/#/definitions/jobEnqueuedResult)
193
- #
194
- # Errors:
195
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
196
- # * 404 - Error if application is not found (https://api.losant.com/#/definitions/error)
197
- # * 422 - Error if too many validation errors occurred on other resources (https://api.losant.com/#/definitions/validationErrors)
198
- def clone(params = {})
199
- params = Utils.symbolize_hash_keys(params)
200
- query_params = { _actions: false, _links: true, _embedded: true }
201
- headers = {}
202
- body = nil
203
-
204
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
205
-
206
- body = params[:options] if params.has_key?(:options)
207
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
208
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
209
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
210
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
211
-
212
- path = "/applications/#{params[:applicationId]}/clone"
213
-
214
- @client.request(
215
- method: :post,
216
- path: path,
217
- query: query_params,
218
- headers: headers,
219
- body: body)
220
- end
221
-
222
- # Deletes an application
223
- #
224
- # Authentication:
225
- # The client must be configured with a valid api
226
- # access token to call this action. The token
227
- # must include at least one of the following scopes:
228
- # all.Application, all.Organization, all.User, application.*, or application.delete.
229
- #
230
- # Parameters:
231
- # * {string} applicationId - ID of the associated application
232
- # * {string} losantdomain - Domain scope of request (rarely needed)
233
- # * {boolean} _actions - Return resource actions in response
234
- # * {boolean} _links - Return resource link in response
235
- # * {boolean} _embedded - Return embedded resources in response
236
- #
237
- # Responses:
238
- # * 200 - If application was successfully deleted (https://api.losant.com/#/definitions/success)
239
- #
240
- # Errors:
241
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
242
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
243
- def delete(params = {})
244
- params = Utils.symbolize_hash_keys(params)
245
- query_params = { _actions: false, _links: true, _embedded: true }
246
- headers = {}
247
- body = nil
248
-
249
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
250
-
251
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
252
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
253
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
254
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
255
-
256
- path = "/applications/#{params[:applicationId]}"
257
-
258
- @client.request(
259
- method: :delete,
260
- path: path,
261
- query: query_params,
262
- headers: headers,
263
- body: body)
264
- end
265
-
266
- # Returns device counts by day for the time range specified for this application
267
- #
268
- # Authentication:
269
- # The client must be configured with a valid api
270
- # access token to call this action. The token
271
- # must include at least one of the following scopes:
272
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.deviceCounts.
273
- #
274
- # Parameters:
275
- # * {string} applicationId - ID of the associated application
276
- # * {string} start - Start of range for device count query (ms since epoch)
277
- # * {string} end - End of range for device count query (ms since epoch)
278
- # * {string} losantdomain - Domain scope of request (rarely needed)
279
- # * {boolean} _actions - Return resource actions in response
280
- # * {boolean} _links - Return resource link in response
281
- # * {boolean} _embedded - Return embedded resources in response
282
- #
283
- # Responses:
284
- # * 200 - Device counts by day (https://api.losant.com/#/definitions/deviceCounts)
285
- #
286
- # Errors:
287
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
288
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
289
- def device_counts(params = {})
290
- params = Utils.symbolize_hash_keys(params)
291
- query_params = { _actions: false, _links: true, _embedded: true }
292
- headers = {}
293
- body = nil
294
-
295
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
296
-
297
- query_params[:start] = params[:start] if params.has_key?(:start)
298
- query_params[:end] = params[:end] if params.has_key?(:end)
299
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
300
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
301
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
302
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
303
-
304
- path = "/applications/#{params[:applicationId]}/deviceCounts"
305
-
306
- @client.request(
307
- method: :get,
308
- path: path,
309
- query: query_params,
310
- headers: headers,
311
- body: body)
312
- end
313
-
314
- # Export an application and all of its resources
315
- #
316
- # Authentication:
317
- # The client must be configured with a valid api
318
- # access token to call this action. The token
319
- # must include at least one of the following scopes:
320
- # all.Application, all.Organization, all.User, application.*, or application.export.
321
- #
322
- # Parameters:
323
- # * {string} applicationId - ID of the associated application
324
- # * {hash} options - Object containing export application options (https://api.losant.com/#/definitions/applicationExportPost)
325
- # * {string} losantdomain - Domain scope of request (rarely needed)
326
- # * {boolean} _actions - Return resource actions in response
327
- # * {boolean} _links - Return resource link in response
328
- # * {boolean} _embedded - Return embedded resources in response
329
- #
330
- # Responses:
331
- # * 200 - a url to download the zip of exported resources (https://api.losant.com/#/definitions/applicationExportResult)
332
- # * 202 - If application was enqueued to be exported (https://api.losant.com/#/definitions/jobEnqueuedResult)
333
- #
334
- # Errors:
335
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
336
- # * 404 - Error if application is not found (https://api.losant.com/#/definitions/error)
337
- def export(params = {})
338
- params = Utils.symbolize_hash_keys(params)
339
- query_params = { _actions: false, _links: true, _embedded: true }
340
- headers = {}
341
- body = nil
342
-
343
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
344
- raise ArgumentError.new("options is required") unless params.has_key?(:options)
345
-
346
- body = params[:options] if params.has_key?(:options)
347
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
348
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
349
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
350
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
351
-
352
- path = "/applications/#{params[:applicationId]}/export"
353
-
354
- @client.request(
355
- method: :post,
356
- path: path,
357
- query: query_params,
358
- headers: headers,
359
- body: body)
360
- end
361
-
362
- # Returns success when a job has been enqueued to archive all selected data tables
363
- #
364
- # Authentication:
365
- # The client must be configured with a valid api
366
- # access token to call this action. The token
367
- # must include at least one of the following scopes:
368
- # all.Application, all.Organization, all.User, application.*, or application.fullDataTablesArchive.
369
- #
370
- # Parameters:
371
- # * {string} applicationId - ID of the associated application
372
- # * {string} losantdomain - Domain scope of request (rarely needed)
373
- # * {boolean} _actions - Return resource actions in response
374
- # * {boolean} _links - Return resource link in response
375
- # * {boolean} _embedded - Return embedded resources in response
376
- #
377
- # Responses:
378
- # * 202 - Enqueued a job to archive all selected data tables of this application archive location (https://api.losant.com/#/definitions/jobEnqueuedResult)
379
- #
380
- # Errors:
381
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
382
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
383
- def full_data_tables_archive(params = {})
384
- params = Utils.symbolize_hash_keys(params)
385
- query_params = { _actions: false, _links: true, _embedded: true }
386
- headers = {}
387
- body = nil
388
-
389
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
390
-
391
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
392
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
393
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
394
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
395
-
396
- path = "/applications/#{params[:applicationId]}/fullDataTablesArchive"
397
-
398
- @client.request(
399
- method: :get,
400
- path: path,
401
- query: query_params,
402
- headers: headers,
403
- body: body)
404
- end
405
-
406
- # Returns success when a job has been enqueued to archive all current events
407
- #
408
- # Authentication:
409
- # The client must be configured with a valid api
410
- # access token to call this action. The token
411
- # must include at least one of the following scopes:
412
- # all.Application, all.Organization, all.User, application.*, or application.fullEventsArchive.
413
- #
414
- # Parameters:
415
- # * {string} applicationId - ID of the associated application
416
- # * {string} losantdomain - Domain scope of request (rarely needed)
417
- # * {boolean} _actions - Return resource actions in response
418
- # * {boolean} _links - Return resource link in response
419
- # * {boolean} _embedded - Return embedded resources in response
420
- #
421
- # Responses:
422
- # * 202 - Enqueued a job to archive all events to this application archive location (https://api.losant.com/#/definitions/jobEnqueuedResult)
423
- #
424
- # Errors:
425
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
426
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
427
- def full_events_archive(params = {})
428
- params = Utils.symbolize_hash_keys(params)
429
- query_params = { _actions: false, _links: true, _embedded: true }
430
- headers = {}
431
- body = nil
432
-
433
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
434
-
435
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
436
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
437
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
438
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
439
-
440
- path = "/applications/#{params[:applicationId]}/fullEventsArchive"
441
-
442
- @client.request(
443
- method: :get,
444
- path: path,
445
- query: query_params,
446
- headers: headers,
447
- body: body)
448
- end
449
-
450
- # Retrieves information on an application
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.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.
457
- #
458
- # Parameters:
459
- # * {string} applicationId - ID of the associated application
460
- # * {string} summaryExclude - Comma-separated list of summary fields to exclude from application summary
461
- # * {string} summaryInclude - Comma-separated list of summary fields to include in application summary
462
- # * {string} losantdomain - Domain scope of request (rarely needed)
463
- # * {boolean} _actions - Return resource actions in response
464
- # * {boolean} _links - Return resource link in response
465
- # * {boolean} _embedded - Return embedded resources in response
466
- #
467
- # Responses:
468
- # * 200 - Application information (https://api.losant.com/#/definitions/application)
469
- #
470
- # Errors:
471
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
472
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
473
- def get(params = {})
474
- params = Utils.symbolize_hash_keys(params)
475
- query_params = { _actions: false, _links: true, _embedded: true }
476
- headers = {}
477
- body = nil
478
-
479
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
480
-
481
- query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude)
482
- query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
483
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
484
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
485
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
486
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
487
-
488
- path = "/applications/#{params[:applicationId]}"
489
-
490
- @client.request(
491
- method: :get,
492
- path: path,
493
- query: query_params,
494
- headers: headers,
495
- body: body)
496
- end
497
-
498
- # Updates an application global at the given key
499
- #
500
- # Authentication:
501
- # The client must be configured with a valid api
502
- # access token to call this action. The token
503
- # must include at least one of the following scopes:
504
- # all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
505
- #
506
- # Parameters:
507
- # * {string} applicationId - ID of the associated application
508
- # * {hash} globals - Array of objects containing new application global information (https://api.losant.com/#/definitions/applicationGlobalPatch)
509
- # * {string} losantdomain - Domain scope of request (rarely needed)
510
- # * {boolean} _actions - Return resource actions in response
511
- # * {boolean} _links - Return resource link in response
512
- # * {boolean} _embedded - Return embedded resources in response
513
- #
514
- # Responses:
515
- # * 200 - Updated application information (https://api.losant.com/#/definitions/application)
516
- #
517
- # Errors:
518
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
519
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
520
- def globals(params = {})
521
- params = Utils.symbolize_hash_keys(params)
522
- query_params = { _actions: false, _links: true, _embedded: true }
523
- headers = {}
524
- body = nil
525
-
526
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
527
- raise ArgumentError.new("globals is required") unless params.has_key?(:globals)
528
-
529
- body = params[:globals] if params.has_key?(:globals)
530
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
531
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
532
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
533
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
534
-
535
- path = "/applications/#{params[:applicationId]}/globals"
536
-
537
- @client.request(
538
- method: :patch,
539
- path: path,
540
- query: query_params,
541
- headers: headers,
542
- body: body)
543
- end
544
-
545
- # Publishes the given message to the given MQTT topic
546
- #
547
- # Authentication:
548
- # The client must be configured with a valid api
549
- # access token to call this action. The token
550
- # must include at least one of the following scopes:
551
- # all.Application, all.Organization, all.User, application.*, or application.mqttPublishMessage.
552
- #
553
- # Parameters:
554
- # * {string} applicationId - ID of the associated application
555
- # * {hash} payload - Object containing topic and message (https://api.losant.com/#/definitions/mqttPublishBody)
556
- # * {string} losantdomain - Domain scope of request (rarely needed)
557
- # * {boolean} _actions - Return resource actions in response
558
- # * {boolean} _links - Return resource link in response
559
- # * {boolean} _embedded - Return embedded resources in response
560
- #
561
- # Responses:
562
- # * 200 - Message successfully published (https://api.losant.com/#/definitions/success)
563
- #
564
- # Errors:
565
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
566
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
567
- def mqtt_publish_message(params = {})
568
- params = Utils.symbolize_hash_keys(params)
569
- query_params = { _actions: false, _links: true, _embedded: true }
570
- headers = {}
571
- body = nil
572
-
573
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
574
- raise ArgumentError.new("payload is required") unless params.has_key?(:payload)
575
-
576
- body = params[:payload] if params.has_key?(:payload)
577
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
578
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
579
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
580
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
581
-
582
- path = "/applications/#{params[:applicationId]}/mqttPublishMessage"
583
-
584
- @client.request(
585
- method: :post,
586
- path: path,
587
- query: query_params,
588
- headers: headers,
589
- body: body)
590
- end
591
-
592
- # Returns notebook execution usage by day for the time range specified for this application
593
- #
594
- # Authentication:
595
- # The client must be configured with a valid api
596
- # access token to call this action. The token
597
- # must include at least one of the following scopes:
598
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.notebookMinuteCounts.
599
- #
600
- # Parameters:
601
- # * {string} applicationId - ID of the associated application
602
- # * {string} start - Start of range for notebook execution query (ms since epoch)
603
- # * {string} end - End of range for notebook execution query (ms since epoch)
604
- # * {string} losantdomain - Domain scope of request (rarely needed)
605
- # * {boolean} _actions - Return resource actions in response
606
- # * {boolean} _links - Return resource link in response
607
- # * {boolean} _embedded - Return embedded resources in response
608
- #
609
- # Responses:
610
- # * 200 - Notebook usage information (https://api.losant.com/#/definitions/notebookMinuteCounts)
611
- #
612
- # Errors:
613
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
614
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
615
- def notebook_minute_counts(params = {})
616
- params = Utils.symbolize_hash_keys(params)
617
- query_params = { _actions: false, _links: true, _embedded: true }
618
- headers = {}
619
- body = nil
620
-
621
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
622
-
623
- query_params[:start] = params[:start] if params.has_key?(:start)
624
- query_params[:end] = params[:end] if params.has_key?(:end)
625
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
626
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
627
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
628
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
629
-
630
- path = "/applications/#{params[:applicationId]}/notebookMinuteCounts"
631
-
632
- @client.request(
633
- method: :get,
634
- path: path,
635
- query: query_params,
636
- headers: headers,
637
- body: body)
638
- end
639
-
640
- # Updates information about an application
641
- #
642
- # Authentication:
643
- # The client must be configured with a valid api
644
- # access token to call this action. The token
645
- # must include at least one of the following scopes:
646
- # all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
647
- #
648
- # Parameters:
649
- # * {string} applicationId - ID of the associated application
650
- # * {hash} application - Object containing new application properties (https://api.losant.com/#/definitions/applicationPatch)
651
- # * {string} summaryExclude - Comma-separated list of summary fields to exclude from application summary
652
- # * {string} summaryInclude - Comma-separated list of summary fields to include in application summary
653
- # * {string} losantdomain - Domain scope of request (rarely needed)
654
- # * {boolean} _actions - Return resource actions in response
655
- # * {boolean} _links - Return resource link in response
656
- # * {boolean} _embedded - Return embedded resources in response
657
- #
658
- # Responses:
659
- # * 200 - Updated application information (https://api.losant.com/#/definitions/application)
660
- #
661
- # Errors:
662
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
663
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
664
- def patch(params = {})
665
- params = Utils.symbolize_hash_keys(params)
666
- query_params = { _actions: false, _links: true, _embedded: true }
667
- headers = {}
668
- body = nil
669
-
670
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
671
- raise ArgumentError.new("application is required") unless params.has_key?(:application)
672
-
673
- body = params[:application] if params.has_key?(:application)
674
- query_params[:summaryExclude] = params[:summaryExclude] if params.has_key?(:summaryExclude)
675
- query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
676
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
677
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
678
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
679
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
680
-
681
- path = "/applications/#{params[:applicationId]}"
682
-
683
- @client.request(
684
- method: :patch,
685
- path: path,
686
- query: query_params,
687
- headers: headers,
688
- body: body)
689
- end
690
-
691
- # Returns payload counts for the time range specified for this application
692
- #
693
- # Authentication:
694
- # The client must be configured with a valid api
695
- # access token to call this action. The token
696
- # must include at least one of the following scopes:
697
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.payloadCounts.
698
- #
699
- # Parameters:
700
- # * {string} applicationId - ID of the associated application
701
- # * {string} start - Start of range for payload count query (ms since epoch)
702
- # * {string} end - End of range for payload count query (ms since epoch)
703
- # * {string} losantdomain - Domain scope of request (rarely needed)
704
- # * {boolean} _actions - Return resource actions in response
705
- # * {boolean} _links - Return resource link in response
706
- # * {boolean} _embedded - Return embedded resources in response
707
- #
708
- # Responses:
709
- # * 200 - Payload counts, by type and source (https://api.losant.com/#/definitions/payloadStats)
710
- #
711
- # Errors:
712
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
713
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
714
- def payload_counts(params = {})
715
- params = Utils.symbolize_hash_keys(params)
716
- query_params = { _actions: false, _links: true, _embedded: true }
717
- headers = {}
718
- body = nil
719
-
720
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
721
-
722
- query_params[:start] = params[:start] if params.has_key?(:start)
723
- query_params[:end] = params[:end] if params.has_key?(:end)
724
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
725
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
726
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
727
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
728
-
729
- path = "/applications/#{params[:applicationId]}/payloadCounts"
730
-
731
- @client.request(
732
- method: :get,
733
- path: path,
734
- query: query_params,
735
- headers: headers,
736
- body: body)
737
- end
738
-
739
- # Returns payload counts per resolution in the time range specified for this application
740
- #
741
- # Authentication:
742
- # The client must be configured with a valid api
743
- # access token to call this action. The token
744
- # must include at least one of the following scopes:
745
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.payloadCountsBreakdown.
746
- #
747
- # Parameters:
748
- # * {string} applicationId - ID of the associated application
749
- # * {string} start - Start of range for payload count query (ms since epoch)
750
- # * {string} end - End of range for payload count query (ms since epoch)
751
- # * {string} resolution - Resolution in milliseconds. Accepted values are: 86400000, 3600000
752
- # * {string} asBytes - If the resulting stats should be returned as bytes
753
- # * {string} includeNonBillable - If non-billable payloads should be included in the result
754
- # * {string} losantdomain - Domain scope of request (rarely needed)
755
- # * {boolean} _actions - Return resource actions in response
756
- # * {boolean} _links - Return resource link in response
757
- # * {boolean} _embedded - Return embedded resources in response
758
- #
759
- # Responses:
760
- # * 200 - Sum of payload counts by date (https://api.losant.com/#/definitions/payloadCountsBreakdown)
761
- #
762
- # Errors:
763
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
764
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
765
- def payload_counts_breakdown(params = {})
766
- params = Utils.symbolize_hash_keys(params)
767
- query_params = { _actions: false, _links: true, _embedded: true }
768
- headers = {}
769
- body = nil
770
-
771
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
772
-
773
- query_params[:start] = params[:start] if params.has_key?(:start)
774
- query_params[:end] = params[:end] if params.has_key?(:end)
775
- query_params[:resolution] = params[:resolution] if params.has_key?(:resolution)
776
- query_params[:asBytes] = params[:asBytes] if params.has_key?(:asBytes)
777
- query_params[:includeNonBillable] = params[:includeNonBillable] if params.has_key?(:includeNonBillable)
778
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
779
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
780
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
781
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
782
-
783
- path = "/applications/#{params[:applicationId]}/payloadCountsBreakdown"
784
-
785
- @client.request(
786
- method: :get,
787
- path: path,
788
- query: query_params,
789
- headers: headers,
790
- body: body)
791
- end
792
-
793
- # Get the current application readme information
794
- #
795
- # Authentication:
796
- # The client must be configured with a valid api
797
- # access token to call this action. The token
798
- # must include at least one of the following scopes:
799
- # all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.
800
- #
801
- # Parameters:
802
- # * {string} applicationId - ID of the associated application
803
- # * {string} losantdomain - Domain scope of request (rarely needed)
804
- # * {boolean} _actions - Return resource actions in response
805
- # * {boolean} _links - Return resource link in response
806
- # * {boolean} _embedded - Return embedded resources in response
807
- #
808
- # Responses:
809
- # * 200 - The application readme information (https://api.losant.com/#/definitions/applicationReadme)
810
- #
811
- # Errors:
812
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
813
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
814
- def readme(params = {})
815
- params = Utils.symbolize_hash_keys(params)
816
- query_params = { _actions: false, _links: true, _embedded: true }
817
- headers = {}
818
- body = nil
819
-
820
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
821
-
822
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
823
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
824
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
825
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
826
-
827
- path = "/applications/#{params[:applicationId]}/readme"
828
-
829
- @client.request(
830
- method: :get,
831
- path: path,
832
- query: query_params,
833
- headers: headers,
834
- body: body)
835
- end
836
-
837
- # Update the current application readme information
838
- #
839
- # Authentication:
840
- # The client must be configured with a valid api
841
- # access token to call this action. The token
842
- # must include at least one of the following scopes:
843
- # all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.
844
- #
845
- # Parameters:
846
- # * {string} applicationId - ID of the associated application
847
- # * {hash} readme - Object containing new readme information (https://api.losant.com/#/definitions/applicationReadmePatch)
848
- # * {string} losantdomain - Domain scope of request (rarely needed)
849
- # * {boolean} _actions - Return resource actions in response
850
- # * {boolean} _links - Return resource link in response
851
- # * {boolean} _embedded - Return embedded resources in response
852
- #
853
- # Responses:
854
- # * 200 - Updated readme information (https://api.losant.com/#/definitions/applicationReadme)
855
- #
856
- # Errors:
857
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
858
- # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
859
- def readme_patch(params = {})
860
- params = Utils.symbolize_hash_keys(params)
861
- query_params = { _actions: false, _links: true, _embedded: true }
862
- headers = {}
863
- body = nil
864
-
865
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
866
- raise ArgumentError.new("readme is required") unless params.has_key?(:readme)
867
-
868
- body = params[:readme] if params.has_key?(:readme)
869
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
870
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
871
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
872
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
873
-
874
- path = "/applications/#{params[:applicationId]}/readme"
875
-
876
- @client.request(
877
- method: :patch,
878
- path: path,
879
- query: query_params,
880
- headers: headers,
881
- body: body)
882
- end
883
-
884
- # Search across an application's resources by target identifier
885
- #
886
- # Authentication:
887
- # The client must be configured with a valid api
888
- # access token to call this action. The token
889
- # must include at least one of the following scopes:
890
- # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.search.
891
- #
892
- # Parameters:
893
- # * {string} applicationId - ID of the associated application
894
- # * {string} filter - The partial resource name being searched for
895
- # * {string} losantdomain - Domain scope of request (rarely needed)
896
- # * {boolean} _actions - Return resource actions in response
897
- # * {boolean} _links - Return resource link in response
898
- # * {boolean} _embedded - Return embedded resources in response
899
- #
900
- # Responses:
901
- # * 200 - An array of resource ids, names, descriptions, and types matching the search query (https://api.losant.com/#/definitions/applicationSearchResult)
902
- #
903
- # Errors:
904
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
905
- # * 404 - Error if application is not found (https://api.losant.com/#/definitions/error)
906
- def search(params = {})
907
- params = Utils.symbolize_hash_keys(params)
908
- query_params = { _actions: false, _links: true, _embedded: true }
909
- headers = {}
910
- body = nil
911
-
912
- raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
913
- raise ArgumentError.new("filter is required") unless params.has_key?(:filter)
914
-
915
- query_params[:filter] = params[:filter] if params.has_key?(:filter)
916
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
917
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
918
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
919
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
920
-
921
- path = "/applications/#{params[:applicationId]}/search"
922
-
923
- @client.request(
924
- method: :get,
925
- path: path,
926
- query: query_params,
927
- headers: headers,
928
- body: body)
929
- end
930
-
931
- end
932
- end