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.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/docs/_schemas.md +41608 -19945
- data/docs/application.md +168 -4
- data/docs/applicationTemplates.md +50 -0
- data/docs/applications.md +46 -0
- data/docs/auth.md +72 -0
- data/docs/device.md +1 -0
- data/docs/devices.md +89 -2
- data/docs/experienceEndpoint.md +43 -0
- data/docs/experienceEndpoints.md +1 -1
- data/docs/experienceView.md +43 -0
- data/lib/losant_rest.rb +2 -1
- data/lib/losant_rest/application.rb +144 -5
- data/lib/losant_rest/application_api_token.rb +1 -1
- data/lib/losant_rest/application_api_tokens.rb +1 -1
- data/lib/losant_rest/application_certificate.rb +1 -1
- data/lib/losant_rest/application_certificate_authorities.rb +1 -1
- data/lib/losant_rest/application_certificate_authority.rb +1 -1
- data/lib/losant_rest/application_certificates.rb +1 -1
- data/lib/losant_rest/application_key.rb +1 -1
- data/lib/losant_rest/application_keys.rb +1 -1
- data/lib/losant_rest/application_templates.rb +88 -0
- data/lib/losant_rest/applications.rb +1 -1
- data/lib/losant_rest/audit_log.rb +1 -1
- data/lib/losant_rest/audit_logs.rb +1 -1
- data/lib/losant_rest/auth.rb +85 -1
- data/lib/losant_rest/client.rb +7 -3
- data/lib/losant_rest/dashboard.rb +1 -1
- data/lib/losant_rest/dashboards.rb +1 -1
- data/lib/losant_rest/data.rb +1 -1
- data/lib/losant_rest/data_table.rb +1 -1
- data/lib/losant_rest/data_table_row.rb +1 -1
- data/lib/losant_rest/data_table_rows.rb +1 -1
- data/lib/losant_rest/data_tables.rb +1 -1
- data/lib/losant_rest/device.rb +3 -1
- data/lib/losant_rest/device_recipe.rb +1 -1
- data/lib/losant_rest/device_recipes.rb +1 -1
- data/lib/losant_rest/devices.rb +105 -3
- data/lib/losant_rest/edge_deployments.rb +1 -1
- data/lib/losant_rest/error.rb +1 -1
- data/lib/losant_rest/event.rb +1 -1
- data/lib/losant_rest/events.rb +1 -1
- data/lib/losant_rest/experience.rb +1 -1
- data/lib/losant_rest/experience_domain.rb +1 -1
- data/lib/losant_rest/experience_domains.rb +1 -1
- data/lib/losant_rest/experience_endpoint.rb +51 -1
- data/lib/losant_rest/experience_endpoints.rb +1 -1
- data/lib/losant_rest/experience_group.rb +1 -1
- data/lib/losant_rest/experience_groups.rb +1 -1
- data/lib/losant_rest/experience_slug.rb +1 -1
- data/lib/losant_rest/experience_slugs.rb +1 -1
- data/lib/losant_rest/experience_user.rb +1 -1
- data/lib/losant_rest/experience_users.rb +1 -1
- data/lib/losant_rest/experience_version.rb +1 -1
- data/lib/losant_rest/experience_versions.rb +1 -1
- data/lib/losant_rest/experience_view.rb +51 -1
- data/lib/losant_rest/experience_views.rb +1 -1
- data/lib/losant_rest/file.rb +1 -1
- data/lib/losant_rest/files.rb +1 -1
- data/lib/losant_rest/flow.rb +1 -1
- data/lib/losant_rest/flow_version.rb +1 -1
- data/lib/losant_rest/flow_versions.rb +1 -1
- data/lib/losant_rest/flows.rb +1 -1
- data/lib/losant_rest/integration.rb +1 -1
- data/lib/losant_rest/integrations.rb +1 -1
- data/lib/losant_rest/me.rb +1 -1
- data/lib/losant_rest/notebook.rb +1 -1
- data/lib/losant_rest/notebooks.rb +1 -1
- data/lib/losant_rest/org.rb +1 -1
- data/lib/losant_rest/org_invites.rb +1 -1
- data/lib/losant_rest/orgs.rb +1 -1
- data/lib/losant_rest/utils.rb +1 -1
- data/lib/losant_rest/version.rb +2 -2
- data/lib/losant_rest/webhook.rb +1 -1
- data/lib/losant_rest/webhooks.rb +1 -1
- data/schemas/advancedDeviceQuery.json +1018 -0
- data/schemas/advancedEventQuery.json +382 -13
- data/schemas/advancedQuery.json +37 -3
- data/schemas/application.json +10 -5
- data/schemas/applicationApiTokenPost.json +6 -0
- data/schemas/applicationCertificate.json +34 -0
- data/schemas/applicationCertificatePatch.json +34 -0
- data/schemas/applicationCertificatePost.json +34 -0
- data/schemas/applicationCertificates.json +34 -0
- data/schemas/{applicationCloneResult.json → applicationCreationByTemplateResult.json} +21 -8
- data/schemas/applicationExportPost.json +24 -0
- data/schemas/applicationExportResult.json +10 -0
- data/schemas/applicationKey.json +34 -0
- data/schemas/applicationKeyPatch.json +34 -0
- data/schemas/applicationKeyPost.json +34 -0
- data/schemas/applicationKeyPostResponse.json +34 -0
- data/schemas/applicationKeys.json +34 -0
- data/schemas/applicationPatch.json +10 -5
- data/schemas/applicationPost.json +14 -5
- data/schemas/applicationReadme.json +29 -0
- data/schemas/applicationReadmePatch.json +11 -0
- data/schemas/applicationTemplate.json +99 -0
- data/schemas/applicationTemplates.json +140 -0
- data/schemas/applications.json +10 -5
- data/schemas/authedDevice.json +34 -0
- data/schemas/dashboard.json +1228 -144
- data/schemas/dashboardPatch.json +1228 -144
- data/schemas/dashboardPost.json +1228 -144
- data/schemas/dashboards.json +1228 -144
- data/schemas/dataExport.json +11 -0
- data/schemas/dataTableRows.json +3 -0
- data/schemas/dataTableRowsExport.json +37 -3
- data/schemas/device.json +16 -3
- data/schemas/devicePatch.json +16 -3
- data/schemas/devicePost.json +16 -3
- data/schemas/deviceRecipe.json +16 -3
- data/schemas/deviceRecipePatch.json +16 -3
- data/schemas/deviceRecipePost.json +16 -3
- data/schemas/deviceRecipes.json +16 -3
- data/schemas/devices.json +19 -3
- data/schemas/devicesDataRemoved.json +12 -0
- data/schemas/devicesDeletePost.json +1034 -0
- data/schemas/devicesDeleted.json +12 -0
- data/schemas/devicesExportPost.json +1035 -0
- data/schemas/devicesPatch.json +1773 -7
- data/schemas/devicesRemoveDataPost.json +1056 -0
- data/schemas/devicesUpdated.json +18 -0
- data/schemas/events.json +1 -816
- data/schemas/eventsExport.json +382 -13
- data/schemas/experienceGroup.json +7 -0
- data/schemas/experienceGroupPatch.json +7 -0
- data/schemas/experienceGroupPost.json +7 -0
- data/schemas/experienceGroups.json +7 -0
- data/schemas/experienceLinkedResources.json +6659 -0
- data/schemas/flow.json +103 -1
- data/schemas/flowPatch.json +103 -1
- data/schemas/flowPost.json +103 -1
- data/schemas/flowVersion.json +206 -2
- data/schemas/flowVersionPost.json +103 -1
- data/schemas/flowVersions.json +206 -2
- data/schemas/flows.json +103 -1
- data/schemas/flowsImportPost.json +206 -2
- data/schemas/flowsImportResult.json +309 -3
- data/schemas/githubLogin.json +9 -0
- data/schemas/integration.json +4 -4
- data/schemas/integrationPatch.json +4 -4
- data/schemas/integrationPost.json +4 -4
- data/schemas/integrations.json +4 -4
- data/schemas/{applicationCloneEnqueued.json → jobEnqueuedResult.json} +0 -0
- data/schemas/me.json +3 -0
- data/schemas/multiDeviceCommand.json +1019 -0
- data/schemas/notebook.json +207 -35
- data/schemas/notebookDataExportOptions.json +4 -0
- data/schemas/notebookExecutionLogs.json +4 -0
- data/schemas/notebookExecutionOptions.json +4 -0
- data/schemas/notebookPatch.json +207 -35
- data/schemas/notebookPost.json +207 -35
- data/schemas/notebooks.json +207 -35
- data/schemas/org.json +8 -0
- data/schemas/orgPatch.json +9 -0
- data/schemas/orgs.json +8 -0
- data/schemas/samlResponse.json +21 -0
- data/schemas/ssoRequest.json +20 -0
- data/schemas/timeSeriesData.json +91 -12
- data/schemas/timeSeriesQuery.json +21 -12
- data/schemas/userCredentials.json +9 -0
- data/schemas/userPost.json +9 -0
- data/schemas/{validationCloneErrors.json → validationErrors.json} +9 -2
- metadata +24 -7
data/docs/experienceEndpoint.md
CHANGED
@@ -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
|
data/docs/experienceEndpoints.md
CHANGED
@@ -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 |
|
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 |
|
data/docs/experienceView.md
CHANGED
@@ -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
|
data/lib/losant_rest.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# The MIT License (MIT)
|
2
2
|
#
|
3
|
-
# Copyright (c)
|
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)
|
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
|
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/
|
144
|
-
# * 202 - If application was enqueued to be cloned (https://api.losant.com/#/definitions/
|
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/
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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
|