losant_rest 1.7.0 → 1.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91975940c2dfb42ffc9bdd5644569f70fe80b740
4
- data.tar.gz: 6cd33ed4a5b4b14b1fe97b3570f739e41f5a0443
3
+ metadata.gz: 798b09d83465bb6054122feb258f838968419806
4
+ data.tar.gz: f7842e23abbbe5ea772e79409d35897397d3f875
5
5
  SHA512:
6
- metadata.gz: 41573b59fe7772a966d77e588544d5dcc92a5bd16717c9f6b67d5d5f5aa3448d4e79f35a801a46f1467b004414e01f3acf01513eb39117a4806ca2f849c0e23e
7
- data.tar.gz: 30c2229858441a706f1f45e5fe58aac6968fae7de44a64809f30da653bf800f34553e4ae4b73906ce024aa8c73a7d54c13b3c1798d6b6fc382be8ae73f9ae98a
6
+ metadata.gz: 925d23892026f32a0529d4428c8ee5cc692ab639883f766b3f021a4c2f2c3d4260c44a389605bc0a7e854e30d0caddd5bb6dfd4a9763ed2221a76d40591089e9
7
+ data.tar.gz: 3a4efe776bc321570d863d1bd8d78e900c7aa602fcb0470a016a605732595a1ce20a2ff8b01eac56fbba60036e7ef325651d2ebfdf04344fbdce2fb857cc289b
data/docs/_schemas.md CHANGED
@@ -39,6 +39,7 @@
39
39
  * [Device](#device)
40
40
  * [Device Command](#device-command)
41
41
  * [Device Commands](#device-commands)
42
+ * [Device Connection Status](#device-connection-status)
42
43
  * [Device Credentials](#device-credentials)
43
44
  * [Device Log](#device-log)
44
45
  * [Device Patch](#device-patch)
@@ -658,6 +659,7 @@ Schema for the body of an Application API Token creation request
658
659
  "edgeDeployments.*",
659
660
  "event.*",
660
661
  "events.*",
662
+ "experience.*",
661
663
  "experienceDomain.*",
662
664
  "experienceDomains.*",
663
665
  "experienceEndpoint.*",
@@ -724,6 +726,7 @@ Schema for the body of an Application API Token creation request
724
726
  "device.removeData",
725
727
  "device.sendCommand",
726
728
  "device.sendState",
729
+ "device.setConnectionStatus",
727
730
  "device.stateStream",
728
731
  "deviceRecipe.bulkCreate",
729
732
  "deviceRecipe.delete",
@@ -746,6 +749,7 @@ Schema for the body of an Application API Token creation request
746
749
  "events.mostRecentBySeverity",
747
750
  "events.patch",
748
751
  "events.post",
752
+ "experience.delete",
749
753
  "experienceDomain.delete",
750
754
  "experienceDomain.get",
751
755
  "experienceDomain.patch",
@@ -5257,6 +5261,139 @@ Schema for an array of Device Commands
5257
5261
 
5258
5262
  <br/>
5259
5263
 
5264
+ ## Device Connection Status
5265
+
5266
+ Schema for the body of a request to set a device&#x27;s connection status
5267
+
5268
+ ### <a name="device-connection-status-schema"></a> Schema
5269
+
5270
+ ```json
5271
+ {
5272
+ "$schema": "http://json-schema.org/draft-04/schema#",
5273
+ "oneOf": [
5274
+ {
5275
+ "title": "Device Connected",
5276
+ "description": "Schema for marking a device as connected",
5277
+ "type": "object",
5278
+ "properties": {
5279
+ "status": {
5280
+ "type": "string",
5281
+ "enum": [
5282
+ "connected"
5283
+ ]
5284
+ },
5285
+ "connectedAt": {
5286
+ "oneOf": [
5287
+ {
5288
+ "type": "string"
5289
+ },
5290
+ {
5291
+ "type": "number"
5292
+ },
5293
+ {
5294
+ "type": "object",
5295
+ "properties": {
5296
+ "$date": {
5297
+ "type": "string"
5298
+ }
5299
+ },
5300
+ "additionalProperties": false,
5301
+ "required": [
5302
+ "$date"
5303
+ ]
5304
+ }
5305
+ ]
5306
+ }
5307
+ },
5308
+ "required": [
5309
+ "status"
5310
+ ],
5311
+ "additionalProperties": false
5312
+ },
5313
+ {
5314
+ "title": "Device Disconnected",
5315
+ "description": "Schema for marking a device as disconnected",
5316
+ "type": "object",
5317
+ "properties": {
5318
+ "status": {
5319
+ "type": "string",
5320
+ "enum": [
5321
+ "disconnected"
5322
+ ]
5323
+ },
5324
+ "connectedAt": {
5325
+ "oneOf": [
5326
+ {
5327
+ "type": "string"
5328
+ },
5329
+ {
5330
+ "type": "number"
5331
+ },
5332
+ {
5333
+ "type": "object",
5334
+ "properties": {
5335
+ "$date": {
5336
+ "type": "string"
5337
+ }
5338
+ },
5339
+ "additionalProperties": false,
5340
+ "required": [
5341
+ "$date"
5342
+ ]
5343
+ }
5344
+ ]
5345
+ },
5346
+ "disconnectedAt": {
5347
+ "oneOf": [
5348
+ {
5349
+ "type": "string"
5350
+ },
5351
+ {
5352
+ "type": "number"
5353
+ },
5354
+ {
5355
+ "type": "object",
5356
+ "properties": {
5357
+ "$date": {
5358
+ "type": "string"
5359
+ }
5360
+ },
5361
+ "additionalProperties": false,
5362
+ "required": [
5363
+ "$date"
5364
+ ]
5365
+ }
5366
+ ]
5367
+ },
5368
+ "disconnectReason": {
5369
+ "type": "string",
5370
+ "maxLength": 1024
5371
+ },
5372
+ "messagesFromClient": {
5373
+ "type": "number"
5374
+ },
5375
+ "messagesToClient": {
5376
+ "type": "number"
5377
+ }
5378
+ },
5379
+ "required": [
5380
+ "status"
5381
+ ],
5382
+ "additionalProperties": false
5383
+ }
5384
+ ]
5385
+ }
5386
+ ```
5387
+ ### <a name="device-connection-status-example"></a> Example
5388
+
5389
+ ```json
5390
+ {
5391
+ "status": "connected"
5392
+ }
5393
+ ```
5394
+
5395
+ <br/>
5396
+
5260
5397
  ## Device Credentials
5261
5398
 
5262
5399
  Schema for the body of a Device authentication request
@@ -8171,6 +8308,72 @@ Schema for a single Experience Endpoint
8171
8308
  },
8172
8309
  "additionalProperties": false
8173
8310
  },
8311
+ "staticReply": {
8312
+ "oneOf": [
8313
+ {
8314
+ "type": "object",
8315
+ "properties": {
8316
+ "value": {
8317
+ "type": "string"
8318
+ },
8319
+ "statusCode": {
8320
+ "type": "number",
8321
+ "min": 100,
8322
+ "max": 599,
8323
+ "integer": true
8324
+ },
8325
+ "type": {
8326
+ "type": "string",
8327
+ "enum": [
8328
+ "page",
8329
+ "redirect"
8330
+ ]
8331
+ }
8332
+ },
8333
+ "required": [
8334
+ "value",
8335
+ "type"
8336
+ ],
8337
+ "additionalProperties": false
8338
+ },
8339
+ {
8340
+ "type": "null"
8341
+ }
8342
+ ]
8343
+ },
8344
+ "unauthorizedReply": {
8345
+ "oneOf": [
8346
+ {
8347
+ "type": "object",
8348
+ "properties": {
8349
+ "value": {
8350
+ "type": "string"
8351
+ },
8352
+ "statusCode": {
8353
+ "type": "number",
8354
+ "min": 100,
8355
+ "max": 599,
8356
+ "integer": true
8357
+ },
8358
+ "type": {
8359
+ "type": "string",
8360
+ "enum": [
8361
+ "page",
8362
+ "redirect"
8363
+ ]
8364
+ }
8365
+ },
8366
+ "required": [
8367
+ "value",
8368
+ "type"
8369
+ ],
8370
+ "additionalProperties": false
8371
+ },
8372
+ {
8373
+ "type": "null"
8374
+ }
8375
+ ]
8376
+ },
8174
8377
  "experienceGroups": {
8175
8378
  "type": "array",
8176
8379
  "items": {
@@ -8275,6 +8478,72 @@ Schema for the body of an Experience Endpoint modification request
8275
8478
  "pattern": "^[A-Fa-f\\d]{24}$"
8276
8479
  },
8277
8480
  "maxItems": 1000
8481
+ },
8482
+ "staticReply": {
8483
+ "oneOf": [
8484
+ {
8485
+ "type": "object",
8486
+ "properties": {
8487
+ "value": {
8488
+ "type": "string"
8489
+ },
8490
+ "statusCode": {
8491
+ "type": "number",
8492
+ "min": 100,
8493
+ "max": 599,
8494
+ "integer": true
8495
+ },
8496
+ "type": {
8497
+ "type": "string",
8498
+ "enum": [
8499
+ "page",
8500
+ "redirect"
8501
+ ]
8502
+ }
8503
+ },
8504
+ "required": [
8505
+ "value",
8506
+ "type"
8507
+ ],
8508
+ "additionalProperties": false
8509
+ },
8510
+ {
8511
+ "type": "null"
8512
+ }
8513
+ ]
8514
+ },
8515
+ "unauthorizedReply": {
8516
+ "oneOf": [
8517
+ {
8518
+ "type": "object",
8519
+ "properties": {
8520
+ "value": {
8521
+ "type": "string"
8522
+ },
8523
+ "statusCode": {
8524
+ "type": "number",
8525
+ "min": 100,
8526
+ "max": 599,
8527
+ "integer": true
8528
+ },
8529
+ "type": {
8530
+ "type": "string",
8531
+ "enum": [
8532
+ "page",
8533
+ "redirect"
8534
+ ]
8535
+ }
8536
+ },
8537
+ "required": [
8538
+ "value",
8539
+ "type"
8540
+ ],
8541
+ "additionalProperties": false
8542
+ },
8543
+ {
8544
+ "type": "null"
8545
+ }
8546
+ ]
8278
8547
  }
8279
8548
  },
8280
8549
  "additionalProperties": false
@@ -8353,6 +8622,72 @@ Schema for the body of an Experience Endpoint creation request
8353
8622
  "pattern": "^[A-Fa-f\\d]{24}$"
8354
8623
  },
8355
8624
  "maxItems": 1000
8625
+ },
8626
+ "staticReply": {
8627
+ "oneOf": [
8628
+ {
8629
+ "type": "object",
8630
+ "properties": {
8631
+ "value": {
8632
+ "type": "string"
8633
+ },
8634
+ "statusCode": {
8635
+ "type": "number",
8636
+ "min": 100,
8637
+ "max": 599,
8638
+ "integer": true
8639
+ },
8640
+ "type": {
8641
+ "type": "string",
8642
+ "enum": [
8643
+ "page",
8644
+ "redirect"
8645
+ ]
8646
+ }
8647
+ },
8648
+ "required": [
8649
+ "value",
8650
+ "type"
8651
+ ],
8652
+ "additionalProperties": false
8653
+ },
8654
+ {
8655
+ "type": "null"
8656
+ }
8657
+ ]
8658
+ },
8659
+ "unauthorizedReply": {
8660
+ "oneOf": [
8661
+ {
8662
+ "type": "object",
8663
+ "properties": {
8664
+ "value": {
8665
+ "type": "string"
8666
+ },
8667
+ "statusCode": {
8668
+ "type": "number",
8669
+ "min": 100,
8670
+ "max": 599,
8671
+ "integer": true
8672
+ },
8673
+ "type": {
8674
+ "type": "string",
8675
+ "enum": [
8676
+ "page",
8677
+ "redirect"
8678
+ ]
8679
+ }
8680
+ },
8681
+ "required": [
8682
+ "value",
8683
+ "type"
8684
+ ],
8685
+ "additionalProperties": false
8686
+ },
8687
+ {
8688
+ "type": "null"
8689
+ }
8690
+ ]
8356
8691
  }
8357
8692
  },
8358
8693
  "additionalProperties": false,
@@ -8512,6 +8847,72 @@ Schema for a collection of Experience Endpoints
8512
8847
  },
