losant_rest 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/docs/_schemas.md +616 -12
  5. data/docs/applications.md +1 -1
  6. data/docs/auditLog.md +43 -0
  7. data/docs/auditLogs.md +47 -0
  8. data/docs/dashboards.md +1 -1
  9. data/docs/device.md +1 -1
  10. data/docs/devices.md +1 -1
  11. data/docs/org.md +1 -1
  12. data/docs/orgInvites.md +77 -0
  13. data/lib/losant_rest/access_token.rb +22 -0
  14. data/lib/losant_rest/access_tokens.rb +22 -0
  15. data/lib/losant_rest/application.rb +22 -0
  16. data/lib/losant_rest/application_key.rb +22 -0
  17. data/lib/losant_rest/application_keys.rb +22 -0
  18. data/lib/losant_rest/applications.rb +23 -1
  19. data/lib/losant_rest/audit_log.rb +73 -0
  20. data/lib/losant_rest/audit_logs.rb +85 -0
  21. data/lib/losant_rest/auth.rb +22 -0
  22. data/lib/losant_rest/client.rb +36 -2
  23. data/lib/losant_rest/dashboard.rb +22 -0
  24. data/lib/losant_rest/dashboards.rb +23 -1
  25. data/lib/losant_rest/data.rb +22 -0
  26. data/lib/losant_rest/device.rb +23 -1
  27. data/lib/losant_rest/device_recipe.rb +22 -0
  28. data/lib/losant_rest/device_recipes.rb +22 -0
  29. data/lib/losant_rest/devices.rb +23 -1
  30. data/lib/losant_rest/error.rb +22 -0
  31. data/lib/losant_rest/event.rb +22 -0
  32. data/lib/losant_rest/events.rb +22 -0
  33. data/lib/losant_rest/flow.rb +22 -0
  34. data/lib/losant_rest/flows.rb +22 -0
  35. data/lib/losant_rest/me.rb +22 -0
  36. data/lib/losant_rest/org.rb +24 -2
  37. data/lib/losant_rest/org_invites.rb +116 -0
  38. data/lib/losant_rest/orgs.rb +22 -0
  39. data/lib/losant_rest/solution.rb +22 -0
  40. data/lib/losant_rest/solution_user.rb +22 -0
  41. data/lib/losant_rest/solution_users.rb +22 -0
  42. data/lib/losant_rest/solutions.rb +22 -0
  43. data/lib/losant_rest/utils.rb +22 -0
  44. data/lib/losant_rest/version.rb +23 -1
  45. data/lib/losant_rest/webhook.rb +22 -0
  46. data/lib/losant_rest/webhooks.rb +22 -0
  47. data/lib/losant_rest.rb +25 -0
  48. data/schemas/auditLog.json +102 -0
  49. data/schemas/auditLogFilter.json +114 -0
  50. data/schemas/auditLogs.json +138 -0
  51. data/schemas/dashboard.json +2 -2
  52. data/schemas/dashboardPatch.json +2 -2
  53. data/schemas/dashboardPost.json +2 -2
  54. data/schemas/dashboards.json +2 -2
  55. data/schemas/flow.json +0 -1
  56. data/schemas/flowPatch.json +0 -1
  57. data/schemas/flowPost.json +0 -1
  58. data/schemas/flows.json +0 -1
  59. data/schemas/orgInviteAction.json +24 -0
  60. data/schemas/orgInviteInfo.json +31 -0
  61. data/schemas/orgInviteResult.json +13 -0
  62. metadata +14 -2
data/docs/applications.md CHANGED
@@ -31,7 +31,7 @@ puts result
31
31
  | perPage | string | N | How many items to return per page | 1000 | 10 |
32
32
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
33
33
  | filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * app |
34
- | orgId | string | N | If not provided, return all applications. If provided but blank, only return applications belonging to the current user. If provided and an id, only return applications belonging to the given organization id. | | 575ecdf07ae143cd83dc4a9a |
34
+ | orgId | string | N | If not provided, return all applications. If provided but blank, only return applications belonging to the current user. If provided and an id, only return applications belonging to the given organization id. | | 575ecdf07ae143cd83dc4a9a |
35
35
 
36
36
  #### Successful Responses
37
37
 
