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.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rbenv-version +1 -0
  4. data/.travis.yml +5 -0
  5. data/Gemfile +2 -0
  6. data/LICENSE +21 -0
  7. data/README.md +237 -0
  8. data/Rakefile +12 -0
  9. data/docs/_schemas.md +6348 -0
  10. data/docs/accessToken.md +107 -0
  11. data/docs/accessTokens.md +68 -0
  12. data/docs/application.md +107 -0
  13. data/docs/applicationKey.md +115 -0
  14. data/docs/applicationKeys.md +81 -0
  15. data/docs/applications.md +76 -0
  16. data/docs/auth.md +104 -0
  17. data/docs/dashboard.md +107 -0
  18. data/docs/dashboards.md +76 -0
  19. data/docs/data.md +78 -0
  20. data/docs/device.md +300 -0
  21. data/docs/deviceRecipe.md +152 -0
  22. data/docs/deviceRecipes.md +81 -0
  23. data/docs/devices.md +117 -0
  24. data/docs/event.md +115 -0
  25. data/docs/events.md +153 -0
  26. data/docs/flow.md +261 -0
  27. data/docs/flows.md +81 -0
  28. data/docs/me.md +312 -0
  29. data/docs/org.md +279 -0
  30. data/docs/orgs.md +75 -0
  31. data/docs/webhook.md +115 -0
  32. data/docs/webhooks.md +81 -0
  33. data/examples/auth.rb +32 -0
  34. data/examples/list_devices.rb +45 -0
  35. data/lib/losant_rest/access_token.rb +122 -0
  36. data/lib/losant_rest/access_tokens.rb +80 -0
  37. data/lib/losant_rest/application.rb +122 -0
  38. data/lib/losant_rest/application_key.rb +128 -0
  39. data/lib/losant_rest/application_keys.rb +98 -0
  40. data/lib/losant_rest/applications.rb +94 -0
  41. data/lib/losant_rest/auth.rb +122 -0
  42. data/lib/losant_rest/client.rb +132 -0
  43. data/lib/losant_rest/dashboard.rb +122 -0
  44. data/lib/losant_rest/dashboards.rb +94 -0
  45. data/lib/losant_rest/data.rb +89 -0
  46. data/lib/losant_rest/device.rb +336 -0
  47. data/lib/losant_rest/device_recipe.rb +169 -0
  48. data/lib/losant_rest/device_recipes.rb +98 -0
  49. data/lib/losant_rest/devices.rb +139 -0
  50. data/lib/losant_rest/error.rb +12 -0
  51. data/lib/losant_rest/event.rb +128 -0
  52. data/lib/losant_rest/events.rb +183 -0
  53. data/lib/losant_rest/flow.rb +290 -0
  54. data/lib/losant_rest/flows.rb +98 -0
  55. data/lib/losant_rest/me.rb +362 -0
  56. data/lib/losant_rest/org.rb +314 -0
  57. data/lib/losant_rest/orgs.rb +92 -0
  58. data/lib/losant_rest/utils.rb +22 -0
  59. data/lib/losant_rest/version.rb +3 -0
  60. data/lib/losant_rest/webhook.rb +128 -0
  61. data/lib/losant_rest/webhooks.rb +98 -0
  62. data/lib/losant_rest.rb +43 -0
  63. data/losant_rest.gemspec +25 -0
  64. data/schemas/accessToken.json +52 -0
  65. data/schemas/accessTokenPatch.json +19 -0
  66. data/schemas/accessTokenPost.json +32 -0
  67. data/schemas/accessTokens.json +65 -0
  68. data/schemas/application.json +65 -0
  69. data/schemas/applicationKey.json +68 -0
  70. data/schemas/applicationKeyPatch.json +18 -0
  71. data/schemas/applicationKeyPost.json +36 -0
  72. data/schemas/applicationKeys.json +110 -0
  73. data/schemas/applicationPatch.json +16 -0
  74. data/schemas/applicationPost.json +23 -0
  75. data/schemas/applications.json +103 -0
  76. data/schemas/authedDevice.json +34 -0
  77. data/schemas/authedUser.json +18 -0
  78. data/schemas/dashboard.json +95 -0
  79. data/schemas/dashboardPatch.json +69 -0
  80. data/schemas/dashboardPost.json +76 -0
  81. data/schemas/dashboards.json +133 -0
  82. data/schemas/device.json +113 -0
  83. data/schemas/deviceCommand.json +20 -0
  84. data/schemas/deviceCommands.json +25 -0
  85. data/schemas/deviceCredentials.json +22 -0
  86. data/schemas/deviceLog.json +28 -0
  87. data/schemas/devicePatch.json +78 -0
  88. data/schemas/devicePost.json +81 -0
  89. data/schemas/deviceRecipe.json +106 -0
  90. data/schemas/deviceRecipeBulkCreate.json +15 -0
  91. data/schemas/deviceRecipeBulkCreatePost.json +19 -0
  92. data/schemas/deviceRecipePatch.json +87 -0
  93. data/schemas/deviceRecipePost.json +90 -0
  94. data/schemas/deviceRecipes.json +148 -0
  95. data/schemas/deviceState.json +30 -0
  96. data/schemas/deviceStates.json +35 -0
  97. data/schemas/deviceTagFilter.json +19 -0
  98. data/schemas/devices.json +155 -0
  99. data/schemas/disableTwoFactorAuth.json +20 -0
  100. data/schemas/enableTwoFactorAuth.json +21 -0
  101. data/schemas/error.json +12 -0
  102. data/schemas/event.json +115 -0
  103. data/schemas/eventPatch.json +20 -0
  104. data/schemas/eventPost.json +39 -0
  105. data/schemas/events.json +165 -0
  106. data/schemas/flow.json +137 -0
  107. data/schemas/flowLog.json +46 -0
  108. data/schemas/flowPatch.json +107 -0
  109. data/schemas/flowPost.json +110 -0
  110. data/schemas/flowStorageEntries.json +7 -0
  111. data/schemas/flowStorageEntry.json +16 -0
  112. data/schemas/flows.json +179 -0
  113. data/schemas/githubLogin.json +14 -0
  114. data/schemas/lastValueData.json +34 -0
  115. data/schemas/lastValueQuery.json +36 -0
  116. data/schemas/me.json +173 -0
  117. data/schemas/mePatch.json +43 -0
  118. data/schemas/multiDeviceCommand.json +45 -0
  119. data/schemas/org.json +81 -0
  120. data/schemas/orgInvitePost.json +24 -0
  121. data/schemas/orgInvites.json +36 -0
  122. data/schemas/orgMemberPatch.json +23 -0
  123. data/schemas/orgPatch.json +16 -0
  124. data/schemas/orgPost.json +19 -0
  125. data/schemas/orgs.json +119 -0
  126. data/schemas/recentItem.json +27 -0
  127. data/schemas/recentItemList.json +36 -0
  128. data/schemas/success.json +12 -0
  129. data/schemas/timeSeriesData.json +89 -0
  130. data/schemas/timeSeriesQuery.json +64 -0
  131. data/schemas/userCredentials.json +25 -0
  132. data/schemas/virtualButtonPress.json +14 -0
  133. data/schemas/webhook.json +52 -0
  134. data/schemas/webhookPatch.json +29 -0
  135. data/schemas/webhookPost.json +32 -0
  136. data/schemas/webhooks.json +94 -0
  137. data/test/basic_test.rb +67 -0
  138. data/test/test_helper.rb +14 -0
  139. metadata +239 -0
