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.
- checksums.yaml +4 -4
- data/docs/_schemas.md +38618 -21196
- data/docs/application.md +76 -0
- data/docs/auth.md +0 -36
- data/docs/dashboards.md +1 -1
- data/docs/dataTableRows.md +2 -2
- data/docs/device.md +1 -0
- data/docs/events.md +81 -0
- data/docs/file.md +43 -0
- data/docs/me.md +50 -13
- data/lib/losant_rest.rb +0 -4
- data/lib/losant_rest/application.rb +90 -0
- data/lib/losant_rest/application_api_token.rb +2 -0
- data/lib/losant_rest/application_api_tokens.rb +2 -0
- data/lib/losant_rest/application_certificate.rb +2 -0
- data/lib/losant_rest/application_certificate_authorities.rb +2 -0
- data/lib/losant_rest/application_certificate_authority.rb +2 -0
- data/lib/losant_rest/application_certificates.rb +2 -0
- data/lib/losant_rest/application_key.rb +2 -0
- data/lib/losant_rest/application_keys.rb +2 -0
- data/lib/losant_rest/applications.rb +2 -0
- data/lib/losant_rest/audit_log.rb +2 -0
- data/lib/losant_rest/audit_logs.rb +2 -0
- data/lib/losant_rest/auth.rb +2 -42
- data/lib/losant_rest/client.rb +2 -18
- data/lib/losant_rest/dashboard.rb +2 -0
- data/lib/losant_rest/dashboards.rb +3 -1
- data/lib/losant_rest/data.rb +2 -0
- data/lib/losant_rest/data_table.rb +2 -0
- data/lib/losant_rest/data_table_row.rb +2 -0
- data/lib/losant_rest/data_table_rows.rb +4 -2
- data/lib/losant_rest/data_tables.rb +2 -0
- data/lib/losant_rest/device.rb +4 -0
- data/lib/losant_rest/device_recipe.rb +2 -0
- data/lib/losant_rest/device_recipes.rb +2 -0
- data/lib/losant_rest/devices.rb +2 -0
- data/lib/losant_rest/edge_deployments.rb +2 -0
- data/lib/losant_rest/event.rb +2 -0
- data/lib/losant_rest/events.rb +103 -0
- data/lib/losant_rest/experience.rb +2 -0
- data/lib/losant_rest/experience_domain.rb +2 -0
- data/lib/losant_rest/experience_domains.rb +2 -0
- data/lib/losant_rest/experience_endpoint.rb +2 -0
- data/lib/losant_rest/experience_endpoints.rb +2 -0
- data/lib/losant_rest/experience_group.rb +2 -0
- data/lib/losant_rest/experience_groups.rb +2 -0
- data/lib/losant_rest/experience_slug.rb +2 -0
- data/lib/losant_rest/experience_slugs.rb +2 -0
- data/lib/losant_rest/experience_user.rb +2 -0
- data/lib/losant_rest/experience_users.rb +2 -0
- data/lib/losant_rest/experience_version.rb +2 -0
- data/lib/losant_rest/experience_versions.rb +2 -0
- data/lib/losant_rest/experience_view.rb +2 -0
- data/lib/losant_rest/experience_views.rb +2 -0
- data/lib/losant_rest/file.rb +2 -0
- data/lib/losant_rest/files.rb +2 -0
- data/lib/losant_rest/flow.rb +2 -0
- data/lib/losant_rest/flow_version.rb +2 -0
- data/lib/losant_rest/flow_versions.rb +2 -0
- data/lib/losant_rest/flows.rb +2 -0
- data/lib/losant_rest/integration.rb +2 -0
- data/lib/losant_rest/integrations.rb +2 -0
- data/lib/losant_rest/me.rb +57 -13
- data/lib/losant_rest/notebook.rb +2 -0
- data/lib/losant_rest/notebooks.rb +2 -0
- data/lib/losant_rest/org.rb +2 -0
- data/lib/losant_rest/org_invites.rb +2 -0
- data/lib/losant_rest/orgs.rb +2 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest/webhook.rb +2 -0
- data/lib/losant_rest/webhooks.rb +2 -0
- data/schemas/advancedEventQuery.json +817 -0
- data/schemas/{dataTableQuery.json → advancedQuery.json} +5 -4
- data/schemas/apiTokens.json +4 -1
- data/schemas/application.json +30 -1
- data/schemas/applicationApiTokenPost.json +5 -0
- data/schemas/applicationCertificate.json +29 -1
- data/schemas/applicationCertificateAuthorities.json +36 -3
- data/schemas/applicationCertificateAuthority.json +32 -2
- data/schemas/applicationCertificateAuthorityPatch.json +3 -1
- data/schemas/applicationCertificateAuthorityPost.json +3 -1
- data/schemas/applicationCertificatePatch.json +3 -1
- data/schemas/applicationCertificatePost.json +3 -1
- data/schemas/applicationCertificates.json +33 -2
- data/schemas/applicationKeys.json +4 -1
- data/schemas/applicationPatch.json +28 -0
- data/schemas/applicationPost.json +28 -0
- data/schemas/applications.json +34 -2
- data/schemas/auditLog.json +0 -3
- data/schemas/auditLogFilter.json +0 -3
- data/schemas/auditLogs.json +4 -4
- data/schemas/authedDevice.json +7 -0
- data/schemas/dashboard.json +3970 -72
- data/schemas/dashboardPatch.json +3969 -72
- data/schemas/dashboardPost.json +3969 -72
- data/schemas/dashboardSendReport.json +4 -0
- data/schemas/dashboardUpdateEvents.json +46 -0
- data/schemas/dashboards.json +3974 -73
- data/schemas/dataTableRows.json +4 -1
- data/schemas/dataTableRowsExport.json +11 -7
- data/schemas/dataTables.json +4 -1
- data/schemas/deviceRecipes.json +4 -1
- data/schemas/devices.json +4 -1
- data/schemas/event.json +19 -2
- data/schemas/eventPost.json +0 -1
- data/schemas/eventTagsSummary.json +28 -0
- data/schemas/events.json +841 -3
- data/schemas/eventsDeleted.json +9 -0
- data/schemas/eventsExport.json +830 -0
- data/schemas/experienceDomain.json +6 -2
- data/schemas/experienceDomainPatch.json +14 -10
- data/schemas/experienceDomainPost.json +8 -4
- data/schemas/experienceDomains.json +6 -2
- data/schemas/experienceEndpoints.json +4 -1
- data/schemas/experienceGroup.json +2 -2
- data/schemas/experienceGroupPatch.json +2 -2
- data/schemas/experienceGroupPost.json +2 -2
- data/schemas/experienceGroups.json +6 -3
- data/schemas/experienceSlugPatch.json +2 -2
- data/schemas/experienceSlugPost.json +2 -2
- data/schemas/experienceUsers.json +4 -1
- data/schemas/experienceViews.json +4 -1
- data/schemas/files.json +4 -1
- data/schemas/flow.json +4 -0
- data/schemas/flowPatch.json +6 -2
- data/schemas/flowPost.json +4 -0
- data/schemas/flowVersion.json +8 -0
- data/schemas/flowVersionPost.json +4 -0
- data/schemas/flowVersions.json +12 -1
- data/schemas/flows.json +8 -1
- data/schemas/flowsImportPost.json +10 -2
- data/schemas/flowsImportResult.json +12 -0
- data/schemas/githubLogin.json +6 -15
- data/schemas/integrations.json +4 -1
- data/schemas/notebooks.json +4 -1
- data/schemas/org.json +2 -4
- data/schemas/orgPatch.json +2 -1
- data/schemas/orgPost.json +2 -1
- data/schemas/orgs.json +6 -5
- data/schemas/passwordResetFinish.json +0 -4
- data/schemas/passwordResetInput.json +0 -4
- data/schemas/resourceTransfer.json +0 -8
- data/schemas/userCredentials.json +6 -15
- data/schemas/userPost.json +6 -15
- data/schemas/webhooks.json +4 -1
- data/test/basic_test.rb +15 -0
- metadata +8 -23
- data/docs/solution.md +0 -133
- data/docs/solutionUser.md +0 -139
- data/docs/solutionUsers.md +0 -96
- data/docs/solutions.md +0 -91
- data/lib/losant_rest/solution.rb +0 -174
- data/lib/losant_rest/solution_user.rb +0 -180
- data/lib/losant_rest/solution_users.rb +0 -138
- data/lib/losant_rest/solutions.rb +0 -134
- data/schemas/authedSolutionUser.json +0 -18
- data/schemas/fileUploadPostResp.json +0 -109
- data/schemas/solution.json +0 -76
- data/schemas/solutionMe.json +0 -150
- data/schemas/solutionPatch.json +0 -48
- data/schemas/solutionPost.json +0 -52
- data/schemas/solutionUser.json +0 -103
- data/schemas/solutionUserCredentials.json +0 -34
- data/schemas/solutionUserPatch.json +0 -74
- data/schemas/solutionUserPost.json +0 -80
- data/schemas/solutionUsers.json +0 -149
- data/schemas/solutions.json +0 -118
data/lib/losant_rest/solution.rb
DELETED
@@ -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
|