losant_rest 1.15.2 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
data/docs/application.md CHANGED
@@ -421,9 +421,7 @@ all.Application, all.Application.cli, all.Organization, all.User, all.User.cli,
421
421
  Add multiple resources to an application via a zip file
422
422
 
423
423
  ```ruby
424
- result = client.application.import(
425
- applicationId: my_application_id,
426
- importBundle: my_import_bundle)
424
+ result = client.application.import(applicationId: my_application_id)
427
425
 
428
426
  puts result
429
427
  ```
@@ -438,8 +436,9 @@ all.Application, all.Organization, all.User, application.*, or application.impor
438
436
  | Name | Type | Required | Description | Default | Example |
439
437
  | ---- | ---- | -------- | ----------- | ------- | ------- |
440
438
  | applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
441
- | importBundle | file | Y | The zip file containing all of the resources to import into the application | | undefined |
439
+ | importBundle | file | N | The zip file containing all of the resources to import into the application | | undefined |
442
440
  | email | string | N | Email address to notify the user when the job to import the application resources has completed or errored, defaults to the email address of the user making the request | | email@example.com |
441
+ | options | [Application Import Options](_schemas.md#application-import-options) | N | Additional import options | | [Application Import Options Example](_schemas.md#application-import-options-example) |
443
442
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
444
443
 
445
444
  #### Successful Responses
data/docs/applications.md CHANGED
@@ -61,7 +61,7 @@ all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read,
61
61
  Create a new application from an import bundle
62
62
 
63
63
  ```ruby
64
- result = client.applications.import(importBundle: my_import_bundle)
64
+ result = client.applications.import(optional_params)
65
65
 
66
66
  puts result
67
67
  ```
@@ -75,13 +75,14 @@ all.Organization, all.User, applications.*, or applications.import.
75
75
 
76
76
  | Name | Type | Required | Description | Default | Example |
77
77
  | ---- | ---- | -------- | ----------- | ------- | ------- |
78
- | importBundle | file | Y | The zip file containing the application to import and all of its resources | | undefined |
78
+ | importBundle | file | N | The zip file containing the application to import and all of its resources | | undefined |
79
79
  | ownerId | string | N | The owner id of the new application, defaults to the id of the user making the request | | 575ed6e87ae143cd83dc4aa8 |
80
80
  | ownerType | string | N | The type of the owner id. Accepted values are: user, organization | user | user |
81
81
  | includeDevices | string | N | If set, import devices from the import bundle | | true |
82
82
  | includeDataTableRows | string | N | If set, import data table rows from import bundle | | true |
83
83
  | includeFiles | string | N | If set, import files from import bundle | | true |
84
84
  | email | string | N | Email address to notify the user when the job to import the application has completed or errored, defaults to the email address of the user making the request | | email@example.com |
85
+ | options | [Application Import Options](_schemas.md#application-import-options) | N | Additional import options | | [Application Import Options Example](_schemas.md#application-import-options-example) |
85
86
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
86
87
 
87
88
  #### Successful Responses
data/docs/flows.md CHANGED
@@ -9,6 +9,7 @@ parameters and the potential responses.
9
9
  * [Get](#get)
10
10
  * [Get by Version](#get-by-version)
11
11
  * [Import](#import)
12
+ * [Palette](#palette)
12
13
  * [Post](#post)
13
14
 
14
15
  <br/>
@@ -151,6 +152,43 @@ all.Application, all.Organization, all.User, flows.*, or flows.import.
151
152
 
152
153
  <br/>
153
154
 
155
+ ## Palette
156
+
157
+ Gets additional nodes that should be available in the palette
158
+
159
+ ```ruby
160
+ result = client.flows.palette(applicationId: my_application_id)
161
+
162
+ puts result
163
+ ```
164
+
165
+ #### Authentication
166
+ The client must be configured with a valid api access token to call this
167
+ action. The token must include at least one of the following scopes:
168
+ all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flows.*, or flows.palette.
169
+
170
+ #### Available Parameters
171
+
172
+ | Name | Type | Required | Description | Default | Example |
173
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
174
+ | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
175
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
176
+
177
+ #### Successful Responses
178
+
179
+ | Code | Type | Description |
180
+ | ---- | ---- | ----------- |
181
+ | 200 | [Palette Response](_schemas.md#palette-response) | The additional nodes available in the palette |
182
+
183
+ #### Error Responses
184
+
185
+ | Code | Type | Description |
186
+ | ---- | ---- | ----------- |
187
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
188
+ | 404 | [Error](_schemas.md#error) | Error if application was not found |
189
+
190
+ <br/>
191
+
154
192
  ## Post
155
193
 
156
194
  Create a new flow for an application
@@ -0,0 +1,222 @@
1
+ # Instance Custom Node Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Instance Custom Node resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Delete](#delete)
10
+ * [Errors](#errors)
11
+ * [Get](#get)
12
+ * [Patch](#patch)
13
+ * [Stats](#stats)
14
+
15
+ <br/>
16
+
17
+ ## Delete
18
+
19
+ Deletes a Custom Node
20
+
21
+ ```ruby
22
+ result = client.instance_custom_node.delete(
23
+ instanceId: my_instance_id,
24
+ instanceCustomNodeId: my_instance_custom_node_id)
25
+
26
+ puts result
27
+ ```
28
+
29
+ #### Authentication
30
+ The client must be configured with a valid api access token to call this
31
+ action. The token must include at least one of the following scopes:
32
+ all.Instance, all.User, instanceCustomNode.*, or instanceCustomNode.delete.
33
+
34
+ #### Available Parameters
35
+
36
+ | Name | Type | Required | Description | Default | Example |
37
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
38
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
39
+ | instanceCustomNodeId | string | Y | ID associated with the Custom Node | | 575ec7417ae143cd83dc4a95 |
40
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
41
+
42
+ #### Successful Responses
43
+
44
+ | Code | Type | Description |
45
+ | ---- | ---- | ----------- |
46
+ | 200 | [Success](_schemas.md#success) | If Custom Node was successfully deleted |
47
+
48
+ #### Error Responses
49
+
50
+ | Code | Type | Description |
51
+ | ---- | ---- | ----------- |
52
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
53
+ | 404 | [Error](_schemas.md#error) | Error if Custom Node was not found |
54
+
55
+ <br/>
56
+
57
+ ## Errors
58
+
59
+ Get information about errors that occurred during runs of this Custom Node
60
+
61
+ ```ruby
62
+ result = client.instance_custom_node.errors(
63
+ instanceId: my_instance_id,
64
+ instanceCustomNodeId: my_instance_custom_node_id)
65
+
66
+ puts result
67
+ ```
68
+
69
+ #### Authentication
70
+ The client must be configured with a valid api access token to call this
71
+ action. The token must include at least one of the following scopes:
72
+ all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNode.*, or instanceCustomNode.errors.
73
+
74
+ #### Available Parameters
75
+
76
+ | Name | Type | Required | Description | Default | Example |
77
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
78
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
79
+ | instanceCustomNodeId | string | Y | ID associated with the Custom Node | | 575ec7417ae143cd83dc4a95 |
80
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
81
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
82
+ | limit | string | N | Maximum number of errors to return | 25 | 25 |
83
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | desc |
84
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
85
+
86
+ #### Successful Responses
87
+
88
+ | Code | Type | Description |
89
+ | ---- | ---- | ----------- |
90
+ | 200 | [Workflow Errors](_schemas.md#workflow-errors) | Custom Node error information |
91
+
92
+ #### Error Responses
93
+
94
+ | Code | Type | Description |
95
+ | ---- | ---- | ----------- |
96
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
97
+ | 404 | [Error](_schemas.md#error) | Error if Custom Node was not found |
98
+
99
+ <br/>
100
+
101
+ ## Get
102
+
103
+ Retrieves information on a Custom Node
104
+
105
+ ```ruby
106
+ result = client.instance_custom_node.get(
107
+ instanceId: my_instance_id,
108
+ instanceCustomNodeId: my_instance_custom_node_id)
109
+
110
+ puts result
111
+ ```
112
+
113
+ #### Authentication
114
+ The client must be configured with a valid api access token to call this
115
+ action. The token must include at least one of the following scopes:
116
+ all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNode.*, or instanceCustomNode.get.
117
+
118
+ #### Available Parameters
119
+
120
+ | Name | Type | Required | Description | Default | Example |
121
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
122
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
123
+ | instanceCustomNodeId | string | Y | ID associated with the Custom Node | | 575ec7417ae143cd83dc4a95 |
124
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
125
+
126
+ #### Successful Responses
127
+
128
+ | Code | Type | Description |
129
+ | ---- | ---- | ----------- |
130
+ | 200 | [Instance Custom Node](_schemas.md#instance-custom-node) | Custom Node information |
131
+
132
+ #### Error Responses
133
+
134
+ | Code | Type | Description |
135
+ | ---- | ---- | ----------- |
136
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
137
+ | 404 | [Error](_schemas.md#error) | Error if Custom Node was not found |
138
+
139
+ <br/>
140
+
141
+ ## Patch
142
+
143
+ Updates information about a Custom Node
144
+
145
+ ```ruby
146
+ result = client.instance_custom_node.patch(
147
+ instanceId: my_instance_id,
148
+ instanceCustomNodeId: my_instance_custom_node_id,
149
+ instanceCustomNode: my_instance_custom_node)
150
+
151
+ puts result
152
+ ```
153
+
154
+ #### Authentication
155
+ The client must be configured with a valid api access token to call this
156
+ action. The token must include at least one of the following scopes:
157
+ all.Instance, all.User, instanceCustomNode.*, or instanceCustomNode.patch.
158
+
159
+ #### Available Parameters
160
+
161
+ | Name | Type | Required | Description | Default | Example |
162
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
163
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
164
+ | instanceCustomNodeId | string | Y | ID associated with the Custom Node | | 575ec7417ae143cd83dc4a95 |
165
+ | instanceCustomNode | [Instance Custom Node Patch](_schemas.md#instance-custom-node-patch) | Y | Object containing new properties of the Custom Node | | [Instance Custom Node Patch Example](_schemas.md#instance-custom-node-patch-example) |
166
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
167
+
168
+ #### Successful Responses
169
+
170
+ | Code | Type | Description |
171
+ | ---- | ---- | ----------- |
172
+ | 200 | [Instance Custom Node](_schemas.md#instance-custom-node) | Updated Custom Node information |
173
+
174
+ #### Error Responses
175
+
176
+ | Code | Type | Description |
177
+ | ---- | ---- | ----------- |
178
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
179
+ | 404 | [Error](_schemas.md#error) | Error if Custom Node was not found |
180
+
181
+ <br/>
182
+
183
+ ## Stats
184
+
185
+ Get statistics about runs for this Custom Node
186
+
187
+ ```ruby
188
+ result = client.instance_custom_node.stats(
189
+ instanceId: my_instance_id,
190
+ instanceCustomNodeId: my_instance_custom_node_id)
191
+
192
+ puts result
193
+ ```
194
+
195
+ #### Authentication
196
+ The client must be configured with a valid api access token to call this
197
+ action. The token must include at least one of the following scopes:
198
+ all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNode.*, or instanceCustomNode.stats.
199
+
200
+ #### Available Parameters
201
+
202
+ | Name | Type | Required | Description | Default | Example |
203
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
204
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
205
+ | instanceCustomNodeId | string | Y | ID associated with the Custom Node | | 575ec7417ae143cd83dc4a95 |
206
+ | duration | string | N | Duration of time range in milliseconds | 86400000 | 86400000 |
207
+ | end | string | N | End of time range in milliseconds since epoch | 0 | 0 |
208
+ | resolution | string | N | Resolution in milliseconds | 3600000 | 3600000 |
209
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
210
+
211
+ #### Successful Responses
212
+
213
+ | Code | Type | Description |
214
+ | ---- | ---- | ----------- |
215
+ | 200 | [Workflow Statistics](_schemas.md#workflow-statistics) | Statistics for Custom Node runs |
216
+
217
+ #### Error Responses
218
+
219
+ | Code | Type | Description |
220
+ | ---- | ---- | ----------- |
221
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
222
+ | 404 | [Error](_schemas.md#error) | Error if Custom Node was not found |
@@ -0,0 +1,91 @@
1
+ # Instance Custom Nodes Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Instance Custom Nodes 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 Custom Nodes for an instance
17
+
18
+ ```ruby
19
+ result = client.instance_custom_nodes.get(instanceId: my_instance_id)
20
+
21
+ puts result
22
+ ```
23
+
24
+ #### Authentication
25
+ The client must be configured with a valid api access token to call this
26
+ action. The token must include at least one of the following scopes:
27
+ all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNodes.*, or instanceCustomNodes.get.
28
+
29
+ #### Available Parameters
30
+
31
+ | Name | Type | Required | Description | Default | Example |
32
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
33
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
34
+ | sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | name | name |
35
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
36
+ | page | string | N | Which page of results to return | 0 | 0 |
37
+ | perPage | string | N | How many items to return per page | 100 | 10 |
38
+ | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | key |
39
+ | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*node |
40
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
41
+
42
+ #### Successful Responses
43
+
44
+ | Code | Type | Description |
45
+ | ---- | ---- | ----------- |
46
+ | 200 | [Instance Custom Nodes](_schemas.md#instance-custom-nodes) | Collection of Custom Nodes |
47
+
48
+ #### Error Responses
49
+
50
+ | Code | Type | Description |
51
+ | ---- | ---- | ----------- |
52
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
53
+
54
+ <br/>
55
+
56
+ ## Post
57
+
58
+ Create a new Custom Node for an instance
59
+
60
+ ```ruby
61
+ result = client.instance_custom_nodes.post(
62
+ instanceId: my_instance_id,
63
+ instanceCustomNode: my_instance_custom_node)
64
+
65
+ puts result
66
+ ```
67
+
68
+ #### Authentication
69
+ The client must be configured with a valid api access token to call this
70
+ action. The token must include at least one of the following scopes:
71
+ all.Instance, all.User, instanceCustomNodes.*, or instanceCustomNodes.post.
72
+
73
+ #### Available Parameters
74
+
75
+ | Name | Type | Required | Description | Default | Example |
76
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
77
+ | instanceId | string | Y | ID associated with the instance | | 575ec7417ae143cd83dc4a96 |
78
+ | instanceCustomNode | [Instance Custom Node Post](_schemas.md#instance-custom-node-post) | Y | Custom Node information | | [Instance Custom Node Post Example](_schemas.md#instance-custom-node-post-example) |
79
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
80
+
81
+ #### Successful Responses
82
+
83
+ | Code | Type | Description |
84
+ | ---- | ---- | ----------- |
85
+ | 201 | [Instance Custom Node](_schemas.md#instance-custom-node) | The successfully created Custom Node |
86
+
87
+ #### Error Responses
88
+
89
+ | Code | Type | Description |
90
+ | ---- | ---- | ----------- |
91
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
@@ -27,7 +27,7 @@ module LosantRest
27
27
  #
28
28
  # User API for accessing Losant data
29
29
  #
30
- # Built For Version 1.22.2
30
+ # Built For Version 1.23.0
31
31
  class Client
32
32
  attr_accessor :auth_token, :url
33
33
 
@@ -268,6 +268,14 @@ module LosantRest
268
268
  @instance_api_tokens ||= InstanceApiTokens.new(self)
269
269
  end
270
270
 
271
+ def instance_custom_node
272
+ @instance_custom_node ||= InstanceCustomNode.new(self)
273
+ end
274
+
275
+ def instance_custom_nodes
276
+ @instance_custom_nodes ||= InstanceCustomNodes.new(self)
277
+ end
278
+
271
279
  def instance_member
272
280
  @instance_member ||= InstanceMember.new(self)
273
281
  end
@@ -358,7 +366,7 @@ module LosantRest
358
366
 
359
367
  headers["Accept"] = "application/json"
360
368
  headers["Content-Type"] = "application/json"
361
- headers["Accept-Version"] = "^1.22.2"
369
+ headers["Accept-Version"] = "^1.23.0"
362
370
  headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
363
371
  path = self.url + options.fetch(:path, "")
364
372
 
@@ -213,6 +213,50 @@ module LosantRest
213
213
  body: body)
214
214
  end
215
215
 
216
+ # Gets additional nodes that should be available in the palette
217
+ #
218
+ # Authentication:
219
+ # The client must be configured with a valid api
220
+ # access token to call this action. The token
221
+ # must include at least one of the following scopes:
222
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flows.*, or flows.palette.
223
+ #
224
+ # Parameters:
225
+ # * {string} applicationId - ID associated with the application
226
+ # * {string} losantdomain - Domain scope of request (rarely needed)
227
+ # * {boolean} _actions - Return resource actions in response
228
+ # * {boolean} _links - Return resource link in response
229
+ # * {boolean} _embedded - Return embedded resources in response
230
+ #
231
+ # Responses:
232
+ # * 200 - The additional nodes available in the palette (https://api.losant.com/#/definitions/paletteResponse)
233
+ #
234
+ # Errors:
235
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
236
+ # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
237
+ def palette(params = {})
238
+ params = Utils.symbolize_hash_keys(params)
239
+ query_params = { _actions: false, _links: true, _embedded: true }
240
+ headers = {}
241
+ body = nil
242
+
243
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
244
+
245
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
246
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
247
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
248
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
249
+
250
+ path = "/applications/#{params[:applicationId]}/flows/palette"
251
+
252
+ @client.request(
253
+ method: :get,
254
+ path: path,
255
+ query: query_params,
256
+ headers: headers,
257
+ body: body)
258
+ end
259
+
216
260
  # Create a new flow for an application
217
261
  #
218
262
  # Authentication: