losant_rest 1.13.1 → 1.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/docs/_schemas.md +10817 -3660
  3. data/docs/application.md +1 -1
  4. data/docs/device.md +43 -0
  5. data/docs/devices.md +39 -0
  6. data/docs/edgeDeployment.md +49 -0
  7. data/docs/embeddedDeployment.md +49 -0
  8. data/docs/embeddedDeployments.md +215 -0
  9. data/docs/flow.md +3 -3
  10. data/docs/flows.md +2 -2
  11. data/docs/instance.md +4 -2
  12. data/docs/instanceOrg.md +2 -0
  13. data/docs/instanceOrgInvite.md +139 -0
  14. data/docs/instanceOrgInvites.md +96 -0
  15. data/docs/instanceOrgMembers.md +2 -2
  16. data/docs/instanceOrgs.md +1 -1
  17. data/docs/me.md +1 -1
  18. data/docs/org.md +1 -1
  19. data/lib/losant_rest/client.rb +22 -2
  20. data/lib/losant_rest/device.rb +50 -0
  21. data/lib/losant_rest/devices.rb +46 -0
  22. data/lib/losant_rest/edge_deployment.rb +81 -0
  23. data/lib/losant_rest/embedded_deployment.rb +81 -0
  24. data/lib/losant_rest/embedded_deployments.rb +280 -0
  25. data/lib/losant_rest/flow.rb +3 -3
  26. data/lib/losant_rest/flows.rb +2 -2
  27. data/lib/losant_rest/instance.rb +1 -0
  28. data/lib/losant_rest/instance_org.rb +4 -0
  29. data/lib/losant_rest/instance_org_invite.rb +182 -0
  30. data/lib/losant_rest/instance_org_invites.rb +138 -0
  31. data/lib/losant_rest/instance_org_members.rb +2 -2
  32. data/lib/losant_rest/instance_orgs.rb +2 -2
  33. data/lib/losant_rest/version.rb +1 -1
  34. data/lib/losant_rest.rb +5 -0
  35. data/schemas/apiTokenPost.json +19 -0
  36. data/schemas/application.json +32 -32
  37. data/schemas/applicationCreationByTemplateResult.json +32 -32
  38. data/schemas/applicationDashboardPost.json +8 -5
  39. data/schemas/applicationPatch.json +13 -13
  40. data/schemas/applicationPost.json +13 -13
  41. data/schemas/applicationTemplate.json +16 -16
  42. data/schemas/applicationTemplates.json +16 -16
  43. data/schemas/applications.json +32 -32
  44. data/schemas/authedDevice.json +2 -1
  45. data/schemas/dashboard.json +8 -5
  46. data/schemas/dashboardPatch.json +8 -5
  47. data/schemas/dashboardPost.json +8 -5
  48. data/schemas/dashboardSendReport.json +6 -6
  49. data/schemas/dashboards.json +8 -5
  50. data/schemas/dataTableRowsDelete.json +1 -1
  51. data/schemas/device.json +2 -1
  52. data/schemas/deviceClassFilter.json +4 -2
  53. data/schemas/devicePatch.json +2 -1
  54. data/schemas/devicePayloadCounts.json +24 -0
  55. data/schemas/devicePost.json +2 -1
  56. data/schemas/deviceRecipe.json +2 -1
  57. data/schemas/deviceRecipePatch.json +2 -1
  58. data/schemas/deviceRecipePost.json +2 -1
  59. data/schemas/deviceRecipes.json +2 -1
  60. data/schemas/devices.json +4 -2
  61. data/schemas/devicesExportPayloadCountPost.json +1350 -0
  62. data/schemas/devicesPatch.json +4 -2
  63. data/schemas/edgeDeployment.json +20 -0
  64. data/schemas/edgeDeployments.json +20 -0
  65. data/schemas/embeddedDeployment.json +179 -0
  66. data/schemas/embeddedDeploymentExport.json +44 -0
  67. data/schemas/embeddedDeploymentRelease.json +58 -0
  68. data/schemas/embeddedDeploymentRemove.json +25 -0
  69. data/schemas/embeddedDeploymentReplace.json +29 -0
  70. data/schemas/embeddedDeployments.json +212 -0
  71. data/schemas/eventsDeleted.json +1 -1
  72. data/schemas/eventsExport.json +4 -0
  73. data/schemas/experienceEndpoint.json +6 -8
  74. data/schemas/experienceEndpointPatch.json +6 -8
  75. data/schemas/experienceEndpointPost.json +6 -8
  76. data/schemas/experienceEndpoints.json +6 -8
  77. data/schemas/experienceLinkedResources.json +790 -85
  78. data/schemas/flow.json +252 -16
  79. data/schemas/flowPatch.json +251 -16
  80. data/schemas/flowPost.json +252 -16
  81. data/schemas/flowVersion.json +503 -33
  82. data/schemas/flowVersionPost.json +251 -16
  83. data/schemas/flowVersions.json +503 -33
  84. data/schemas/flows.json +253 -16
  85. data/schemas/flowsImportPost.json +503 -32
  86. data/schemas/flowsImportResult.json +785 -79
  87. data/schemas/githubLogin.json +19 -0
  88. data/schemas/historicalSummary.json +147 -102
  89. data/schemas/instance.json +92 -79
  90. data/schemas/instanceMember.json +10 -0
  91. data/schemas/instanceMemberPost.json +18 -3
  92. data/schemas/instanceMembers.json +14 -0
  93. data/schemas/instanceOrg.json +87 -74
  94. data/schemas/instanceOrgMember.json +14 -0
  95. data/schemas/instanceOrgMembers.json +8 -0
  96. data/schemas/instanceOrgPatch.json +64 -26
  97. data/schemas/instanceOrgPost.json +65 -27
  98. data/schemas/instanceOrgs.json +91 -74
  99. data/schemas/instancePatch.json +2 -2
  100. data/schemas/me.json +134 -105
  101. data/schemas/notebook.json +32 -1
  102. data/schemas/notebookExecutionLogs.json +2 -1
  103. data/schemas/notebookPatch.json +32 -1
  104. data/schemas/notebookPost.json +32 -1
  105. data/schemas/notebooks.json +32 -1
  106. data/schemas/org.json +145 -110
  107. data/schemas/orgInvite.json +90 -0
  108. data/schemas/orgInviteCollection.json +130 -0
  109. data/schemas/orgInvites.json +82 -77
  110. data/schemas/orgRoleInfo.json +69 -0
  111. data/schemas/orgs.json +145 -110
  112. data/schemas/payloadStats.json +28 -12
  113. data/schemas/userCredentials.json +19 -0
  114. data/schemas/userPost.json +19 -0
  115. data/schemas/virtualButtonPress.json +4 -0
  116. metadata +27 -6
