losant_rest 1.13.1 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/docs/_schemas.md +2919 -507
  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/flow.md +1 -1
  8. data/docs/instanceOrg.md +2 -0
  9. data/docs/instanceOrgInvite.md +139 -0
  10. data/docs/instanceOrgInvites.md +96 -0
  11. data/docs/instanceOrgMembers.md +2 -2
  12. data/docs/instanceOrgs.md +1 -1
  13. data/docs/me.md +1 -1
  14. data/docs/org.md +1 -1
  15. data/lib/losant_rest.rb +3 -0
  16. data/lib/losant_rest/client.rb +14 -2
  17. data/lib/losant_rest/device.rb +50 -0
  18. data/lib/losant_rest/devices.rb +46 -0
  19. data/lib/losant_rest/edge_deployment.rb +81 -0
  20. data/lib/losant_rest/flow.rb +1 -1
  21. data/lib/losant_rest/instance_org.rb +4 -0
  22. data/lib/losant_rest/instance_org_invite.rb +182 -0
  23. data/lib/losant_rest/instance_org_invites.rb +138 -0
  24. data/lib/losant_rest/instance_org_members.rb +2 -2
  25. data/lib/losant_rest/instance_orgs.rb +2 -2
  26. data/lib/losant_rest/version.rb +1 -1
  27. data/schemas/apiTokenPost.json +11 -0
  28. data/schemas/devicePayloadCounts.json +24 -0
  29. data/schemas/devicesExportPayloadCountPost.json +1350 -0
  30. data/schemas/edgeDeployment.json +16 -0
  31. data/schemas/edgeDeployments.json +16 -0
  32. data/schemas/experienceLinkedResources.json +45 -0
  33. data/schemas/flow.json +15 -0
  34. data/schemas/flowPatch.json +15 -0
  35. data/schemas/flowPost.json +15 -0
  36. data/schemas/flowVersion.json +30 -0
  37. data/schemas/flowVersionPost.json +15 -0
  38. data/schemas/flowVersions.json +30 -0
  39. data/schemas/flows.json +15 -0
  40. data/schemas/flowsImportPost.json +30 -0
  41. data/schemas/flowsImportResult.json +45 -0
  42. data/schemas/githubLogin.json +11 -0
  43. data/schemas/historicalSummary.json +60 -28
  44. data/schemas/instanceMember.json +4 -0
  45. data/schemas/instanceMemberPost.json +18 -3
  46. data/schemas/instanceMembers.json +8 -0
  47. data/schemas/instanceOrgMember.json +8 -0
  48. data/schemas/instanceOrgMembers.json +8 -0
  49. data/schemas/instanceOrgs.json +4 -0
  50. data/schemas/me.json +30 -14
  51. data/schemas/notebook.json +30 -0
  52. data/schemas/notebookPatch.json +30 -0
  53. data/schemas/notebookPost.json +30 -0
  54. data/schemas/notebooks.json +30 -0
  55. data/schemas/org.json +30 -14
  56. data/schemas/orgInvite.json +90 -0
  57. data/schemas/orgInviteCollection.json +130 -0
  58. data/schemas/orgInvites.json +82 -77
  59. data/schemas/orgRoleInfo.json +69 -0
  60. data/schemas/orgs.json +30 -14
  61. data/schemas/payloadStats.json +28 -12
  62. data/schemas/userCredentials.json +11 -0
  63. data/schemas/userPost.json +11 -0
  64. data/schemas/virtualButtonPress.json +4 -0
  65. metadata +13 -2
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
 
data/lib/losant_rest.rb CHANGED
@@ -51,6 +51,7 @@ require_relative "losant_rest/device"
51
51
  require_relative "losant_rest/device_recipe"
52
52
  require_relative "losant_rest/device_recipes"
53
53
  require_relative "losant_rest/devices"
54
+ require_relative "losant_rest/edge_deployment"
54
55
  require_relative "losant_rest/edge_deployments"
55
56
  require_relative "losant_rest/event"
56
57
  require_relative "losant_rest/events"
@@ -81,6 +82,8 @@ require_relative "losant_rest/instance_api_tokens"
81
82
  require_relative "losant_rest/instance_member"
82
83
  require_relative "losant_rest/instance_members"
83
84
  require_relative "losant_rest/instance_org"
85
+ require_relative "losant_rest/instance_org_invite"
86
+ require_relative "losant_rest/instance_org_invites"
84
87
  require_relative "losant_rest/instance_org_member"
85
88
  require_relative "losant_rest/instance_org_members"
86
89
  require_relative "losant_rest/instance_orgs"
@@ -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.21.0
31
31
  class Client
