losant_rest 1.8.4 → 1.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/_schemas.md +505 -19
- data/docs/application.md +2 -0
- data/docs/applications.md +2 -0
- data/docs/dashboard.md +43 -2
- data/docs/me.md +2 -1
- data/docs/org.md +2 -1
- data/docs/orgs.md +2 -1
- data/lib/losant_rest/application.rb +4 -0
- data/lib/losant_rest/applications.rb +4 -0
- data/lib/losant_rest/client.rb +2 -2
- data/lib/losant_rest/dashboard.rb +49 -2
- data/lib/losant_rest/me.rb +3 -1
- data/lib/losant_rest/org.rb +3 -1
- data/lib/losant_rest/orgs.rb +3 -1
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/compositeDeviceState.json +0 -3
- data/schemas/dashboard.json +3 -0
- data/schemas/dashboardPatch.json +3 -0
- data/schemas/dashboardPost.json +3 -0
- data/schemas/dashboardSendReport.json +38 -0
- data/schemas/dashboards.json +3 -0
- data/schemas/deviceState.json +0 -3
- data/schemas/deviceStateOrStates.json +0 -6
- data/schemas/deviceStates.json +0 -3
- data/schemas/githubLogin.json +1 -0
- data/schemas/userCredentials.json +1 -0
- data/schemas/userPost.json +1 -0
- data/schemas/validateContextError.json +78 -0
- data/schemas/validateContextSuccess.json +78 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23c8728a224f810eeec0a7943f3eb891795292b983a2eca3f25f1ad775876728
|
|
4
|
+
data.tar.gz: 8f28f88835dd65b5343227fb0a9599e80fc325683928518abc9eec4b8116668f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c8bcb8a73d53a6223d984273769afd2a940f44024dfe8e310d96ae9ad6081a4d4532095ab8df625c8d6433cdf509146ac7364760524278e9103f517eb812574
|
|
7
|
+
data.tar.gz: 4ca229270f93a2225ec39067dd167330cce601b08053b32f3bbc4a9399b2ffef675b86f3eeaf4a897cc83928c93382805a906c088a3de94775993441869106d9
|
data/docs/_schemas.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* [Dashboard Context Instance](#dashboard-context-instance)
|
|
27
27
|
* [Dashboard Patch](#dashboard-patch)
|
|
28
28
|
* [Dashboard Post](#dashboard-post)
|
|
29
|
+
* [Dashboard Send Report](#dashboard-send-report)
|
|
29
30
|
* [Dashboards](#dashboards)
|
|
30
31
|
* [Data Table](#data-table)
|
|
31
32
|
* [Data Table Column](#data-table-column)
|
|
@@ -167,6 +168,8 @@
|
|
|
167
168
|
* [Time Series Query](#time-series-query)
|
|
168
169
|
* [User Credentials](#user-credentials)
|
|
169
170
|
* [User Post](#user-post)
|
|
171
|
+
* [Validate Context Error](#validate-context-error)
|
|
172
|
+
* [Validate Context Success](#validate-context-success)
|
|
170
173
|
* [Virtual Button Press](#virtual-button-press)
|
|
171
174
|
* [Webhook](#webhook)
|
|
172
175
|
* [Webhook Patch](#webhook-patch)
|
|
@@ -3072,9 +3075,6 @@ Schema for a composite Device state
|
|
|
3072
3075
|
]
|
|
3073
3076
|
}
|
|
3074
3077
|
]
|
|
3075
|
-
},
|
|
3076
|
-
"relayId": {
|
|
3077
|
-
"type": "string"
|
|
3078
3078
|
}
|
|
3079
3079
|
}
|
|
3080
3080
|
}
|
|
@@ -3405,6 +3405,9 @@ Schema for a single Dashboard
|
|
|
3405
3405
|
"additionalProperties": false
|
|
3406
3406
|
},
|
|
3407
3407
|
"maxItems": 100
|
|
3408
|
+
},
|
|
3409
|
+
"includeFullDevice": {
|
|
3410
|
+
"type": "boolean"
|
|
3408
3411
|
}
|
|
3409
3412
|
},
|
|
3410
3413
|
"additionalProperties": false
|
|
@@ -3430,13 +3433,18 @@ Schema for a single Dashboard
|
|
|
3430
3433
|
"dashboardId": "575ece2b7ae143cd83dc4a9b",
|
|
3431
3434
|
"creationDate": "2016-06-13T04:00:00.000Z",
|
|
3432
3435
|
"lastUpdated": "2016-06-13T04:00:00.000Z",
|
|
3433
|
-
"
|
|
3434
|
-
"
|
|
3436
|
+
"organizationName": "Losant",
|
|
3437
|
+
"organizationIconColor": "#284fff",
|
|
3438
|
+
"ownerType": "organization",
|
|
3439
|
+
"ownerId": "58238ff2fe7b4b01009a0554",
|
|
3435
3440
|
"name": "My Dashboard",
|
|
3436
3441
|
"description": "The best dashboard description",
|
|
3437
3442
|
"refreshRate": 60,
|
|
3438
3443
|
"public": false,
|
|
3444
|
+
"isPasswordProtected": false,
|
|
3445
|
+
"defaultTheme": "light",
|
|
3439
3446
|
"blocks": [],
|
|
3447
|
+
"_currentRole": "admin",
|
|
3440
3448
|
"reportConfigs": [
|
|
3441
3449
|
{
|
|
3442
3450
|
"toEmail": [
|
|
@@ -3446,6 +3454,88 @@ Schema for a single Dashboard
|
|
|
3446
3454
|
"theme": "dark",
|
|
3447
3455
|
"subject": "Daily Dashboard Report"
|
|
3448
3456
|
}
|
|
3457
|
+
],
|
|
3458
|
+
"contextConfiguration": [
|
|
3459
|
+
{
|
|
3460
|
+
"validationEnabled": true,
|
|
3461
|
+
"validationConfig": {
|
|
3462
|
+
"deviceIds": [
|
|
3463
|
+
"589de9bca1975a00017b2293"
|
|
3464
|
+
],
|
|
3465
|
+
"deviceTags": [
|
|
3466
|
+
{
|
|
3467
|
+
"key": "type",
|
|
3468
|
+
"value": "Weather Station"
|
|
3469
|
+
}
|
|
3470
|
+
],
|
|
3471
|
+
"includeFullDevice": true
|
|
3472
|
+
},
|
|
3473
|
+
"name": "deviceId-withIdAndTagValidationAndIncludeFullDevice",
|
|
3474
|
+
"type": "deviceId",
|
|
3475
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
3476
|
+
"defaultValue": "589de9bca1975a00017b2295"
|
|
3477
|
+
},
|
|
3478
|
+
{
|
|
3479
|
+
"validationEnabled": false,
|
|
3480
|
+
"validationConfig": {
|
|
3481
|
+
"includeFullDevice": false
|
|
3482
|
+
},
|
|
3483
|
+
"name": "deviceId-noValidationNoFullDevice",
|
|
3484
|
+
"type": "deviceId",
|
|
3485
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
3486
|
+
"defaultValue": "589de9bca1975a00017b2295"
|
|
3487
|
+
},
|
|
3488
|
+
{
|
|
3489
|
+
"validationEnabled": true,
|
|
3490
|
+
"validationConfig": {
|
|
3491
|
+
"attributes": [
|
|
3492
|
+
"dew-point",
|
|
3493
|
+
"feels-like",
|
|
3494
|
+
"humidity",
|
|
3495
|
+
"location",
|
|
3496
|
+
"pressure",
|
|
3497
|
+
"temp",
|
|
3498
|
+
"visibility",
|
|
3499
|
+
"wind-speed"
|
|
3500
|
+
]
|
|
3501
|
+
},
|
|
3502
|
+
"name": "attr",
|
|
3503
|
+
"type": "deviceAttribute",
|
|
3504
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
3505
|
+
"defaultValue": "temp"
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
"validationEnabled": true,
|
|
3509
|
+
"validationConfig": {
|
|
3510
|
+
"deviceTags": [
|
|
3511
|
+
{
|
|
3512
|
+
"key": "DeviceRecipe",
|
|
3513
|
+
"value": "Weather Station"
|
|
3514
|
+
},
|
|
3515
|
+
{
|
|
3516
|
+
"key": "region"
|
|
3517
|
+
}
|
|
3518
|
+
]
|
|
3519
|
+
},
|
|
3520
|
+
"name": "deviceTag-withValidation",
|
|
3521
|
+
"type": "deviceTag",
|
|
3522
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
3523
|
+
"defaultValue": {
|
|
3524
|
+
"key": "DeviceRecipe",
|
|
3525
|
+
"value": "Weather Station"
|
|
3526
|
+
}
|
|
3527
|
+
},
|
|
3528
|
+
{
|
|
3529
|
+
"validationEnabled": false,
|
|
3530
|
+
"validationConfig": {},
|
|
3531
|
+
"name": "deviceTag-noValidation",
|
|
3532
|
+
"type": "deviceTag",
|
|
3533
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
3534
|
+
"defaultValue": {
|
|
3535
|
+
"key": "DeviceRecipe",
|
|
3536
|
+
"value": "Weather Station"
|
|
3537
|
+
}
|
|
3538
|
+
}
|
|
3449
3539
|
]
|
|
3450
3540
|
}
|
|
3451
3541
|
```
|
|
@@ -3769,6 +3859,9 @@ Schema for the body of a Dashboard modification request
|
|
|
3769
3859
|
"additionalProperties": false
|
|
3770
3860
|
},
|
|
3771
3861
|
"maxItems": 100
|
|
3862
|
+
},
|
|
3863
|
+
"includeFullDevice": {
|
|
3864
|
+
"type": "boolean"
|
|
3772
3865
|
}
|
|
3773
3866
|
},
|
|
3774
3867
|
"additionalProperties": false
|
|
@@ -4073,6 +4166,9 @@ Schema for the body of a Dashboard creation request
|
|
|
4073
4166
|
"additionalProperties": false
|
|
4074
4167
|
},
|
|
4075
4168
|
"maxItems": 100
|
|
4169
|
+
},
|
|
4170
|
+
"includeFullDevice": {
|
|
4171
|
+
"type": "boolean"
|
|
4076
4172
|
}
|
|
4077
4173
|
},
|
|
4078
4174
|
"additionalProperties": false
|
|
@@ -4105,6 +4201,68 @@ Schema for the body of a Dashboard creation request
|
|
|
4105
4201
|
|
|
4106
4202
|
<br/>
|
|
4107
4203
|
|
|
4204
|
+
## Dashboard Send Report
|
|
4205
|
+
|
|
4206
|
+
Schema for the body of a Dashboard report request
|
|
4207
|
+
|
|
4208
|
+
### <a name="dashboard-send-report-schema"></a> Schema
|
|
4209
|
+
|
|
4210
|
+
```json
|
|
4211
|
+
{
|
|
4212
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
4213
|
+
"type": "object",
|
|
4214
|
+
"required": [
|
|
4215
|
+
"toEmail"
|
|
4216
|
+
],
|
|
4217
|
+
"properties": {
|
|
4218
|
+
"toEmail": {
|
|
4219
|
+
"type": "array",
|
|
4220
|
+
"min": 1,
|
|
4221
|
+
"max": 10,
|
|
4222
|
+
"items": {
|
|
4223
|
+
"type": "string",
|
|
4224
|
+
"format": "email",
|
|
4225
|
+
"maxLength": 1024
|
|
4226
|
+
}
|
|
4227
|
+
},
|
|
4228
|
+
"subject": {
|
|
4229
|
+
"type": "string",
|
|
4230
|
+
"max": 255
|
|
4231
|
+
},
|
|
4232
|
+
"message": {
|
|
4233
|
+
"type": "string",
|
|
4234
|
+
"max": 32767
|
|
4235
|
+
},
|
|
4236
|
+
"theme": {
|
|
4237
|
+
"type": "string",
|
|
4238
|
+
"enum": [
|
|
4239
|
+
"dark",
|
|
4240
|
+
"light"
|
|
4241
|
+
]
|
|
4242
|
+
},
|
|
4243
|
+
"time": {
|
|
4244
|
+
"type": "number"
|
|
4245
|
+
}
|
|
4246
|
+
},
|
|
4247
|
+
"additionalProperties": false
|
|
4248
|
+
}
|
|
4249
|
+
```
|
|
4250
|
+
### <a name="dashboard-send-report-example"></a> Example
|
|
4251
|
+
|
|
4252
|
+
```json
|
|
4253
|
+
{
|
|
4254
|
+
"toEmail": [
|
|
4255
|
+
"test@email.com"
|
|
4256
|
+
],
|
|
4257
|
+
"subject": "Dashboard Report",
|
|
4258
|
+
"message": "Lookit",
|
|
4259
|
+
"time": 1551887386704,
|
|
4260
|
+
"theme": "dark"
|
|
4261
|
+
}
|
|
4262
|
+
```
|
|
4263
|
+
|
|
4264
|
+
<br/>
|
|
4265
|
+
|
|
4108
4266
|
## Dashboards
|
|
4109
4267
|
|
|
4110
4268
|
Schema for a collection of Dashboards
|
|
@@ -4418,6 +4576,9 @@ Schema for a collection of Dashboards
|
|
|
4418
4576
|
"additionalProperties": false
|
|
4419
4577
|
},
|
|
4420
4578
|
"maxItems": 100
|
|
4579
|
+
},
|
|
4580
|
+
"includeFullDevice": {
|
|
4581
|
+
"type": "boolean"
|
|
4421
4582
|
}
|
|
4422
4583
|
},
|
|
4423
4584
|
"additionalProperties": false
|
|
@@ -4484,13 +4645,18 @@ Schema for a collection of Dashboards
|
|
|
4484
4645
|
"dashboardId": "575ece2b7ae143cd83dc4a9b",
|
|
4485
4646
|
"creationDate": "2016-06-13T04:00:00.000Z",
|
|
4486
4647
|
"lastUpdated": "2016-06-13T04:00:00.000Z",
|
|
4487
|
-
"
|
|
4488
|
-
"
|
|
4648
|
+
"organizationName": "Losant",
|
|
4649
|
+
"organizationIconColor": "#284fff",
|
|
4650
|
+
"ownerType": "organization",
|
|
4651
|
+
"ownerId": "58238ff2fe7b4b01009a0554",
|
|
4489
4652
|
"name": "My Dashboard",
|
|
4490
4653
|
"description": "The best dashboard description",
|
|
4491
4654
|
"refreshRate": 60,
|
|
4492
4655
|
"public": false,
|
|
4656
|
+
"isPasswordProtected": false,
|
|
4657
|
+
"defaultTheme": "light",
|
|
4493
4658
|
"blocks": [],
|
|
4659
|
+
"_currentRole": "admin",
|
|
4494
4660
|
"reportConfigs": [
|
|
4495
4661
|
{
|
|
4496
4662
|
"toEmail": [
|
|
@@ -4500,6 +4666,88 @@ Schema for a collection of Dashboards
|
|
|
4500
4666
|
"theme": "dark",
|
|
4501
4667
|
"subject": "Daily Dashboard Report"
|
|
4502
4668
|
}
|
|
4669
|
+
],
|
|
4670
|
+
"contextConfiguration": [
|
|
4671
|
+
{
|
|
4672
|
+
"validationEnabled": true,
|
|
4673
|
+
"validationConfig": {
|
|
4674
|
+
"deviceIds": [
|
|
4675
|
+
"589de9bca1975a00017b2293"
|
|
4676
|
+
],
|
|
4677
|
+
"deviceTags": [
|
|
4678
|
+
{
|
|
4679
|
+
"key": "type",
|
|
4680
|
+
"value": "Weather Station"
|
|
4681
|
+
}
|
|
4682
|
+
],
|
|
4683
|
+
"includeFullDevice": true
|
|
4684
|
+
},
|
|
4685
|
+
"name": "deviceId-withIdAndTagValidationAndIncludeFullDevice",
|
|
4686
|
+
"type": "deviceId",
|
|
4687
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
4688
|
+
"defaultValue": "589de9bca1975a00017b2295"
|
|
4689
|
+
},
|
|
4690
|
+
{
|
|
4691
|
+
"validationEnabled": false,
|
|
4692
|
+
"validationConfig": {
|
|
4693
|
+
"includeFullDevice": false
|
|
4694
|
+
},
|
|
4695
|
+
"name": "deviceId-noValidationNoFullDevice",
|
|
4696
|
+
"type": "deviceId",
|
|
4697
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
4698
|
+
"defaultValue": "589de9bca1975a00017b2295"
|
|
4699
|
+
},
|
|
4700
|
+
{
|
|
4701
|
+
"validationEnabled": true,
|
|
4702
|
+
"validationConfig": {
|
|
4703
|
+
"attributes": [
|
|
4704
|
+
"dew-point",
|
|
4705
|
+
"feels-like",
|
|
4706
|
+
"humidity",
|
|
4707
|
+
"location",
|
|
4708
|
+
"pressure",
|
|
4709
|
+
"temp",
|
|
4710
|
+
"visibility",
|
|
4711
|
+
"wind-speed"
|
|
4712
|
+
]
|
|
4713
|
+
},
|
|
4714
|
+
"name": "attr",
|
|
4715
|
+
"type": "deviceAttribute",
|
|
4716
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
4717
|
+
"defaultValue": "temp"
|
|
4718
|
+
},
|
|
4719
|
+
{
|
|
4720
|
+
"validationEnabled": true,
|
|
4721
|
+
"validationConfig": {
|
|
4722
|
+
"deviceTags": [
|
|
4723
|
+
{
|
|
4724
|
+
"key": "DeviceRecipe",
|
|
4725
|
+
"value": "Weather Station"
|
|
4726
|
+
},
|
|
4727
|
+
{
|
|
4728
|
+
"key": "region"
|
|
4729
|
+
}
|
|
4730
|
+
]
|
|
4731
|
+
},
|
|
4732
|
+
"name": "deviceTag-withValidation",
|
|
4733
|
+
"type": "deviceTag",
|
|
4734
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
4735
|
+
"defaultValue": {
|
|
4736
|
+
"key": "DeviceRecipe",
|
|
4737
|
+
"value": "Weather Station"
|
|
4738
|
+
}
|
|
4739
|
+
},
|
|
4740
|
+
{
|
|
4741
|
+
"validationEnabled": false,
|
|
4742
|
+
"validationConfig": {},
|
|
4743
|
+
"name": "deviceTag-noValidation",
|
|
4744
|
+
"type": "deviceTag",
|
|
4745
|
+
"applicationId": "589de7d2a1975a00017b227f",
|
|
4746
|
+
"defaultValue": {
|
|
4747
|
+
"key": "DeviceRecipe",
|
|
4748
|
+
"value": "Weather Station"
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4503
4751
|
]
|
|
4504
4752
|
}
|
|
4505
4753
|
],
|
|
@@ -7190,9 +7438,6 @@ Schema for a single Device state
|
|
|
7190
7438
|
}
|
|
7191
7439
|
]
|
|
7192
7440
|
},
|
|
7193
|
-
"relayId": {
|
|
7194
|
-
"type": "string"
|
|
7195
|
-
},
|
|
7196
7441
|
"meta": {},
|
|
7197
7442
|
"data": {
|
|
7198
7443
|
"type": "object",
|
|
@@ -7269,9 +7514,6 @@ Schema for a single device state or an array of device states
|
|
|
7269
7514
|
}
|
|
7270
7515
|
]
|
|
7271
7516
|
},
|
|
7272
|
-
"relayId": {
|
|
7273
|
-
"type": "string"
|
|
7274
|
-
},
|
|
7275
7517
|
"meta": {},
|
|
7276
7518
|
"data": {
|
|
7277
7519
|
"type": "object",
|
|
@@ -7328,9 +7570,6 @@ Schema for a single device state or an array of device states
|
|
|
7328
7570
|
}
|
|
7329
7571
|
]
|
|
7330
7572
|
},
|
|
7331
|
-
"relayId": {
|
|
7332
|
-
"type": "string"
|
|
7333
|
-
},
|
|
7334
7573
|
"meta": {},
|
|
7335
7574
|
"data": {
|
|
7336
7575
|
"type": "object",
|
|
@@ -7410,9 +7649,6 @@ Schema for an array of Device states
|
|
|
7410
7649
|
}
|
|
7411
7650
|
]
|
|
7412
7651
|
},
|
|
7413
|
-
"relayId": {
|
|
7414
|
-
"type": "string"
|
|
7415
|
-
},
|
|
7416
7652
|
"meta": {},
|
|
7417
7653
|
"data": {
|
|
7418
7654
|
"type": "object",
|
|
@@ -19599,6 +19835,7 @@ Schema for the body of a Github login request
|
|
|
19599
19835
|
"auditLogs.get",
|
|
19600
19836
|
"dashboard.patch",
|
|
19601
19837
|
"dashboard.delete",
|
|
19838
|
+
"dashboard.sendReport",
|
|
19602
19839
|
"dashboards.get",
|
|
19603
19840
|
"dashboards.post",
|
|
19604
19841
|
"org.get",
|
|
@@ -25169,6 +25406,7 @@ Schema for the body of a User authentication request
|
|
|
25169
25406
|
"auditLogs.get",
|
|
25170
25407
|
"dashboard.patch",
|
|
25171
25408
|
"dashboard.delete",
|
|
25409
|
+
"dashboard.sendReport",
|
|
25172
25410
|
"dashboards.get",
|
|
25173
25411
|
"dashboards.post",
|
|
25174
25412
|
"org.get",
|
|
@@ -25563,6 +25801,7 @@ Schema for the body of a User creation request
|
|
|
25563
25801
|
"auditLogs.get",
|
|
25564
25802
|
"dashboard.patch",
|
|
25565
25803
|
"dashboard.delete",
|
|
25804
|
+
"dashboard.sendReport",
|
|
25566
25805
|
"dashboards.get",
|
|
25567
25806
|
"dashboards.post",
|
|
25568
25807
|
"org.get",
|
|
@@ -25664,6 +25903,253 @@ Schema for the body of a User creation request
|
|
|
25664
25903
|
|
|
25665
25904
|
<br/>
|
|
25666
25905
|
|
|
25906
|
+
## Validate Context Error
|
|
25907
|
+
|
|
25908
|
+
Schema for the result of a validateContext call when invalid context is passed
|
|
25909
|
+
|
|
25910
|
+
### <a name="validate-context-error-schema"></a> Schema
|
|
25911
|
+
|
|
25912
|
+
```json
|
|
25913
|
+
{
|
|
25914
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
25915
|
+
"type": "object",
|
|
25916
|
+
"properties": {
|
|
25917
|
+
"type": {
|
|
25918
|
+
"type": "string"
|
|
25919
|
+
},
|
|
25920
|
+
"message": {
|
|
25921
|
+
"type": "string"
|
|
25922
|
+
},
|
|
25923
|
+
"ctx": {
|
|
25924
|
+
"type": "object",
|
|
25925
|
+
"patternProperties": {
|
|
25926
|
+
"^[0-9a-zA-Z_-]{1,255}$": {
|
|
25927
|
+
"anyOf": [
|
|
25928
|
+
[
|
|
25929
|
+
{
|
|
25930
|
+
"type": "string",
|
|
25931
|
+
"maxLength": 32767
|
|
25932
|
+
},
|
|
25933
|
+
{
|
|
25934
|
+
"type": "number"
|
|
25935
|
+
},
|
|
25936
|
+
{
|
|
25937
|
+
"type": "object",
|
|
25938
|
+
"properties": {
|
|
25939
|
+
"key": {
|
|
25940
|
+
"type": "string",
|
|
25941
|
+
"pattern": "^[0-9a-zA-Z_-]{1,255}$"
|
|
25942
|
+
},
|
|
25943
|
+
"value": {
|
|
25944
|
+
"type": "string",
|
|
25945
|
+
"minLength": 1,
|
|
25946
|
+
"maxLength": 255
|
|
25947
|
+
}
|
|
25948
|
+
},
|
|
25949
|
+
"additionalProperties": false
|
|
25950
|
+
}
|
|
25951
|
+
],
|
|
25952
|
+
{
|
|
25953
|
+
"type": "object",
|
|
25954
|
+
"properties": {
|
|
25955
|
+
"id": {
|
|
25956
|
+
"type": "string",
|
|
25957
|
+
"pattern": "^[A-Fa-f\\d]{24}$"
|
|
25958
|
+
},
|
|
25959
|
+
"name": {
|
|
25960
|
+
"type": "string",
|
|
25961
|
+
"minLength": 1,
|
|
25962
|
+
"maxLength": 255
|
|
25963
|
+
},
|
|
25964
|
+
"description": {
|
|
25965
|
+
"type": "string",
|
|
25966
|
+
"maxLength": 32767
|
|
25967
|
+
},
|
|
25968
|
+
"tags": {
|
|
25969
|
+
"type": "object",
|
|
25970
|
+
"patternProperties": {
|
|
25971
|
+
"^[0-9a-zA-Z_-]{1,255}$": {
|
|
25972
|
+
"type": "array",
|
|
25973
|
+
"minItems": 1,
|
|
25974
|
+
"items": {
|
|
25975
|
+
"type": "string",
|
|
25976
|
+
"minLength": 1,
|
|
25977
|
+
"maxLength": 255
|
|
25978
|
+
}
|
|
25979
|
+
}
|
|
25980
|
+
}
|
|
25981
|
+
}
|
|
25982
|
+
}
|
|
25983
|
+
}
|
|
25984
|
+
]
|
|
25985
|
+
}
|
|
25986
|
+
},
|
|
25987
|
+
"additionalProperties": false
|
|
25988
|
+
}
|
|
25989
|
+
}
|
|
25990
|
+
}
|
|
25991
|
+
```
|
|
25992
|
+
### <a name="validate-context-error-example"></a> Example
|
|
25993
|
+
|
|
25994
|
+
```json
|
|
25995
|
+
{
|
|
25996
|
+
"type": "Validation",
|
|
25997
|
+
"message": "deviceId-noValidationNoFullDevice (589de9bca1975a00017b22ff) is not a valid deviceId",
|
|
25998
|
+
"ctx": {
|
|
25999
|
+
"deviceId-withIdAndTagValidationAndIncludeFullDevice": {
|
|
26000
|
+
"id": "589de9bca1975a00017b2295",
|
|
26001
|
+
"name": "Cincinnati",
|
|
26002
|
+
"tags": {
|
|
26003
|
+
"type": [
|
|
26004
|
+
"Weather Station"
|
|
26005
|
+
],
|
|
26006
|
+
"region": [
|
|
26007
|
+
"Midwest"
|
|
26008
|
+
],
|
|
26009
|
+
"DeviceRecipe": [
|
|
26010
|
+
"Weather Station"
|
|
26011
|
+
]
|
|
26012
|
+
}
|
|
26013
|
+
},
|
|
26014
|
+
"deviceId-noValidationNoFullDevice": "589de9bca1975a00017b2296",
|
|
26015
|
+
"deviceAttribute": "dew-point",
|
|
26016
|
+
"deviceTag-withValidation": {
|
|
26017
|
+
"key": "DeviceRecipe",
|
|
26018
|
+
"value": "Weather Station"
|
|
26019
|
+
},
|
|
26020
|
+
"deviceTag-noValidation": {
|
|
26021
|
+
"key": "DeviceRecipe",
|
|
26022
|
+
"value": "Weather Station"
|
|
26023
|
+
}
|
|
26024
|
+
}
|
|
26025
|
+
}
|
|
26026
|
+
```
|
|
26027
|
+
|
|
26028
|
+
<br/>
|
|
26029
|
+
|
|
26030
|
+
## Validate Context Success
|
|
26031
|
+
|
|
26032
|
+
Schema for the result of a successful validateContext call
|
|
26033
|
+
|
|
26034
|
+
### <a name="validate-context-success-schema"></a> Schema
|
|
26035
|
+
|
|
26036
|
+
```json
|
|
26037
|
+
{
|
|
26038
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
26039
|
+
"type": "object",
|
|
26040
|
+
"properties": {
|
|
26041
|
+
"success": {
|
|
26042
|
+
"type": "boolean",
|
|
26043
|
+
"enum": [
|
|
26044
|
+
true
|
|
26045
|
+
]
|
|
26046
|
+
},
|
|
26047
|
+
"ctx": {
|
|
26048
|
+
"type": "object",
|
|
26049
|
+
"patternProperties": {
|
|
26050
|
+
"^[0-9a-zA-Z_-]{1,255}$": {
|
|
26051
|
+
"anyOf": [
|
|
26052
|
+
[
|
|
26053
|
+
{
|
|
26054
|
+
"type": "string",
|
|
26055
|
+
"maxLength": 32767
|
|
26056
|
+
},
|
|
26057
|
+
{
|
|
26058
|
+
"type": "number"
|
|
26059
|
+
},
|
|
26060
|
+
{
|
|
26061
|
+
"type": "object",
|
|
26062
|
+
"properties": {
|
|
26063
|
+
"key": {
|
|
26064
|
+
"type": "string",
|
|
26065
|
+
"pattern": "^[0-9a-zA-Z_-]{1,255}$"
|
|
26066
|
+
},
|
|
26067
|
+
"value": {
|
|
26068
|
+
"type": "string",
|
|
26069
|
+
"minLength": 1,
|
|
26070
|
+
"maxLength": 255
|
|
26071
|
+
}
|
|
26072
|
+
},
|
|
26073
|
+
"additionalProperties": false
|
|
26074
|
+
}
|
|
26075
|
+
],
|
|
26076
|
+
{
|
|
26077
|
+
"type": "object",
|
|
26078
|
+
"properties": {
|
|
26079
|
+
"id": {
|
|
26080
|
+
"type": "string",
|
|
26081
|
+
"pattern": "^[A-Fa-f\\d]{24}$"
|
|
26082
|
+
},
|
|
26083
|
+
"name": {
|
|
26084
|
+
"type": "string",
|
|
26085
|
+
"minLength": 1,
|
|
26086
|
+
"maxLength": 255
|
|
26087
|
+
},
|
|
26088
|
+
"description": {
|
|
26089
|
+
"type": "string",
|
|
26090
|
+
"maxLength": 32767
|
|
26091
|
+
},
|
|
26092
|
+
"tags": {
|
|
26093
|
+
"type": "object",
|
|
26094
|
+
"patternProperties": {
|
|
26095
|
+
"^[0-9a-zA-Z_-]{1,255}$": {
|
|
26096
|
+
"type": "array",
|
|
26097
|
+
"minItems": 1,
|
|
26098
|
+
"items": {
|
|
26099
|
+
"type": "string",
|
|
26100
|
+
"minLength": 1,
|
|
26101
|
+
"maxLength": 255
|
|
26102
|
+
}
|
|
26103
|
+
}
|
|
26104
|
+
}
|
|
26105
|
+
}
|
|
26106
|
+
}
|
|
26107
|
+
}
|
|
26108
|
+
]
|
|
26109
|
+
}
|
|
26110
|
+
},
|
|
26111
|
+
"additionalProperties": false
|
|
26112
|
+
}
|
|
26113
|
+
}
|
|
26114
|
+
}
|
|
26115
|
+
```
|
|
26116
|
+
### <a name="validate-context-success-example"></a> Example
|
|
26117
|
+
|
|
26118
|
+
```json
|
|
26119
|
+
{
|
|
26120
|
+
"success": true,
|
|
26121
|
+
"ctx": {
|
|
26122
|
+
"deviceId-withIdAndTagValidationAndIncludeFullDevice": {
|
|
26123
|
+
"id": "589de9bca1975a00017b2295",
|
|
26124
|
+
"name": "Cincinnati",
|
|
26125
|
+
"tags": {
|
|
26126
|
+
"type": [
|
|
26127
|
+
"Weather Station"
|
|
26128
|
+
],
|
|
26129
|
+
"region": [
|
|
26130
|
+
"Midwest"
|
|
26131
|
+
],
|
|
26132
|
+
"DeviceRecipe": [
|
|
26133
|
+
"Weather Station"
|
|
26134
|
+
]
|
|
26135
|
+
}
|
|
26136
|
+
},
|
|
26137
|
+
"deviceId-noValidationNoFullDevice": "589de9bca1975a00017b2296",
|
|
26138
|
+
"deviceAttribute": "dew-point",
|
|
26139
|
+
"deviceTag-withValidation": {
|
|
26140
|
+
"key": "DeviceRecipe",
|
|
26141
|
+
"value": "Weather Station"
|
|
26142
|
+
},
|
|
26143
|
+
"deviceTag-noValidation": {
|
|
26144
|
+
"key": "DeviceRecipe",
|
|
26145
|
+
"value": "Weather Station"
|
|
26146
|
+
}
|
|
26147
|
+
}
|
|
26148
|
+
}
|
|
26149
|
+
```
|
|
26150
|
+
|
|
26151
|
+
<br/>
|
|
26152
|
+
|
|
25667
26153
|
## Virtual Button Press
|
|
25668
26154
|
|
|
25669
26155
|
Schema for the body of a request to press a Workflow virtual button
|