losant_rest 1.8.7 → 1.8.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/docs/_schemas.md +38618 -21196
  3. data/docs/application.md +76 -0
  4. data/docs/auth.md +0 -36
  5. data/docs/dashboards.md +1 -1
  6. data/docs/dataTableRows.md +2 -2
  7. data/docs/device.md +1 -0
  8. data/docs/events.md +81 -0
  9. data/docs/file.md +43 -0
  10. data/docs/me.md +50 -13
  11. data/lib/losant_rest.rb +0 -4
  12. data/lib/losant_rest/application.rb +90 -0
  13. data/lib/losant_rest/application_api_token.rb +2 -0
  14. data/lib/losant_rest/application_api_tokens.rb +2 -0
  15. data/lib/losant_rest/application_certificate.rb +2 -0
  16. data/lib/losant_rest/application_certificate_authorities.rb +2 -0
  17. data/lib/losant_rest/application_certificate_authority.rb +2 -0
  18. data/lib/losant_rest/application_certificates.rb +2 -0
  19. data/lib/losant_rest/application_key.rb +2 -0
  20. data/lib/losant_rest/application_keys.rb +2 -0
  21. data/lib/losant_rest/applications.rb +2 -0
  22. data/lib/losant_rest/audit_log.rb +2 -0
  23. data/lib/losant_rest/audit_logs.rb +2 -0
  24. data/lib/losant_rest/auth.rb +2 -42
  25. data/lib/losant_rest/client.rb +2 -18
  26. data/lib/losant_rest/dashboard.rb +2 -0
  27. data/lib/losant_rest/dashboards.rb +3 -1
  28. data/lib/losant_rest/data.rb +2 -0
  29. data/lib/losant_rest/data_table.rb +2 -0
  30. data/lib/losant_rest/data_table_row.rb +2 -0
  31. data/lib/losant_rest/data_table_rows.rb +4 -2
  32. data/lib/losant_rest/data_tables.rb +2 -0
  33. data/lib/losant_rest/device.rb +4 -0
  34. data/lib/losant_rest/device_recipe.rb +2 -0
  35. data/lib/losant_rest/device_recipes.rb +2 -0
  36. data/lib/losant_rest/devices.rb +2 -0
  37. data/lib/losant_rest/edge_deployments.rb +2 -0
  38. data/lib/losant_rest/event.rb +2 -0
  39. data/lib/losant_rest/events.rb +103 -0
  40. data/lib/losant_rest/experience.rb +2 -0
  41. data/lib/losant_rest/experience_domain.rb +2 -0
  42. data/lib/losant_rest/experience_domains.rb +2 -0
  43. data/lib/losant_rest/experience_endpoint.rb +2 -0
  44. data/lib/losant_rest/experience_endpoints.rb +2 -0
  45. data/lib/losant_rest/experience_group.rb +2 -0
  46. data/lib/losant_rest/experience_groups.rb +2 -0
  47. data/lib/losant_rest/experience_slug.rb +2 -0
  48. data/lib/losant_rest/experience_slugs.rb +2 -0
  49. data/lib/losant_rest/experience_user.rb +2 -0
  50. data/lib/losant_rest/experience_users.rb +2 -0
  51. data/lib/losant_rest/experience_version.rb +2 -0
  52. data/lib/losant_rest/experience_versions.rb +2 -0
  53. data/lib/losant_rest/experience_view.rb +2 -0
  54. data/lib/losant_rest/experience_views.rb +2 -0
  55. data/lib/losant_rest/file.rb +2 -0
  56. data/lib/losant_rest/files.rb +2 -0
  57. data/lib/losant_rest/flow.rb +2 -0
  58. data/lib/losant_rest/flow_version.rb +2 -0
  59. data/lib/losant_rest/flow_versions.rb +2 -0
  60. data/lib/losant_rest/flows.rb +2 -0
  61. data/lib/losant_rest/integration.rb +2 -0
  62. data/lib/losant_rest/integrations.rb +2 -0
  63. data/lib/losant_rest/me.rb +57 -13
  64. data/lib/losant_rest/notebook.rb +2 -0
  65. data/lib/losant_rest/notebooks.rb +2 -0
  66. data/lib/losant_rest/org.rb +2 -0
  67. data/lib/losant_rest/org_invites.rb +2 -0
  68. data/lib/losant_rest/orgs.rb +2 -0
  69. data/lib/losant_rest/version.rb +1 -1
  70. data/lib/losant_rest/webhook.rb +2 -0
  71. data/lib/losant_rest/webhooks.rb +2 -0
  72. data/schemas/advancedEventQuery.json +817 -0
  73. data/schemas/{dataTableQuery.json → advancedQuery.json} +5 -4
  74. data/schemas/apiTokens.json +4 -1
  75. data/schemas/application.json +30 -1
  76. data/schemas/applicationApiTokenPost.json +5 -0
  77. data/schemas/applicationCertificate.json +29 -1
  78. data/schemas/applicationCertificateAuthorities.json +36 -3
  79. data/schemas/applicationCertificateAuthority.json +32 -2
  80. data/schemas/applicationCertificateAuthorityPatch.json +3 -1
  81. data/schemas/applicationCertificateAuthorityPost.json +3 -1
  82. data/schemas/applicationCertificatePatch.json +3 -1
  83. data/schemas/applicationCertificatePost.json +3 -1
  84. data/schemas/applicationCertificates.json +33 -2
  85. data/schemas/applicationKeys.json +4 -1
  86. data/schemas/applicationPatch.json +28 -0
  87. data/schemas/applicationPost.json +28 -0
  88. data/schemas/applications.json +34 -2
  89. data/schemas/auditLog.json +0 -3
  90. data/schemas/auditLogFilter.json +0 -3
  91. data/schemas/auditLogs.json +4 -4
  92. data/schemas/authedDevice.json +7 -0
  93. data/schemas/dashboard.json +3970 -72
  94. data/schemas/dashboardPatch.json +3969 -72
  95. data/schemas/dashboardPost.json +3969 -72
  96. data/schemas/dashboardSendReport.json +4 -0
  97. data/schemas/dashboardUpdateEvents.json +46 -0
  98. data/schemas/dashboards.json +3974 -73
  99. data/schemas/dataTableRows.json +4 -1
  100. data/schemas/dataTableRowsExport.json +11 -7
  101. data/schemas/dataTables.json +4 -1
  102. data/schemas/deviceRecipes.json +4 -1
  103. data/schemas/devices.json +4 -1
  104. data/schemas/event.json +19 -2
  105. data/schemas/eventPost.json +0 -1
  106. data/schemas/eventTagsSummary.json +28 -0
  107. data/schemas/events.json +841 -3
  108. data/schemas/eventsDeleted.json +9 -0
  109. data/schemas/eventsExport.json +830 -0
  110. data/schemas/experienceDomain.json +6 -2
  111. data/schemas/experienceDomainPatch.json +14 -10
  112. data/schemas/experienceDomainPost.json +8 -4
  113. data/schemas/experienceDomains.json +6 -2
  114. data/schemas/experienceEndpoints.json +4 -1
  115. data/schemas/experienceGroup.json +2 -2
  116. data/schemas/experienceGroupPatch.json +2 -2
  117. data/schemas/experienceGroupPost.json +2 -2
  118. data/schemas/experienceGroups.json +6 -3
  119. data/schemas/experienceSlugPatch.json +2 -2
  120. data/schemas/experienceSlugPost.json +2 -2
  121. data/schemas/experienceUsers.json +4 -1
  122. data/schemas/experienceViews.json +4 -1
  123. data/schemas/files.json +4 -1
  124. data/schemas/flow.json +4 -0
  125. data/schemas/flowPatch.json +6 -2
  126. data/schemas/flowPost.json +4 -0
  127. data/schemas/flowVersion.json +8 -0
  128. data/schemas/flowVersionPost.json +4 -0
  129. data/schemas/flowVersions.json +12 -1
  130. data/schemas/flows.json +8 -1
  131. data/schemas/flowsImportPost.json +10 -2
  132. data/schemas/flowsImportResult.json +12 -0
  133. data/schemas/githubLogin.json +6 -15
  134. data/schemas/integrations.json +4 -1
  135. data/schemas/notebooks.json +4 -1
  136. data/schemas/org.json +2 -4
  137. data/schemas/orgPatch.json +2 -1
  138. data/schemas/orgPost.json +2 -1
  139. data/schemas/orgs.json +6 -5
  140. data/schemas/passwordResetFinish.json +0 -4
  141. data/schemas/passwordResetInput.json +0 -4
  142. data/schemas/resourceTransfer.json +0 -8
  143. data/schemas/userCredentials.json +6 -15
  144. data/schemas/userPost.json +6 -15
  145. data/schemas/webhooks.json +4 -1
  146. data/test/basic_test.rb +15 -0
  147. metadata +8 -23
  148. data/docs/solution.md +0 -133
  149. data/docs/solutionUser.md +0 -139
  150. data/docs/solutionUsers.md +0 -96
  151. data/docs/solutions.md +0 -91
  152. data/lib/losant_rest/solution.rb +0 -174
  153. data/lib/losant_rest/solution_user.rb +0 -180
  154. data/lib/losant_rest/solution_users.rb +0 -138
  155. data/lib/losant_rest/solutions.rb +0 -134
  156. data/schemas/authedSolutionUser.json +0 -18
  157. data/schemas/fileUploadPostResp.json +0 -109
  158. data/schemas/solution.json +0 -76
  159. data/schemas/solutionMe.json +0 -150
  160. data/schemas/solutionPatch.json +0 -48
  161. data/schemas/solutionPost.json +0 -52
  162. data/schemas/solutionUser.json +0 -103
  163. data/schemas/solutionUserCredentials.json +0 -34
  164. data/schemas/solutionUserPatch.json +0 -74
  165. data/schemas/solutionUserPost.json +0 -80
  166. data/schemas/solutionUsers.json +0 -149
  167. data/schemas/solutions.json +0 -118
@@ -1,174 +0,0 @@
1
- # The MIT License (MIT)
2
- #
3
- # Copyright (c) 2019 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 Solution Resource
26
- class Solution
27
-
28
- def initialize(client)
29
- @client = client
30
- end
31
-
32
- # Deletes a solution
33
- #
34
- # Authentication:
35
- # The client must be configured with a valid api
36
- # access token to call this action. The token
37
- # must include at least one of the following scopes:
38
- # all.Organization, all.User, solution.*, or solution.delete.
39
- #
40
- # Parameters:
41
- # * {string} orgId - ID associated with the organization
42
- # * {string} solutionId - ID associated with the solution
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 - If solution was successfully deleted (https://api.losant.com/#/definitions/success)
50
- #
51
- # Errors:
52
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
53
- # * 404 - Error if solution was not found (https://api.losant.com/#/definitions/error)
54
- def delete(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
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
62
-
63
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
64
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
65
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
66
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
67
-
68
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}"
69
-
70
- @client.request(
71
- method: :delete,
72
- path: path,
73
- query: query_params,
74
- headers: headers,
75
- body: body)
76
- end
77
-
78
- # Retrieves information on a solution
79
- #
80
- # Authentication:
81
- # The client must be configured with a valid api
82
- # access token to call this action. The token
83
- # must include at least one of the following scopes:
84
- # all.Organization, all.Organization.read, all.User, all.User.read, solution.*, or solution.get.
85
- #
86
- # Parameters:
87
- # * {string} orgId - ID associated with the organization
88
- # * {string} solutionId - ID associated with the solution
89
- # * {string} losantdomain - Domain scope of request (rarely needed)
90
- # * {boolean} _actions - Return resource actions in response
91
- # * {boolean} _links - Return resource link in response
92
- # * {boolean} _embedded - Return embedded resources in response
93
- #
94
- # Responses:
95
- # * 200 - Solution information (https://api.losant.com/#/definitions/solution)
96
- #
97
- # Errors:
98
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
99
- # * 404 - Error if solution was not found (https://api.losant.com/#/definitions/error)
100
- def get(params = {})
101
- params = Utils.symbolize_hash_keys(params)
102
- query_params = { _actions: false, _links: true, _embedded: true }
103
- headers = {}
104
- body = nil
105
-
106
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
107
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
108
-
109
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
110
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
111
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
112
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
113
-
114
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}"
115
-
116
- @client.request(
117
- method: :get,
118
- path: path,
119
- query: query_params,
120
- headers: headers,
121
- body: body)
122
- end
123
-
124
- # Updates information about a solution
125
- #
126
- # Authentication:
127
- # The client must be configured with a valid api
128
- # access token to call this action. The token
129
- # must include at least one of the following scopes:
130
- # all.Organization, all.User, solution.*, or solution.patch.
131
- #
132
- # Parameters:
133
- # * {string} orgId - ID associated with the organization
134
- # * {string} solutionId - ID associated with the solution
135
- # * {hash} solution - Object containing new properties of the solution (https://api.losant.com/#/definitions/solutionPatch)
136
- # * {string} losantdomain - Domain scope of request (rarely needed)
137
- # * {boolean} _actions - Return resource actions in response
138
- # * {boolean} _links - Return resource link in response
139
- # * {boolean} _embedded - Return embedded resources in response
140
- #
141
- # Responses:
142
- # * 200 - Updated solution information (https://api.losant.com/#/definitions/solution)
143
- #
144
- # Errors:
145
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
146
- # * 404 - Error if solution was not found (https://api.losant.com/#/definitions/error)
147
- def patch(params = {})
148
- params = Utils.symbolize_hash_keys(params)
149
- query_params = { _actions: false, _links: true, _embedded: true }
150
- headers = {}
151
- body = nil
152
-
153
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
154
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
155
- raise ArgumentError.new("solution is required") unless params.has_key?(:solution)
156
-
157
- body = params[:solution] if params.has_key?(:solution)
158
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
159
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
160
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
161
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
162
-
163
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}"
164
-
165
- @client.request(
166
- method: :patch,
167
- path: path,
168
- query: query_params,
169
- headers: headers,
170
- body: body)
171
- end
172
-
173
- end
174
- end
@@ -1,180 +0,0 @@
1
- # The MIT License (MIT)
2
- #
3
- # Copyright (c) 2019 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 Solution User Resource
26
- class SolutionUser
27
-
28
- def initialize(client)
29
- @client = client
30
- end
31
-
32
- # Deletes a solution user
33
- #
34
- # Authentication:
35
- # The client must be configured with a valid api
36
- # access token to call this action. The token
37
- # must include at least one of the following scopes:
38
- # all.Organization, all.User, solutionUser.*, or solutionUser.delete.
39
- #
40
- # Parameters:
41
- # * {string} orgId - ID associated with the organization
42
- # * {string} solutionId - ID associated with the solution
43
- # * {string} solutionUserId - ID associated with the solution user
44
- # * {string} losantdomain - Domain scope of request (rarely needed)
45
- # * {boolean} _actions - Return resource actions in response
46
- # * {boolean} _links - Return resource link in response
47
- # * {boolean} _embedded - Return embedded resources in response
48
- #
49
- # Responses:
50
- # * 200 - If solution user was successfully deleted (https://api.losant.com/#/definitions/success)
51
- #
52
- # Errors:
53
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
54
- # * 404 - Error if solution user was not found (https://api.losant.com/#/definitions/error)
55
- def delete(params = {})
56
- params = Utils.symbolize_hash_keys(params)
57
- query_params = { _actions: false, _links: true, _embedded: true }
58
- headers = {}
59
- body = nil
60
-
61
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
62
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
63
- raise ArgumentError.new("solutionUserId is required") unless params.has_key?(:solutionUserId)
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 = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}/users/#{params[:solutionUserId]}"
71
-
72
- @client.request(
73
- method: :delete,
74
- path: path,
75
- query: query_params,
76
- headers: headers,
77
- body: body)
78
- end
79
-
80
- # Retrieves information on a solution user
81
- #
82
- # Authentication:
83
- # The client must be configured with a valid api
84
- # access token to call this action. The token
85
- # must include at least one of the following scopes:
86
- # all.Organization, all.Organization.read, all.User, all.User.read, solutionUser.*, or solutionUser.get.
87
- #
88
- # Parameters:
89
- # * {string} orgId - ID associated with the organization
90
- # * {string} solutionId - ID associated with the solution
91
- # * {string} solutionUserId - ID associated with the solution user
92
- # * {string} losantdomain - Domain scope of request (rarely needed)
93
- # * {boolean} _actions - Return resource actions in response
94
- # * {boolean} _links - Return resource link in response
95
- # * {boolean} _embedded - Return embedded resources in response
96
- #
97
- # Responses:
98
- # * 200 - Solution user information (https://api.losant.com/#/definitions/solutionUser)
99
- #
100
- # Errors:
101
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
102
- # * 404 - Error if solution user was not found (https://api.losant.com/#/definitions/error)
103
- def get(params = {})
104
- params = Utils.symbolize_hash_keys(params)
105
- query_params = { _actions: false, _links: true, _embedded: true }
106
- headers = {}
107
- body = nil
108
-
109
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
110
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
111
- raise ArgumentError.new("solutionUserId is required") unless params.has_key?(:solutionUserId)
112
-
113
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
114
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
115
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
116
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
117
-
118
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}/users/#{params[:solutionUserId]}"
119
-
120
- @client.request(
121
- method: :get,
122
- path: path,
123
- query: query_params,
124
- headers: headers,
125
- body: body)
126
- end
127
-
128
- # Updates information about a solution user
129
- #
130
- # Authentication:
131
- # The client must be configured with a valid api
132
- # access token to call this action. The token
133
- # must include at least one of the following scopes:
134
- # all.Organization, all.User, solutionUser.*, or solutionUser.patch.
135
- #
136
- # Parameters:
137
- # * {string} orgId - ID associated with the organization
138
- # * {string} solutionId - ID associated with the solution
139
- # * {string} solutionUserId - ID associated with the solution user
140
- # * {hash} solutionUser - Object containing new properties of the solution user (https://api.losant.com/#/definitions/solutionUserPatch)
141
- # * {string} losantdomain - Domain scope of request (rarely needed)
142
- # * {boolean} _actions - Return resource actions in response
143
- # * {boolean} _links - Return resource link in response
144
- # * {boolean} _embedded - Return embedded resources in response
145
- #
146
- # Responses:
147
- # * 200 - Updated solution user information (https://api.losant.com/#/definitions/solutionUser)
148
- #
149
- # Errors:
150
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
151
- # * 404 - Error if solution user was not found (https://api.losant.com/#/definitions/error)
152
- def patch(params = {})
153
- params = Utils.symbolize_hash_keys(params)
154
- query_params = { _actions: false, _links: true, _embedded: true }
155
- headers = {}
156
- body = nil
157
-
158
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
159
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
160
- raise ArgumentError.new("solutionUserId is required") unless params.has_key?(:solutionUserId)
161
- raise ArgumentError.new("solutionUser is required") unless params.has_key?(:solutionUser)
162
-
163
- body = params[:solutionUser] if params.has_key?(:solutionUser)
164
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
165
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
166
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
167
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
168
-
169
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}/users/#{params[:solutionUserId]}"
170
-
171
- @client.request(
172
- method: :patch,
173
- path: path,
174
- query: query_params,
175
- headers: headers,
176
- body: body)
177
- end
178
-
179
- end
180
- end
@@ -1,138 +0,0 @@
1
- # The MIT License (MIT)
2
- #
3
- # Copyright (c) 2019 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 Solution Users Resource
26
- class SolutionUsers
27
-
28
- def initialize(client)
29
- @client = client
30
- end
31
-
32
- # Returns the users for the solution
33
- #
34
- # Authentication:
35
- # The client must be configured with a valid api
36
- # access token to call this action. The token
37
- # must include at least one of the following scopes:
38
- # all.Organization, all.Organization.read, all.User, all.User.read, solutionUsers.*, or solutionUsers.get.
39
- #
40
- # Parameters:
41
- # * {string} orgId - ID associated with the organization
42
- # * {string} solutionId - ID associated with the solution
43
- # * {string} sortField - Field to sort the results by. Accepted values are: email, firstName, lastName, id, creationDate, lastLogin, lastUpdated
44
- # * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
45
- # * {string} page - Which page of results to return
46
- # * {string} perPage - How many items to return per page
47
- # * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: email, firstName, lastName
48
- # * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
49
- # * {string} losantdomain - Domain scope of request (rarely needed)
50
- # * {boolean} _actions - Return resource actions in response
51
- # * {boolean} _links - Return resource link in response
52
- # * {boolean} _embedded - Return embedded resources in response
53
- #
54
- # Responses:
55
- # * 200 - Collection of solution users (https://api.losant.com/#/definitions/solutionUsers)
56
- #
57
- # Errors:
58
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
59
- def get(params = {})
60
- params = Utils.symbolize_hash_keys(params)
61
- query_params = { _actions: false, _links: true, _embedded: true }
62
- headers = {}
63
- body = nil
64
-
65
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
66
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
67
-
68
- query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
69
- query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
70
- query_params[:page] = params[:page] if params.has_key?(:page)
71
- query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
72
- query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
73
- query_params[:filter] = params[:filter] if params.has_key?(:filter)
74
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
75
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
76
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
77
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
78
-
79
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}/users"
80
-
81
- @client.request(
82
- method: :get,
83
- path: path,
84
- query: query_params,
85
- headers: headers,
86
- body: body)
87
- end
88
-
89
- # Create a new solution user
90
- #
91
- # Authentication:
92
- # The client must be configured with a valid api
93
- # access token to call this action. The token
94
- # must include at least one of the following scopes:
95
- # all.Organization, all.User, solutionUsers.*, or solutionUsers.post.
96
- #
97
- # Parameters:
98
- # * {string} orgId - ID associated with the organization
99
- # * {string} solutionId - ID associated with the solution
100
- # * {hash} solutionUser - New solution user information (https://api.losant.com/#/definitions/solutionUserPost)
101
- # * {string} losantdomain - Domain scope of request (rarely needed)
102
- # * {boolean} _actions - Return resource actions in response
103
- # * {boolean} _links - Return resource link in response
104
- # * {boolean} _embedded - Return embedded resources in response
105
- #
106
- # Responses:
107
- # * 201 - Successfully created solution user (https://api.losant.com/#/definitions/solutionUser)
108
- #
109
- # Errors:
110
- # * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
111
- def post(params = {})
112
- params = Utils.symbolize_hash_keys(params)
113
- query_params = { _actions: false, _links: true, _embedded: true }
114
- headers = {}
115
- body = nil
116
-
117
- raise ArgumentError.new("orgId is required") unless params.has_key?(:orgId)
118
- raise ArgumentError.new("solutionId is required") unless params.has_key?(:solutionId)
119
- raise ArgumentError.new("solutionUser is required") unless params.has_key?(:solutionUser)
120
-
121
- body = params[:solutionUser] if params.has_key?(:solutionUser)
122
- headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
123
- query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
124
- query_params[:_links] = params[:_links] if params.has_key?(:_links)
125
- query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
126
-
127
- path = "/orgs/#{params[:orgId]}/solutions/#{params[:solutionId]}/users"
128
-
129
- @client.request(
130
- method: :post,
131
- path: path,
132
- query: query_params,
133
- headers: headers,
134
- body: body)
135
- end
136
-
137
- end
138
- end