32
32
  attr_accessor :auth_token, :url
33
33
 
@@ -148,6 +148,10 @@ 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
@@ -268,6 +272,14 @@ module LosantRest
268
272
  @instance_org ||= InstanceOrg.new(self)
269
273
  end
270
274
 
275
+ def instance_org_invite
276
+ @instance_org_invite ||= InstanceOrgInvite.new(self)
277
+ end
278
+
279
+ def instance_org_invites
280
+ @instance_org_invites ||= InstanceOrgInvites.new(self)
281
+ end
282
+
271
283
  def instance_org_member
272
284
  @instance_org_member ||= InstanceOrgMember.new(self)
273
285
  end
@@ -338,7 +350,7 @@ module LosantRest
338
350
 
339
351
  headers["Accept"] = "application/json"
340
352
  headers["Content-Type"] = "application/json"
341
- headers["Accept-Version"] = "^1.20.1"
353
+ headers["Accept-Version"] = "^1.21.0"
342
354
  headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
343
355
  path = self.url + options.fetch(:path, "")
344
356
 
@@ -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
@@ -331,7 +331,7 @@ module LosantRest
331
331
  # The client must be configured with a valid api
332
332
  # access token to call this action. The token
333
333
  # must include at least one of the following scopes:
334
- # all.Application, all.Organization, all.User, flow.*, or flow.getStorageEntriesMetadata.
334
+ # all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flow.*, or flow.getStorageEntriesMetadata.
335
335
  #
336
336
  # Parameters:
337
337
  # * {string} applicationId - ID associated with the application
@@ -88,6 +88,7 @@ module LosantRest
88
88
  # Parameters:
89
89
  # * {string} instanceId - ID associated with the instance
90
90
  # * {string} orgId - ID associated with the organization
91
+ # * {string} summaryInclude - Comma-separated list of summary fields to include in org summary
91
92
  # * {string} losantdomain - Domain scope of request (rarely needed)
92
93
  # * {boolean} _actions - Return resource actions in response
93
94
  # * {boolean} _links - Return resource link in response
@@ -108,6 +109,7 @@ module LosantRest
108
109
  raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
109
110
  raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
110
111
 
112
+ query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
111
113
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
112
114
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
113
115
  query_params[:_links] = params[:_links] if params.has_key?(:_links)
@@ -134,6 +136,7 @@ module LosantRest
134
136
  # Parameters:
135
137
  # * {string} instanceId - ID associated with the instance
136
138
  # * {string} orgId - ID associated with the organization
139
+ # * {string} summaryInclude - Comma-separated list of summary fields to include in org summary
137
140
  # * {hash} organization - Object containing new organization properties (https://api.losant.com/#/definitions/instanceOrgPatch)
138
141
  # * {string} losantdomain - Domain scope of request (rarely needed)
139
142
  # * {boolean} _actions - Return resource actions in response
@@ -156,6 +159,7 @@ module LosantRest
156
159
  raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
157
160
  raise ArgumentError.new("organization is required") unless params.has_key?(:organization)
158
161
 
162
+ query_params[:summaryInclude] = params[:summaryInclude] if params.has_key?(:summaryInclude)
159
163
  body = params[:organization] if params.has_key?(:organization)
160
164
  headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
161
165
  query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
