losant_rest 1.9.2 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/docs/_schemas.md +38445 -24043
  3. data/docs/application.md +124 -2
  4. data/docs/applicationTemplates.md +50 -0
  5. data/docs/auth.md +72 -0
  6. data/docs/device.md +1 -0
  7. data/docs/devices.md +92 -3
  8. data/docs/experienceEndpoints.md +1 -0
  9. data/docs/file.md +4 -4
  10. data/docs/flow.md +94 -1
  11. data/docs/flowVersion.md +96 -1
  12. data/lib/losant_rest.rb +1 -0
  13. data/lib/losant_rest/application.rb +93 -2
  14. data/lib/losant_rest/application_templates.rb +88 -0
  15. data/lib/losant_rest/auth.rb +84 -0
  16. data/lib/losant_rest/client.rb +6 -2
  17. data/lib/losant_rest/device.rb +2 -0
  18. data/lib/losant_rest/devices.rb +105 -2
  19. data/lib/losant_rest/experience_endpoints.rb +2 -0
  20. data/lib/losant_rest/file.rb +3 -3
  21. data/lib/losant_rest/flow.rb +115 -1
  22. data/lib/losant_rest/flow_version.rb +115 -1
  23. data/lib/losant_rest/version.rb +2 -2
  24. data/schemas/advancedDeviceQuery.json +1018 -0
  25. data/schemas/advancedEventQuery.json +382 -13
  26. data/schemas/advancedQuery.json +37 -3
  27. data/schemas/application.json +7 -2
  28. data/schemas/applicationApiTokenPost.json +8 -1
  29. data/schemas/applicationCreationByTemplateResult.json +7 -2
  30. data/schemas/applicationPatch.json +7 -2
  31. data/schemas/applicationPost.json +11 -2
  32. data/schemas/applicationReadme.json +29 -0
  33. data/schemas/applicationReadmePatch.json +11 -0
  34. data/schemas/applicationTemplate.json +99 -0
  35. data/schemas/applicationTemplates.json +140 -0
  36. data/schemas/applications.json +7 -2
  37. data/schemas/dashboard.json +1168 -144
  38. data/schemas/dashboardPatch.json +1168 -144
  39. data/schemas/dashboardPost.json +1168 -144
  40. data/schemas/dashboards.json +1168 -144
  41. data/schemas/dataExport.json +11 -0
  42. data/schemas/dataTableRows.json +3 -0
  43. data/schemas/dataTableRowsExport.json +37 -3
  44. data/schemas/device.json +16 -3
  45. data/schemas/devicePatch.json +16 -3
  46. data/schemas/devicePost.json +16 -3
  47. data/schemas/deviceRecipe.json +16 -3
  48. data/schemas/deviceRecipePatch.json +16 -3
  49. data/schemas/deviceRecipePost.json +16 -3
  50. data/schemas/deviceRecipes.json +16 -3
  51. data/schemas/devices.json +19 -3
  52. data/schemas/devicesDataRemoved.json +12 -0
  53. data/schemas/devicesDeletePost.json +1034 -0
  54. data/schemas/devicesDeleted.json +12 -0
  55. data/schemas/devicesExportPost.json +1035 -0
  56. data/schemas/devicesPatch.json +1773 -7
  57. data/schemas/devicesRemoveDataPost.json +1056 -0
  58. data/schemas/devicesUpdated.json +18 -0
  59. data/schemas/eventPost.json +22 -0
  60. data/schemas/events.json +1 -816
  61. data/schemas/eventsExport.json +382 -13
  62. data/schemas/experienceDomain.json +1 -1
  63. data/schemas/experienceDomainPatch.json +1 -1
  64. data/schemas/experienceDomainPost.json +1 -1
  65. data/schemas/experienceDomains.json +1 -1
  66. data/schemas/experienceGroup.json +7 -0
  67. data/schemas/experienceGroupPatch.json +7 -0
  68. data/schemas/experienceGroupPost.json +7 -0
  69. data/schemas/experienceGroups.json +7 -0
  70. data/schemas/experienceLinkedResources.json +309 -3
  71. data/schemas/experienceVersion.json +1 -1
  72. data/schemas/experienceVersions.json +1 -1
  73. data/schemas/flow.json +103 -1
  74. data/schemas/flowErrors.json +87 -0
  75. data/schemas/flowPatch.json +103 -1
  76. data/schemas/flowPost.json +103 -1
  77. data/schemas/flowStats.json +54 -0
  78. data/schemas/flowVersion.json +206 -2
  79. data/schemas/flowVersionPost.json +103 -1
  80. data/schemas/flowVersions.json +206 -2
  81. data/schemas/flows.json +103 -1
  82. data/schemas/flowsImportPost.json +206 -2
  83. data/schemas/flowsImportResult.json +309 -3
  84. data/schemas/githubLogin.json +10 -1
  85. data/schemas/me.json +3 -0
  86. data/schemas/multiDeviceCommand.json +1019 -0
  87. data/schemas/notebook.json +99 -2
  88. data/schemas/notebookPatch.json +99 -2
  89. data/schemas/notebookPost.json +99 -2
  90. data/schemas/notebooks.json +99 -2
  91. data/schemas/org.json +8 -0
  92. data/schemas/orgPatch.json +9 -0
  93. data/schemas/orgs.json +8 -0
  94. data/schemas/samlResponse.json +21 -0
  95. data/schemas/ssoRequest.json +20 -0
  96. data/schemas/timeSeriesData.json +91 -12
  97. data/schemas/timeSeriesQuery.json +21 -12
  98. data/schemas/userCredentials.json +10 -1
  99. data/schemas/userPost.json +10 -1
  100. metadata +20 -4