@@ -0,0 +1,96 @@
1
+ # Instance Org Invites Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Instance Org Invites 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 a collection of instance organization invites
17
+
18
+ ```ruby
19
+ result = client.instance_org_invites.get(
20
+ instanceId: my_instance_id,
21
+ orgId: my_org_id)
22
+
23
+ puts result
24
+ ```
25
+
26
+ #### Authentication
27
+ The client must be configured with a valid api access token to call this
28
+ action. The token must include at least one of the following scopes:
29
+ all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgInvites.*, or instanceOrgInvites.get.
30
+
31
+ #### Available Parameters
32
+
33
+ | Name | Type | Required | Description | Default | Example |
34
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
35
+ | instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
36
+ | orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
37
+ | sortField | string | N | Field to sort the results by. Accepted values are: email, role, inviteDate | inviteDate | role |
38
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | asc |
39
+ | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: email, role | | email |
40
+ | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * instance |
41
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
42
+
43
+ #### Successful Responses
44
+
45
+ | Code | Type | Description |
46
+ | ---- | ---- | ----------- |
47
+ | 200 | [Instance Organization Invitations](_schemas.md#instance-organization-invitations) | A collection of instance organization invitations |
48
+
49
+ #### Error Responses
50
+
51
+ | Code | Type | Description |
52
+ | ---- | ---- | ----------- |
53
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
54
+ | 404 | [Error](_schemas.md#error) | Error if instance or organization was not found |
55
+
56
+ <br/>
57
+
58
+ ## Post
59
+
60
+ Invites a member to an instance organization
61
+
62
+ ```ruby
63
+ result = client.instance_org_invites.post(
64
+ instanceId: my_instance_id,
65
+ orgId: my_org_id,
66
+ invite: my_invite)
67
+
68
+ puts result
69
+ ```
70
+
71
+ #### Authentication
72
+ The client must be configured with a valid api access token to call this
73
+ action. The token must include at least one of the following scopes:
74
+ all.Instance, all.User, instanceOrgInvites.*, or instanceOrgInvites.post.
75
+
76
+ #### Available Parameters
77
+
78
+ | Name | Type | Required | Description | Default | Example |
79
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
80
+ | instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
81
+ | orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
82
+ | invite | [Organization Invitation Post](_schemas.md#organization-invitation-post) | Y | Object containing new invite info | | [Organization Invitation Post Example](_schemas.md#organization-invitation-post-example) |
83
+ | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
84
+
85
+ #### Successful Responses
86
+
87
+ | Code | Type | Description |
88
+ | ---- | ---- | ----------- |
89
+ | 201 | [Instance Organization Invitations](_schemas.md#instance-organization-invitations) | The new organization invite |
90
+
91
+ #### Error Responses
92
+
93
+ | Code | Type | Description |
94
+ | ---- | ---- | ----------- |
95
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
96
+ | 404 | [Error](_schemas.md#error) | Error if instance or organization was not found |
@@ -33,7 +33,7 @@ all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgMembers.*,
33
33
  | Name | Type | Required | Description | Default | Example |
34
34
  | ---- | ---- | -------- | ----------- | ------- | ------- |
35
35
  | instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
36
- | orgId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
36
+ | orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
37
37
  | sortField | string | N | Field to sort the results by. Accepted values are: email, role | email | role |
38
38
  | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
39
39
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: email, role | | email |
@@ -78,7 +78,7 @@ all.Instance, all.User, instanceOrgMembers.*, or instanceOrgMembers.post.
78
78
  | Name | Type | Required | Description | Default | Example |
79
79
  | ---- | ---- | -------- | ----------- | ------- | ------- |
80
80
  | instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
81
- | orgId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
81
+ | orgId | string | Y | ID associated with the organization | | 575ec8687ae143cd83dc4a97 |
82
82
  | member | [Instance Org Member Post](_schemas.md#instance-org-member-post) | Y | Object containing new member info | | [Instance Org Member Post Example](_schemas.md#instance-org-member-post-example) |
83
83
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
84
84
 
data/docs/instanceOrgs.md CHANGED
@@ -37,7 +37,6 @@ all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgs.*, or ins
37
37
  | perPage | string | N | How many items to return per page | 100 | 10 |
38
38
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
39
39
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*org |
40
- | summaryExclude | string | N | Comma-separated list of summary fields to exclude from org summaries | | payloadCount |
41
40
  | summaryInclude | string | N | Comma-separated list of summary fields to include in org summary | | payloadCount |
42
41
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
43
42
 
@@ -75,6 +74,7 @@ all.Instance, all.User, instanceOrgs.*, or instanceOrgs.post.
75
74
  | Name | Type | Required | Description | Default | Example |
76
75
  | ---- | ---- | -------- | ----------- | ------- | ------- |
77
76
  | instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
77
+ | summaryInclude | string | N | Comma-separated list of summary fields to include in org summary | | payloadCount |
78
78
  | orgConfig | [Instance Owned Organization Post](_schemas.md#instance-owned-organization-post) | N | Object containing configurations for the new organization | | [Instance Owned Organization Post Example](_schemas.md#instance-owned-organization-post-example) |
79
79
  | losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
80
80
 
data/docs/me.md CHANGED
@@ -376,7 +376,7 @@ all.User, all.User.read, me.*, or me.payloadCounts.
376
376
 
377
377
  | Code | Type | Description |
378
378
  | ---- | ---- | ----------- |
379
- | 200 | [Payload Counts](_schemas.md#payload-counts) | Payload counts, by type and source |
379
+ | 200 | [Payload Stats](_schemas.md#payload-stats) | Payload counts, by type and source |
380
380
 
381
381
  #### Error Responses
382
382
 
data/docs/org.md CHANGED
@@ -247,7 +247,7 @@ all.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.
247
247
 
248
248
  | Code | Type | Description |
249
249
  | ---- | ---- | ----------- |
250
- | 200 | [Payload Counts](_schemas.md#payload-counts) | Payload counts, by type and source |
250
+ | 200 | [Payload Stats](_schemas.md#payload-stats) | Payload counts, by type and source |
251
251
 
252
252
  #### Error Responses
253
253
 
@@ -27,7 +27,7 @@ module LosantRest
27
27
  #
28
28
  # User API for accessing Losant data
29
29
  #
30
- # Built For Version 1.20.1
30
+ # Built For Version 1.22.1
31
31
  class Client
32
32
  attr_accessor :auth_token, :url
33
33
 
@@ -148,10 +148,22 @@ module LosantRest
148
148
  @devices ||= Devices.new(self)
149
149
  end
150
150
 
151
+ def edge_deployment
152
+ @edge_deployment ||= EdgeDeployment.new(self)
153
+ end
154
+
151
155
  def edge_deployments
152
156
  @edge_deployments ||= EdgeDeployments.new(self)
153
157
  end
154
158
 
159
+ def embedded_deployment
160
+ @embedded_deployment ||= EmbeddedDeployment.new(self)
161
+ end
162
+
163
+ def embedded_deployments
164
+ @embedded_deployments ||= EmbeddedDeployments.new(self)
165
+ end
166
+
155
167
  def event
156
168
  @event ||= Event.new(self)
157
169
  end
@@ -268,6 +280,14 @@ module LosantRest
268
280
  @instance_org ||= InstanceOrg.new(self)
269
281
  end
270
282
 
283
+ def instance_org_invite
284
+ @instance_org_invite ||= InstanceOrgInvite.new(self)
285
+ end
286
+
287
+ def instance_org_invites
288
+ @instance_org_invites ||= InstanceOrgInvites.new(self)
289
+ end
290
+
271
291
  def instance_org_member
272
292
  @instance_org_member ||= InstanceOrgMember.new(self)
273
293
  end
@@ -338,7 +358,7 @@ module LosantRest
338
358
 
339
359
  headers["Accept"] = "application/json"
340
360
  headers["Content-Type"] = "application/json"
341
- headers["Accept-Version"] = "^1.20.1"
361
+ headers["Accept-Version"] = "^1.22.1"
342
362
  headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
343
363
  path = self.url + options.fetch(:path, "")
344
364
 
@@ -438,6 +438,56 @@ module LosantRest
438
438
  body: body)
439
439
  end
440
440
 
441
+ # Returns payload counts for the time range specified for this device
442
+ #
443
+ # Authentication:
444
+ # The client must be configured with a valid api
445
+ # access token to call this action. The token
446
+ # must include at least one of the following scopes:
447
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, device.*, or device.payloadCounts.
448
+ #
449
+ # Parameters:
450
+ # * {string} applicationId - ID associated with the application
451
+ # * {string} deviceId - ID associated with the device
452
+ # * {string} start - Start of range for payload count query (ms since epoch)
453
+ # * {string} end - End of range for payload count query (ms since epoch)
454
+ # * {string} losantdomain - Domain scope of request (rarely needed)
455
+ # * {boolean} _actions - Return resource actions in response
456
+ # * {boolean} _links - Return resource link in response
457
+ # * {boolean} _embedded - Return embedded resources in response
458
+ #
459
+ # Responses:
460
+ # * 200 - Payload counts, by type (https://api.losant.com/#/definitions/devicePayloadCounts)
461
+ #
462
+ # Errors:
463
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
464
+ # * 404 - Error if device was not found (https://api.losant.com/#/definitions/error)
465
+ def payload_counts(params = {})
466
+ params = Utils.symbolize_hash_keys(params)
467
+ query_params = { _actions: false, _links: true, _embedded: true }
468
+ headers = {}
469
+ body = nil
470
+
471
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
472
+ raise ArgumentError.new("deviceId is required") unless params.has_key?(:deviceId)
473
+
474
+ query_params[:start] = params[:start] if params.has_key?(:start)
475
+ query_params[:end] = params[:end] if params.has_key?(:end)
476
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
477
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
478
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
479
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
480
+
481
+ path = "/applications/#{params[:applicationId]}/devices/#{params[:deviceId]}/payloadCounts"
482
+
483
+ @client.request(
484
+ method: :get,
485
+ path: path,
486
+ query: query_params,
487
+ headers: headers,
488
+ body: body)
489
+ end
490
+
441
491
  # Removes all device data for the specified time range. Defaults to all data.
442
492
  #
443
493
  # Authentication:
@@ -295,6 +295,52 @@ module LosantRest
295
295
  body: body)
296
296
  end
297
297
 
298
+ # Creates an export of payload count information for the matching devices
299
+ #
300
+ # Authentication:
301
+ # The client must be configured with a valid api
302
+ # access token to call this action. The token
303
+ # must include at least one of the following scopes:
304
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.payloadCounts.
305
+ #
306
+ # Parameters:
307
+ # * {string} applicationId - ID associated with the application
308
+ # * {hash} options - Object containing export configuration (https://api.losant.com/#/definitions/devicesExportPayloadCountPost)
309
+ # * {string} losantdomain - Domain scope of request (rarely needed)
310
+ # * {boolean} _actions - Return resource actions in response
311
+ # * {boolean} _links - Return resource link in response
312
+ # * {boolean} _embedded - Return embedded resources in response
313
+ #
314
+ # Responses:
315
+ # * 200 - If generation of export was successfully started (https://api.losant.com/#/definitions/success)
316
+ #
317
+ # Errors:
318
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
319
+ # * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
320
+ def payload_counts(params = {})
321
+ params = Utils.symbolize_hash_keys(params)
322
+ query_params = { _actions: false, _links: true, _embedded: true }
323
+ headers = {}
324
+ body = nil
325
+
326
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
327
+
328
+ body = params[:options] if params.has_key?(:options)
329
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
330
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
331
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
332
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
333
+
334
+ path = "/applications/#{params[:applicationId]}/devices/payloadCounts"
335
+
336
+ @client.request(
337
+ method: :post,
338
+ path: path,
339
+ query: query_params,
340
+ headers: headers,
341
+ body: body)
342
+ end
343
+
298
344
  # Create a new device for an application
299
345
  #
300
346
  # Authentication:
@@ -0,0 +1,81 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2021 Losant IoT, Inc.
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require "json"
24
+
25
+ module LosantRest
26
+
27
+ # Class containing all the actions for the Edge Deployment Resource
28
+ class EdgeDeployment
29
+
30
+ def initialize(client)
31
+ @client = client
32
+ end
33
+
34
+ # Retrieves information on an edge deployment
35
+ #
36
+ # Authentication:
37
+ # The client must be configured with a valid api
38
+ # access token to call this action. The token
39
+ # must include at least one of the following scopes:
40
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, edgeDeployment.*, or edgeDeployment.get.
41
+ #
42
+ # Parameters:
43
+ # * {string} applicationId - ID associated with the application
44
+ # * {string} edgeDeploymentId - ID associated with the edge deployment
45
+ # * {string} losantdomain - Domain scope of request (rarely needed)
46
+ # * {boolean} _actions - Return resource actions in response
47
+ # * {boolean} _links - Return resource link in response
48
+ # * {boolean} _embedded - Return embedded resources in response
49
+ #
50
+ # Responses:
51
+ # * 200 - Edge deployment information (https://api.losant.com/#/definitions/edgeDeployment)
52
+ #
53
+ # Errors:
54
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
55
+ # * 404 - Error if edge deployment was not found (https://api.losant.com/#/definitions/error)
56
+ def get(params = {})
57
+ params = Utils.symbolize_hash_keys(params)
58
+ query_params = { _actions: false, _links: true, _embedded: true }
59
+ headers = {}
60
+ body = nil
61
+
62
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
63
+ raise ArgumentError.new("edgeDeploymentId is required") unless params.has_key?(:edgeDeploymentId)
64
+
65
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
66
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
67
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
68
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
69
+
70
+ path = "/applications/#{params[:applicationId]}/edge/deployments/#{params[:edgeDeploymentId]}"
71
+
72
+ @client.request(
73
+ method: :get,
74
+ path: path,
75
+ query: query_params,
76
+ headers: headers,
77
+ body: body)
78
+ end
79
+
80
+ end
81
+ end
@@ -0,0 +1,81 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2021 Losant IoT, Inc.
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ require "json"
24
+
25
+ module LosantRest
26
+
27
+ # Class containing all the actions for the Embedded Deployment Resource
28
+ class EmbeddedDeployment
29
+
30
+ def initialize(client)
31
+ @client = client
32
+ end
33
+
34
+ # Retrieves information on an embedded deployment
35
+ #
36
+ # Authentication:
37
+ # The client must be configured with a valid api
38
+ # access token to call this action. The token
39
+ # must include at least one of the following scopes:
40
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, embeddedDeployment.*, or embeddedDeployment.get.
41
+ #
42
+ # Parameters:
43
+ # * {string} applicationId - ID associated with the application
44
+ # * {string} embeddedDeploymentId - ID associated with the embedded deployment
45
+ # * {string} losantdomain - Domain scope of request (rarely needed)
46
+ # * {boolean} _actions - Return resource actions in response
47
+ # * {boolean} _links - Return resource link in response
48
+ # * {boolean} _embedded - Return embedded resources in response
49
+ #
50
+ # Responses:
51
+ # * 200 - Embedded deployment information (https://api.losant.com/#/definitions/embeddedDeployment)
52
+ #
53
+ # Errors:
54
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
55
+ # * 404 - Error if embedded deployment was not found (https://api.losant.com/#/definitions/error)
56
+ def get(params = {})
57
+ params = Utils.symbolize_hash_keys(params)
58
+ query_params = { _actions: false, _links: true, _embedded: true }
59
+ headers = {}
60
+ body = nil
61
+
62
+ raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
63
+ raise ArgumentError.new("embeddedDeploymentId is required") unless params.has_key?(:embeddedDeploymentId)
64
+
65
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
66
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
67
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
68
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
69
+
70
+ path = "/applications/#{params[:applicationId]}/embedded/deployments/#{params[:embeddedDeploymentId]}"
71
+
72
+ @client.request(
73
+ method: :get,
74
+ path: path,
75
+ query: query_params,
76
+ headers: headers,
77
+ body: body)
78
+ end
79
+
80
+ end
81
+ end