losant_rest 1.0.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 +7 -0
- data/.gitignore +23 -0
- data/.rbenv-version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +2 -0
- data/LICENSE +21 -0
- data/README.md +237 -0
- data/Rakefile +12 -0
- data/docs/_schemas.md +6348 -0
- data/docs/accessToken.md +107 -0
- data/docs/accessTokens.md +68 -0
- data/docs/application.md +107 -0
- data/docs/applicationKey.md +115 -0
- data/docs/applicationKeys.md +81 -0
- data/docs/applications.md +76 -0
- data/docs/auth.md +104 -0
- data/docs/dashboard.md +107 -0
- data/docs/dashboards.md +76 -0
- data/docs/data.md +78 -0
- data/docs/device.md +300 -0
- data/docs/deviceRecipe.md +152 -0
- data/docs/deviceRecipes.md +81 -0
- data/docs/devices.md +117 -0
- data/docs/event.md +115 -0
- data/docs/events.md +153 -0
- data/docs/flow.md +261 -0
- data/docs/flows.md +81 -0
- data/docs/me.md +312 -0
- data/docs/org.md +279 -0
- data/docs/orgs.md +75 -0
- data/docs/webhook.md +115 -0
- data/docs/webhooks.md +81 -0
- data/examples/auth.rb +32 -0
- data/examples/list_devices.rb +45 -0
- data/lib/losant_rest/access_token.rb +122 -0
- data/lib/losant_rest/access_tokens.rb +80 -0
- data/lib/losant_rest/application.rb +122 -0
- data/lib/losant_rest/application_key.rb +128 -0
- data/lib/losant_rest/application_keys.rb +98 -0
- data/lib/losant_rest/applications.rb +94 -0
- data/lib/losant_rest/auth.rb +122 -0
- data/lib/losant_rest/client.rb +132 -0
- data/lib/losant_rest/dashboard.rb +122 -0
- data/lib/losant_rest/dashboards.rb +94 -0
- data/lib/losant_rest/data.rb +89 -0
- data/lib/losant_rest/device.rb +336 -0
- data/lib/losant_rest/device_recipe.rb +169 -0
- data/lib/losant_rest/device_recipes.rb +98 -0
- data/lib/losant_rest/devices.rb +139 -0
- data/lib/losant_rest/error.rb +12 -0
- data/lib/losant_rest/event.rb +128 -0
- data/lib/losant_rest/events.rb +183 -0
- data/lib/losant_rest/flow.rb +290 -0
- data/lib/losant_rest/flows.rb +98 -0
- data/lib/losant_rest/me.rb +362 -0
- data/lib/losant_rest/org.rb +314 -0
- data/lib/losant_rest/orgs.rb +92 -0
- data/lib/losant_rest/utils.rb +22 -0
- data/lib/losant_rest/version.rb +3 -0
- data/lib/losant_rest/webhook.rb +128 -0
- data/lib/losant_rest/webhooks.rb +98 -0
- data/lib/losant_rest.rb +43 -0
- data/losant_rest.gemspec +25 -0
- data/schemas/accessToken.json +52 -0
- data/schemas/accessTokenPatch.json +19 -0
- data/schemas/accessTokenPost.json +32 -0
- data/schemas/accessTokens.json +65 -0
- data/schemas/application.json +65 -0
- data/schemas/applicationKey.json +68 -0
- data/schemas/applicationKeyPatch.json +18 -0
- data/schemas/applicationKeyPost.json +36 -0
- data/schemas/applicationKeys.json +110 -0
- data/schemas/applicationPatch.json +16 -0
- data/schemas/applicationPost.json +23 -0
- data/schemas/applications.json +103 -0
- data/schemas/authedDevice.json +34 -0
- data/schemas/authedUser.json +18 -0
- data/schemas/dashboard.json +95 -0
- data/schemas/dashboardPatch.json +69 -0
- data/schemas/dashboardPost.json +76 -0
- data/schemas/dashboards.json +133 -0
- data/schemas/device.json +113 -0
- data/schemas/deviceCommand.json +20 -0
- data/schemas/deviceCommands.json +25 -0
- data/schemas/deviceCredentials.json +22 -0
- data/schemas/deviceLog.json +28 -0
- data/schemas/devicePatch.json +78 -0
- data/schemas/devicePost.json +81 -0
- data/schemas/deviceRecipe.json +106 -0
- data/schemas/deviceRecipeBulkCreate.json +15 -0
- data/schemas/deviceRecipeBulkCreatePost.json +19 -0
- data/schemas/deviceRecipePatch.json +87 -0
- data/schemas/deviceRecipePost.json +90 -0
- data/schemas/deviceRecipes.json +148 -0
- data/schemas/deviceState.json +30 -0
- data/schemas/deviceStates.json +35 -0
- data/schemas/deviceTagFilter.json +19 -0
- data/schemas/devices.json +155 -0
- data/schemas/disableTwoFactorAuth.json +20 -0
- data/schemas/enableTwoFactorAuth.json +21 -0
- data/schemas/error.json +12 -0
- data/schemas/event.json +115 -0
- data/schemas/eventPatch.json +20 -0
- data/schemas/eventPost.json +39 -0
- data/schemas/events.json +165 -0
- data/schemas/flow.json +137 -0
- data/schemas/flowLog.json +46 -0
- data/schemas/flowPatch.json +107 -0
- data/schemas/flowPost.json +110 -0
- data/schemas/flowStorageEntries.json +7 -0
- data/schemas/flowStorageEntry.json +16 -0
- data/schemas/flows.json +179 -0
- data/schemas/githubLogin.json +14 -0
- data/schemas/lastValueData.json +34 -0
- data/schemas/lastValueQuery.json +36 -0
- data/schemas/me.json +173 -0
- data/schemas/mePatch.json +43 -0
- data/schemas/multiDeviceCommand.json +45 -0
- data/schemas/org.json +81 -0
- data/schemas/orgInvitePost.json +24 -0
- data/schemas/orgInvites.json +36 -0
- data/schemas/orgMemberPatch.json +23 -0
- data/schemas/orgPatch.json +16 -0
- data/schemas/orgPost.json +19 -0
- data/schemas/orgs.json +119 -0
- data/schemas/recentItem.json +27 -0
- data/schemas/recentItemList.json +36 -0
- data/schemas/success.json +12 -0
- data/schemas/timeSeriesData.json +89 -0
- data/schemas/timeSeriesQuery.json +64 -0
- data/schemas/userCredentials.json +25 -0
- data/schemas/virtualButtonPress.json +14 -0
- data/schemas/webhook.json +52 -0
- data/schemas/webhookPatch.json +29 -0
- data/schemas/webhookPost.json +32 -0
- data/schemas/webhooks.json +94 -0
- data/test/basic_test.rb +67 -0
- data/test/test_helper.rb +14 -0
- metadata +239 -0
data/docs/flow.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Flow Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Flow resource, including the expected
|
|
5
|
+
parameters and the potential responses.
|
|
6
|
+
|
|
7
|
+
##### Contents
|
|
8
|
+
|
|
9
|
+
* [Delete](#delete)
|
|
10
|
+
* [Get](#get)
|
|
11
|
+
* [Get Log Entries](#get-log-entries)
|
|
12
|
+
* [Get Storage Entries](#get-storage-entries)
|
|
13
|
+
* [Patch](#patch)
|
|
14
|
+
* [Press Virtual Button](#press-virtual-button)
|
|
15
|
+
* [Set Storage Entry](#set-storage-entry)
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
18
|
+
|
|
19
|
+
## Delete
|
|
20
|
+
|
|
21
|
+
Deletes a flow
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
result = client.flow.delete(
|
|
25
|
+
applicationId: my_application_id,
|
|
26
|
+
flowId: my_flow_id)
|
|
27
|
+
|
|
28
|
+
puts result
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Available Parameters
|
|
32
|
+
|
|
33
|
+
| Name | Type | Required | Description | Default | Example |
|
|
34
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
35
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
36
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
37
|
+
|
|
38
|
+
#### Successful Responses
|
|
39
|
+
|
|
40
|
+
| Code | Type | Description |
|
|
41
|
+
| ---- | ---- | ----------- |
|
|
42
|
+
| 200 | [Success](_schemas.md#success) | If flow was successfully deleted |
|
|
43
|
+
|
|
44
|
+
#### Error Responses
|
|
45
|
+
|
|
46
|
+
| Code | Type | Description |
|
|
47
|
+
| ---- | ---- | ----------- |
|
|
48
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
49
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
|
50
|
+
|
|
51
|
+
<br/>
|
|
52
|
+
|
|
53
|
+
## Get
|
|
54
|
+
|
|
55
|
+
Retrieves information on a flow
|
|
56
|
+
|
|
57
|
+
```ruby
|
|
58
|
+
result = client.flow.get(
|
|
59
|
+
applicationId: my_application_id,
|
|
60
|
+
flowId: my_flow_id)
|
|
61
|
+
|
|
62
|
+
puts result
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### Available Parameters
|
|
66
|
+
|
|
67
|
+
| Name | Type | Required | Description | Default | Example |
|
|
68
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
69
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
70
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
71
|
+
|
|
72
|
+
#### Successful Responses
|
|
73
|
+
|
|
74
|
+
| Code | Type | Description |
|
|
75
|
+
| ---- | ---- | ----------- |
|
|
76
|
+
| 200 | [Workflow](_schemas.md#workflow) | Flow information |
|
|
77
|
+
|
|
78
|
+
#### Error Responses
|
|
79
|
+
|
|
80
|
+
| Code | Type | Description |
|
|
81
|
+
| ---- | ---- | ----------- |
|
|
82
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
83
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
|
84
|
+
|
|
85
|
+
<br/>
|
|
86
|
+
|
|
87
|
+
## Get Log Entries
|
|
88
|
+
|
|
89
|
+
Retrieve the recent log entries about the flows
|
|
90
|
+
|
|
91
|
+
```ruby
|
|
92
|
+
result = client.flow.get_log_entries(
|
|
93
|
+
applicationId: my_application_id,
|
|
94
|
+
flowId: my_flow_id)
|
|
95
|
+
|
|
96
|
+
puts result
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### Available Parameters
|
|
100
|
+
|
|
101
|
+
| Name | Type | Required | Description | Default | Example |
|
|
102
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
103
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
104
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
105
|
+
| limit | string | N | Max log entries to return (ordered by time descending) | 1 | 10 |
|
|
106
|
+
| since | string | N | Look for log entries since this time (ms since epoch) | 0 | 1465790400000 |
|
|
107
|
+
|
|
108
|
+
#### Successful Responses
|
|
109
|
+
|
|
110
|
+
| Code | Type | Description |
|
|
111
|
+
| ---- | ---- | ----------- |
|
|
112
|
+
| 200 | [Workflow Log](_schemas.md#workflow-log) | Recent log entries |
|
|
113
|
+
|
|
114
|
+
#### Error Responses
|
|
115
|
+
|
|
116
|
+
| Code | Type | Description |
|
|
117
|
+
| ---- | ---- | ----------- |
|
|
118
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
119
|
+
| 404 | [Error](_schemas.md#error) | Error if device was not found |
|
|
120
|
+
|
|
121
|
+
<br/>
|
|
122
|
+
|
|
123
|
+
## Get Storage Entries
|
|
124
|
+
|
|
125
|
+
Gets the current values in persistent storage
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
result = client.flow.get_storage_entries(
|
|
129
|
+
applicationId: my_application_id,
|
|
130
|
+
flowId: my_flow_id)
|
|
131
|
+
|
|
132
|
+
puts result
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### Available Parameters
|
|
136
|
+
|
|
137
|
+
| Name | Type | Required | Description | Default | Example |
|
|
138
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
139
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
140
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
141
|
+
|
|
142
|
+
#### Successful Responses
|
|
143
|
+
|
|
144
|
+
| Code | Type | Description |
|
|
145
|
+
| ---- | ---- | ----------- |
|
|
146
|
+
| 200 | [Workflow Storage Entries](_schemas.md#workflow-storage-entries) | The stored values |
|
|
147
|
+
|
|
148
|
+
#### Error Responses
|
|
149
|
+
|
|
150
|
+
| Code | Type | Description |
|
|
151
|
+
| ---- | ---- | ----------- |
|
|
152
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
153
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
|
154
|
+
|
|
155
|
+
<br/>
|
|
156
|
+
|
|
157
|
+
## Patch
|
|
158
|
+
|
|
159
|
+
Updates information about a flow
|
|
160
|
+
|
|
161
|
+
```ruby
|
|
162
|
+
result = client.flow.patch(
|
|
163
|
+
applicationId: my_application_id,
|
|
164
|
+
flowId: my_flow_id,
|
|
165
|
+
flow: my_flow)
|
|
166
|
+
|
|
167
|
+
puts result
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Available Parameters
|
|
171
|
+
|
|
172
|
+
| Name | Type | Required | Description | Default | Example |
|
|
173
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
174
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
175
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
176
|
+
| flow | [Workflow Patch](_schemas.md#workflow-patch) | Y | Object containing new properties of the flow | | [Workflow Patch Example](_schemas.md#workflow-patch-example) |
|
|
177
|
+
|
|
178
|
+
#### Successful Responses
|
|
179
|
+
|
|
180
|
+
| Code | Type | Description |
|
|
181
|
+
| ---- | ---- | ----------- |
|
|
182
|
+
| 200 | [Workflow](_schemas.md#workflow) | Updated flow information |
|
|
183
|
+
|
|
184
|
+
#### Error Responses
|
|
185
|
+
|
|
186
|
+
| Code | Type | Description |
|
|
187
|
+
| ---- | ---- | ----------- |
|
|
188
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
189
|
+
| 404 | [Error](_schemas.md#error) | Error if flow is not found |
|
|
190
|
+
|
|
191
|
+
<br/>
|
|
192
|
+
|
|
193
|
+
## Press Virtual Button
|
|
194
|
+
|
|
195
|
+
Presses the specified virtual button on the flow
|
|
196
|
+
|
|
197
|
+
```ruby
|
|
198
|
+
result = client.flow.press_virtual_button(
|
|
199
|
+
applicationId: my_application_id,
|
|
200
|
+
flowId: my_flow_id,
|
|
201
|
+
button: my_button)
|
|
202
|
+
|
|
203
|
+
puts result
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### Available Parameters
|
|
207
|
+
|
|
208
|
+
| Name | Type | Required | Description | Default | Example |
|
|
209
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
210
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
211
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
212
|
+
| button | [Virtual Button Press](_schemas.md#virtual-button-press) | Y | Object containing button key and payload | | [Virtual Button Press Example](_schemas.md#virtual-button-press-example) |
|
|
213
|
+
|
|
214
|
+
#### Successful Responses
|
|
215
|
+
|
|
216
|
+
| Code | Type | Description |
|
|
217
|
+
| ---- | ---- | ----------- |
|
|
218
|
+
| 200 | [Success](_schemas.md#success) | Virtual button was pressed |
|
|
219
|
+
|
|
220
|
+
#### Error Responses
|
|
221
|
+
|
|
222
|
+
| Code | Type | Description |
|
|
223
|
+
| ---- | ---- | ----------- |
|
|
224
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
225
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
|
226
|
+
|
|
227
|
+
<br/>
|
|
228
|
+
|
|
229
|
+
## Set Storage Entry
|
|
230
|
+
|
|
231
|
+
Sets a storage value
|
|
232
|
+
|
|
233
|
+
```ruby
|
|
234
|
+
result = client.flow.set_storage_entry(
|
|
235
|
+
applicationId: my_application_id,
|
|
236
|
+
flowId: my_flow_id,
|
|
237
|
+
entry: my_entry)
|
|
238
|
+
|
|
239
|
+
puts result
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
#### Available Parameters
|
|
243
|
+
|
|
244
|
+
| Name | Type | Required | Description | Default | Example |
|
|
245
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
246
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
247
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
|
248
|
+
| entry | [Workflow Storage Entry](_schemas.md#workflow-storage-entry) | Y | Object containing storage entry | | [Workflow Storage Entry Example](_schemas.md#workflow-storage-entry-example) |
|
|
249
|
+
|
|
250
|
+
#### Successful Responses
|
|
251
|
+
|
|
252
|
+
| Code | Type | Description |
|
|
253
|
+
| ---- | ---- | ----------- |
|
|
254
|
+
| 200 | [Success](_schemas.md#success) | Value was successfully stored |
|
|
255
|
+
|
|
256
|
+
#### Error Responses
|
|
257
|
+
|
|
258
|
+
| Code | Type | Description |
|
|
259
|
+
| ---- | ---- | ----------- |
|
|
260
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
261
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
data/docs/flows.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Flows Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Flows 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 flows for an application
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
result = client.flows.get(applicationId: my_application_id)
|
|
20
|
+
|
|
21
|
+
puts result
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
#### Available Parameters
|
|
25
|
+
|
|
26
|
+
| Name | Type | Required | Description | Default | Example |
|
|
27
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
28
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
29
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate | name | name |
|
|
30
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
|
31
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
|
32
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
|
33
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
|
34
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*flow |
|
|
35
|
+
|
|
36
|
+
#### Successful Responses
|
|
37
|
+
|
|
38
|
+
| Code | Type | Description |
|
|
39
|
+
| ---- | ---- | ----------- |
|
|
40
|
+
| 200 | [Workflows](_schemas.md#workflows) | Collection of flows |
|
|
41
|
+
|
|
42
|
+
#### Error Responses
|
|
43
|
+
|
|
44
|
+
| Code | Type | Description |
|
|
45
|
+
| ---- | ---- | ----------- |
|
|
46
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
47
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
|
48
|
+
|
|
49
|
+
<br/>
|
|
50
|
+
|
|
51
|
+
## Post
|
|
52
|
+
|
|
53
|
+
Create a new flow for an application
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
result = client.flows.post(
|
|
57
|
+
applicationId: my_application_id,
|
|
58
|
+
flow: my_flow)
|
|
59
|
+
|
|
60
|
+
puts result
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Available Parameters
|
|
64
|
+
|
|
65
|
+
| Name | Type | Required | Description | Default | Example |
|
|
66
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
67
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
|
68
|
+
| flow | [Workflow Post](_schemas.md#workflow-post) | Y | New flow information | | [Workflow Post Example](_schemas.md#workflow-post-example) |
|
|
69
|
+
|
|
70
|
+
#### Successful Responses
|
|
71
|
+
|
|
72
|
+
| Code | Type | Description |
|
|
73
|
+
| ---- | ---- | ----------- |
|
|
74
|
+
| 201 | [Workflow](_schemas.md#workflow) | Successfully created flow |
|
|
75
|
+
|
|
76
|
+
#### Error Responses
|
|
77
|
+
|
|
78
|
+
| Code | Type | Description |
|
|
79
|
+
| ---- | ---- | ----------- |
|
|
80
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
81
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
data/docs/me.md
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Me Actions
|
|
2
|
+
|
|
3
|
+
Details on the various actions that can be performed on the
|
|
4
|
+
Me resource, including the expected
|
|
5
|
+
parameters and the potential responses.
|
|
6
|
+
|
|
7
|
+
##### Contents
|
|
8
|
+
|
|
9
|
+
* [Add Recent Item](#add-recent-item)
|
|
10
|
+
* [Delete](#delete)
|
|
11
|
+
* [Disable Two Factor Auth](#disable-two-factor-auth)
|
|
12
|
+
* [Disconnect Github](#disconnect-github)
|
|
13
|
+
* [Disconnect Twitter](#disconnect-twitter)
|
|
14
|
+
* [Enable Two Factor Auth](#enable-two-factor-auth)
|
|
15
|
+
* [Fetch Recent Items](#fetch-recent-items)
|
|
16
|
+
* [Get](#get)
|
|
17
|
+
* [Patch](#patch)
|
|
18
|
+
* [Verify Email](#verify-email)
|
|
19
|
+
|
|
20
|
+
<br/>
|
|
21
|
+
|
|
22
|
+
## Add Recent Item
|
|
23
|
+
|
|
24
|
+
Adds an item to a recent item list
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
result = client.me.add_recent_item(data: my_data)
|
|
28
|
+
|
|
29
|
+
puts result
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Available Parameters
|
|
33
|
+
|
|
34
|
+
| Name | Type | Required | Description | Default | Example |
|
|
35
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
36
|
+
| data | [Recent Item](_schemas.md#recent-item) | Y | Object containing recent item info | | [Recent Item Example](_schemas.md#recent-item-example) |
|
|
37
|
+
|
|
38
|
+
#### Successful Responses
|
|
39
|
+
|
|
40
|
+
| Code | Type | Description |
|
|
41
|
+
| ---- | ---- | ----------- |
|
|
42
|
+
| 200 | [Recent Item List](_schemas.md#recent-item-list) | Updated recent item list |
|
|
43
|
+
|
|
44
|
+
#### Error Responses
|
|
45
|
+
|
|
46
|
+
| Code | Type | Description |
|
|
47
|
+
| ---- | ---- | ----------- |
|
|
48
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
49
|
+
|
|
50
|
+
<br/>
|
|
51
|
+
|
|
52
|
+
## Delete
|
|
53
|
+
|
|
54
|
+
Deletes the current user
|
|
55
|
+
|
|
56
|
+
```ruby
|
|
57
|
+
result = client.me.delete(credentials: my_credentials)
|
|
58
|
+
|
|
59
|
+
puts result
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
#### Available Parameters
|
|
63
|
+
|
|
64
|
+
| Name | Type | Required | Description | Default | Example |
|
|
65
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
66
|
+
| credentials | [User Credentials](_schemas.md#user-credentials) | Y | User authentication credentials | | [User Credentials Example](_schemas.md#user-credentials-example) |
|
|
67
|
+
|
|
68
|
+
#### Successful Responses
|
|
69
|
+
|
|
70
|
+
| Code | Type | Description |
|
|
71
|
+
| ---- | ---- | ----------- |
|
|
72
|
+
| 200 | [Success](_schemas.md#success) | If the user was successfully deleted |
|
|
73
|
+
|
|
74
|
+
#### Error Responses
|
|
75
|
+
|
|
76
|
+
| Code | Type | Description |
|
|
77
|
+
| ---- | ---- | ----------- |
|
|
78
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
79
|
+
|
|
80
|
+
<br/>
|
|
81
|
+
|
|
82
|
+
## Disable Two Factor Auth
|
|
83
|
+
|
|
84
|
+
Disables two factor auth for the current user
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
result = client.me.disable_two_factor_auth(data: my_data)
|
|
88
|
+
|
|
89
|
+
puts result
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### Available Parameters
|
|
93
|
+
|
|
94
|
+
| Name | Type | Required | Description | Default | Example |
|
|
95
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
96
|
+
| data | [Disable Two Factor Auth](_schemas.md#disable-two-factor-auth) | Y | Object containing two factor auth properties | | [Disable Two Factor Auth Example](_schemas.md#disable-two-factor-auth-example) |
|
|
97
|
+
|
|
98
|
+
#### Successful Responses
|
|
99
|
+
|
|
100
|
+
| Code | Type | Description |
|
|
101
|
+
| ---- | ---- | ----------- |
|
|
102
|
+
| 200 | [Me](_schemas.md#me) | Updated user information |
|
|
103
|
+
|
|
104
|
+
#### Error Responses
|
|
105
|
+
|
|
106
|
+
| Code | Type | Description |
|
|
107
|
+
| ---- | ---- | ----------- |
|
|
108
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
109
|
+
|
|
110
|
+
<br/>
|
|
111
|
+
|
|
112
|
+
## Disconnect Github
|
|
113
|
+
|
|
114
|
+
Disconnects the user from Github
|
|
115
|
+
|
|
116
|
+
```ruby
|
|
117
|
+
result = client.me.disconnect_github
|
|
118
|
+
|
|
119
|
+
puts result
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### Available Parameters
|
|
123
|
+
|
|
124
|
+
No parameters needed for this call.
|
|
125
|
+
|
|
126
|
+
#### Successful Responses
|
|
127
|
+
|
|
128
|
+
| Code | Type | Description |
|
|
129
|
+
| ---- | ---- | ----------- |
|
|
130
|
+
| 200 | [Me](_schemas.md#me) | Updated user information |
|
|
131
|
+
|
|
132
|
+
#### Error Responses
|
|
133
|
+
|
|
134
|
+
| Code | Type | Description |
|
|
135
|
+
| ---- | ---- | ----------- |
|
|
136
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
137
|
+
|
|
138
|
+
<br/>
|
|
139
|
+
|
|
140
|
+
## Disconnect Twitter
|
|
141
|
+
|
|
142
|
+
Disconnects the user from Twitter
|
|
143
|
+
|
|
144
|
+
```ruby
|
|
145
|
+
result = client.me.disconnect_twitter
|
|
146
|
+
|
|
147
|
+
puts result
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Available Parameters
|
|
151
|
+
|
|
152
|
+
No parameters needed for this call.
|
|
153
|
+
|
|
154
|
+
#### Successful Responses
|
|
155
|
+
|
|
156
|
+
| Code | Type | Description |
|
|
157
|
+
| ---- | ---- | ----------- |
|
|
158
|
+
| 200 | [Me](_schemas.md#me) | Updated user information |
|
|
159
|
+
|
|
160
|
+
#### Error Responses
|
|
161
|
+
|
|
162
|
+
| Code | Type | Description |
|
|
163
|
+
| ---- | ---- | ----------- |
|
|
164
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
165
|
+
|
|
166
|
+
<br/>
|
|
167
|
+
|
|
168
|
+
## Enable Two Factor Auth
|
|
169
|
+
|
|
170
|
+
Enables two factor auth for the current user
|
|
171
|
+
|
|
172
|
+
```ruby
|
|
173
|
+
result = client.me.enable_two_factor_auth(data: my_data)
|
|
174
|
+
|
|
175
|
+
puts result
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Available Parameters
|
|
179
|
+
|
|
180
|
+
| Name | Type | Required | Description | Default | Example |
|
|
181
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
182
|
+
| data | [Enable Two Factor Auth](_schemas.md#enable-two-factor-auth) | Y | Object containing two factor auth properties | | [Enable Two Factor Auth Example](_schemas.md#enable-two-factor-auth-example) |
|
|
183
|
+
|
|
184
|
+
#### Successful Responses
|
|
185
|
+
|
|
186
|
+
| Code | Type | Description |
|
|
187
|
+
| ---- | ---- | ----------- |
|
|
188
|
+
| 200 | [Me](_schemas.md#me) | Updated user information |
|
|
189
|
+
|
|
190
|
+
#### Error Responses
|
|
191
|
+
|
|
192
|
+
| Code | Type | Description |
|
|
193
|
+
| ---- | ---- | ----------- |
|
|
194
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
195
|
+
|
|
196
|
+
<br/>
|
|
197
|
+
|
|
198
|
+
## Fetch Recent Items
|
|
199
|
+
|
|
200
|
+
Gets a recent item list
|
|
201
|
+
|
|
202
|
+
```ruby
|
|
203
|
+
result = client.me.fetch_recent_items(itemType: my_item_type)
|
|
204
|
+
|
|
205
|
+
puts result
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
#### Available Parameters
|
|
209
|
+
|
|
210
|
+
| Name | Type | Required | Description | Default | Example |
|
|
211
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
212
|
+
| parentId | string | N | Parent id of the recent list | | 575ec8687ae143cd83dc4a97 |
|
|
213
|
+
| itemType | undefined | Y | Item type to get the recent list of. Accepted values are: application, device, flow, dashboard | | application |
|
|
214
|
+
|
|
215
|
+
#### Successful Responses
|
|
216
|
+
|
|
217
|
+
| Code | Type | Description |
|
|
218
|
+
| ---- | ---- | ----------- |
|
|
219
|
+
| 200 | [Recent Item List](_schemas.md#recent-item-list) | Recent item list |
|
|
220
|
+
|
|
221
|
+
#### Error Responses
|
|
222
|
+
|
|
223
|
+
| Code | Type | Description |
|
|
224
|
+
| ---- | ---- | ----------- |
|
|
225
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
226
|
+
|
|
227
|
+
<br/>
|
|
228
|
+
|
|
229
|
+
## Get
|
|
230
|
+
|
|
231
|
+
Retrieves information on the current user
|
|
232
|
+
|
|
233
|
+
```ruby
|
|
234
|
+
result = client.me.get(optional_params)
|
|
235
|
+
|
|
236
|
+
puts result
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
#### Available Parameters
|
|
240
|
+
|
|
241
|
+
| Name | Type | Required | Description | Default | Example |
|
|
242
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
243
|
+
| includeRecent | undefined | N | Should the user include recent app/dashboard info | | true |
|
|
244
|
+
|
|
245
|
+
#### Successful Responses
|
|
246
|
+
|
|
247
|
+
| Code | Type | Description |
|
|
248
|
+
| ---- | ---- | ----------- |
|
|
249
|
+
| 200 | [Me](_schemas.md#me) | Current user information |
|
|
250
|
+
|
|
251
|
+
#### Error Responses
|
|
252
|
+
|
|
253
|
+
| Code | Type | Description |
|
|
254
|
+
| ---- | ---- | ----------- |
|
|
255
|
+
|
|
256
|
+
<br/>
|
|
257
|
+
|
|
258
|
+
## Patch
|
|
259
|
+
|
|
260
|
+
Updates information about the current user
|
|
261
|
+
|
|
262
|
+
```ruby
|
|
263
|
+
result = client.me.patch(user: my_user)
|
|
264
|
+
|
|
265
|
+
puts result
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
#### Available Parameters
|
|
269
|
+
|
|
270
|
+
| Name | Type | Required | Description | Default | Example |
|
|
271
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
|
272
|
+
| user | [Me Patch](_schemas.md#me-patch) | Y | Object containing new user properties | | [Me Patch Example](_schemas.md#me-patch-example) |
|
|
273
|
+
|
|
274
|
+
#### Successful Responses
|
|
275
|
+
|
|
276
|
+
| Code | Type | Description |
|
|
277
|
+
| ---- | ---- | ----------- |
|
|
278
|
+
| 200 | [Me](_schemas.md#me) | Updated user information |
|
|
279
|
+
|
|
280
|
+
#### Error Responses
|
|
281
|
+
|
|
282
|
+
| Code | Type | Description |
|
|
283
|
+
| ---- | ---- | ----------- |
|
|
284
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
|
285
|
+
|
|
286
|
+
<br/>
|
|
287
|
+
|
|
288
|
+
## Verify Email
|
|
289
|
+
|
|
290
|
+
Sends an email verification to the user
|
|
291
|
+
|
|
292
|
+
```ruby
|
|
293
|
+
result = client.me.verify_email
|
|
294
|
+
|
|
295
|
+
puts result
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Available Parameters
|
|
299
|
+
|
|
300
|
+
No parameters needed for this call.
|
|
301
|
+
|
|
302
|
+
#### Successful Responses
|
|
303
|
+
|
|
304
|
+
| Code | Type | Description |
|
|
305
|
+
| ---- | ---- | ----------- |
|
|
306
|
+
| 200 | [Success](_schemas.md#success) | If email verification was successfully sent |
|
|
307
|
+
|
|
308
|
+
#### Error Responses
|
|
309
|
+
|
|
310
|
+
| Code | Type | Description |
|
|
311
|
+
| ---- | ---- | ----------- |
|
|
312
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|