losant_rest 1.9.1 → 1.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/docs/_schemas.md +41608 -19945
  5. data/docs/application.md +168 -4
  6. data/docs/applicationTemplates.md +50 -0
  7. data/docs/applications.md +46 -0
  8. data/docs/auth.md +72 -0
  9. data/docs/device.md +1 -0
  10. data/docs/devices.md +89 -2
  11. data/docs/experienceEndpoint.md +43 -0
  12. data/docs/experienceEndpoints.md +1 -1
  13. data/docs/experienceView.md +43 -0
  14. data/lib/losant_rest.rb +2 -1
  15. data/lib/losant_rest/application.rb +144 -5
  16. data/lib/losant_rest/application_api_token.rb +1 -1
  17. data/lib/losant_rest/application_api_tokens.rb +1 -1
  18. data/lib/losant_rest/application_certificate.rb +1 -1
  19. data/lib/losant_rest/application_certificate_authorities.rb +1 -1
  20. data/lib/losant_rest/application_certificate_authority.rb +1 -1
  21. data/lib/losant_rest/application_certificates.rb +1 -1
  22. data/lib/losant_rest/application_key.rb +1 -1
  23. data/lib/losant_rest/application_keys.rb +1 -1
  24. data/lib/losant_rest/application_templates.rb +88 -0
  25. data/lib/losant_rest/applications.rb +1 -1
  26. data/lib/losant_rest/audit_log.rb +1 -1
  27. data/lib/losant_rest/audit_logs.rb +1 -1
  28. data/lib/losant_rest/auth.rb +85 -1
  29. data/lib/losant_rest/client.rb +7 -3
  30. data/lib/losant_rest/dashboard.rb +1 -1
  31. data/lib/losant_rest/dashboards.rb +1 -1
  32. data/lib/losant_rest/data.rb +1 -1
  33. data/lib/losant_rest/data_table.rb +1 -1
  34. data/lib/losant_rest/data_table_row.rb +1 -1
  35. data/lib/losant_rest/data_table_rows.rb +1 -1
  36. data/lib/losant_rest/data_tables.rb +1 -1
  37. data/lib/losant_rest/device.rb +3 -1
  38. data/lib/losant_rest/device_recipe.rb +1 -1
  39. data/lib/losant_rest/device_recipes.rb +1 -1
  40. data/lib/losant_rest/devices.rb +105 -3
  41. data/lib/losant_rest/edge_deployments.rb +1 -1
  42. data/lib/losant_rest/error.rb +1 -1
  43. data/lib/losant_rest/event.rb +1 -1
  44. data/lib/losant_rest/events.rb +1 -1
  45. data/lib/losant_rest/experience.rb +1 -1
  46. data/lib/losant_rest/experience_domain.rb +1 -1
  47. data/lib/losant_rest/experience_domains.rb +1 -1
  48. data/lib/losant_rest/experience_endpoint.rb +51 -1
  49. data/lib/losant_rest/experience_endpoints.rb +1 -1
  50. data/lib/losant_rest/experience_group.rb +1 -1
  51. data/lib/losant_rest/experience_groups.rb +1 -1
  52. data/lib/losant_rest/experience_slug.rb +1 -1
  53. data/lib/losant_rest/experience_slugs.rb +1 -1
  54. data/lib/losant_rest/experience_user.rb +1 -1
  55. data/lib/losant_rest/experience_users.rb +1 -1
  56. data/lib/losant_rest/experience_version.rb +1 -1
  57. data/lib/losant_rest/experience_versions.rb +1 -1
  58. data/lib/losant_rest/experience_view.rb +51 -1
  59. data/lib/losant_rest/experience_views.rb +1 -1
  60. data/lib/losant_rest/file.rb +1 -1
  61. data/lib/losant_rest/files.rb +1 -1
  62. data/lib/losant_rest/flow.rb +1 -1
  63. data/lib/losant_rest/flow_version.rb +1 -1
  64. data/lib/losant_rest/flow_versions.rb +1 -1
  65. data/lib/losant_rest/flows.rb +1 -1
  66. data/lib/losant_rest/integration.rb +1 -1
  67. data/lib/losant_rest/integrations.rb +1 -1
  68. data/lib/losant_rest/me.rb +1 -1
  69. data/lib/losant_rest/notebook.rb +1 -1
  70. data/lib/losant_rest/notebooks.rb +1 -1
  71. data/lib/losant_rest/org.rb +1 -1
  72. data/lib/losant_rest/org_invites.rb +1 -1
  73. data/lib/losant_rest/orgs.rb +1 -1
  74. data/lib/losant_rest/utils.rb +1 -1
  75. data/lib/losant_rest/version.rb +2 -2
  76. data/lib/losant_rest/webhook.rb +1 -1
  77. data/lib/losant_rest/webhooks.rb +1 -1
  78. data/schemas/advancedDeviceQuery.json +1018 -0
  79. data/schemas/advancedEventQuery.json +382 -13
  80. data/schemas/advancedQuery.json +37 -3
  81. data/schemas/application.json +10 -5
  82. data/schemas/applicationApiTokenPost.json +6 -0
  83. data/schemas/applicationCertificate.json +34 -0
  84. data/schemas/applicationCertificatePatch.json +34 -0
  85. data/schemas/applicationCertificatePost.json +34 -0
  86. data/schemas/applicationCertificates.json +34 -0
  87. data/schemas/{applicationCloneResult.json → applicationCreationByTemplateResult.json} +21 -8
  88. data/schemas/applicationExportPost.json +24 -0
  89. data/schemas/applicationExportResult.json +10 -0
  90. data/schemas/applicationKey.json +34 -0
  91. data/schemas/applicationKeyPatch.json +34 -0
  92. data/schemas/applicationKeyPost.json +34 -0
  93. data/schemas/applicationKeyPostResponse.json +34 -0
  94. data/schemas/applicationKeys.json +34 -0
  95. data/schemas/applicationPatch.json +10 -5
  96. data/schemas/applicationPost.json +14 -5
  97. data/schemas/applicationReadme.json +29 -0
  98. data/schemas/applicationReadmePatch.json +11 -0
  99. data/schemas/applicationTemplate.json +99 -0
  100. data/schemas/applicationTemplates.json +140 -0
  101. data/schemas/applications.json +10 -5
  102. data/schemas/authedDevice.json +34 -0
  103. data/schemas/dashboard.json +1228 -144
  104. data/schemas/dashboardPatch.json +1228 -144
  105. data/schemas/dashboardPost.json +1228 -144
  106. data/schemas/dashboards.json +1228 -144
  107. data/schemas/dataExport.json +11 -0
  108. data/schemas/dataTableRows.json +3 -0
  109. data/schemas/dataTableRowsExport.json +37 -3
  110. data/schemas/device.json +16 -3
  111. data/schemas/devicePatch.json +16 -3
  112. data/schemas/devicePost.json +16 -3
  113. data/schemas/deviceRecipe.json +16 -3
  114. data/schemas/deviceRecipePatch.json +16 -3
  115. data/schemas/deviceRecipePost.json +16 -3
  116. data/schemas/deviceRecipes.json +16 -3
  117. data/schemas/devices.json +19 -3
  118. data/schemas/devicesDataRemoved.json +12 -0
  119. data/schemas/devicesDeletePost.json +1034 -0
  120. data/schemas/devicesDeleted.json +12 -0
  121. data/schemas/devicesExportPost.json +1035 -0
  122. data/schemas/devicesPatch.json +1773 -7
  123. data/schemas/devicesRemoveDataPost.json +1056 -0
  124. data/schemas/devicesUpdated.json +18 -0
  125. data/schemas/events.json +1 -816
  126. data/schemas/eventsExport.json +382 -13
  127. data/schemas/experienceGroup.json +7 -0
  128. data/schemas/experienceGroupPatch.json +7 -0
  129. data/schemas/experienceGroupPost.json +7 -0
  130. data/schemas/experienceGroups.json +7 -0
  131. data/schemas/experienceLinkedResources.json +6659 -0
  132. data/schemas/flow.json +103 -1
  133. data/schemas/flowPatch.json +103 -1
  134. data/schemas/flowPost.json +103 -1
  135. data/schemas/flowVersion.json +206 -2
  136. data/schemas/flowVersionPost.json +103 -1
  137. data/schemas/flowVersions.json +206 -2
  138. data/schemas/flows.json +103 -1
  139. data/schemas/flowsImportPost.json +206 -2
  140. data/schemas/flowsImportResult.json +309 -3
  141. data/schemas/githubLogin.json +9 -0
  142. data/schemas/integration.json +4 -4
  143. data/schemas/integrationPatch.json +4 -4
  144. data/schemas/integrationPost.json +4 -4
  145. data/schemas/integrations.json +4 -4
  146. data/schemas/{applicationCloneEnqueued.json → jobEnqueuedResult.json} +0 -0
  147. data/schemas/me.json +3 -0
  148. data/schemas/multiDeviceCommand.json +1019 -0
  149. data/schemas/notebook.json +207 -35
  150. data/schemas/notebookDataExportOptions.json +4 -0
  151. data/schemas/notebookExecutionLogs.json +4 -0
  152. data/schemas/notebookExecutionOptions.json +4 -0
  153. data/schemas/notebookPatch.json +207 -35
  154. data/schemas/notebookPost.json +207 -35
  155. data/schemas/notebooks.json +207 -35
  156. data/schemas/org.json +8 -0
  157. data/schemas/orgPatch.json +9 -0
  158. data/schemas/orgs.json +8 -0
  159. data/schemas/samlResponse.json +21 -0
  160. data/schemas/ssoRequest.json +20 -0
  161. data/schemas/timeSeriesData.json +91 -12
  162. data/schemas/timeSeriesQuery.json +21 -12
  163. data/schemas/userCredentials.json +9 -0
  164. data/schemas/userPost.json +9 -0
  165. data/schemas/{validationCloneErrors.json → validationErrors.json} +9 -2
  166. metadata +24 -7