@@ -0,0 +1,182 @@
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 Instance Org Invite Resource
28
+ class InstanceOrgInvite
29
+
30
+ def initialize(client)
31
+ @client = client
32
+ end
33
+
34
+ # Revokes an instance org invitation
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.Instance, all.User, instanceOrgInvite.*, or instanceOrgInvite.delete.
41
+ #
42
+ # Parameters:
43
+ # * {string} instanceId - ID associated with the instance
44
+ # * {string} orgId - ID associated with the organization
45
+ # * {string} inviteId - ID associated with the organization invite
46
+ # * {string} losantdomain - Domain scope of request (rarely needed)
47
+ # * {boolean} _actions - Return resource actions in response
48
+ # * {boolean} _links - Return resource link in response
49
+ # * {boolean} _embedded - Return embedded resources in response
50
+ #
51
+ # Responses:
52
+ # * 200 - If an invite was successfully deleted (https://api.losant.com/#/definitions/success)
53
+ #
54
+ # Errors:
55
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
56
+ # * 404 - Error if instance, organization or invite was not found (https://api.losant.com/#/definitions/error)
57
+ def delete(params = {})
58
+ params = Utils.symbolize_hash_keys(params)
59
+ query_params = { _actions: false, _links: true, _embedded: true }
60
+ headers = {}
61
+ body = nil
62
+
63
+ raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
64
+ raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
65
+ raise ArgumentError.new("inviteId is required") unless params.has_key?(:inviteId)
66
+
67
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
68
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
69
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
70
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
71
+
72
+ path = "/instances/#{params[:instanceId]}/orgs/#{params[:orgId]}/invites/#{params[:inviteId]}"
73
+
74
+ @client.request(
75
+ method: :delete,
76
+ path: path,
77
+ query: query_params,
78
+ headers: headers,
79
+ body: body)
80
+ end
81
+
82
+ # Returns an organization invite
83
+ #
84
+ # Authentication:
85
+ # The client must be configured with a valid api
86
+ # access token to call this action. The token
87
+ # must include at least one of the following scopes:
88
+ # all.Instance, all.Instance.read, all.User, all.User.read, instanceOrgInvite.*, or instanceOrgInvite.get.
89
+ #
90
+ # Parameters:
91
+ # * {string} instanceId - ID associated with the instance
92
+ # * {string} orgId - ID associated with the organization
93
+ # * {string} inviteId - ID associated with the organization invite
94
+ # * {string} losantdomain - Domain scope of request (rarely needed)
95
+ # * {boolean} _actions - Return resource actions in response
96
+ # * {boolean} _links - Return resource link in response
97
+ # * {boolean} _embedded - Return embedded resources in response
98
+ #
99
+ # Responses:
100
+ # * 200 - A single organization invite (https://api.losant.com/#/definitions/orgInvite)
101
+ #
102
+ # Errors:
103
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
104
+ # * 404 - Error if instance, organization, or invite was not found (https://api.losant.com/#/definitions/error)
105
+ def get(params = {})
106
+ params = Utils.symbolize_hash_keys(params)
107
+ query_params = { _actions: false, _links: true, _embedded: true }
108
+ headers = {}
109
+ body = nil
110
+
111
+ raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
112
+ raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
113
+ raise ArgumentError.new("inviteId is required") unless params.has_key?(:inviteId)
114
+
115
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
116
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
117
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
118
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
119
+
120
+ path = "/instances/#{params[:instanceId]}/orgs/#{params[:orgId]}/invites/#{params[:inviteId]}"
121
+
122
+ @client.request(
123
+ method: :get,
124
+ path: path,
125
+ query: query_params,
126
+ headers: headers,
127
+ body: body)
128
+ end
129
+
130
+ # Resend an organization invite with modified role info
131
+ #
132
+ # Authentication:
133
+ # The client must be configured with a valid api
134
+ # access token to call this action. The token
135
+ # must include at least one of the following scopes:
136
+ # all.Instance, all.User, instanceOrgInvite.*, or instanceOrgInvite.resendInvite.
137
+ #
138
+ # Parameters:
139
+ # * {string} instanceId - ID associated with the instance
140
+ # * {string} orgId - ID associated with the organization
141
+ # * {string} inviteId - ID associated with the organization invite
142
+ # * {hash} roleInfo - Object containing updated role info (https://api.losant.com/#/definitions/orgRoleInfo)
143
+ # * {string} losantdomain - Domain scope of request (rarely needed)
144
+ # * {boolean} _actions - Return resource actions in response
145
+ # * {boolean} _links - Return resource link in response
146
+ # * {boolean} _embedded - Return embedded resources in response
147
+ #
148
+ # Responses:
149
+ # * 201 - The new org invite (https://api.losant.com/#/definitions/orgInvite)
150
+ #
151
+ # Errors:
152
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
153
+ # * 404 - Error if instance, organization, or invite was not found (https://api.losant.com/#/definitions/error)
154
+ def resend_invite(params = {})
155
+ params = Utils.symbolize_hash_keys(params)
156
+ query_params = { _actions: false, _links: true, _embedded: true }
157
+ headers = {}
158
+ body = nil
159
+
160
+ raise ArgumentError.new("instanceId is required") unless params.has_key?(:instanceId)
161
+ raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
162
+ raise ArgumentError.new("inviteId is required") unless params.has_key?(:inviteId)
163
+ raise ArgumentError.new("roleInfo is required") unless params.has_key?(:roleInfo)
164
+
165
+ body = params[:roleInfo] if params.has_key?(:roleInfo)
166
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
167
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
168
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
169
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
170
+
171
+ path = "/instances/#{params[:instanceId]}/orgs/#{params[:orgId]}/invites/#{params[:inviteId]}"
172
+
173
+ @client.request(
174
+ method: :post,
175
+ path: path,
176
+ query: query_params,
177
+ headers: headers,
178
+ body: body)
179
+ end
180
+
181
+ end
182
+ end