losant_rest 1.0.8 → 1.1.0
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/.ruby-version +1 -0
- data/.travis.yml +3 -2
- data/README.md +19 -8
- data/docs/_schemas.md +210 -184
- data/docs/application.md +20 -0
- data/docs/applicationApiToken.md +130 -0
- data/docs/applicationApiTokens.md +83 -0
- data/docs/applicationKey.md +15 -0
- data/docs/applicationKeys.md +10 -0
- data/docs/applications.md +10 -0
- data/docs/auditLog.md +5 -0
- data/docs/auditLogs.md +5 -0
- data/docs/auth.md +20 -8
- data/docs/dashboard.md +13 -0
- data/docs/dashboards.md +10 -0
- data/docs/data.md +10 -0
- data/docs/device.md +55 -0
- data/docs/deviceRecipe.md +20 -0
- data/docs/deviceRecipes.md +10 -0
- data/docs/devices.md +20 -0
- data/docs/event.md +15 -0
- data/docs/events.md +20 -0
- data/docs/flow.md +35 -0
- data/docs/flows.md +10 -0
- data/docs/me.md +61 -0
- data/docs/org.md +51 -0
- data/docs/orgInvites.md +6 -0
- data/docs/orgs.md +11 -0
- data/docs/solution.md +15 -0
- data/docs/solutionUser.md +15 -0
- data/docs/solutionUsers.md +10 -0
- data/docs/solutions.md +10 -0
- data/docs/webhook.md +15 -0
- data/docs/webhooks.md +10 -0
- data/lib/losant_rest.rb +2 -2
- data/lib/losant_rest/application.rb +24 -0
- data/lib/losant_rest/{access_token.rb → application_api_token.rb} +47 -23
- data/lib/losant_rest/{access_tokens.rb → application_api_tokens.rb} +27 -11
- data/lib/losant_rest/application_key.rb +18 -0
- data/lib/losant_rest/application_keys.rb +12 -0
- data/lib/losant_rest/applications.rb +12 -0
- data/lib/losant_rest/audit_log.rb +6 -0
- data/lib/losant_rest/audit_logs.rb +6 -0
- data/lib/losant_rest/auth.rb +20 -8
- data/lib/losant_rest/client.rb +8 -8
- data/lib/losant_rest/dashboard.rb +15 -0
- data/lib/losant_rest/dashboards.rb +12 -0
- data/lib/losant_rest/data.rb +12 -0
- data/lib/losant_rest/device.rb +66 -0
- data/lib/losant_rest/device_recipe.rb +24 -0
- data/lib/losant_rest/device_recipes.rb +12 -0
- data/lib/losant_rest/devices.rb +24 -0
- data/lib/losant_rest/event.rb +18 -0
- data/lib/losant_rest/events.rb +24 -0
- data/lib/losant_rest/flow.rb +42 -0
- data/lib/losant_rest/flows.rb +12 -0
- data/lib/losant_rest/me.rb +74 -0
- data/lib/losant_rest/org.rb +62 -0
- data/lib/losant_rest/org_invites.rb +6 -0
- data/lib/losant_rest/orgs.rb +14 -0
- data/lib/losant_rest/solution.rb +18 -0
- data/lib/losant_rest/solution_user.rb +18 -0
- data/lib/losant_rest/solution_users.rb +12 -0
- data/lib/losant_rest/solutions.rb +12 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest/webhook.rb +18 -0
- data/lib/losant_rest/webhooks.rb +12 -0
- data/losant_rest.gemspec +3 -3
- data/schemas/{accessToken.json → apiToken.json} +31 -3
- data/schemas/{accessTokenPatch.json → apiTokenPatch.json} +4 -0
- data/schemas/applicationApiTokenPost.json +116 -0
- data/schemas/auditLog.json +3 -1
- data/schemas/auditLogFilter.json +3 -1
- data/schemas/auditLogs.json +3 -1
- data/schemas/event.json +4 -2
- data/schemas/events.json +4 -2
- metadata +17 -19
- data/.rbenv-version +0 -1
- data/docs/accessToken.md +0 -107
- data/docs/accessTokens.md +0 -68
- data/schemas/accessTokenPost.json +0 -32
- data/schemas/accessTokens.json +0 -65
- data/schemas/deviceState.json +0 -31
data/schemas/auditLog.json
CHANGED
@@ -42,6 +42,7 @@
|
|
42
42
|
"secondaryTargetType": {
|
43
43
|
"type": "string",
|
44
44
|
"enum": [
|
45
|
+
"ApiToken",
|
45
46
|
"ApplicationKey",
|
46
47
|
"Device",
|
47
48
|
"DeviceRecipe",
|
@@ -66,7 +67,8 @@
|
|
66
67
|
"Device",
|
67
68
|
"Flow",
|
68
69
|
"SolutionUser",
|
69
|
-
"User"
|
70
|
+
"User",
|
71
|
+
"ApiToken"
|
70
72
|
]
|
71
73
|
},
|
72
74
|
"actorName": {
|
data/schemas/auditLogFilter.json
CHANGED
data/schemas/auditLogs.json
CHANGED
@@ -49,6 +49,7 @@
|
|
49
49
|
"secondaryTargetType": {
|
50
50
|
"type": "string",
|
51
51
|
"enum": [
|
52
|
+
"ApiToken",
|
52
53
|
"ApplicationKey",
|
53
54
|
"Device",
|
54
55
|
"DeviceRecipe",
|
@@ -73,7 +74,8 @@
|
|
73
74
|
"Device",
|
74
75
|
"Flow",
|
75
76
|
"SolutionUser",
|
76
|
-
"User"
|
77
|
+
"User",
|
78
|
+
"ApiToken"
|
77
79
|
]
|
78
80
|
},
|
79
81
|
"actorName": {
|
data/schemas/event.json
CHANGED
data/schemas/events.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: losant_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Kuehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.14.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.14.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '12'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: webmock
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
61
|
+
version: '2.3'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
68
|
+
version: '2.3'
|
69
69
|
description: Easily use the Losant IoT Platform through its REST API with Ruby
|
70
70
|
email:
|
71
71
|
- hello@losant.com
|
@@ -74,16 +74,16 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gitignore"
|
77
|
-
- ".
|
77
|
+
- ".ruby-version"
|
78
78
|
- ".travis.yml"
|
79
79
|
- Gemfile
|
80
80
|
- LICENSE
|
81
81
|
- README.md
|
82
82
|
- Rakefile
|
83
83
|
- docs/_schemas.md
|
84
|
-
- docs/accessToken.md
|
85
|
-
- docs/accessTokens.md
|
86
84
|
- docs/application.md
|
85
|
+
- docs/applicationApiToken.md
|
86
|
+
- docs/applicationApiTokens.md
|
87
87
|
- docs/applicationKey.md
|
88
88
|
- docs/applicationKeys.md
|
89
89
|
- docs/applications.md
|
@@ -114,9 +114,9 @@ files:
|
|
114
114
|
- examples/auth.rb
|
115
115
|
- examples/list_devices.rb
|
116
116
|
- lib/losant_rest.rb
|
117
|
-
- lib/losant_rest/access_token.rb
|
118
|
-
- lib/losant_rest/access_tokens.rb
|
119
117
|
- lib/losant_rest/application.rb
|
118
|
+
- lib/losant_rest/application_api_token.rb
|
119
|
+
- lib/losant_rest/application_api_tokens.rb
|
120
120
|
- lib/losant_rest/application_key.rb
|
121
121
|
- lib/losant_rest/application_keys.rb
|
122
122
|
- lib/losant_rest/applications.rb
|
@@ -149,11 +149,10 @@ files:
|
|
149
149
|
- lib/losant_rest/webhook.rb
|
150
150
|
- lib/losant_rest/webhooks.rb
|
151
151
|
- losant_rest.gemspec
|
152
|
-
- schemas/
|
153
|
-
- schemas/
|
154
|
-
- schemas/accessTokenPost.json
|
155
|
-
- schemas/accessTokens.json
|
152
|
+
- schemas/apiToken.json
|
153
|
+
- schemas/apiTokenPatch.json
|
156
154
|
- schemas/application.json
|
155
|
+
- schemas/applicationApiTokenPost.json
|
157
156
|
- schemas/applicationKey.json
|
158
157
|
- schemas/applicationKeyPatch.json
|
159
158
|
- schemas/applicationKeyPost.json
|
@@ -185,7 +184,6 @@ files:
|
|
185
184
|
- schemas/deviceRecipePatch.json
|
186
185
|
- schemas/deviceRecipePost.json
|
187
186
|
- schemas/deviceRecipes.json
|
188
|
-
- schemas/deviceState.json
|
189
187
|
- schemas/deviceStateOrStates.json
|
190
188
|
- schemas/deviceStates.json
|
191
189
|
- schemas/deviceTagFilter.json
|
@@ -264,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
262
|
version: '0'
|
265
263
|
requirements: []
|
266
264
|
rubyforge_project:
|
267
|
-
rubygems_version: 2.6.
|
265
|
+
rubygems_version: 2.6.8
|
268
266
|
signing_key:
|
269
267
|
specification_version: 4
|
270
268
|
summary: Provides a simple ruby wrapper around the Losant REST API
|
data/.rbenv-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.3.1
|
data/docs/accessToken.md
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
# Access Token Actions
|
2
|
-
|
3
|
-
Details on the various actions that can be performed on the
|
4
|
-
Access Token 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 an accessToken
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
result = client.access_token.delete(accessTokenId: my_access_token_id)
|
21
|
-
|
22
|
-
puts result
|
23
|
-
```
|
24
|
-
|
25
|
-
#### Available Parameters
|
26
|
-
|
27
|
-
| Name | Type | Required | Description | Default | Example |
|
28
|
-
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
29
|
-
| accessTokenId | string | Y | ID associated with the accessToken | | 575ec7417ae143cd83dc4a95 |
|
30
|
-
|
31
|
-
#### Successful Responses
|
32
|
-
|
33
|
-
| Code | Type | Description |
|
34
|
-
| ---- | ---- | ----------- |
|
35
|
-
| 200 | [Success](_schemas.md#success) | If accessToken was successfully deleted |
|
36
|
-
|
37
|
-
#### Error Responses
|
38
|
-
|
39
|
-
| Code | Type | Description |
|
40
|
-
| ---- | ---- | ----------- |
|
41
|
-
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
42
|
-
| 404 | [Error](_schemas.md#error) | Error if accessToken was not found |
|
43
|
-
|
44
|
-
<br/>
|
45
|
-
|
46
|
-
## Get
|
47
|
-
|
48
|
-
Retrieves information on an accessToken
|
49
|
-
|
50
|
-
```ruby
|
51
|
-
result = client.access_token.get(accessTokenId: my_access_token_id)
|
52
|
-
|
53
|
-
puts result
|
54
|
-
```
|
55
|
-
|
56
|
-
#### Available Parameters
|
57
|
-
|
58
|
-
| Name | Type | Required | Description | Default | Example |
|
59
|
-
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
60
|
-
| accessTokenId | string | Y | ID associated with the accessToken | | 575ec7417ae143cd83dc4a95 |
|
61
|
-
|
62
|
-
#### Successful Responses
|
63
|
-
|
64
|
-
| Code | Type | Description |
|
65
|
-
| ---- | ---- | ----------- |
|
66
|
-
| 200 | [Access Token](_schemas.md#access-token) | Access token information |
|
67
|
-
|
68
|
-
#### Error Responses
|
69
|
-
|
70
|
-
| Code | Type | Description |
|
71
|
-
| ---- | ---- | ----------- |
|
72
|
-
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
73
|
-
| 404 | [Error](_schemas.md#error) | Error if accessToken was not found |
|
74
|
-
|
75
|
-
<br/>
|
76
|
-
|
77
|
-
## Patch
|
78
|
-
|
79
|
-
Updates information about an accessToken
|
80
|
-
|
81
|
-
```ruby
|
82
|
-
result = client.access_token.patch(
|
83
|
-
accessTokenId: my_access_token_id,
|
84
|
-
accessToken: my_access_token)
|
85
|
-
|
86
|
-
puts result
|
87
|
-
```
|
88
|
-
|
89
|
-
#### Available Parameters
|
90
|
-
|
91
|
-
| Name | Type | Required | Description | Default | Example |
|
92
|
-
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
93
|
-
| accessTokenId | string | Y | ID associated with the accessToken | | 575ec7417ae143cd83dc4a95 |
|
94
|
-
| accessToken | [Access Token Patch](_schemas.md#access-token-patch) | Y | Object containing new properties of the accessToken | | [Access Token Patch Example](_schemas.md#access-token-patch-example) |
|
95
|
-
|
96
|
-
#### Successful Responses
|
97
|
-
|
98
|
-
| Code | Type | Description |
|
99
|
-
| ---- | ---- | ----------- |
|
100
|
-
| 200 | [Access Token](_schemas.md#access-token) | Updated accessToken information |
|
101
|
-
|
102
|
-
#### Error Responses
|
103
|
-
|
104
|
-
| Code | Type | Description |
|
105
|
-
| ---- | ---- | ----------- |
|
106
|
-
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
107
|
-
| 404 | [Error](_schemas.md#error) | Error if accessToken was not found |
|
data/docs/accessTokens.md
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
# Access Tokens Actions
|
2
|
-
|
3
|
-
Details on the various actions that can be performed on the
|
4
|
-
Access Tokens 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 the accessTokens for a user
|
17
|
-
|
18
|
-
```ruby
|
19
|
-
result = client.access_tokens.get(optional_params)
|
20
|
-
|
21
|
-
puts result
|
22
|
-
```
|
23
|
-
|
24
|
-
#### Available Parameters
|
25
|
-
|
26
|
-
No parameters needed for this call.
|
27
|
-
|
28
|
-
#### Successful Responses
|
29
|
-
|
30
|
-
| Code | Type | Description |
|
31
|
-
| ---- | ---- | ----------- |
|
32
|
-
| 200 | [Access Tokens](_schemas.md#access-tokens) | Collection of accessTokens |
|
33
|
-
|
34
|
-
#### Error Responses
|
35
|
-
|
36
|
-
| Code | Type | Description |
|
37
|
-
| ---- | ---- | ----------- |
|
38
|
-
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
39
|
-
|
40
|
-
<br/>
|
41
|
-
|
42
|
-
## Post
|
43
|
-
|
44
|
-
Create a new accessToken for a user
|
45
|
-
|
46
|
-
```ruby
|
47
|
-
result = client.access_tokens.post(accessToken: my_access_token)
|
48
|
-
|
49
|
-
puts result
|
50
|
-
```
|
51
|
-
|
52
|
-
#### Available Parameters
|
53
|
-
|
54
|
-
| Name | Type | Required | Description | Default | Example |
|
55
|
-
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
56
|
-
| accessToken | [Access Token Post](_schemas.md#access-token-post) | Y | AccessToken information | | [Access Token Post Example](_schemas.md#access-token-post-example) |
|
57
|
-
|
58
|
-
#### Successful Responses
|
59
|
-
|
60
|
-
| Code | Type | Description |
|
61
|
-
| ---- | ---- | ----------- |
|
62
|
-
| 201 | [Access Token](_schemas.md#access-token) | The successfully created accessToken |
|
63
|
-
|
64
|
-
#### Error Responses
|
65
|
-
|
66
|
-
| Code | Type | Description |
|
67
|
-
| ---- | ---- | ----------- |
|
68
|
-
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
@@ -1,32 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"type": "object",
|
4
|
-
"properties": {
|
5
|
-
"name": {
|
6
|
-
"type": "string",
|
7
|
-
"minLength": 1,
|
8
|
-
"maxLength": 255
|
9
|
-
},
|
10
|
-
"expirationDate": {
|
11
|
-
"type": "string",
|
12
|
-
"format": "date-time"
|
13
|
-
},
|
14
|
-
"scope": {
|
15
|
-
"type": "array",
|
16
|
-
"items": {
|
17
|
-
"type": "string"
|
18
|
-
}
|
19
|
-
},
|
20
|
-
"status": {
|
21
|
-
"type": "string",
|
22
|
-
"enum": [
|
23
|
-
"active",
|
24
|
-
"inactive"
|
25
|
-
]
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"additionalProperties": false,
|
29
|
-
"required": [
|
30
|
-
"name"
|
31
|
-
]
|
32
|
-
}
|
data/schemas/accessTokens.json
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"type": "object",
|
4
|
-
"properties": {
|
5
|
-
"items": {
|
6
|
-
"type": "array",
|
7
|
-
"items": {
|
8
|
-
"title": "Access Token",
|
9
|
-
"description": "Schema for a single Access Token",
|
10
|
-
"type": "object",
|
11
|
-
"properties": {
|
12
|
-
"id": {
|
13
|
-
"type": "string",
|
14
|
-
"pattern": "^[A-Fa-f\\d]{24}$"
|
15
|
-
},
|
16
|
-
"accessTokenId": {
|
17
|
-
"type": "string",
|
18
|
-
"pattern": "^[A-Fa-f\\d]{24}$"
|
19
|
-
},
|
20
|
-
"userId": {
|
21
|
-
"type": "string",
|
22
|
-
"pattern": "^[A-Fa-f\\d]{24}$"
|
23
|
-
},
|
24
|
-
"name": {
|
25
|
-
"type": "string",
|
26
|
-
"minLength": 1,
|
27
|
-
"maxLength": 255
|
28
|
-
},
|
29
|
-
"creationDate": {
|
30
|
-
"type": "string",
|
31
|
-
"format": "date-time"
|
32
|
-
},
|
33
|
-
"lastUpdated": {
|
34
|
-
"type": "string",
|
35
|
-
"format": "date-time"
|
36
|
-
},
|
37
|
-
"expirationDate": {
|
38
|
-
"type": "string",
|
39
|
-
"format": "date-time"
|
40
|
-
},
|
41
|
-
"scope": {
|
42
|
-
"type": "array",
|
43
|
-
"items": {
|
44
|
-
"type": "string"
|
45
|
-
}
|
46
|
-
},
|
47
|
-
"status": {
|
48
|
-
"type": "string",
|
49
|
-
"enum": [
|
50
|
-
"active",
|
51
|
-
"inactive"
|
52
|
-
]
|
53
|
-
},
|
54
|
-
"token": {
|
55
|
-
"type": "string",
|
56
|
-
"minLength": 1
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
60
|
-
},
|
61
|
-
"count": {
|
62
|
-
"type": "integer"
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|