8513
8848
  "additionalProperties": false
8514
8849
  },
8850
+ "staticReply": {
8851
+ "oneOf": [
8852
+ {
8853
+ "type": "object",
8854
+ "properties": {
8855
+ "value": {
8856
+ "type": "string"
8857
+ },
8858
+ "statusCode": {
8859
+ "type": "number",
8860
+ "min": 100,
8861
+ "max": 599,
8862
+ "integer": true
8863
+ },
8864
+ "type": {
8865
+ "type": "string",
8866
+ "enum": [
8867
+ "page",
8868
+ "redirect"
8869
+ ]
8870
+ }
8871
+ },
8872
+ "required": [
8873
+ "value",
8874
+ "type"
8875
+ ],
8876
+ "additionalProperties": false
8877
+ },
8878
+ {
8879
+ "type": "null"
8880
+ }
8881
+ ]
8882
+ },
8883
+ "unauthorizedReply": {
8884
+ "oneOf": [
8885
+ {
8886
+ "type": "object",
8887
+ "properties": {
8888
+ "value": {
8889
+ "type": "string"
8890
+ },
8891
+ "statusCode": {
8892
+ "type": "number",
8893
+ "min": 100,
8894
+ "max": 599,
8895
+ "integer": true
8896
+ },
8897
+ "type": {
8898
+ "type": "string",
8899
+ "enum": [
8900
+ "page",
8901
+ "redirect"
8902
+ ]
8903
+ }
8904
+ },
8905
+ "required": [
8906
+ "value",
8907
+ "type"
8908
+ ],
8909
+ "additionalProperties": false
8910
+ },
8911
+ {
8912
+ "type": "null"
8913
+ }
8914
+ ]
8915
+ },
8515
8916
  "experienceGroups": {
8516
8917
  "type": "array",
8517
8918
  "items": {
@@ -18287,8 +18688,6 @@ Schema for a single Organization
18287
18688
  "role": {
18288
18689
  "type": "string",
18289
18690
  "enum": [
18290
- "admin",
18291
- "edit",
18292
18691
  "collaborate",
18293
18692
  "view",
18294
18693
  "none"
@@ -18315,8 +18714,6 @@ Schema for a single Organization
18315
18714
  "role": {
18316
18715
  "type": "string",
18317
18716
  "enum": [
18318
- "admin",
18319
- "edit",
18320
18717
  "collaborate",
18321
18718
  "view",
18322
18719
  "none"
@@ -18783,8 +19180,6 @@ Schema for the body of a request to send an invitation
18783
19180
  "role": {
18784
19181
  "type": "string",
18785
19182
  "enum": [
18786
- "admin",
18787
- "edit",
18788
19183
  "collaborate",
18789
19184
  "view",
18790
19185
  "none"
@@ -18811,8 +19206,6 @@ Schema for the body of a request to send an invitation
18811
19206
  "role": {
18812
19207
  "type": "string",
18813
19208
  "enum": [
18814
- "admin",
18815
- "edit",
18816
19209
  "collaborate",
18817
19210
  "view",
18818
19211
  "none"
@@ -18922,8 +19315,6 @@ Schema for an array of pending invitations to an Organization
18922
19315
  "role": {
18923
19316
  "type": "string",
18924
19317
  "enum": [
18925
- "admin",
18926
- "edit",
18927
19318
  "collaborate",
18928
19319
  "view",
18929
19320
  "none"
@@ -18950,8 +19341,6 @@ Schema for an array of pending invitations to an Organization
18950
19341
  "role": {
18951
19342
  "type": "string",
18952
19343
  "enum": [
18953
- "admin",
18954
- "edit",
18955
19344
  "collaborate",
18956
19345
  "view",
18957
19346
  "none"
@@ -19034,8 +19423,6 @@ Schema for the body of a request to modify an Organization member
19034
19423
  "role": {
19035
19424
  "type": "string",
19036
19425
  "enum": [
19037
- "admin",
19038
- "edit",
19039
19426
  "collaborate",
19040
19427
  "view",
19041
19428
  "none"
@@ -19062,8 +19449,6 @@ Schema for the body of a request to modify an Organization member
19062
19449
  "role": {
19063
19450
  "type": "string",
19064
19451
  "enum": [
19065
- "admin",
19066
- "edit",
19067
19452
  "collaborate",
19068
19453
  "view",
19069
19454
  "none"
@@ -19297,8 +19682,6 @@ Schema for a collection of Organizations
19297
19682
  "role": {
19298
19683
  "type": "string",
19299
19684
  "enum": [
19300
- "admin",
19301
- "edit",
19302
19685
  "collaborate",
19303
19686
  "view",
19304
19687
  "none"
@@ -19325,8 +19708,6 @@ Schema for a collection of Organizations
19325
19708
  "role": {
19326
19709
  "type": "string",
19327
19710
  "enum": [
19328
- "admin",
19329
- "edit",
19330
19711
  "collaborate",
19331
19712
  "view",
19332
19713
  "none"
data/docs/device.md CHANGED
@@ -17,6 +17,7 @@ parameters and the potential responses.
17
17
  * [Remove Data](#remove-data)
18
18
  * [Send Command](#send-command)
19
19
  * [Send State](#send-state)
20
+ * [Set Connection Status](#set-connection-status)
20
21
 
21
22
  <br/>
22
23
 
@@ -466,3 +467,44 @@ all.Application, all.Device, all.Organization, all.User, device.*, or device.sen
466
467
  | ---- | ---- | ----------- |
467
468
  | 400 | [Error](_schemas.md#error) | Error if malformed request |
468
469
  | 404 | [Error](_schemas.md#error) | Error if device was not found |
470
+
471
+ <br/>
472
+
473
+ ## Set Connection Status
474
+
475
+ Set the current connection status of the device
476
+
477
+ ```ruby
478
+ result = client.device.set_connection_status(
479
+ applicationId: my_application_id,
480
+ deviceId: my_device_id,
481
+ connectionStatus: my_connection_status)
482
+
483
+ puts result
484
+ ```
485
+
486
+ #### Authentication
487
+ The client must be configured with a valid api access token to call this
488
+ action. The token must include at least one of the following scopes:
489
+ all.Application, all.Device, all.Organization, all.User, device.*, or device.setConnectionStatus.
490
+
491
+ #### Available Parameters
492
+
493
+ | Name | Type | Required | Description | Default | Example |
494
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
495
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
496
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
497
+ | connectionStatus | [Device Connection Status](_schemas.md#device-connection-status) | Y | The current connection status of the device | | [Device Connection Status Example](_schemas.md#device-connection-status-example) |
498
+
499
+ #### Successful Responses
500
+
501
+ | Code | Type | Description |
502
+ | ---- | ---- | ----------- |
503
+ | 200 | [Success](_schemas.md#success) | If connection status was successfully applied |
504
+
505
+ #### Error Responses
506
+
507
+ | Code | Type | Description |
508
+ | ---- | ---- | ----------- |
509
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
510
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
@@ -0,0 +1,51 @@
1
+ # Experience Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Experience resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Delete](#delete)
10
+
11
+ <br/>
12
+
13
+ ## Delete
14
+
15
+ Deletes multiple parts of an experience including users, domains, endpoints, groups, views, and workflows
16
+
17
+ ```ruby
18
+ result = client.experience.delete(applicationId: my_application_id)
19
+
20
+ puts result
21
+ ```
22
+
23
+ #### Authentication
24
+ The client must be configured with a valid api access token to call this
25
+ action. The token must include at least one of the following scopes:
26
+ all.Application, all.Organization, all.User, experience.*, or experience.delete.
27
+
28
+ #### Available Parameters
29
+
30
+ | Name | Type | Required | Description | Default | Example |
31
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
32
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
33
+ | keepUser | string | N | Experience Users will automatically be deleted unless this is set. | | true |
34
+ | keepDomains | string | N | Experience Domains will automatically be deleted unless this is set. | | true |
35
+ | keepEndpoints | string | N | Experience Endpoints will automatically be deleted unless this is set. | | true |
36
+ | keepGroups | string | N | Experience Groups will automatically be deleted unless this is set. | | true |
37
+ | keepViews | string | N | Experience Views will automatically be deleted unless this is set. | | true |
38
+ | removeWorkflows | string | N | If set will delete any workflows under this application with an Endpoint Trigger Node. | | true |
39
+
40
+ #### Successful Responses
41
+
42
+ | Code | Type | Description |
43
+ | ---- | ---- | ----------- |
44
+ | 200 | [Success](_schemas.md#success) | If everything marked as true 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 application was not found |
@@ -27,7 +27,7 @@ module LosantRest
27
27
  #
28
28
  # User API for accessing Losant data
29
29
  #
30
- # Built For Version 1.12.0
30
+ # Built For Version 1.12.1
31
31
  class Client
32
32
  attr_accessor :auth_token, :url
33
33
 
@@ -128,6 +128,10 @@ module LosantRest
128
128
  @events ||= Events.new(self)
129
129
  end
130
130
 
131
+ def experience
132
+ @experience ||= Experience.new(self)
133
+ end
134
+
131
135
  def experience_domain
132
136
  @experience_domain ||= ExperienceDomain.new(self)
133
137
  end
@@ -246,7 +250,7 @@ module LosantRest
246
250
 
247
251
  headers["Accept"] = "application/json"
248
252
  headers["Content-Type"] = "application/json"
249
- headers["Accept-Version"] = "^1.12.0"
253
+ headers["Accept-Version"] = "^1.12.1"
250
254
  headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
251
255
  path = self.url + options.fetch(:path, "")
252
256