losant_rest 1.7.2 → 1.8.0
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 +7347 -4603
- data/docs/application.md +47 -0
- data/docs/applicationApiToken.md +3 -0
- data/docs/applicationApiTokens.md +2 -0
- data/docs/applicationKey.md +3 -0
- data/docs/applicationKeys.md +2 -0
- data/docs/applications.md +2 -0
- data/docs/auditLog.md +1 -0
- data/docs/auditLogs.md +1 -0
- data/docs/auth.md +4 -0
- data/docs/dashboard.md +4 -0
- data/docs/dashboards.md +2 -0
- data/docs/data.md +2 -0
- data/docs/dataTable.md +5 -0
- data/docs/dataTableRow.md +3 -0
- data/docs/dataTableRows.md +9 -3
- data/docs/dataTables.md +2 -0
- data/docs/device.md +12 -0
- data/docs/deviceRecipe.md +4 -0
- data/docs/deviceRecipes.md +2 -0
- data/docs/devices.md +4 -0
- data/docs/edgeDeployments.md +4 -0
- data/docs/event.md +3 -0
- data/docs/events.md +4 -0
- data/docs/experience.md +52 -8
- data/docs/experienceDomain.md +3 -0
- data/docs/experienceDomains.md +2 -0
- data/docs/experienceEndpoint.md +4 -0
- data/docs/experienceEndpoints.md +9 -1
- data/docs/experienceGroup.md +3 -0
- data/docs/experienceGroups.md +2 -0
- data/docs/experienceSlug.md +133 -0
- data/docs/experienceSlugs.md +87 -0
- data/docs/experienceUser.md +3 -0
- data/docs/experienceUsers.md +2 -0
- data/docs/experienceVersion.md +133 -0
- data/docs/experienceVersions.md +93 -0
- data/docs/experienceView.md +4 -0
- data/docs/experienceViews.md +3 -0
- data/docs/file.md +4 -0
- data/docs/files.md +2 -0
- data/docs/flow.md +8 -0
- data/docs/flowVersion.md +4 -0
- data/docs/flowVersions.md +2 -0
- data/docs/flows.md +54 -1
- data/docs/integration.md +3 -0
- data/docs/integrations.md +2 -0
- data/docs/me.md +19 -3
- data/docs/org.md +10 -0
- data/docs/orgInvites.md +2 -0
- data/docs/orgs.md +2 -0
- data/docs/solution.md +3 -0
- data/docs/solutionUser.md +3 -0
- data/docs/solutionUsers.md +2 -0
- data/docs/solutions.md +2 -0
- data/docs/webhook.md +3 -0
- data/docs/webhooks.md +2 -0
- data/lib/losant_rest/application.rb +47 -0
- data/lib/losant_rest/client.rb +18 -2
- data/lib/losant_rest/data_table_rows.rb +3 -3
- data/lib/losant_rest/experience.rb +62 -11
- data/lib/losant_rest/experience_endpoint.rb +2 -0
- data/lib/losant_rest/experience_endpoints.rb +11 -1
- data/lib/losant_rest/experience_slug.rb +174 -0
- data/lib/losant_rest/experience_slugs.rb +124 -0
- data/lib/losant_rest/experience_version.rb +174 -0
- data/lib/losant_rest/experience_versions.rb +136 -0
- data/lib/losant_rest/experience_view.rb +2 -0
- data/lib/losant_rest/experience_views.rb +2 -0
- data/lib/losant_rest/flows.rb +66 -1
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest.rb +4 -0
- data/schemas/apiTokens.json +128 -0
- data/schemas/application.json +6 -0
- data/schemas/applicationApiTokenPost.json +18 -0
- data/schemas/applications.json +6 -0
- data/schemas/dataTableRowInMultiple.json +20 -0
- data/schemas/dataTableRowInsert.json +42 -0
- data/schemas/dataTableRowInsertResult.json +54 -0
- data/schemas/edgeDeployment.json +119 -0
- data/schemas/emailVerificationVerify.json +20 -0
- data/schemas/experienceBootstrapOptions.json +25 -0
- data/schemas/experienceBootstrapResult.json +16 -0
- data/schemas/experienceDomain.json +5 -0
- data/schemas/experienceDomainPatch.json +12 -0
- data/schemas/experienceDomainPost.json +12 -0
- data/schemas/experienceDomains.json +5 -0
- data/schemas/experienceSlug.json +37 -0
- data/schemas/experienceSlugPatch.json +25 -0
- data/schemas/experienceSlugPost.json +28 -0
- data/schemas/experienceSlugs.json +57 -0
- data/schemas/experienceVersion.json +82 -0
- data/schemas/experienceVersionPatch.json +19 -0
- data/schemas/experienceVersionPost.json +35 -0
- data/schemas/experienceVersions.json +102 -0
- data/schemas/file.json +3 -0
- data/schemas/files.json +3 -0
- data/schemas/flow.json +5 -0
- data/schemas/flowPatch.json +1 -0
- data/schemas/flowPost.json +2 -0
- data/schemas/flowVersion.json +622 -433
- data/schemas/flowVersionPost.json +1 -0
- data/schemas/flowVersions.json +622 -433
- data/schemas/flows.json +6 -0
- data/schemas/flowsImportPost.json +3 -0
- data/schemas/flowsImportResult.json +628 -434
- data/schemas/githubLogin.json +18 -0
- data/schemas/me.json +12 -0
- data/schemas/mqttPublishBody.json +20 -0
- data/schemas/org.json +12 -0
- data/schemas/orgs.json +12 -0
- data/schemas/passwordResetFinish.json +31 -0
- data/schemas/passwordResetInput.json +19 -0
- data/schemas/passwordResetResponse.json +18 -0
- data/schemas/solutionMe.json +150 -0
- data/schemas/userCredentials.json +18 -0
- data/schemas/userPost.json +388 -0
- metadata +32 -2
@@ -0,0 +1,174 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 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 Experience Slug Resource
|
26
|
+
class ExperienceSlug
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deletes an experience slug
|
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.Application, all.Organization, all.User, experienceSlug.*, or experienceSlug.delete.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} experienceSlugId - ID associated with the experience slug
|
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 experience slug 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 experience slug 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("applicationId is required") unless params.has_key?(:applicationId)
|
61
|
+
raise ArgumentError.new("experienceSlugId is required") unless params.has_key?(:experienceSlugId)
|
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 = "/applications/#{params[:applicationId]}/experience/slugs/#{params[:experienceSlugId]}"
|
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 an experience slug
|
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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, experienceSlug.*, or experienceSlug.get.
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# * {string} applicationId - ID associated with the application
|
88
|
+
# * {string} experienceSlugId - ID associated with the experience slug
|
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 - Experience slug information (https://api.losant.com/#/definitions/experienceSlug)
|
96
|
+
#
|
97
|
+
# Errors:
|
98
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
99
|
+
# * 404 - Error if experience slug 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("applicationId is required") unless params.has_key?(:applicationId)
|
107
|
+
raise ArgumentError.new("experienceSlugId is required") unless params.has_key?(:experienceSlugId)
|
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 = "/applications/#{params[:applicationId]}/experience/slugs/#{params[:experienceSlugId]}"
|
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 an experience slug
|
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.Application, all.Organization, all.User, experienceSlug.*, or experienceSlug.patch.
|
131
|
+
#
|
132
|
+
# Parameters:
|
133
|
+
# * {string} applicationId - ID associated with the application
|
134
|
+
# * {string} experienceSlugId - ID associated with the experience slug
|
135
|
+
# * {hash} experienceSlug - Object containing new properties of the experience slug (https://api.losant.com/#/definitions/experienceSlugPatch)
|
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 experience slug information (https://api.losant.com/#/definitions/experienceSlug)
|
143
|
+
#
|
144
|
+
# Errors:
|
145
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
146
|
+
# * 404 - Error if experience slug 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("applicationId is required") unless params.has_key?(:applicationId)
|
154
|
+
raise ArgumentError.new("experienceSlugId is required") unless params.has_key?(:experienceSlugId)
|
155
|
+
raise ArgumentError.new("experienceSlug is required") unless params.has_key?(:experienceSlug)
|
156
|
+
|
157
|
+
body = params[:experienceSlug] if params.has_key?(:experienceSlug)
|
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 = "/applications/#{params[:applicationId]}/experience/slugs/#{params[:experienceSlugId]}"
|
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
|
@@ -0,0 +1,124 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 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 Experience Slugs Resource
|
26
|
+
class ExperienceSlugs
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns the experience slugs for an application
|
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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, experienceSlugs.*, or experienceSlugs.get.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
43
|
+
# * {boolean} _actions - Return resource actions in response
|
44
|
+
# * {boolean} _links - Return resource link in response
|
45
|
+
# * {boolean} _embedded - Return embedded resources in response
|
46
|
+
#
|
47
|
+
# Responses:
|
48
|
+
# * 200 - Collection of experience slugs (https://api.losant.com/#/definitions/experienceSlugs)
|
49
|
+
#
|
50
|
+
# Errors:
|
51
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
52
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
53
|
+
def get(params = {})
|
54
|
+
params = Utils.symbolize_hash_keys(params)
|
55
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
56
|
+
headers = {}
|
57
|
+
body = nil
|
58
|
+
|
59
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
60
|
+
|
61
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
62
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
63
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
64
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
65
|
+
|
66
|
+
path = "/applications/#{params[:applicationId]}/experience/slugs"
|
67
|
+
|
68
|
+
@client.request(
|
69
|
+
method: :get,
|
70
|
+
path: path,
|
71
|
+
query: query_params,
|
72
|
+
headers: headers,
|
73
|
+
body: body)
|
74
|
+
end
|
75
|
+
|
76
|
+
# Create a new experience slug for an application
|
77
|
+
#
|
78
|
+
# Authentication:
|
79
|
+
# The client must be configured with a valid api
|
80
|
+
# access token to call this action. The token
|
81
|
+
# must include at least one of the following scopes:
|
82
|
+
# all.Application, all.Organization, all.User, experienceSlugs.*, or experienceSlugs.post.
|
83
|
+
#
|
84
|
+
# Parameters:
|
85
|
+
# * {string} applicationId - ID associated with the application
|
86
|
+
# * {hash} experienceSlug - New experience slug information (https://api.losant.com/#/definitions/experienceSlugPost)
|
87
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
88
|
+
# * {boolean} _actions - Return resource actions in response
|
89
|
+
# * {boolean} _links - Return resource link in response
|
90
|
+
# * {boolean} _embedded - Return embedded resources in response
|
91
|
+
#
|
92
|
+
# Responses:
|
93
|
+
# * 201 - Successfully created experience slug (https://api.losant.com/#/definitions/experienceSlug)
|
94
|
+
#
|
95
|
+
# Errors:
|
96
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
97
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
98
|
+
def post(params = {})
|
99
|
+
params = Utils.symbolize_hash_keys(params)
|
100
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
101
|
+
headers = {}
|
102
|
+
body = nil
|
103
|
+
|
104
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
105
|
+
raise ArgumentError.new("experienceSlug is required") unless params.has_key?(:experienceSlug)
|
106
|
+
|
107
|
+
body = params[:experienceSlug] if params.has_key?(:experienceSlug)
|
108
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
109
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
110
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
111
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
112
|
+
|
113
|
+
path = "/applications/#{params[:applicationId]}/experience/slugs"
|
114
|
+
|
115
|
+
@client.request(
|
116
|
+
method: :post,
|
117
|
+
path: path,
|
118
|
+
query: query_params,
|
119
|
+
headers: headers,
|
120
|
+
body: body)
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,174 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 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 Experience Version Resource
|
26
|
+
class ExperienceVersion
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deletes an experience version
|
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.Application, all.Organization, all.User, experienceVersion.*, or experienceVersion.delete.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} experienceVersionIdOrName - Version ID or version name associated with the experience version
|
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 experience version 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 experience version 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("applicationId is required") unless params.has_key?(:applicationId)
|
61
|
+
raise ArgumentError.new("experienceVersionIdOrName is required") unless params.has_key?(:experienceVersionIdOrName)
|
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 = "/applications/#{params[:applicationId]}/experience/versions/#{params[:experienceVersionIdOrName]}"
|
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 an experience version
|
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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, experienceVersion.*, or experienceVersion.get.
|
85
|
+
#
|
86
|
+
# Parameters:
|
87
|
+
# * {string} applicationId - ID associated with the application
|
88
|
+
# * {string} experienceVersionIdOrName - Version ID or version name associated with the experience version
|
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 - Experience version information (https://api.losant.com/#/definitions/experienceVersion)
|
96
|
+
#
|
97
|
+
# Errors:
|
98
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
99
|
+
# * 404 - Error if experience version 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("applicationId is required") unless params.has_key?(:applicationId)
|
107
|
+
raise ArgumentError.new("experienceVersionIdOrName is required") unless params.has_key?(:experienceVersionIdOrName)
|
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 = "/applications/#{params[:applicationId]}/experience/versions/#{params[:experienceVersionIdOrName]}"
|
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 an experience version
|
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.Application, all.Organization, all.User, experienceVersion.*, or experienceVersion.patch.
|
131
|
+
#
|
132
|
+
# Parameters:
|
133
|
+
# * {string} applicationId - ID associated with the application
|
134
|
+
# * {string} experienceVersionIdOrName - Version ID or version name associated with the experience version
|
135
|
+
# * {hash} experienceVersion - Object containing new properties of the experience version (https://api.losant.com/#/definitions/experienceVersionPatch)
|
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 experience version information (https://api.losant.com/#/definitions/experienceVersion)
|
143
|
+
#
|
144
|
+
# Errors:
|
145
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
146
|
+
# * 404 - Error if experience version 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("applicationId is required") unless params.has_key?(:applicationId)
|
154
|
+
raise ArgumentError.new("experienceVersionIdOrName is required") unless params.has_key?(:experienceVersionIdOrName)
|
155
|
+
raise ArgumentError.new("experienceVersion is required") unless params.has_key?(:experienceVersion)
|
156
|
+
|
157
|
+
body = params[:experienceVersion] if params.has_key?(:experienceVersion)
|
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 = "/applications/#{params[:applicationId]}/experience/versions/#{params[:experienceVersionIdOrName]}"
|
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
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2018 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 Experience Versions Resource
|
26
|
+
class ExperienceVersions
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns the experience versions for an application
|
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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, experienceVersions.*, or experienceVersions.get.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: version, id, creationDate, lastUpdated
|
43
|
+
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
44
|
+
# * {string} page - Which page of results to return
|
45
|
+
# * {string} perPage - How many items to return per page
|
46
|
+
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: version
|
47
|
+
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
48
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
49
|
+
# * {boolean} _actions - Return resource actions in response
|
50
|
+
# * {boolean} _links - Return resource link in response
|
51
|
+
# * {boolean} _embedded - Return embedded resources in response
|
52
|
+
#
|
53
|
+
# Responses:
|
54
|
+
# * 200 - Collection of experience versions (https://api.losant.com/#/definitions/experienceVersions)
|
55
|
+
#
|
56
|
+
# Errors:
|
57
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
58
|
+
# * 404 - Error if application was not found (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("applicationId is required") unless params.has_key?(:applicationId)
|
66
|
+
|
67
|
+
query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
|
68
|
+
query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
|
69
|
+
query_params[:page] = params[:page] if params.has_key?(:page)
|
70
|
+
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
|
71
|
+
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
72
|
+
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
73
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
74
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
75
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
76
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
77
|
+
|
78
|
+
path = "/applications/#{params[:applicationId]}/experience/versions"
|
79
|
+
|
80
|
+
@client.request(
|
81
|
+
method: :get,
|
82
|
+
path: path,
|
83
|
+
query: query_params,
|
84
|
+
headers: headers,
|
85
|
+
body: body)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Create a new experience version for an application
|
89
|
+
#
|
90
|
+
# Authentication:
|
91
|
+
# The client must be configured with a valid api
|
92
|
+
# access token to call this action. The token
|
93
|
+
# must include at least one of the following scopes:
|
94
|
+
# all.Application, all.Organization, all.User, experienceVersions.*, or experienceVersions.post.
|
95
|
+
#
|
96
|
+
# Parameters:
|
97
|
+
# * {string} applicationId - ID associated with the application
|
98
|
+
# * {hash} experienceVersion - New experience version information (https://api.losant.com/#/definitions/experienceVersionPost)
|
99
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
100
|
+
# * {boolean} _actions - Return resource actions in response
|
101
|
+
# * {boolean} _links - Return resource link in response
|
102
|
+
# * {boolean} _embedded - Return embedded resources in response
|
103
|
+
#
|
104
|
+
# Responses:
|
105
|
+
# * 201 - Successfully created experience version (https://api.losant.com/#/definitions/experienceVersion)
|
106
|
+
#
|
107
|
+
# Errors:
|
108
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
109
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
110
|
+
def post(params = {})
|
111
|
+
params = Utils.symbolize_hash_keys(params)
|
112
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
113
|
+
headers = {}
|
114
|
+
body = nil
|
115
|
+
|
116
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
117
|
+
raise ArgumentError.new("experienceVersion is required") unless params.has_key?(:experienceVersion)
|
118
|
+
|
119
|
+
body = params[:experienceVersion] if params.has_key?(:experienceVersion)
|
120
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
121
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
122
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
123
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
124
|
+
|
125
|
+
path = "/applications/#{params[:applicationId]}/experience/versions"
|
126
|
+
|
127
|
+
@client.request(
|
128
|
+
method: :post,
|
129
|
+
path: path,
|
130
|
+
query: query_params,
|
131
|
+
headers: headers,
|
132
|
+
body: body)
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
end
|
@@ -86,6 +86,7 @@ module LosantRest
|
|
86
86
|
# Parameters:
|
87
87
|
# * {string} applicationId - ID associated with the application
|
88
88
|
# * {string} experienceViewId - ID associated with the experience view
|
89
|
+
# * {string} version - Version of this experience view to return
|
89
90
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
90
91
|
# * {boolean} _actions - Return resource actions in response
|
91
92
|
# * {boolean} _links - Return resource link in response
|
@@ -106,6 +107,7 @@ module LosantRest
|
|
106
107
|
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
107
108
|
raise ArgumentError.new("experienceViewId is required") unless params.has_key?(:experienceViewId)
|
108
109
|
|
110
|
+
query_params[:version] = params[:version] if params.has_key?(:version)
|
109
111
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
110
112
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
111
113
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
@@ -46,6 +46,7 @@ module LosantRest
|
|
46
46
|
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name
|
47
47
|
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
48
48
|
# * {string} viewType - Filter views to those only of the given type. Accepted values are: page, layout, component
|
49
|
+
# * {string} version - Return the experience views belonging to this version
|
49
50
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
50
51
|
# * {boolean} _actions - Return resource actions in response
|
51
52
|
# * {boolean} _links - Return resource link in response
|
@@ -72,6 +73,7 @@ module LosantRest
|
|
72
73
|
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
73
74
|
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
74
75
|
query_params[:viewType] = params[:viewType] if params.has_key?(:viewType)
|
76
|
+
query_params[:version] = params[:version] if params.has_key?(:version)
|
75
77
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
76
78
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
77
79
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|