losant_rest 1.11.1 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/_schemas.md +17165 -8770
- data/docs/application.md +41 -0
- data/docs/applicationDashboard.md +133 -0
- data/docs/applicationDashboards.md +93 -0
- data/docs/applicationKeys.md +3 -2
- data/docs/experienceEndpoint.md +1 -0
- data/docs/flows.md +1 -0
- data/docs/integration.md +1 -0
- data/docs/webhook.md +1 -0
- data/lib/losant_rest.rb +2 -0
- data/lib/losant_rest/application.rb +47 -0
- data/lib/losant_rest/application_dashboard.rb +176 -0
- data/lib/losant_rest/application_dashboards.rb +138 -0
- data/lib/losant_rest/application_keys.rb +3 -0
- data/lib/losant_rest/client.rb +10 -2
- data/lib/losant_rest/experience_endpoint.rb +2 -0
- data/lib/losant_rest/flows.rb +2 -0
- data/lib/losant_rest/integration.rb +2 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest/webhook.rb +2 -0
- data/schemas/advancedApplicationKeyQuery.json +1082 -0
- data/schemas/advancedFlowQuery.json +218 -0
- data/schemas/advancedFlowVersionQuery.json +218 -0
- data/schemas/applicationApiTokenPost.json +7 -0
- data/schemas/applicationDashboardPost.json +5665 -0
- data/schemas/applicationGlobalPatch.json +33 -0
- data/schemas/dashboard.json +28 -1
- data/schemas/dashboardPatch.json +28 -1
- data/schemas/dashboardPost.json +28 -1
- data/schemas/dashboards.json +28 -1
- data/schemas/files.json +3 -0
- data/schemas/githubLogin.json +18 -0
- data/schemas/instance.json +132 -0
- data/schemas/instanceOrg.json +119 -0
- data/schemas/instanceOrgPatch.json +103 -0
- data/schemas/instanceOrgPost.json +114 -0
- data/schemas/instanceOrgs.json +160 -0
- data/schemas/instances.json +43 -0
- data/schemas/userCredentials.json +18 -0
- data/schemas/userPost.json +18 -0
- metadata +16 -3
data/docs/application.md
CHANGED
@@ -15,6 +15,7 @@ parameters and the potential responses.
|
|
15
15
|
* [Full Data Tables Archive](#full-data-tables-archive)
|
16
16
|
* [Full Events Archive](#full-events-archive)
|
17
17
|
* [Get](#get)
|
18
|
+
* [Globals](#globals)
|
18
19
|
* [Import](#import)
|
19
20
|
* [Mqtt Publish Message](#mqtt-publish-message)
|
20
21
|
* [Patch](#patch)
|
@@ -375,6 +376,46 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
375
376
|
|
376
377
|
<br/>
|
377
378
|
|
379
|
+
## Globals
|
380
|
+
|
381
|
+
Updates an application global at the given key
|
382
|
+
|
383
|
+
```ruby
|
384
|
+
result = client.application.globals(
|
385
|
+
applicationId: my_application_id,
|
386
|
+
globals: my_globals)
|
387
|
+
|
388
|
+
puts result
|
389
|
+
```
|
390
|
+
|
391
|
+
#### Authentication
|
392
|
+
The client must be configured with a valid api access token to call this
|
393
|
+
action. The token must include at least one of the following scopes:
|
394
|
+
all.Application, all.Organization, all.User, application.*, or application.patch.
|
395
|
+
|
396
|
+
#### Available Parameters
|
397
|
+
|
398
|
+
| Name | Type | Required | Description | Default | Example |
|
399
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
400
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
401
|
+
| globals | [Application Global Patch](_schemas.md#application-global-patch) | Y | Array of objects containing new application global information | | [Application Global Patch Example](_schemas.md#application-global-patch-example) |
|
402
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
403
|
+
|
404
|
+
#### Successful Responses
|
405
|
+
|
406
|
+
| Code | Type | Description |
|
407
|
+
| ---- | ---- | ----------- |
|
408
|
+
| 200 | [Application](_schemas.md#application) | Updated application information |
|
409
|
+
|
410
|
+
#### Error Responses
|
411
|
+
|
412
|
+
| Code | Type | Description |
|
413
|
+
| ---- | ---- | ----------- |
|
414
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
415
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
416
|
+
|
417
|
+
<br/>
|
418
|
+
|
378
419
|
## Import
|
379
420
|
|
380
421
|
Add multiple resources to an application via a zip file
|
@@ -0,0 +1,133 @@
|
|
1
|
+
# Application Dashboard Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Application Dashboard resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Delete](#delete)
|
10
|
+
* [Get](#get)
|
11
|
+
* [Patch](#patch)
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
## Delete
|
16
|
+
|
17
|
+
Deletes a dashboard
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
result = client.application_dashboard.delete(
|
21
|
+
dashboardId: my_dashboard_id,
|
22
|
+
applicationId: my_application_id)
|
23
|
+
|
24
|
+
puts result
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Authentication
|
28
|
+
The client must be configured with a valid api access token to call this
|
29
|
+
action. The token must include at least one of the following scopes:
|
30
|
+
all.Application, all.Organization, all.User, applicationDashboard.*, or applicationDashboard.delete.
|
31
|
+
|
32
|
+
#### Available Parameters
|
33
|
+
|
34
|
+
| Name | Type | Required | Description | Default | Example |
|
35
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
36
|
+
| dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
|
37
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
38
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
39
|
+
|
40
|
+
#### Successful Responses
|
41
|
+
|
42
|
+
| Code | Type | Description |
|
43
|
+
| ---- | ---- | ----------- |
|
44
|
+
| 200 | [Success](_schemas.md#success) | If dashboard was successfully deleted |
|
45
|
+
|
46
|
+
#### Error Responses
|
47
|
+
|
48
|
+
| Code | Type | Description |
|
49
|
+
| ---- | ---- | ----------- |
|
50
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
51
|
+
| 404 | [Error](_schemas.md#error) | Error if dashboard was not found |
|
52
|
+
|
53
|
+
<br/>
|
54
|
+
|
55
|
+
## Get
|
56
|
+
|
57
|
+
Retrieves information on a dashboard
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
result = client.application_dashboard.get(
|
61
|
+
dashboardId: my_dashboard_id,
|
62
|
+
applicationId: my_application_id)
|
63
|
+
|
64
|
+
puts result
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Authentication
|
68
|
+
The client must be configured with a valid api access token to call this
|
69
|
+
action. The token must include at least one of the following scopes:
|
70
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationDashboard.*, or applicationDashboard.get.
|
71
|
+
|
72
|
+
#### Available Parameters
|
73
|
+
|
74
|
+
| Name | Type | Required | Description | Default | Example |
|
75
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
76
|
+
| dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
|
77
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
78
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
79
|
+
|
80
|
+
#### Successful Responses
|
81
|
+
|
82
|
+
| Code | Type | Description |
|
83
|
+
| ---- | ---- | ----------- |
|
84
|
+
| 200 | [Dashboard](_schemas.md#dashboard) | Dashboard information |
|
85
|
+
|
86
|
+
#### Error Responses
|
87
|
+
|
88
|
+
| Code | Type | Description |
|
89
|
+
| ---- | ---- | ----------- |
|
90
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
91
|
+
| 404 | [Error](_schemas.md#error) | Error if dashboard was not found |
|
92
|
+
|
93
|
+
<br/>
|
94
|
+
|
95
|
+
## Patch
|
96
|
+
|
97
|
+
Updates information about a dashboard
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
result = client.application_dashboard.patch(
|
101
|
+
dashboardId: my_dashboard_id,
|
102
|
+
applicationId: my_application_id,
|
103
|
+
dashboard: my_dashboard)
|
104
|
+
|
105
|
+
puts result
|
106
|
+
```
|
107
|
+
|
108
|
+
#### Authentication
|
109
|
+
The client must be configured with a valid api access token to call this
|
110
|
+
action. The token must include at least one of the following scopes:
|
111
|
+
all.Application, all.Organization, all.User, applicationDashboard.*, or applicationDashboard.patch.
|
112
|
+
|
113
|
+
#### Available Parameters
|
114
|
+
|
115
|
+
| Name | Type | Required | Description | Default | Example |
|
116
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
117
|
+
| dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
|
118
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
119
|
+
| dashboard | [Dashboard Patch](_schemas.md#dashboard-patch) | Y | Object containing new dashboard properties | | [Dashboard Patch Example](_schemas.md#dashboard-patch-example) |
|
120
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
121
|
+
|
122
|
+
#### Successful Responses
|
123
|
+
|
124
|
+
| Code | Type | Description |
|
125
|
+
| ---- | ---- | ----------- |
|
126
|
+
| 200 | [Dashboard](_schemas.md#dashboard) | Update dashboard information |
|
127
|
+
|
128
|
+
#### Error Responses
|
129
|
+
|
130
|
+
| Code | Type | Description |
|
131
|
+
| ---- | ---- | ----------- |
|
132
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
133
|
+
| 404 | [Error](_schemas.md#error) | Error if dashboard was not found |
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# Application Dashboards Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Application Dashboards resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
* [Post](#post)
|
11
|
+
|
12
|
+
<br/>
|
13
|
+
|
14
|
+
## Get
|
15
|
+
|
16
|
+
Returns all dashboards scoped to the given application.
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
result = client.application_dashboards.get(applicationId: my_application_id)
|
20
|
+
|
21
|
+
puts result
|
22
|
+
```
|
23
|
+
|
24
|
+
#### Authentication
|
25
|
+
The client must be configured with a valid api access token to call this
|
26
|
+
action. The token must include at least one of the following scopes:
|
27
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationDashboards.*, or applicationDashboards.get.
|
28
|
+
|
29
|
+
#### Available Parameters
|
30
|
+
|
31
|
+
| Name | Type | Required | Description | Default | Example |
|
32
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
33
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
34
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate | name | name |
|
35
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
36
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
37
|
+
| perPage | string | N | How many items to return per page | 100 | 10 |
|
38
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
39
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * dashboard |
|
40
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
41
|
+
|
42
|
+
#### Successful Responses
|
43
|
+
|
44
|
+
| Code | Type | Description |
|
45
|
+
| ---- | ---- | ----------- |
|
46
|
+
| 200 | [Dashboards](_schemas.md#dashboards) | Collection of dashboards |
|
47
|
+
|
48
|
+
#### Error Responses
|
49
|
+
|
50
|
+
| Code | Type | Description |
|
51
|
+
| ---- | ---- | ----------- |
|
52
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
53
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
54
|
+
|
55
|
+
<br/>
|
56
|
+
|
57
|
+
## Post
|
58
|
+
|
59
|
+
Create a new dashboard
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
result = client.application_dashboards.post(
|
63
|
+
applicationId: my_application_id,
|
64
|
+
dashboard: my_dashboard)
|
65
|
+
|
66
|
+
puts result
|
67
|
+
```
|
68
|
+
|
69
|
+
#### Authentication
|
70
|
+
The client must be configured with a valid api access token to call this
|
71
|
+
action. The token must include at least one of the following scopes:
|
72
|
+
all.Application, all.Organization, all.User, applicationDashboards.*, or applicationDashboards.post.
|
73
|
+
|
74
|
+
#### Available Parameters
|
75
|
+
|
76
|
+
| Name | Type | Required | Description | Default | Example |
|
77
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
78
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
79
|
+
| dashboard | [Application Dashboard Post](_schemas.md#application-dashboard-post) | Y | New dashboard information | | [Application Dashboard Post Example](_schemas.md#application-dashboard-post-example) |
|
80
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
81
|
+
|
82
|
+
#### Successful Responses
|
83
|
+
|
84
|
+
| Code | Type | Description |
|
85
|
+
| ---- | ---- | ----------- |
|
86
|
+
| 201 | [Dashboard](_schemas.md#dashboard) | Successfully created dashboard |
|
87
|
+
|
88
|
+
#### Error Responses
|
89
|
+
|
90
|
+
| Code | Type | Description |
|
91
|
+
| ---- | ---- | ----------- |
|
92
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
93
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
data/docs/applicationKeys.md
CHANGED
@@ -31,12 +31,13 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
31
31
|
| Name | Type | Required | Description | Default | Example |
|
32
32
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
33
33
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
34
|
-
| sortField | string | N | Field to sort the results by. Accepted values are: key, status, id, creationDate, lastUpdated |
|
35
|
-
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc |
|
34
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: key, status, id, creationDate, lastUpdated | creationDate | creationDate |
|
35
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | asc |
|
36
36
|
| page | string | N | Which page of results to return | 0 | 0 |
|
37
37
|
| perPage | string | N | How many items to return per page | 100 | 10 |
|
38
38
|
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: key, status | | key |
|
39
39
|
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | the*key |
|
40
|
+
| query | [Advanced Application Key Query](_schemas.md#advanced-application-key-query) | N | Application key filter JSON object which overrides the filterField and filter parameters. | | [Advanced Application Key Query Example](_schemas.md#advanced-application-key-query-example) |
|
40
41
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
41
42
|
|
42
43
|
#### Successful Responses
|
data/docs/experienceEndpoint.md
CHANGED
@@ -36,6 +36,7 @@ all.Application, all.Organization, all.User, experienceEndpoint.*, or experience
|
|
36
36
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
37
37
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
38
38
|
| experienceEndpointId | string | Y | ID associated with the experience endpoint | | 575ed78e7ae143cd83dc4aab |
|
39
|
+
| includeWorkflows | string | N | If the workflows that utilize this experience endpoint should also be deleted. | | true |
|
39
40
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
40
41
|
|
41
42
|
#### Successful Responses
|
data/docs/flows.md
CHANGED
@@ -43,6 +43,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
43
43
|
| triggerFilter | [Workflow Trigger Filter](_schemas.md#workflow-trigger-filter) | N | Array of triggers to filter by - always filters against default flow version. | | [Workflow Trigger Filter Example](_schemas.md#workflow-trigger-filter-example) |
|
44
44
|
| includeCustomNodes | string | N | If the result of the request should also include the details of any custom nodes referenced by the returned workflows | false | true |
|
45
45
|
| query | [Advanced Workflow Query](_schemas.md#advanced-workflow-query) | N | Workflow filter JSON object which overrides the filterField, filter, triggerFilter, and flowClass parameters. | | [Advanced Workflow Query Example](_schemas.md#advanced-workflow-query-example) |
|
46
|
+
| allVersions | string | N | If the request should also return flows with matching versions. Only applicable for requests with an advanced query. | false | true |
|
46
47
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
47
48
|
|
48
49
|
#### Successful Responses
|
data/docs/integration.md
CHANGED
@@ -35,6 +35,7 @@ all.Application, all.Organization, all.User, integration.*, or integration.delet
|
|
35
35
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
36
36
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
37
37
|
| integrationId | string | Y | ID associated with the integration | | 575ed78e7ae143cd83dc4aab |
|
38
|
+
| includeWorkflows | string | N | If the workflows that utilize this integration should also be deleted. | | true |
|
38
39
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
39
40
|
|
40
41
|
#### Successful Responses
|
data/docs/webhook.md
CHANGED
@@ -35,6 +35,7 @@ all.Application, all.Organization, all.User, webhook.*, or webhook.delete.
|
|
35
35
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
36
36
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
37
37
|
| webhookId | string | Y | ID associated with the webhook | | 575ed78e7ae143cd83dc4aab |
|
38
|
+
| includeWorkflows | string | N | If the workflows that utilize this webhook should also be deleted. | | true |
|
38
39
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
39
40
|
|
40
41
|
#### Successful Responses
|
data/lib/losant_rest.rb
CHANGED
@@ -30,6 +30,8 @@ require_relative "losant_rest/application_certificate"
|
|
30
30
|
require_relative "losant_rest/application_certificate_authorities"
|
31
31
|
require_relative "losant_rest/application_certificate_authority"
|
32
32
|
require_relative "losant_rest/application_certificates"
|
33
|
+
require_relative "losant_rest/application_dashboard"
|
34
|
+
require_relative "losant_rest/application_dashboards"
|
33
35
|
require_relative "losant_rest/application_key"
|
34
36
|
require_relative "losant_rest/application_keys"
|
35
37
|
require_relative "losant_rest/application_template"
|
@@ -447,6 +447,53 @@ module LosantRest
|
|
447
447
|
body: body)
|
448
448
|
end
|
449
449
|
|
450
|
+
# Updates an application global at the given key
|
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.Organization, all.User, application.*, or application.patch.
|
457
|
+
#
|
458
|
+
# Parameters:
|
459
|
+
# * {string} applicationId - ID of the associated application
|
460
|
+
# * {hash} globals - Array of objects containing new application global information (https://api.losant.com/#/definitions/applicationGlobalPatch)
|
461
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
462
|
+
# * {boolean} _actions - Return resource actions in response
|
463
|
+
# * {boolean} _links - Return resource link in response
|
464
|
+
# * {boolean} _embedded - Return embedded resources in response
|
465
|
+
#
|
466
|
+
# Responses:
|
467
|
+
# * 200 - Updated application information (https://api.losant.com/#/definitions/application)
|
468
|
+
#
|
469
|
+
# Errors:
|
470
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
471
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
472
|
+
def globals(params = {})
|
473
|
+
params = Utils.symbolize_hash_keys(params)
|
474
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
475
|
+
headers = {}
|
476
|
+
body = nil
|
477
|
+
|
478
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
479
|
+
raise ArgumentError.new("globals is required") unless params.has_key?(:globals)
|
480
|
+
|
481
|
+
body = params[:globals] if params.has_key?(:globals)
|
482
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
483
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
484
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
485
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
486
|
+
|
487
|
+
path = "/applications/#{params[:applicationId]}/globals"
|
488
|
+
|
489
|
+
@client.request(
|
490
|
+
method: :patch,
|
491
|
+
path: path,
|
492
|
+
query: query_params,
|
493
|
+
headers: headers,
|
494
|
+
body: body)
|
495
|
+
end
|
496
|
+
|
450
497
|
# Publishes the given message to the given MQTT topic
|
451
498
|
#
|
452
499
|
# Authentication:
|
@@ -0,0 +1,176 @@
|
|
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 Dashboard Resource
|
28
|
+
class ApplicationDashboard
|
29
|
+
|
30
|
+
def initialize(client)
|
31
|
+
@client = client
|
32
|
+
end
|
33
|
+
|
34
|
+
# Deletes a dashboard
|
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, applicationDashboard.*, or applicationDashboard.delete.
|
41
|
+
#
|
42
|
+
# Parameters:
|
43
|
+
# * {string} dashboardId - ID of the associated dashboard
|
44
|
+
# * {string} applicationId - ID of the associated application
|
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 - If dashboard was successfully deleted (https://api.losant.com/#/definitions/success)
|
52
|
+
#
|
53
|
+
# Errors:
|
54
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
55
|
+
# * 404 - Error if dashboard was not found (https://api.losant.com/#/definitions/error)
|
56
|
+
def delete(params = {})
|
57
|
+
params = Utils.symbolize_hash_keys(params)
|
58
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
59
|
+
headers = {}
|
60
|
+
body = nil
|
61
|
+
|
62
|
+
raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
|
63
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
64
|
+
|
65
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
66
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
67
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
68
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
69
|
+
|
70
|
+
path = "/applications/#{params[:applicationId]}/dashboards/#{params[:dashboardId]}"
|
71
|
+
|
72
|
+
@client.request(
|
73
|
+
method: :delete,
|
74
|
+
path: path,
|
75
|
+
query: query_params,
|
76
|
+
headers: headers,
|
77
|
+
body: body)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Retrieves information on a dashboard
|
81
|
+
#
|
82
|
+
# Authentication:
|
83
|
+
# The client must be configured with a valid api
|
84
|
+
# access token to call this action. The token
|
85
|
+
# must include at least one of the following scopes:
|
86
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, applicationDashboard.*, or applicationDashboard.get.
|
87
|
+
#
|
88
|
+
# Parameters:
|
89
|
+
# * {string} dashboardId - ID of the associated dashboard
|
90
|
+
# * {string} applicationId - ID of the associated application
|
91
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
92
|
+
# * {boolean} _actions - Return resource actions in response
|
93
|
+
# * {boolean} _links - Return resource link in response
|
94
|
+
# * {boolean} _embedded - Return embedded resources in response
|
95
|
+
#
|
96
|
+
# Responses:
|
97
|
+
# * 200 - Dashboard information (https://api.losant.com/#/definitions/dashboard)
|
98
|
+
#
|
99
|
+
# Errors:
|
100
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
101
|
+
# * 404 - Error if dashboard was not found (https://api.losant.com/#/definitions/error)
|
102
|
+
def get(params = {})
|
103
|
+
params = Utils.symbolize_hash_keys(params)
|
104
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
105
|
+
headers = {}
|
106
|
+
body = nil
|
107
|
+
|
108
|
+
raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
|
109
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
110
|
+
|
111
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
112
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
113
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
114
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
115
|
+
|
116
|
+
path = "/applications/#{params[:applicationId]}/dashboards/#{params[:dashboardId]}"
|
117
|
+
|
118
|
+
@client.request(
|
119
|
+
method: :get,
|
120
|
+
path: path,
|
121
|
+
query: query_params,
|
122
|
+
headers: headers,
|
123
|
+
body: body)
|
124
|
+
end
|
125
|
+
|
126
|
+
# Updates information about a dashboard
|
127
|
+
#
|
128
|
+
# Authentication:
|
129
|
+
# The client must be configured with a valid api
|
130
|
+
# access token to call this action. The token
|
131
|
+
# must include at least one of the following scopes:
|
132
|
+
# all.Application, all.Organization, all.User, applicationDashboard.*, or applicationDashboard.patch.
|
133
|
+
#
|
134
|
+
# Parameters:
|
135
|
+
# * {string} dashboardId - ID of the associated dashboard
|
136
|
+
# * {string} applicationId - ID of the associated application
|
137
|
+
# * {hash} dashboard - Object containing new dashboard properties (https://api.losant.com/#/definitions/dashboardPatch)
|
138
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
139
|
+
# * {boolean} _actions - Return resource actions in response
|
140
|
+
# * {boolean} _links - Return resource link in response
|
141
|
+
# * {boolean} _embedded - Return embedded resources in response
|
142
|
+
#
|
143
|
+
# Responses:
|
144
|
+
# * 200 - Update dashboard information (https://api.losant.com/#/definitions/dashboard)
|
145
|
+
#
|
146
|
+
# Errors:
|
147
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
148
|
+
# * 404 - Error if dashboard was not found (https://api.losant.com/#/definitions/error)
|
149
|
+
def patch(params = {})
|
150
|
+
params = Utils.symbolize_hash_keys(params)
|
151
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
152
|
+
headers = {}
|
153
|
+
body = nil
|
154
|
+
|
155
|
+
raise ArgumentError.new("dashboardId is required") unless params.has_key?(:dashboardId)
|
156
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
157
|
+
raise ArgumentError.new("dashboard is required") unless params.has_key?(:dashboard)
|
158
|
+
|
159
|
+
body = params[:dashboard] if params.has_key?(:dashboard)
|
160
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
161
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
162
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
163
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
164
|
+
|
165
|
+
path = "/applications/#{params[:applicationId]}/dashboards/#{params[:dashboardId]}"
|
166
|
+
|
167
|
+
@client.request(
|
168
|
+
method: :patch,
|
169
|
+
path: path,
|
170
|
+
query: query_params,
|
171
|
+
headers: headers,
|
172
|
+
body: body)
|
173
|
+
end
|
174
|
+
|
175
|
+
end
|
176
|
+
end
|