data/docs/dashboard.md ADDED
@@ -0,0 +1,107 @@
1
+ # Dashboard Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ 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.dashboard.delete(dashboardId: my_dashboard_id)
21
+
22
+ puts result
23
+ ```
24
+
25
+ #### Available Parameters
26
+
27
+ | Name | Type | Required | Description | Default | Example |
28
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
29
+ | dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
30
+
31
+ #### Successful Responses
32
+
33
+ | Code | Type | Description |
34
+ | ---- | ---- | ----------- |
35
+ | 200 | [Success](_schemas.md#success) | If dashboard 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 dashboard was not found |
43
+
44
+ <br/>
45
+
46
+ ## Get
47
+
48
+ Retrieves information on a dashboard
49
+
50
+ ```ruby
51
+ result = client.dashboard.get(dashboardId: my_dashboard_id)
52
+
53
+ puts result
54
+ ```
55
+
56
+ #### Available Parameters
57
+
58
+ | Name | Type | Required | Description | Default | Example |
59
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
60
+ | dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
61
+
62
+ #### Successful Responses
63
+
64
+ | Code | Type | Description |
65
+ | ---- | ---- | ----------- |
66
+ | 200 | [Dashboard](_schemas.md#dashboard) | Dashboard 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 dashboard was not found |
74
+
75
+ <br/>
76
+
77
+ ## Patch
78
+
79
+ Updates information about a dashboard
80
+
81
+ ```ruby
82
+ result = client.dashboard.patch(
83
+ dashboardId: my_dashboard_id,
84
+ dashboard: my_dashboard)
85
+
86
+ puts result
87
+ ```
88
+
89
+ #### Available Parameters
90
+
91
+ | Name | Type | Required | Description | Default | Example |
92
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
93
+ | dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
94
+ | dashboard | [Dashboard Patch](_schemas.md#dashboard-patch) | Y | Object containing new dashboard properties | | [Dashboard Patch Example](_schemas.md#dashboard-patch-example) |
95
+
96
+ #### Successful Responses
97
+
98
+ | Code | Type | Description |
99
+ | ---- | ---- | ----------- |
100
+ | 200 | [Dashboard](_schemas.md#dashboard) | Update dashboard 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 dashboard was not found |
@@ -0,0 +1,76 @@
1
+ # Dashboards Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ 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 the dashboards the current user has permission to see
17
+
18
+ ```ruby
19
+ result = client.dashboards.get(optional_params)
20
+
21
+ puts result
22
+ ```
23
+
24
+ #### Available Parameters
25
+
26
+ | Name | Type | Required | Description | Default | Example |
27
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
28
+ | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, ownerId | name | name |
29
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
30
+ | page | string | N | Which page of results to return | 0 | 0 |
31
+ | perPage | string | N | How many items to return per page | 1000 | 10 |
32
+ | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
33
+ | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * dashboard |
34
+ | orgId | string | N | If not provided, return all dashboards. If provided but blank, only return dashboards belonging to the current user. If provided and an id, only return dashboards belonging to the given organization id. | | 575ece7e7ae143cd83dc4a9c |
35
+
36
+ #### Successful Responses
37
+
38
+ | Code | Type | Description |
39
+ | ---- | ---- | ----------- |
40
+ | 200 | [Dashboards](_schemas.md#dashboards) | Collection of dashboards |
41
+
42
+ #### Error Responses
43
+
44
+ | Code | Type | Description |
45
+ | ---- | ---- | ----------- |
46
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
47
+
48
+ <br/>
49
+
50
+ ## Post
51
+
52
+ Create a new dasboard
53
+
54
+ ```ruby
55
+ result = client.dashboards.post(dashboard: my_dashboard)
56
+
57
+ puts result
58
+ ```
59
+
60
+ #### Available Parameters
61
+
62
+ | Name | Type | Required | Description | Default | Example |
63
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
64
+ | dashboard | [Dashboard Post](_schemas.md#dashboard-post) | Y | New dashboard information | | [Dashboard Post Example](_schemas.md#dashboard-post-example) |
65
+
66
+ #### Successful Responses
67
+
68
+ | Code | Type | Description |
69
+ | ---- | ---- | ----------- |
70
+ | 201 | [Dashboard](_schemas.md#dashboard) | Successfully created dashboard |
71
+
72
+ #### Error Responses
73
+
74
+ | Code | Type | Description |
75
+ | ---- | ---- | ----------- |
76
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
data/docs/data.md ADDED
@@ -0,0 +1,78 @@
1
+ # Data Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Data resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Last Value Query](#last-value-query)
10
+ * [Time Series Query](#time-series-query)
11
+
12
+ <br/>
13
+
14
+ ## Last Value Query
15
+
16
+ Returns the last known data for the given attribute
17
+
18
+ ```ruby
19
+ result = client.data.last_value_query(
20
+ applicationId: my_application_id,
21
+ query: my_query)
22
+
23
+ puts result
24
+ ```
25
+
26
+ #### Available Parameters
27
+
28
+ | Name | Type | Required | Description | Default | Example |
29
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
30
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
31
+ | query | [Last Value Query](_schemas.md#last-value-query) | Y | The query parameters | | [Last Value Query Example](_schemas.md#last-value-query-example) |
32
+
33
+ #### Successful Responses
34
+
35
+ | Code | Type | Description |
36
+ | ---- | ---- | ----------- |
37
+ | 200 | [Last Value Data](_schemas.md#last-value-data) | Last known data for the requested attribute |
38
+
39
+ #### Error Responses
40
+
41
+ | Code | Type | Description |
42
+ | ---- | ---- | ----------- |
43
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
44
+ | 404 | [Error](_schemas.md#error) | Error if application was not found |
45
+
46
+ <br/>
47
+
48
+ ## Time Series Query
49
+
50
+ Returns the data for the given query
51
+
52
+ ```ruby
53
+ result = client.data.time_series_query(
54
+ applicationId: my_application_id,
55
+ query: my_query)
56
+
57
+ puts result
58
+ ```
59
+
60
+ #### Available Parameters
61
+
62
+ | Name | Type | Required | Description | Default | Example |
63
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
64
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
65
+ | query | [Time Series Query](_schemas.md#time-series-query) | Y | The query parameters | | [Time Series Query Example](_schemas.md#time-series-query-example) |
66
+
67
+ #### Successful Responses
68
+
69
+ | Code | Type | Description |
70
+ | ---- | ---- | ----------- |
71
+ | 200 | [Time Series Data](_schemas.md#time-series-data) | Data for requested time range |
72
+
73
+ #### Error Responses
74
+
75
+ | Code | Type | Description |
76
+ | ---- | ---- | ----------- |
77
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
78
+ | 404 | [Error](_schemas.md#error) | Error if application was not found |
data/docs/device.md ADDED
@@ -0,0 +1,300 @@
1
+ # Device Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Device resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Delete](#delete)
10
+ * [Get](#get)
11
+ * [Get Command](#get-command)
12
+ * [Get Log Entries](#get-log-entries)
13
+ * [Get State](#get-state)
14
+ * [Patch](#patch)
15
+ * [Send Command](#send-command)
16
+ * [Send State](#send-state)
17
+
18
+ <br/>
19
+
20
+ ## Delete
21
+
22
+ Deletes a device
23
+
24
+ ```ruby
25
+ result = client.device.delete(
26
+ applicationId: my_application_id,
27
+ deviceId: my_device_id)
28
+
29
+ puts result
30
+ ```
31
+
32
+ #### Available Parameters
33
+
34
+ | Name | Type | Required | Description | Default | Example |
35
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
36
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
37
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
38
+
39
+ #### Successful Responses
40
+
41
+ | Code | Type | Description |
42
+ | ---- | ---- | ----------- |
43
+ | 200 | [Success](_schemas.md#success) | If device was successfully deleted |
44
+
45
+ #### Error Responses
46
+
47
+ | Code | Type | Description |
48
+ | ---- | ---- | ----------- |
49
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
50
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
51
+
52
+ <br/>
53
+
54
+ ## Get
55
+
56
+ Retrieves information on a device
57
+
58
+ ```ruby
59
+ result = client.device.get(
60
+ applicationId: my_application_id,
61
+ deviceId: my_device_id)
62
+
63
+ puts result
64
+ ```
65
+
66
+ #### Available Parameters
67
+
68
+ | Name | Type | Required | Description | Default | Example |
69
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
70
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
71
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
72
+
73
+ #### Successful Responses
74
+
75
+ | Code | Type | Description |
76
+ | ---- | ---- | ----------- |
77
+ | 200 | [Device](_schemas.md#device) | Device information |
78
+
79
+ #### Error Responses
80
+
81
+ | Code | Type | Description |
82
+ | ---- | ---- | ----------- |
83
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
84
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
85
+
86
+ <br/>
87
+
88
+ ## Get Command
89
+
90
+ Retrieve the last known commands(s) sent to the device
91
+
92
+ ```ruby
93
+ result = client.device.get_command(
94
+ applicationId: my_application_id,
95
+ deviceId: my_device_id)
96
+
97
+ puts result
98
+ ```
99
+
100
+ #### Available Parameters
101
+
102
+ | Name | Type | Required | Description | Default | Example |
103
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
104
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
105
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
106
+ | limit | string | N | Max command entries to return (ordered by time descending) | 1 | 10 |
107
+ | since | string | N | Look for command entries since this time (ms since epoch) | 0 | 1465790400000 |
108
+
109
+ #### Successful Responses
110
+
111
+ | Code | Type | Description |
112
+ | ---- | ---- | ----------- |
113
+ | 200 | [Device Commands](_schemas.md#device-commands) | Recent device commands |
114
+
115
+ #### Error Responses
116
+
117
+ | Code | Type | Description |
118
+ | ---- | ---- | ----------- |
119
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
120
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
121
+
122
+ <br/>
123
+
124
+ ## Get Log Entries
125
+
126
+ Retrieve the recent log entries about the device
127
+
128
+ ```ruby
129
+ result = client.device.get_log_entries(
130
+ applicationId: my_application_id,
131
+ deviceId: my_device_id)
132
+
133
+ puts result
134
+ ```
135
+
136
+ #### Available Parameters
137
+
138
+ | Name | Type | Required | Description | Default | Example |
139
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
140
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
141
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
142
+ | limit | string | N | Max log entries to return (ordered by time descending) | 1 | 10 |
143
+ | since | string | N | Look for log entries since this time (ms since epoch) | 0 | 1465790400000 |
144
+
145
+ #### Successful Responses
146
+
147
+ | Code | Type | Description |
148
+ | ---- | ---- | ----------- |
149
+ | 200 | [Device Log](_schemas.md#device-log) | Recent log entries |
150
+
151
+ #### Error Responses
152
+
153
+ | Code | Type | Description |
154
+ | ---- | ---- | ----------- |
155
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
156
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
157
+
158
+ <br/>
159
+
160
+ ## Get State
161
+
162
+ Retrieve the last known state(s) of the device
163
+
164
+ ```ruby
165
+ result = client.device.get_state(
166
+ applicationId: my_application_id,
167
+ deviceId: my_device_id)
168
+
169
+ puts result
170
+ ```
171
+
172
+ #### Available Parameters
173
+
174
+ | Name | Type | Required | Description | Default | Example |
175
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
176
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
177
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
178
+ | limit | string | N | Max state entries to return (ordered by time descending) | 1 | 10 |
179
+ | since | string | N | Look for state entries since this time (ms since epoch) | 0 | 1465790400000 |
180
+
181
+ #### Successful Responses
182
+
183
+ | Code | Type | Description |
184
+ | ---- | ---- | ----------- |
185
+ | 200 | [Device States](_schemas.md#device-states) | Recent device states |
186
+
187
+ #### Error Responses
188
+
189
+ | Code | Type | Description |
190
+ | ---- | ---- | ----------- |
191
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
192
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
193
+
194
+ <br/>
195
+
196
+ ## Patch
197
+
198
+ Updates information about a device
199
+
200
+ ```ruby
201
+ result = client.device.patch(
202
+ applicationId: my_application_id,
203
+ deviceId: my_device_id,
204
+ device: my_device)
205
+
206
+ puts result
207
+ ```
208
+
209
+ #### Available Parameters
210
+
211
+ | Name | Type | Required | Description | Default | Example |
212
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
213
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
214
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
215
+ | device | [Device Patch](_schemas.md#device-patch) | Y | Object containing new properties of the device | | [Device Patch Example](_schemas.md#device-patch-example) |
216
+
217
+ #### Successful Responses
218
+
219
+ | Code | Type | Description |
220
+ | ---- | ---- | ----------- |
221
+ | 200 | [Device](_schemas.md#device) | Updated device information |
222
+
223
+ #### Error Responses
224
+
225
+ | Code | Type | Description |
226
+ | ---- | ---- | ----------- |
227
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
228
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
229
+
230
+ <br/>
231
+
232
+ ## Send Command
233
+
234
+ Send a command to a device
235
+
236
+ ```ruby
237
+ result = client.device.send_command(
238
+ applicationId: my_application_id,
239
+ deviceId: my_device_id,
240
+ deviceCommand: my_device_command)
241
+
242
+ puts result
243
+ ```
244
+
245
+ #### Available Parameters
246
+
247
+ | Name | Type | Required | Description | Default | Example |
248
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
249
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
250
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
251
+ | deviceCommand | [Device Command](_schemas.md#device-command) | Y | Command to send to the device | | [Device Command Example](_schemas.md#device-command-example) |
252
+
253
+ #### Successful Responses
254
+
255
+ | Code | Type | Description |
256
+ | ---- | ---- | ----------- |
257
+ | 200 | [Success](_schemas.md#success) | If command was successfully sent |
258
+
259
+ #### Error Responses
260
+
261
+ | Code | Type | Description |
262
+ | ---- | ---- | ----------- |
263
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
264
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
265
+
266
+ <br/>
267
+
268
+ ## Send State
269
+
270
+ Send the current state of the device
271
+
272
+ ```ruby
273
+ result = client.device.send_state(
274
+ applicationId: my_application_id,
275
+ deviceId: my_device_id,
276
+ deviceState: my_device_state)
277
+
278
+ puts result
279
+ ```
280
+
281
+ #### Available Parameters
282
+
283
+ | Name | Type | Required | Description | Default | Example |
284
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
285
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
286
+ | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
287
+ | deviceState | [Device State](_schemas.md#device-state) | Y | Object containing the current state of the device | | [Device State Example](_schemas.md#device-state-example) |
288
+
289
+ #### Successful Responses
290
+
291
+ | Code | Type | Description |
292
+ | ---- | ---- | ----------- |
293
+ | 200 | [Success](_schemas.md#success) | If state was successfully received |
294
+
295
+ #### Error Responses
296
+
297
+ | Code | Type | Description |
298
+ | ---- | ---- | ----------- |
299
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
300
+ | 404 | [Error](_schemas.md#error) | Error if device was not found |
@@ -0,0 +1,152 @@
1
+ # Device Recipe Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Device Recipe resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Bulk Create](#bulk-create)
10
+ * [Delete](#delete)
11
+ * [Get](#get)
12
+ * [Patch](#patch)
13
+
14
+ <br/>
15
+
16
+ ## Bulk Create
17
+
18
+ Bulk creates devices using this recipe from a CSV
19
+
20
+ ```ruby
21
+ result = client.device_recipe.bulk_create(
22
+ applicationId: my_application_id,
23
+ deviceRecipeId: my_device_recipe_id,
24
+ bulkInfo: my_bulk_info)
25
+
26
+ puts result
27
+ ```
28
+
29
+ #### Available Parameters
30
+
31
+ | Name | Type | Required | Description | Default | Example |
32
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
33
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
34
+ | deviceRecipeId | string | Y | ID associated with the device recipe | | 575ecec57ae143cd83dc4a9f |
35
+ | bulkInfo | [Device Recipe Bulk Create Post](_schemas.md#device-recipe-bulk-create-post) | Y | Object containing bulk creation info | | [Device Recipe Bulk Create Post Example](_schemas.md#device-recipe-bulk-create-post-example) |
36
+
37
+ #### Successful Responses
38
+
39
+ | Code | Type | Description |
40
+ | ---- | ---- | ----------- |
41
+ | 201 | [Device Recipe Bulk Create](_schemas.md#device-recipe-bulk-create) | If devices were sucessfully created |
42
+
43
+ #### Error Responses
44
+
45
+ | Code | Type | Description |
46
+ | ---- | ---- | ----------- |
47
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
48
+ | 404 | [Error](_schemas.md#error) | Error if device recipe was not found |
49
+
50
+ <br/>
51
+
52
+ ## Delete
53
+
54
+ Deletes a device recipe
55
+
56
+ ```ruby
57
+ result = client.device_recipe.delete(
58
+ applicationId: my_application_id,
59
+ deviceRecipeId: my_device_recipe_id)
60
+
61
+ puts result
62
+ ```
63
+
64
+ #### Available Parameters
65
+
66
+ | Name | Type | Required | Description | Default | Example |
67
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
68
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
69
+ | deviceRecipeId | string | Y | ID associated with the device recipe | | 575ecec57ae143cd83dc4a9f |
70
+
71
+ #### Successful Responses
72
+
73
+ | Code | Type | Description |
74
+ | ---- | ---- | ----------- |
75
+ | 200 | [Success](_schemas.md#success) | If device recipe was successfully deleted |
76
+
77
+ #### Error Responses
78
+
79
+ | Code | Type | Description |
80
+ | ---- | ---- | ----------- |
81
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
82
+ | 404 | [Error](_schemas.md#error) | Error if device recipe was not found |
83
+
84
+ <br/>
85
+
86
+ ## Get
87
+
88
+ Retrieves information on a device recipe
89
+
90
+ ```ruby
91
+ result = client.device_recipe.get(
92
+ applicationId: my_application_id,
93
+ deviceRecipeId: my_device_recipe_id)
94
+
95
+ puts result
96
+ ```
97
+
98
+ #### Available Parameters
99
+
100
+ | Name | Type | Required | Description | Default | Example |
101
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
102
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
103
+ | deviceRecipeId | string | Y | ID associated with the device recipe | | 575ecec57ae143cd83dc4a9f |
104
+
105
+ #### Successful Responses
106
+
107
+ | Code | Type | Description |
108
+ | ---- | ---- | ----------- |
109
+ | 200 | [Device Recipe](_schemas.md#device-recipe) | Device recipe information |
110
+
111
+ #### Error Responses
112
+
113
+ | Code | Type | Description |
114
+ | ---- | ---- | ----------- |
115
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
116
+ | 404 | [Error](_schemas.md#error) | Error if device recipe was not found |
117
+
118
+ <br/>
119
+
120
+ ## Patch
121
+
122
+ Updates information about a device recipe
123
+
124
+ ```ruby
125
+ result = client.device_recipe.patch(
126
+ applicationId: my_application_id,
127
+ deviceRecipeId: my_device_recipe_id,
128
+ deviceRecipe: my_device_recipe)
129
+
130
+ puts result
131
+ ```
132
+
133
+ #### Available Parameters
134
+
135
+ | Name | Type | Required | Description | Default | Example |
136
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
137
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
138
+ | deviceRecipeId | string | Y | ID associated with the device recipe | | 575ecec57ae143cd83dc4a9f |
139
+ | deviceRecipe | [Device Recipe Patch](_schemas.md#device-recipe-patch) | Y | Object containing new properties of the device recipe | | [Device Recipe Patch Example](_schemas.md#device-recipe-patch-example) |
140
+
141
+ #### Successful Responses
142
+
143
+ | Code | Type | Description |
144
+ | ---- | ---- | ----------- |
145
+ | 200 | [Device Recipe](_schemas.md#device-recipe) | Updated device recipe information |
146
+
147
+ #### Error Responses
148
+
149
+ | Code | Type | Description |
150
+ | ---- | ---- | ----------- |
151
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
152
+ | 404 | [Error](_schemas.md#error) | Error if device recipe was not found |