@@ -8,6 +8,7 @@ parameters and the potential responses.
8
8
 
9
9
  * [Delete](#delete)
10
10
  * [Get](#get)
11
+ * [Linked Resources](#linked-resources)
11
12
  * [Patch](#patch)
12
13
 
13
14
  <br/>
@@ -93,6 +94,48 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
93
94
 
94
95
  <br/>
95
96
 
97
+ ## Linked Resources
98
+
99
+ Retrieves information on resources linked to an experience endpoint
100
+
101
+ ```ruby
102
+ result = client.experience_endpoint.linked_resources(
103
+ applicationId: my_application_id,
104
+ experienceEndpointId: my_experience_endpoint_id)
105
+
106
+ puts result
107
+ ```
108
+
109
+ #### Authentication
110
+ The client must be configured with a valid api access token to call this
111
+ action. The token must include at least one of the following scopes:
112
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, experienceEndpoint.*, or experienceEndpoint.linkedResources.
113
+
114
+ #### Available Parameters
115
+
116
+ | Name | Type | Required | Description | Default | Example |
117
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
118
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
119
+ | experienceEndpointId | string | Y | ID associated with the experience endpoint | | 575ed78e7ae143cd83dc4aab |
120
+ | version | string | N | Version of this experience endpoint to query | develop | develop |
121
+ | includeCustomNodes | string | N | If the result of the request should also include the details of any custom nodes referenced by returned workflows | false | true |
122
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
123
+
124
+ #### Successful Responses
125
+
126
+ | Code | Type | Description |
127
+ | ---- | ---- | ----------- |
128
+ | 200 | [Experience Linked Resources](_schemas.md#experience-linked-resources) | Linked resource information |
129
+
130
+ #### Error Responses
131
+
132
+ | Code | Type | Description |
133
+ | ---- | ---- | ----------- |
134
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
135
+ | 404 | [Error](_schemas.md#error) | Error if experience endpoint was not found |
136
+
137
+ <br/>
138
+
96
139
  ## Patch
97
140
 
98
141
  Updates information about an experience endpoint
@@ -32,7 +32,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
32
32
  | Name | Type | Required | Description | Default | Example |
33
33
  | ---- | ---- | -------- | ----------- | ------- | ------- |
34
34
  | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
35
- | sortField | string | N | Field to sort the results by. Accepted values are: order, method, route, id, creationDate, requestCount, lastUpdated | order | position |
35
+ | sortField | string | N | Field to sort the results by. Accepted values are: order, method, route, id, creationDate, requestCount, lastUpdated | order | order |
36
36
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
37
37
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: method, route | | method |
38
38
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*route |
@@ -8,6 +8,7 @@ parameters and the potential responses.
8
8
 
9
9
  * [Delete](#delete)
10
10
  * [Get](#get)
11
+ * [Linked Resources](#linked-resources)
11
12
  * [Patch](#patch)
12
13
 
13
14
  <br/>
@@ -93,6 +94,48 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
93
94
 
94
95
  <br/>
95
96
 
97
+ ## Linked Resources
98
+
99
+ Retrieves information on resources linked to an experience view
100
+
101
+ ```ruby
102
+ result = client.experience_view.linked_resources(
103
+ applicationId: my_application_id,
104
+ experienceViewId: my_experience_view_id)
105
+
106
+ puts result
107
+ ```
108
+
109
+ #### Authentication
110
+ The client must be configured with a valid api access token to call this
111
+ action. The token must include at least one of the following scopes:
112
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, experienceView.*, or experienceView.linkedResources.
113
+
114
+ #### Available Parameters
115
+
116
+ | Name | Type | Required | Description | Default | Example |
117
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
118
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
119
+ | experienceViewId | string | Y | ID associated with the experience view | | 575ed78e7ae143cd83dc4aab |
120
+ | version | string | N | Version of this experience view to query | develop | develop |
121
+ | includeCustomNodes | string | N | If the result of the request should also include the details of any custom nodes referenced by returned workflows | false | true |
122
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
123
+
124
+ #### Successful Responses
125
+
126
+ | Code | Type | Description |
127
+ | ---- | ---- | ----------- |
128
+ | 200 | [Experience Linked Resources](_schemas.md#experience-linked-resources) | Linked resource information |
129
+
130
+ #### Error Responses
131
+
132
+ | Code | Type | Description |
133
+ | ---- | ---- | ----------- |
134
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
135
+ | 404 | [Error](_schemas.md#error) | Error if experience view was not found |
136
+
137
+ <br/>
138
+
96
139
  ## Patch
97
140
 
98
141
  Updates information about an experience view
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -32,6 +32,7 @@ require_relative "losant_rest/application_certificate_authority"
32
32
  require_relative "losant_rest/application_certificates"
33
33
  require_relative "losant_rest/application_key"
34
34
  require_relative "losant_rest/application_keys"
35
+ require_relative "losant_rest/application_templates"
35
36
  require_relative "losant_rest/applications"
36
37
  require_relative "losant_rest/audit_log"
37
38
  require_relative "losant_rest/audit_logs"
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -78,7 +78,7 @@ module LosantRest
78
78
  body: body)
79
79
  end
80
80
 
81
- # Returns success when a job has been enqueued to backfill all current data to it's archive
81
+ # Returns success when a job has been enqueued to backfill all current data to its archive
82
82
  #
83
83
  # Authentication:
84
84
  # The client must be configured with a valid api
@@ -140,13 +140,13 @@ module LosantRest
140
140
  #
141
141
  # Responses:
142
142
  # * 200 - if dryRun is set and successful, then return success (https://api.losant.com/#/definitions/applicationCloneDryRunResult)
143
- # * 201 - If application was successfully cloned (https://api.losant.com/#/definitions/applicationCloneResult)
144
- # * 202 - If application was enqueued to be cloned (https://api.losant.com/#/definitions/applicationCloneEnqueued)
143
+ # * 201 - If application was successfully cloned (https://api.losant.com/#/definitions/applicationCreationByTemplateResult)
144
+ # * 202 - If application was enqueued to be cloned (https://api.losant.com/#/definitions/jobEnqueuedResult)
145
145
  #
146
146
  # Errors:
147
147
  # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
148
148
  # * 404 - Error if application is not found (https://api.losant.com/#/definitions/error)
149
- # * 422 - Error if too many validation errors occurred on other resources (https://api.losant.com/#/definitions/validationCloneErrors)
149
+ # * 422 - Error if too many validation errors occurred on other resources (https://api.losant.com/#/definitions/validationErrors)
150
150
  def clone(params = {})
151
151
  params = Utils.symbolize_hash_keys(params)
152
152
  query_params = { _actions: false, _links: true, _embedded: true }
@@ -215,6 +215,54 @@ module LosantRest
215
215
  body: body)
216
216
  end
217
217
 
218
+ # Export an application and all of its resources
219
+ #
220
+ # Authentication:
221
+ # The client must be configured with a valid api
222
+ # access token to call this action. The token
223
+ # must include at least one of the following scopes:
224
+ # all.Application, all.Organization, all.User, application.*, or application.export.
225
+ #
226
+ # Parameters:
227
+ # * {string} applicationId - ID of the associated application
228
+ # * {hash} options - Object containing export application options (https://api.losant.com/#/definitions/applicationExportPost)
229
+ # * {string} losantdomain - Domain scope of request (rarely needed)
230
+ # * {boolean} _actions - Return resource actions in response
231
+ # * {boolean} _links - Return resource link in response
232
+ # * {boolean} _embedded - Return embedded resources in response
233
+ #
234
+ # Responses:
235
+ # * 200 - a url to download the zip of exported resources (https://api.losant.com/#/definitions/applicationExportResult)
236
+ # * 202 - If application was enqueued to be exported (https://api.losant.com/#/definitions/jobEnqueuedResult)
237
+ #
238
+ # Errors:
239
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
240
+ # * 404 - Error if application is not found (https://api.losant.com/#/definitions/error)
241
+ def export(params = {})
242
+ params = Utils.symbolize_hash_keys(params)
243
+ query_params = { _actions: false, _links: true, _embedded: true }
244
+ headers = {}
245
+ body = nil
246
+
247
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
248
+ raise ArgumentError.new("options is required") unless params.has_key?(:options)
249
+
250
+ body = params[:options] if params.has_key?(:options)
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]}/export"
257
+
258
+ @client.request(
259
+ method: :post,
260
+ path: path,
261
+ query: query_params,
262
+ headers: headers,
263
+ body: body)
264
+ end
265
+
218
266
  # Returns success when a job has been enqueued to archive all selected data tables
219
267
  #
220
268
  # Authentication:
@@ -497,6 +545,97 @@ module LosantRest
497
545
  body: body)
498
546
  end
499
547
 
548
+ # Get the current application readme information
549
+ #
550
+ # Authentication:
551
+ # The client must be configured with a valid api
552
+ # access token to call this action. The token
553
+ # must include at least one of the following scopes:
554
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.get.
555
+ #
556
+ # Parameters:
557
+ # * {string} applicationId - ID of the associated application
558
+ # * {string} losantdomain - Domain scope of request (rarely needed)
559
+ # * {boolean} _actions - Return resource actions in response
560
+ # * {boolean} _links - Return resource link in response
561
+ # * {boolean} _embedded - Return embedded resources in response
562
+ #
563
+ # Responses:
564
+ # * 200 - The application readme information (https://api.losant.com/#/definitions/applicationReadme)
565
+ #
566
+ # Errors:
567
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
568
+ # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
569
+ def readme(params = {})
570
+ params = Utils.symbolize_hash_keys(params)
571
+ query_params = { _actions: false, _links: true, _embedded: true }
572
+ headers = {}
573
+ body = nil
574
+
575
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
576
+
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]}/readme"
583
+
584
+ @client.request(
585
+ method: :get,
586
+ path: path,
587
+ query: query_params,
588
+ headers: headers,
589
+ body: body)
590
+ end
591
+
592
+ # Update the current application readme information
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.Organization, all.User, application.*, or application.patch.
599
+ #
600
+ # Parameters:
601
+ # * {string} applicationId - ID of the associated application
602
+ # * {hash} readme - Object containing new readme information (https://api.losant.com/#/definitions/applicationReadmePatch)
603
+ # * {string} losantdomain - Domain scope of request (rarely needed)
604
+ # * {boolean} _actions - Return resource actions in response
605
+ # * {boolean} _links - Return resource link in response
606
+ # * {boolean} _embedded - Return embedded resources in response
607
+ #
608
+ # Responses:
609
+ # * 200 - Updated readme information (https://api.losant.com/#/definitions/applicationReadme)
610
+ #
611
+ # Errors:
612
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
613
+ # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
614
+ def readme_patch(params = {})
615
+ params = Utils.symbolize_hash_keys(params)
616
+ query_params = { _actions: false, _links: true, _embedded: true }
617
+ headers = {}
618
+ body = nil
619
+
620
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
621
+ raise ArgumentError.new("readme is required") unless params.has_key?(:readme)
622
+
623
+ body = params[:readme] if params.has_key?(:readme)
624
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
625
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
626
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
627
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
628
+
629
+ path = "/applications/#{params[:applicationId]}/readme"
630
+
631
+ @client.request(
632
+ method: :patch,
633
+ path: path,
634
+ query: query_params,
635
+ headers: headers,
636
+ body: body)
637
+ end
638
+
500
639
  # Search across an application's resources by target identifier
501
640
  #
502
641
  # Authentication:
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  # The MIT License (MIT)
2
2
  #
3
- # Copyright (c) 2019 Losant IoT, Inc.
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
4
  #
5
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  # of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,88 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2020 Losant IoT, Inc.
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require "json"
24
+
25
+ module LosantRest
26
+
27
+ # Class containing all the actions for the Application Templates Resource
28
+ class ApplicationTemplates
29
+
30
+ def initialize(client)
31
+ @client = client
32
+ end
33
+
34
+ # Returns the application templates the current user has permission to see
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.User, all.User.read, applicationTemplates.*, or applicationTemplates.get.
41
+ #
42
+ # Parameters:
43
+ # * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated
44
+ # * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
45
+ # * {string} page - Which page of results to return
46
+ # * {string} perPage - How many items to return per page
47
+ # * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name
48
+ # * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
49
+ # * {string} losantdomain - Domain scope of request (rarely needed)
50
+ # * {boolean} _actions - Return resource actions in response
51
+ # * {boolean} _links - Return resource link in response
52
+ # * {boolean} _embedded - Return embedded resources in response
53
+ #
54
+ # Responses:
55
+ # * 200 - Collection of application templates (https://api.losant.com/#/definitions/applicationTemplates)
56
+ #
57
+ # Errors:
58
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
59
+ def get(params = {})
60
+ params = Utils.symbolize_hash_keys(params)
61
+ query_params = { _actions: false, _links: true, _embedded: true }
62
+ headers = {}
63
+ body = nil
64
+
65
+
66
+ query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
67
+ query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
68
+ query_params[:page] = params[:page] if params.has_key?(:page)
69
+ query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
70
+ query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
71
+ query_params[:filter] = params[:filter] if params.has_key?(:filter)
72
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
73
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
74
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
75
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
76
+
77
+ path = "/applicationTemplates"
78
+
79
+ @client.request(
80
+ method: :get,
81
+ path: path,
82
+ query: query_params,
83
+ headers: headers,
84
+ body: body)
85
+ end
86
+
87
+ end
88
+ end