losant_rest 1.22.3 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/_schemas.md +1313 -145
- data/docs/file.md +3 -3
- data/docs/files.md +2 -2
- data/docs/me.md +11 -1
- data/docs/privateFile.md +222 -0
- data/docs/privateFiles.md +97 -0
- data/lib/platform_rest/client.rb +10 -2
- data/lib/platform_rest/file.rb +3 -3
- data/lib/platform_rest/files.rb +1 -1
- data/lib/platform_rest/me.rb +21 -1
- data/lib/platform_rest/private_file.rb +230 -0
- data/lib/platform_rest/private_files.rb +146 -0
- data/lib/platform_rest/version.rb +1 -1
- data/lib/platform_rest.rb +2 -0
- data/schemas/apiTokenPost.json +12 -2
- data/schemas/application.json +7 -0
- data/schemas/applicationClonePost.json +4 -0
- data/schemas/applicationCreationByTemplateResult.json +7 -0
- data/schemas/applicationDashboardPost.json +3 -1
- data/schemas/applicationExportPost.json +4 -0
- data/schemas/applicationImportExecutions.json +2 -0
- data/schemas/applicationPatch.json +4 -0
- data/schemas/applicationPost.json +4 -0
- data/schemas/applicationTemplate.json +3 -0
- data/schemas/applicationTemplates.json +3 -0
- data/schemas/applications.json +7 -0
- data/schemas/auditLog.json +1 -0
- data/schemas/auditLogFilter.json +1 -0
- data/schemas/auditLogs.json +1 -0
- data/schemas/credentialLinkedResources.json +18 -0
- data/schemas/dashboard.json +3 -1
- data/schemas/dashboardBlockSuggestCodePost.json +620 -0
- data/schemas/dashboardBlockSuggestCodeResponse.json +49 -0
- data/schemas/dashboardPatch.json +3 -1
- data/schemas/dashboardPost.json +3 -1
- data/schemas/dashboards.json +3 -1
- data/schemas/experienceLinkedResources.json +18 -0
- data/schemas/fileUploadPostResponse.json +103 -82
- data/schemas/files.json +1 -1
- data/schemas/flow.json +6 -0
- data/schemas/flowPatch.json +6 -0
- data/schemas/flowPost.json +6 -0
- data/schemas/flowVersion.json +12 -0
- data/schemas/flowVersionPost.json +6 -0
- data/schemas/flowVersions.json +12 -0
- data/schemas/flows.json +6 -0
- data/schemas/flowsImportPost.json +12 -0
- data/schemas/flowsImportResult.json +18 -0
- data/schemas/githubLogin.json +12 -2
- data/schemas/historicalSummaries.json +10 -0
- data/schemas/historicalSummary.json +10 -0
- data/schemas/importIntoApplicationOptions.json +1 -0
- data/schemas/importNewApplicationOptions.json +1 -0
- data/schemas/instance.json +7 -0
- data/schemas/instanceOrg.json +7 -0
- data/schemas/instanceOrgPatch.json +4 -0
- data/schemas/instanceOrgPost.json +4 -0
- data/schemas/instanceOrgs.json +7 -0
- data/schemas/instancePatch.json +4 -0
- data/schemas/instanceSandbox.json +6 -0
- data/schemas/instanceSandboxes.json +6 -0
- data/schemas/instances.json +7 -0
- data/schemas/me.json +11 -0
- data/schemas/notebook.json +9 -0
- data/schemas/notebookPatch.json +9 -0
- data/schemas/notebookPost.json +9 -0
- data/schemas/notebooks.json +9 -0
- data/schemas/org.json +7 -0
- data/schemas/orgs.json +7 -0
- data/schemas/samlResponse.json +12 -2
- data/schemas/suggestFunctionPost.json +2 -1
- data/schemas/suggestFunctionResponse.json +13 -1
- data/schemas/userCredentials.json +12 -2
- data/schemas/userPost.json +12 -2
- data/schemas/webhook.json +3 -0
- data/schemas/webhookPatch.json +3 -0
- data/schemas/webhookPost.json +3 -0
- data/schemas/webhooks.json +3 -0
- metadata +8 -2
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# The MIT License (MIT)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2024 Losant IoT, Inc.
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
require "json"
|
|
24
|
+
|
|
25
|
+
module PlatformRest
|
|
26
|
+
|
|
27
|
+
# Class containing all the actions for the Private File Resource
|
|
28
|
+
class PrivateFile
|
|
29
|
+
|
|
30
|
+
def initialize(client)
|
|
31
|
+
@client = client
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Deletes a private file or directory, if a directory all the contents that directory will also be removed.
|
|
35
|
+
#
|
|
36
|
+
# Authentication:
|
|
37
|
+
# The client must be configured with a valid api
|
|
38
|
+
# access token to call this action. The token
|
|
39
|
+
# must include at least one of the following scopes:
|
|
40
|
+
# all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, privateFile.*, or privateFile.delete.
|
|
41
|
+
#
|
|
42
|
+
# Parameters:
|
|
43
|
+
# * {string} applicationId - ID associated with the application
|
|
44
|
+
# * {string} privateFileId - ID associated with the private file
|
|
45
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
|
46
|
+
# * {boolean} _actions - Return resource actions in response
|
|
47
|
+
# * {boolean} _links - Return resource link in response
|
|
48
|
+
# * {boolean} _embedded - Return embedded resources in response
|
|
49
|
+
#
|
|
50
|
+
# Responses:
|
|
51
|
+
# * 200 - If private file was successfully deleted (https://api.losant.com/#/definitions/success)
|
|
52
|
+
#
|
|
53
|
+
# Errors:
|
|
54
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
|
55
|
+
# * 404 - Error if private file was not found (https://api.losant.com/#/definitions/error)
|
|
56
|
+
def delete(params = {})
|
|
57
|
+
params = Utils.symbolize_hash_keys(params)
|
|
58
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
|
59
|
+
headers = {}
|
|
60
|
+
body = nil
|
|
61
|
+
|
|
62
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
|
63
|
+
raise ArgumentError.new("privateFileId is required") unless params.has_key?(:privateFileId)
|
|
64
|
+
|
|
65
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
|
66
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
|
67
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
|
68
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
|
69
|
+
|
|
70
|
+
path = "/applications/#{params[:applicationId]}/privateFiles/#{params[:privateFileId]}"
|
|
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 private file
|
|
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.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, privateFile.*, or privateFile.get.
|
|
87
|
+
#
|
|
88
|
+
# Parameters:
|
|
89
|
+
# * {string} applicationId - ID associated with the application
|
|
90
|
+
# * {string} privateFileId - ID associated with the private file
|
|
91
|
+
# * {string} urlTTL - Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
|
|
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 - Private file information (https://api.losant.com/#/definitions/file)
|
|
99
|
+
#
|
|
100
|
+
# Errors:
|
|
101
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
|
102
|
+
# * 404 - Error if private file 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("applicationId is required") unless params.has_key?(:applicationId)
|
|
110
|
+
raise ArgumentError.new("privateFileId is required") unless params.has_key?(:privateFileId)
|
|
111
|
+
|
|
112
|
+
query_params[:urlTTL] = params[:urlTTL] if params.has_key?(:urlTTL)
|
|
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 = "/applications/#{params[:applicationId]}/privateFiles/#{params[:privateFileId]}"
|
|
119
|
+
|
|
120
|
+
@client.request(
|
|
121
|
+
method: :get,
|
|
122
|
+
path: path,
|
|
123
|
+
query: query_params,
|
|
124
|
+
headers: headers,
|
|
125
|
+
body: body)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Move a private file or the entire contents of a directory
|
|
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.Application, all.Application.cli, all.Organization, all.User, all.User.cli, privateFile.*, or privateFile.move.
|
|
135
|
+
#
|
|
136
|
+
# Parameters:
|
|
137
|
+
# * {string} applicationId - ID associated with the application
|
|
138
|
+
# * {string} privateFileId - ID associated with the private file
|
|
139
|
+
# * {undefined} name - The new name of the private file or directory
|
|
140
|
+
# * {undefined} parentDirectory - The new parent directory for the private file or directory to move into.
|
|
141
|
+
# * {string} urlTTL - Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
|
|
142
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
|
143
|
+
# * {boolean} _actions - Return resource actions in response
|
|
144
|
+
# * {boolean} _links - Return resource link in response
|
|
145
|
+
# * {boolean} _embedded - Return embedded resources in response
|
|
146
|
+
#
|
|
147
|
+
# Responses:
|
|
148
|
+
# * 201 - Returns a new private file or directory that was created by the move, if a directory a job will kick off to move all the directories children. (https://api.losant.com/#/definitions/file)
|
|
149
|
+
#
|
|
150
|
+
# Errors:
|
|
151
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
|
152
|
+
# * 404 - Error if private file was not found (https://api.losant.com/#/definitions/error)
|
|
153
|
+
def move(params = {})
|
|
154
|
+
params = Utils.symbolize_hash_keys(params)
|
|
155
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
|
156
|
+
headers = {}
|
|
157
|
+
body = nil
|
|
158
|
+
|
|
159
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
|
160
|
+
raise ArgumentError.new("privateFileId is required") unless params.has_key?(:privateFileId)
|
|
161
|
+
|
|
162
|
+
query_params[:name] = params[:name] if params.has_key?(:name)
|
|
163
|
+
query_params[:parentDirectory] = params[:parentDirectory] if params.has_key?(:parentDirectory)
|
|
164
|
+
query_params[:urlTTL] = params[:urlTTL] if params.has_key?(:urlTTL)
|
|
165
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
|
166
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
|
167
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
|
168
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
|
169
|
+
|
|
170
|
+
path = "/applications/#{params[:applicationId]}/privateFiles/#{params[:privateFileId]}/move"
|
|
171
|
+
|
|
172
|
+
@client.request(
|
|
173
|
+
method: :post,
|
|
174
|
+
path: path,
|
|
175
|
+
query: query_params,
|
|
176
|
+
headers: headers,
|
|
177
|
+
body: body)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Reupload a private file
|
|
181
|
+
#
|
|
182
|
+
# Authentication:
|
|
183
|
+
# The client must be configured with a valid api
|
|
184
|
+
# access token to call this action. The token
|
|
185
|
+
# must include at least one of the following scopes:
|
|
186
|
+
# all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, privateFile.*, or privateFile.patch.
|
|
187
|
+
#
|
|
188
|
+
# Parameters:
|
|
189
|
+
# * {string} applicationId - ID associated with the application
|
|
190
|
+
# * {string} privateFileId - ID associated with the private file
|
|
191
|
+
# * {hash} updates - Updated information about the private file (https://api.losant.com/#/definitions/filePatch)
|
|
192
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
|
193
|
+
# * {boolean} _actions - Return resource actions in response
|
|
194
|
+
# * {boolean} _links - Return resource link in response
|
|
195
|
+
# * {boolean} _embedded - Return embedded resources in response
|
|
196
|
+
#
|
|
197
|
+
# Responses:
|
|
198
|
+
# * 201 - Successfully updated private file and the information needed to upload the file content (https://api.losant.com/#/definitions/fileUploadPostResponse)
|
|
199
|
+
#
|
|
200
|
+
# Errors:
|
|
201
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
|
202
|
+
# * 404 - Error if private file was not found (https://api.losant.com/#/definitions/error)
|
|
203
|
+
def patch(params = {})
|
|
204
|
+
params = Utils.symbolize_hash_keys(params)
|
|
205
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
|
206
|
+
headers = {}
|
|
207
|
+
body = nil
|
|
208
|
+
|
|
209
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
|
210
|
+
raise ArgumentError.new("privateFileId is required") unless params.has_key?(:privateFileId)
|
|
211
|
+
raise ArgumentError.new("updates is required") unless params.has_key?(:updates)
|
|
212
|
+
|
|
213
|
+
body = params[:updates] if params.has_key?(:updates)
|
|
214
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
|
215
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
|
216
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
|
217
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
|
218
|
+
|
|
219
|
+
path = "/applications/#{params[:applicationId]}/privateFiles/#{params[:privateFileId]}"
|
|
220
|
+
|
|
221
|
+
@client.request(
|
|
222
|
+
method: :patch,
|
|
223
|
+
path: path,
|
|
224
|
+
query: query_params,
|
|
225
|
+
headers: headers,
|
|
226
|
+
body: body)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
end
|
|
230
|
+
end
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# The MIT License (MIT)
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2024 Losant IoT, Inc.
|
|
4
|
+
#
|
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
# furnished to do so, subject to the following conditions:
|
|
11
|
+
#
|
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
# copies or substantial portions of the Software.
|
|
14
|
+
#
|
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
# SOFTWARE.
|
|
22
|
+
|
|
23
|
+
require "json"
|
|
24
|
+
|
|
25
|
+
module PlatformRest
|
|
26
|
+
|
|
27
|
+
# Class containing all the actions for the Private Files Resource
|
|
28
|
+
class PrivateFiles
|
|
29
|
+
|
|
30
|
+
def initialize(client)
|
|
31
|
+
@client = client
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns the private files for an application
|
|
35
|
+
#
|
|
36
|
+
# Authentication:
|
|
37
|
+
# The client must be configured with a valid api
|
|
38
|
+
# access token to call this action. The token
|
|
39
|
+
# must include at least one of the following scopes:
|
|
40
|
+
# all.Application, all.Application.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, privateFiles.*, or privateFiles.get.
|
|
41
|
+
#
|
|
42
|
+
# Parameters:
|
|
43
|
+
# * {string} applicationId - ID associated with the application
|
|
44
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: lastUpdated, type, name, creationDate
|
|
45
|
+
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
|
46
|
+
# * {string} page - Which page of results to return
|
|
47
|
+
# * {string} perPage - How many items to return per page
|
|
48
|
+
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name
|
|
49
|
+
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
|
50
|
+
# * {string} type - Limit by the type (file or directory) of the file
|
|
51
|
+
# * {string} status - Limit the result to only files of this status. Accepted values are: completed, pending
|
|
52
|
+
# * {string} directory - Get private files that are inside of this directory
|
|
53
|
+
# * {string} urlTTL - Time in seconds that the private file url will be valid for. Only applies to private files of type 'file'. If 0, no url will be returned.
|
|
54
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
|
55
|
+
# * {boolean} _actions - Return resource actions in response
|
|
56
|
+
# * {boolean} _links - Return resource link in response
|
|
57
|
+
# * {boolean} _embedded - Return embedded resources in response
|
|
58
|
+
#
|
|
59
|
+
# Responses:
|
|
60
|
+
# * 200 - Collection of private files (https://api.losant.com/#/definitions/files)
|
|
61
|
+
#
|
|
62
|
+
# Errors:
|
|
63
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
|
64
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
|
65
|
+
def get(params = {})
|
|
66
|
+
params = Utils.symbolize_hash_keys(params)
|
|
67
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
|
68
|
+
headers = {}
|
|
69
|
+
body = nil
|
|
70
|
+
|
|
71
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
|
72
|
+
|
|
73
|
+
query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
|
|
74
|
+
query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
|
|
75
|
+
query_params[:page] = params[:page] if params.has_key?(:page)
|
|
76
|
+
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
|
|
77
|
+
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
|
78
|
+
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
|
79
|
+
query_params[:type] = params[:type] if params.has_key?(:type)
|
|
80
|
+
query_params[:status] = params[:status] if params.has_key?(:status)
|
|
81
|
+
query_params[:directory] = params[:directory] if params.has_key?(:directory)
|
|
82
|
+
query_params[:urlTTL] = params[:urlTTL] if params.has_key?(:urlTTL)
|
|
83
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
|
84
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
|
85
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
|
86
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
|
87
|
+
|
|
88
|
+
path = "/applications/#{params[:applicationId]}/privateFiles"
|
|
89
|
+
|
|
90
|
+
@client.request(
|
|
91
|
+
method: :get,
|
|
92
|
+
path: path,
|
|
93
|
+
query: query_params,
|
|
94
|
+
headers: headers,
|
|
95
|
+
body: body)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Create a new private file for an application
|
|
99
|
+
#
|
|
100
|
+
# Authentication:
|
|
101
|
+
# The client must be configured with a valid api
|
|
102
|
+
# access token to call this action. The token
|
|
103
|
+
# must include at least one of the following scopes:
|
|
104
|
+
# all.Application, all.Application.cli, all.Organization, all.User, all.User.cli, privateFiles.*, or privateFiles.post.
|
|
105
|
+
#
|
|
106
|
+
# Parameters:
|
|
107
|
+
# * {string} applicationId - ID associated with the application
|
|
108
|
+
# * {hash} privateFile - New private file information (https://api.losant.com/#/definitions/filePost)
|
|
109
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
|
110
|
+
# * {boolean} _actions - Return resource actions in response
|
|
111
|
+
# * {boolean} _links - Return resource link in response
|
|
112
|
+
# * {boolean} _embedded - Return embedded resources in response
|
|
113
|
+
#
|
|
114
|
+
# Responses:
|
|
115
|
+
# * 201 - Successfully created private file and the information needed to upload the file content (https://api.losant.com/#/definitions/fileUploadPostResponse)
|
|
116
|
+
#
|
|
117
|
+
# Errors:
|
|
118
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
|
119
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
|
120
|
+
def post(params = {})
|
|
121
|
+
params = Utils.symbolize_hash_keys(params)
|
|
122
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
|
123
|
+
headers = {}
|
|
124
|
+
body = nil
|
|
125
|
+
|
|
126
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
|
127
|
+
raise ArgumentError.new("privateFile is required") unless params.has_key?(:privateFile)
|
|
128
|
+
|
|
129
|
+
body = params[:privateFile] if params.has_key?(:privateFile)
|
|
130
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
|
131
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
|
132
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
|
133
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
|
134
|
+
|
|
135
|
+
path = "/applications/#{params[:applicationId]}/privateFiles"
|
|
136
|
+
|
|
137
|
+
@client.request(
|
|
138
|
+
method: :post,
|
|
139
|
+
path: path,
|
|
140
|
+
query: query_params,
|
|
141
|
+
headers: headers,
|
|
142
|
+
body: body)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
end
|
|
146
|
+
end
|
data/lib/platform_rest.rb
CHANGED
|
@@ -112,6 +112,8 @@ require_relative "platform_rest/notebooks"
|
|
|
112
112
|
require_relative "platform_rest/org"
|
|
113
113
|
require_relative "platform_rest/org_invites"
|
|
114
114
|
require_relative "platform_rest/orgs"
|
|
115
|
+
require_relative "platform_rest/private_file"
|
|
116
|
+
require_relative "platform_rest/private_files"
|
|
115
117
|
require_relative "platform_rest/resource_job"
|
|
116
118
|
require_relative "platform_rest/resource_jobs"
|
|
117
119
|
require_relative "platform_rest/user_api_token"
|
data/schemas/apiTokenPost.json
CHANGED
|
@@ -85,10 +85,12 @@
|
|
|
85
85
|
"flows.*",
|
|
86
86
|
"flowVersion.*",
|
|
87
87
|
"flowVersions.*",
|
|
88
|
-
"resourceJobs.*",
|
|
89
|
-
"resourceJob.*",
|
|
90
88
|
"notebook.*",
|
|
91
89
|
"notebooks.*",
|
|
90
|
+
"privateFile.*",
|
|
91
|
+
"privateFiles.*",
|
|
92
|
+
"resourceJobs.*",
|
|
93
|
+
"resourceJob.*",
|
|
92
94
|
"webhook.*",
|
|
93
95
|
"webhooks.*",
|
|
94
96
|
"application.applyTemplate",
|
|
@@ -325,6 +327,13 @@
|
|
|
325
327
|
"notebook.upload",
|
|
326
328
|
"notebooks.get",
|
|
327
329
|
"notebooks.post",
|
|
330
|
+
"privateFile.get",
|
|
331
|
+
"privateFile.patch",
|
|
332
|
+
"privateFile.move",
|
|
333
|
+
"privateFile.delete",
|
|
334
|
+
"privateFile.upload",
|
|
335
|
+
"privateFiles.get",
|
|
336
|
+
"privateFiles.post",
|
|
328
337
|
"resourceJob.get",
|
|
329
338
|
"resourceJob.logs",
|
|
330
339
|
"resourceJob.patch",
|
|
@@ -361,6 +370,7 @@
|
|
|
361
370
|
"dashboard.patch",
|
|
362
371
|
"dashboard.delete",
|
|
363
372
|
"dashboard.sendReport",
|
|
373
|
+
"dashboard.suggestCode",
|
|
364
374
|
"dashboards.get",
|
|
365
375
|
"dashboards.post",
|
|
366
376
|
"org.get",
|
data/schemas/application.json
CHANGED
|
@@ -170,6 +170,9 @@
|
|
|
170
170
|
"notebookCount": {
|
|
171
171
|
"type": "integer"
|
|
172
172
|
},
|
|
173
|
+
"privateFileCount": {
|
|
174
|
+
"type": "integer"
|
|
175
|
+
},
|
|
173
176
|
"resourceJobCount": {
|
|
174
177
|
"type": "integer"
|
|
175
178
|
},
|
|
@@ -472,6 +475,10 @@
|
|
|
472
475
|
"type": "boolean",
|
|
473
476
|
"default": false
|
|
474
477
|
},
|
|
478
|
+
"includePrivateFiles": {
|
|
479
|
+
"type": "boolean",
|
|
480
|
+
"default": false
|
|
481
|
+
},
|
|
475
482
|
"includeDataTableRows": {
|
|
476
483
|
"type": "boolean",
|
|
477
484
|
"default": false
|
|
@@ -175,6 +175,9 @@
|
|
|
175
175
|
"notebookCount": {
|
|
176
176
|
"type": "integer"
|
|
177
177
|
},
|
|
178
|
+
"privateFileCount": {
|
|
179
|
+
"type": "integer"
|
|
180
|
+
},
|
|
178
181
|
"resourceJobCount": {
|
|
179
182
|
"type": "integer"
|
|
180
183
|
},
|
|
@@ -477,6 +480,10 @@
|
|
|
477
480
|
"type": "boolean",
|
|
478
481
|
"default": false
|
|
479
482
|
},
|
|
483
|
+
"includePrivateFiles": {
|
|
484
|
+
"type": "boolean",
|
|
485
|
+
"default": false
|
|
486
|
+
},
|
|
480
487
|
"includeDataTableRows": {
|
|
481
488
|
"type": "boolean",
|
|
482
489
|
"default": false
|
data/schemas/applications.json
CHANGED
|
@@ -177,6 +177,9 @@
|
|
|
177
177
|
"notebookCount": {
|
|
178
178
|
"type": "integer"
|
|
179
179
|
},
|
|
180
|
+
"privateFileCount": {
|
|
181
|
+
"type": "integer"
|
|
182
|
+
},
|
|
180
183
|
"resourceJobCount": {
|
|
181
184
|
"type": "integer"
|
|
182
185
|
},
|
|
@@ -479,6 +482,10 @@
|
|
|
479
482
|
"type": "boolean",
|
|
480
483
|
"default": false
|
|
481
484
|
},
|
|
485
|
+
"includePrivateFiles": {
|
|
486
|
+
"type": "boolean",
|
|
487
|
+
"default": false
|
|
488
|
+
},
|
|
482
489
|
"includeDataTableRows": {
|
|
483
490
|
"type": "boolean",
|
|
484
491
|
"default": false
|
data/schemas/auditLog.json
CHANGED
data/schemas/auditLogFilter.json
CHANGED
data/schemas/auditLogs.json
CHANGED
|
@@ -536,6 +536,12 @@
|
|
|
536
536
|
},
|
|
537
537
|
"update": {
|
|
538
538
|
"type": "boolean"
|
|
539
|
+
},
|
|
540
|
+
"public": {
|
|
541
|
+
"type": "boolean"
|
|
542
|
+
},
|
|
543
|
+
"private": {
|
|
544
|
+
"type": "boolean"
|
|
539
545
|
}
|
|
540
546
|
},
|
|
541
547
|
"additionalProperties": false
|
|
@@ -3667,6 +3673,12 @@
|
|
|
3667
3673
|
},
|
|
3668
3674
|
"update": {
|
|
3669
3675
|
"type": "boolean"
|
|
3676
|
+
},
|
|
3677
|
+
"public": {
|
|
3678
|
+
"type": "boolean"
|
|
3679
|
+
},
|
|
3680
|
+
"private": {
|
|
3681
|
+
"type": "boolean"
|
|
3670
3682
|
}
|
|
3671
3683
|
},
|
|
3672
3684
|
"additionalProperties": false
|
|
@@ -6707,6 +6719,12 @@
|
|
|
6707
6719
|
},
|
|
6708
6720
|
"update": {
|
|
6709
6721
|
"type": "boolean"
|
|
6722
|
+
},
|
|
6723
|
+
"public": {
|
|
6724
|
+
"type": "boolean"
|
|
6725
|
+
},
|
|
6726
|
+
"private": {
|
|
6727
|
+
"type": "boolean"
|
|
6710
6728
|
}
|
|
6711
6729
|
},
|
|
6712
6730
|
"additionalProperties": false
|