@@ -118,6 +118,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
118
118
  | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
119
119
  | statGrouping | string | N | Field to group the statistics by. Accepted values are: statusCode, endpointId, version, domain | statusCode | statusCode |
120
120
  | duration | string | N | Duration in milliseconds | 86400000 | 86400000 |
121
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
121
122
  | resolution | string | N | Resolution in milliseconds | 3600000 | 3600000 |
122
123
  | versionFilter | string | N | Filters the stats to a particular experience version | | myVersion |
123
124
  | domainFilter | string | N | Filters the stats to a particular experience domain or slug | | mycustomdomain.com |
@@ -50,7 +50,7 @@ all.Application, all.Organization, all.User, file.*, or file.delete.
50
50
  | Code | Type | Description |
51
51
  | ---- | ---- | ----------- |
52
52
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
53
- | 404 | [Error](_schemas.md#error) | Error if event was not found |
53
+ | 404 | [Error](_schemas.md#error) | Error if file was not found |
54
54
 
55
55
  <br/>
56
56
 
@@ -132,7 +132,7 @@ all.Application, all.Organization, all.User, file.*, or file.move.
132
132
  | Code | Type | Description |
133
133
  | ---- | ---- | ----------- |
134
134
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
135
- | 404 | [Error](_schemas.md#error) | Error if application was not found |
135
+ | 404 | [Error](_schemas.md#error) | Error if file was not found |
136
136
 
137
137
  <br/>
138
138
 
@@ -174,7 +174,7 @@ all.Application, all.Organization, all.User, file.*, or file.patch.
174
174
  | Code | Type | Description |
175
175
  | ---- | ---- | ----------- |
176
176
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
177
- | 404 | [Error](_schemas.md#error) | Error if application was not found |
177
+ | 404 | [Error](_schemas.md#error) | Error if file was not found |
178
178
 
179
179
  <br/>
180
180
 
@@ -216,4 +216,4 @@ all.Application, all.Organization, all.User, file.*, or file.upload.
216
216
  | Code | Type | Description |
217
217
  | ---- | ---- | ----------- |
218
218
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
219
- | 404 | [Error](_schemas.md#error) | Error if application was not found |
219
+ | 404 | [Error](_schemas.md#error) | Error if file was not found |
@@ -8,12 +8,14 @@ parameters and the potential responses.
8
8
 
9
9
  * [Clear Storage Entries](#clear-storage-entries)
10
10
  * [Delete](#delete)
11
+ * [Errors](#errors)
11
12
  * [Get](#get)
12
13
  * [Get Log Entries](#get-log-entries)
13
14
  * [Get Storage Entries](#get-storage-entries)
14
15
  * [Patch](#patch)
15
16
  * [Press Virtual Button](#press-virtual-button)
16
17
  * [Set Storage Entry](#set-storage-entry)
18
+ * [Stats](#stats)
17
19
 
18
20
  <br/>
19
21
 
@@ -97,6 +99,52 @@ all.Application, all.Organization, all.User, flow.*, or flow.delete.
97
99
 
98
100
  <br/>
99
101
 
102
+ ## Errors
103
+
104
+ Get information about errors that occurred during runs of this workflow
105
+
106
+ ```ruby
107
+ result = client.flow.errors(
108
+ applicationId: my_application_id,
109
+ flowId: my_flow_id)
110
+
111
+ puts result
112
+ ```
113
+
114
+ #### Authentication
115
+ The client must be configured with a valid api access token to call this
116
+ action. The token must include at least one of the following scopes:
117
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.errors.
118
+
119
+ #### Available Parameters
120
+
121
+ | Name | Type | Required | Description | Default | Example |
122
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
123
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
124
+ | flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
125
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
126
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
127
+ | limit | string | N | Maximum number of errors to return | 25 | 25 |
128
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | desc |
129
+ | flowVersion | string | N | Flow version name or ID. When not included, will be errors for all versions. Pass develop for just the develop version. | | develop |
130
+ | deviceId | string | N | For edge workflows, the Device ID to return workflow errors for. When not included, will be errors for all device IDs. | | 575ed18f7ae143cd83dc4bb6 |
131
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
132
+
133
+ #### Successful Responses
134
+
135
+ | Code | Type | Description |
136
+ | ---- | ---- | ----------- |
137
+ | 200 | [Workflow Errors](_schemas.md#workflow-errors) | Workflow error information |
138
+
139
+ #### Error Responses
140
+
141
+ | Code | Type | Description |
142
+ | ---- | ---- | ----------- |
143
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
144
+ | 404 | [Error](_schemas.md#error) | Error if flow was not found |
145
+
146
+ <br/>
147
+
100
148
  ## Get
101
149
 
102
150
  Retrieves information on a flow
@@ -176,7 +224,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
176
224
  | Code | Type | Description |
177
225
  | ---- | ---- | ----------- |
178
226
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
179
- | 404 | [Error](_schemas.md#error) | Error if device was not found |
227
+ | 404 | [Error](_schemas.md#error) | Error if flow was not found |
180
228
 
181
229
  <br/>
182
230
 
@@ -344,3 +392,48 @@ all.Application, all.Organization, all.User, flow.*, or flow.setStorageEntry.
344
392
  | ---- | ---- | ----------- |
345
393
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
346
394
  | 404 | [Error](_schemas.md#error) | Error if flow was not found |
395
+
396
+ <br/>
397
+
398
+ ## Stats
399
+
400
+ Get statistics about workflow runs for this workflow
401
+
402
+ ```ruby
403
+ result = client.flow.stats(
404
+ applicationId: my_application_id,
405
+ flowId: my_flow_id)
406
+
407
+ puts result
408
+ ```
409
+
410
+ #### Authentication
411
+ The client must be configured with a valid api access token to call this
412
+ action. The token must include at least one of the following scopes:
413
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.stats.
414
+
415
+ #### Available Parameters
416
+
417
+ | Name | Type | Required | Description | Default | Example |
418
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
419
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
420
+ | flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
421
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
422
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
423
+ | resolution | string | N | Resolution in milliseconds | 3600000 | 3600000 |
424
+ | flowVersion | string | N | Flow version name or ID. When not included, will be aggregate for all versions. Pass develop for just the develop version. | | develop |
425
+ | deviceId | string | N | For edge workflows, the device ID to return workflow stats for. When not included, will be aggregate for all device IDs. | | 575ed18f7ae143cd83dc4bb6 |
426
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
427
+
428
+ #### Successful Responses
429
+
430
+ | Code | Type | Description |
431
+ | ---- | ---- | ----------- |
432
+ | 200 | [Workflow Statistics](_schemas.md#workflow-statistics) | Statistics for workflow runs |
433
+
434
+ #### Error Responses
435
+
436
+ | Code | Type | Description |
437
+ | ---- | ---- | ----------- |
438
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
439
+ | 404 | [Error](_schemas.md#error) | Error if flow was not found |
@@ -7,9 +7,11 @@ parameters and the potential responses.
7
7
  ##### Contents
8
8
 
9
9
  * [Delete](#delete)
10
+ * [Errors](#errors)
10
11
  * [Get](#get)
11
12
  * [Get Log Entries](#get-log-entries)
12
13
  * [Patch](#patch)
14
+ * [Stats](#stats)
13
15
 
14
16
  <br/>
15
17
 
@@ -55,6 +57,53 @@ all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.delet
55
57
 
56
58
  <br/>
57
59
 
60
+ ## Errors
61
+
62
+ Get information about errors that occurred during runs of this workflow version
63
+
64
+ ```ruby
65
+ result = client.flow_version.errors(
66
+ applicationId: my_application_id,
67
+ flowId: my_flow_id,
68
+ flowVersionId: my_flow_version_id)
69
+
70
+ puts result
71
+ ```
72
+
73
+ #### Authentication
74
+ The client must be configured with a valid api access token to call this
75
+ action. The token must include at least one of the following scopes:
76
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.errors.
77
+
78
+ #### Available Parameters
79
+
80
+ | Name | Type | Required | Description | Default | Example |
81
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
82
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
83
+ | flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
84
+ | flowVersionId | string | Y | Version ID or version name associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
85
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
86
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
87
+ | limit | string | N | Maximum number of errors to return | 25 | 25 |
88
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | desc |
89
+ | deviceId | string | N | For edge workflows, the Device ID to return workflow errors for. When not included, will be errors for all device IDs. | | 575ed18f7ae143cd83dc4bb6 |
90
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
91
+
92
+ #### Successful Responses
93
+
94
+ | Code | Type | Description |
95
+ | ---- | ---- | ----------- |
96
+ | 200 | [Workflow Errors](_schemas.md#workflow-errors) | Workflow error information |
97
+
98
+ #### Error Responses
99
+
100
+ | Code | Type | Description |
101
+ | ---- | ---- | ----------- |
102
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
103
+ | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
104
+
105
+ <br/>
106
+
58
107
  ## Get
59
108
 
60
109
  Retrieves information on a flow version
@@ -138,7 +187,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
138
187
  | Code | Type | Description |
139
188
  | ---- | ---- | ----------- |
140
189
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
141
- | 404 | [Error](_schemas.md#error) | Error if device was not found |
190
+ | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
142
191
 
143
192
  <br/>
144
193
 
@@ -184,3 +233,49 @@ all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.patch
184
233
  | ---- | ---- | ----------- |
185
234
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
186
235
  | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
236
+
237
+ <br/>
238
+
239
+ ## Stats
240
+
241
+ Get statistics about workflow runs for this workflow version
242
+
243
+ ```ruby
244
+ result = client.flow_version.stats(
245
+ applicationId: my_application_id,
246
+ flowId: my_flow_id,
247
+ flowVersionId: my_flow_version_id)
248
+
249
+ puts result
250
+ ```
251
+
252
+ #### Authentication
253
+ The client must be configured with a valid api access token to call this
254
+ action. The token must include at least one of the following scopes:
255
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.stats.
256
+
257
+ #### Available Parameters
258
+
259
+ | Name | Type | Required | Description | Default | Example |
260
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
261
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
262
+ | flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
263
+ | flowVersionId | string | Y | Version ID or version name associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
264
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
265
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
266
+ | resolution | string | N | Resolution in milliseconds | 3600000 | 3600000 |
267
+ | deviceId | string | N | For edge workflows, the device ID to return workflow stats for. When not included, will be aggregate for all device IDs. | | 575ed18f7ae143cd83dc4bb6 |
268
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
269
+
270
+ #### Successful Responses
271
+
272
+ | Code | Type | Description |
273
+ | ---- | ---- | ----------- |
274
+ | 200 | [Workflow Statistics](_schemas.md#workflow-statistics) | Statistics for workflow runs |
275
+
276
+ #### Error Responses
277
+
278
+ | Code | Type | Description |
279
+ | ---- | ---- | ----------- |
280
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
281
+ | 404 | [Error](_schemas.md#error) | Error if flow version was not found |
@@ -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"
@@ -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
@@ -215,7 +215,7 @@ module LosantRest
215
215
  body: body)
216
216
  end
217
217
 
218
- # Export an application and all of it's resources
218
+ # Export an application and all of its resources
219
219
  #
220
220
  # Authentication:
221
221
  # The client must be configured with a valid api
@@ -545,6 +545,97 @@ module LosantRest
545
545
  body: body)
546
546
  end
547
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
+
548
639
  # Search across an application's resources by target identifier
549
640
  #
550
641
  # Authentication:
@@ -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