data/docs/auditLog.md ADDED
@@ -0,0 +1,43 @@
1
+ # Audit Log Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Audit Log resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Get](#get)
10
+
11
+ <br/>
12
+
13
+ ## Get
14
+
15
+ Retrieves information on an audit log
16
+
17
+ ```ruby
18
+ result = client.audit_log.get(
19
+ orgId: my_org_id,
20
+ auditLogId: my_audit_log_id)
21
+
22
+ puts result
23
+ ```
24
+
25
+ #### Available Parameters
26
+
27
+ | Name | Type | Required | Description | Default | Example |
28
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
29
+ | orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
30
+ | auditLogId | string | Y | ID associated with the audit log | | 57955788124b37010084c053 |
31
+
32
+ #### Successful Responses
33
+
34
+ | Code | Type | Description |
35
+ | ---- | ---- | ----------- |
36
+ | 200 | [Audit Log](_schemas.md#audit-log) | Audit log information |
37
+
38
+ #### Error Responses
39
+
40
+ | Code | Type | Description |
41
+ | ---- | ---- | ----------- |
42
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
43
+ | 404 | [Error](_schemas.md#error) | Error if audit log was not found |
data/docs/auditLogs.md ADDED
@@ -0,0 +1,47 @@
1
+ # Audit Logs Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ Audit Logs resource, including the expected
5
+ parameters and the potential responses.
6
+
7
+ ##### Contents
8
+
9
+ * [Get](#get)
10
+
11
+ <br/>
12
+
13
+ ## Get
14
+
15
+ Returns the audit logs for the organization
16
+
17
+ ```ruby
18
+ result = client.audit_logs.get(orgId: my_org_id)
19
+
20
+ puts result
21
+ ```
22
+
23
+ #### Available Parameters
24
+
25
+ | Name | Type | Required | Description | Default | Example |
26
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
27
+ | orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
28
+ | sortField | string | N | Field to sort the results by. Accepted values are: creationDate, responseStatus, actorName | creationDate | creationDate |
29
+ | sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | desc | 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
+ | start | string | N | Start of time range for audit log query | | 1465790400000 |
33
+ | end | string | N | End of time range for audit log query | | 1465790400000 |
34
+ | auditLogFilter | [Audit Log Filter](_schemas.md#audit-log-filter) | N | Filters for the audit log query | | [Audit Log Filter Example](_schemas.md#audit-log-filter-example) |
35
+
36
+ #### Successful Responses
37
+
38
+ | Code | Type | Description |
39
+ | ---- | ---- | ----------- |
40
+ | 200 | [Audit Logs](_schemas.md#audit-logs) | Collection of audit logs |
41
+
42
+ #### Error Responses
43
+
44
+ | Code | Type | Description |
45
+ | ---- | ---- | ----------- |
46
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
47
+ | 404 | [Error](_schemas.md#error) | Error if organization was not found |
data/docs/dashboards.md CHANGED
@@ -31,7 +31,7 @@ puts result
31
31
  | perPage | string | N | How many items to return per page | 1000 | 10 |
32
32
  | filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
33
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 |
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
35
 
36
36
  #### Successful Responses
37
37
 
data/docs/device.md CHANGED
@@ -74,7 +74,7 @@ puts result
74
74
  | deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
75
75
  | start | string | N | Start time of export (ms since epoch - 0 means now, negative is relative to now) | 1 | 1465790400000 |
76
76
  | end | string | N | End time of export (ms since epoch - 0 means now, negative is relative to now) | 0 | 1465790400000 |
77
- | email | string | N | Email address to send export to. Defaults to current user&#x27;s email. | | email@example.com |
77
+ | email | string | N | Email address to send export to. Defaults to current user&#x27;s email. | | email@example.com |
78
78
  | callbackUrl | string | N | Callback URL to call with export result. | | https://example.com/cburl |
79
79
 
80
80
  #### Successful Responses
data/docs/devices.md CHANGED
@@ -28,7 +28,7 @@ puts result
28
28
  | Name | Type | Required | Description | Default | Example |
29
29
  | ---- | ---- | -------- | ----------- | ------- | ------- |
30
30
  | applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
31
- | email | string | N | Email address to send export to. Defaults to current user&#x27;s email. | | email@example.com |
31
+ | email | string | N | Email address to send export to. Defaults to current user&#x27;s email. | | email@example.com |
32
32
  | callbackUrl | string | N | Callback URL to call with export result. | | https://example.com/cburl |
33
33
 
34
34
  #### Successful Responses
data/docs/org.md CHANGED
@@ -249,7 +249,7 @@ puts result
249
249
 
250
250
  ## Remove Member
251
251
 
252
- Modifies a current org member&#x27;s role
252
+ Removes a member from the org
253
253
 
254
254
  ```ruby
255
255
  result = client.org.remove_member(
@@ -0,0 +1,77 @@
1
+ # Org Invites Actions
2
+
3
+ Details on the various actions that can be performed on the
4
+ 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
+ Gets information about an invite
17
+
18
+ ```ruby
19
+ result = client.org_invites.get(
20
+ token: my_token,
21
+ email: my_email)
22
+
23
+ puts result
24
+ ```
25
+
26
+ #### Available Parameters
27
+
28
+ | Name | Type | Required | Description | Default | Example |
29
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
30
+ | token | string | Y | The token associated with the invite | | aTokenString |
31
+ | email | string | Y | The email associated with the invite | | example@example.com |
32
+
33
+ #### Successful Responses
34
+
35
+ | Code | Type | Description |
36
+ | ---- | ---- | ----------- |
37
+ | 200 | [Organization Invitation Information](_schemas.md#organization-invitation-information) | Information about invite |
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 invite not found |
45
+ | 410 | [Error](_schemas.md#error) | Error if invite has expired |
46
+
47
+ <br/>
48
+
49
+ ## Post
50
+
51
+ Accepts/Rejects an invite
52
+
53
+ ```ruby
54
+ result = client.org_invites.post(invite: my_invite)
55
+
56
+ puts result
57
+ ```
58
+
59
+ #### Available Parameters
60
+
61
+ | Name | Type | Required | Description | Default | Example |
62
+ | ---- | ---- | -------- | ----------- | ------- | ------- |
63
+ | invite | [Organization Invitation Action](_schemas.md#organization-invitation-action) | Y | Invite info and acceptance | | [Organization Invitation Action Example](_schemas.md#organization-invitation-action-example) |
64
+
65
+ #### Successful Responses
66
+
67
+ | Code | Type | Description |
68
+ | ---- | ---- | ----------- |
69
+ | 200 | [Organization Invitation Result](_schemas.md#organization-invitation-result) | Acceptance/Rejection of invite |
70
+
71
+ #### Error Responses
72
+
73
+ | Code | Type | Description |
74
+ | ---- | ---- | ----------- |
75
+ | 400 | [Error](_schemas.md#error) | Error if malformed request |
76
+ | 404 | [Error](_schemas.md#error) | Error if invite not found |
77
+ | 410 | [Error](_schemas.md#error) | Error if invite has expired |
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Access Token Resource
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Access Tokens Resource
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Application Resource
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Application Key Resource
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Application Keys Resource
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Applications Resource
@@ -16,7 +38,7 @@ module LosantRest
16
38
  # * {string} perPage - How many items to return per page
17
39
  # * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name
18
40
  # * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
19
- # * {string} orgId - If not provided, return all applications. If provided but blank, only return applications belonging to the current user. If provided and an id, only return applications belonging to the given organization id.
41
+ # * {string} orgId - If not provided, return all applications. If provided but blank, only return applications belonging to the current user. If provided and an id, only return applications belonging to the given organization id.
20
42
  # * {string} losantdomain - Domain scope of request (rarely needed)
21
43
  # * {boolean} _actions - Return resource actions in response
22
44
  # * {boolean} _links - Return resource link in response
@@ -0,0 +1,73 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+ module LosantRest
24
+
25
+ # Class containing all the actions for the Audit Log Resource
26
+ class AuditLog
27
+
28
+ def initialize(client)
29
+ @client = client
30
+ end
31
+
32
+ # Retrieves information on an audit log
33
+ #
34
+ # Parameters:
35
+ # * {string} orgId - ID associated with the organization
36
+ # * {string} auditLogId - ID associated with the audit log
37
+ # * {string} losantdomain - Domain scope of request (rarely needed)
38
+ # * {boolean} _actions - Return resource actions in response
39
+ # * {boolean} _links - Return resource link in response
40
+ # * {boolean} _embedded - Return embedded resources in response
41
+ #
42
+ # Responses:
43
+ # * 200 - Audit log information (https://api.losant.com/#/definitions/auditLog)
44
+ #
45
+ # Errors:
46
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
47
+ # * 404 - Error if audit log was not found (https://api.losant.com/#/definitions/error)
48
+ def get(params = {})
49
+ params = Utils.symbolize_hash_keys(params)
50
+ query_params = { _actions: false, _links: true, _embedded: true }
51
+ headers = {}
52
+ body = nil
53
+
54
+ raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
55
+ raise ArgumentError.new("auditLogId is required") unless params.has_key?(:auditLogId)
56
+
57
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
58
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
59
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
60
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
61
+
62
+ path = "/orgs/#{params[:orgId]}/audit-logs/#{params[:auditLogId]}"
63
+
64
+ @client.request(
65
+ method: :get,
66
+ path: path,
67
+ query: query_params,
68
+ headers: headers,
69
+ body: body)
70
+ end
71
+
72
+ end
73
+ end
@@ -0,0 +1,85 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+ module LosantRest
24
+
25
+ # Class containing all the actions for the Audit Logs Resource
26
+ class AuditLogs
27
+
28
+ def initialize(client)
29
+ @client = client
30
+ end
31
+
32
+ # Returns the audit logs for the organization
33
+ #
34
+ # Parameters:
35
+ # * {string} orgId - ID associated with the organization
36
+ # * {string} sortField - Field to sort the results by. Accepted values are: creationDate, responseStatus, actorName
37
+ # * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
38
+ # * {string} page - Which page of results to return
39
+ # * {string} perPage - How many items to return per page
40
+ # * {string} start - Start of time range for audit log query
41
+ # * {string} end - End of time range for audit log query
42
+ # * {hash} auditLogFilter - Filters for the audit log query (https://api.losant.com/#/definitions/auditLogFilter)
43
+ # * {string} losantdomain - Domain scope of request (rarely needed)
44
+ # * {boolean} _actions - Return resource actions in response
45
+ # * {boolean} _links - Return resource link in response
46
+ # * {boolean} _embedded - Return embedded resources in response
47
+ #
48
+ # Responses:
49
+ # * 200 - Collection of audit logs (https://api.losant.com/#/definitions/auditLogs)
50
+ #
51
+ # Errors:
52
+ # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
53
+ # * 404 - Error if organization was not found (https://api.losant.com/#/definitions/error)
54
+ def get(params = {})
55
+ params = Utils.symbolize_hash_keys(params)
56
+ query_params = { _actions: false, _links: true, _embedded: true }
57
+ headers = {}
58
+ body = nil
59
+
60
+ raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
61
+
62
+ query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
63
+ query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
64
+ query_params[:page] = params[:page] if params.has_key?(:page)
65
+ query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
66
+ query_params[:start] = params[:start] if params.has_key?(:start)
67
+ query_params[:end] = params[:end] if params.has_key?(:end)
68
+ query_params[:auditLogFilter] = params[:auditLogFilter] if params.has_key?(:auditLogFilter)
69
+ headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
70
+ query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
71
+ query_params[:_links] = params[:_links] if params.has_key?(:_links)
72
+ query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
73
+
74
+ path = "/orgs/#{params[:orgId]}/audit-logs"
75
+
76
+ @client.request(
77
+ method: :get,
78
+ path: path,
79
+ query: query_params,
80
+ headers: headers,
81
+ body: body)
82
+ end
83
+
84
+ end
85
+ end
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Auth Resource
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  require "httparty"
2
24
 
3
25
  module LosantRest
@@ -5,7 +27,7 @@ module LosantRest
5
27
  #
6
28
  # User API for accessing Losant data
7
29
  #
8
- # Built For Version 1.5.1
30
+ # Built For Version 1.5.2
9
31
  class Client
10
32
  attr_accessor :auth_token, :url
11
33
 
@@ -38,6 +60,14 @@ module LosantRest
38
60
  @applications ||= Applications.new(self)
39
61
  end
40
62
 
63
+ def audit_log
64
+ @audit_log ||= AuditLog.new(self)
65
+ end
66
+
67
+ def audit_logs
68
+ @audit_logs ||= AuditLogs.new(self)
69
+ end
70
+
41
71
  def auth
42
72
  @auth ||= Auth.new(self)
43
73
  end
@@ -94,6 +124,10 @@ module LosantRest
94
124
  @org ||= Org.new(self)
95
125
  end
96
126
 
127
+ def org_invites
128
+ @org_invites ||= OrgInvites.new(self)
129
+ end
130
+
97
131
  def orgs
98
132
  @orgs ||= Orgs.new(self)
99
133
  end
@@ -128,7 +162,7 @@ module LosantRest
128
162
 
129
163
  headers["Accept"] = "application/json"
130
164
  headers["Content-Type"] = "application/json"
131
- headers["Accept-Version"] = "^1.5.1"
165
+ headers["Accept-Version"] = "^1.5.2"
132
166
  headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
133
167
  path = self.url + options.fetch(:path, "")
134
168
 
@@ -1,3 +1,25 @@
1
+ # The MIT License (MIT)
2
+ #
3
+ # Copyright (c) 2017 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
+
1
23
  module LosantRest
2
24
 
3
25
  # Class containing all the actions for the Dashboard Resource