losant_rest 1.22.4 → 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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/docs/_schemas.md +1290 -142
  3. data/docs/file.md +3 -3
  4. data/docs/files.md +2 -2
  5. data/docs/privateFile.md +222 -0
  6. data/docs/privateFiles.md +97 -0
  7. data/lib/platform_rest/client.rb +10 -2
  8. data/lib/platform_rest/file.rb +3 -3
  9. data/lib/platform_rest/files.rb +1 -1
  10. data/lib/platform_rest/private_file.rb +230 -0
  11. data/lib/platform_rest/private_files.rb +146 -0
  12. data/lib/platform_rest/version.rb +1 -1
  13. data/lib/platform_rest.rb +2 -0
  14. data/schemas/apiTokenPost.json +12 -2
  15. data/schemas/application.json +7 -0
  16. data/schemas/applicationClonePost.json +4 -0
  17. data/schemas/applicationCreationByTemplateResult.json +7 -0
  18. data/schemas/applicationDashboardPost.json +3 -1
  19. data/schemas/applicationExportPost.json +4 -0
  20. data/schemas/applicationImportExecutions.json +2 -0
  21. data/schemas/applicationPatch.json +4 -0
  22. data/schemas/applicationPost.json +4 -0
  23. data/schemas/applicationTemplate.json +3 -0
  24. data/schemas/applicationTemplates.json +3 -0
  25. data/schemas/applications.json +7 -0
  26. data/schemas/auditLog.json +1 -0
  27. data/schemas/auditLogFilter.json +1 -0
  28. data/schemas/auditLogs.json +1 -0
  29. data/schemas/credentialLinkedResources.json +18 -0
  30. data/schemas/dashboard.json +3 -1
  31. data/schemas/dashboardBlockSuggestCodePost.json +620 -0
  32. data/schemas/dashboardBlockSuggestCodeResponse.json +49 -0
  33. data/schemas/dashboardPatch.json +3 -1
  34. data/schemas/dashboardPost.json +3 -1
  35. data/schemas/dashboards.json +3 -1
  36. data/schemas/experienceLinkedResources.json +18 -0
  37. data/schemas/fileUploadPostResponse.json +103 -82
  38. data/schemas/files.json +1 -1
  39. data/schemas/flow.json +6 -0
  40. data/schemas/flowPatch.json +6 -0
  41. data/schemas/flowPost.json +6 -0
  42. data/schemas/flowVersion.json +12 -0
  43. data/schemas/flowVersionPost.json +6 -0
  44. data/schemas/flowVersions.json +12 -0
  45. data/schemas/flows.json +6 -0
  46. data/schemas/flowsImportPost.json +12 -0
  47. data/schemas/flowsImportResult.json +18 -0
  48. data/schemas/githubLogin.json +12 -2
  49. data/schemas/historicalSummaries.json +10 -0
  50. data/schemas/historicalSummary.json +10 -0
  51. data/schemas/importIntoApplicationOptions.json +1 -0
  52. data/schemas/importNewApplicationOptions.json +1 -0
  53. data/schemas/instance.json +7 -0
  54. data/schemas/instanceOrg.json +7 -0
  55. data/schemas/instanceOrgPatch.json +4 -0
  56. data/schemas/instanceOrgPost.json +4 -0
  57. data/schemas/instanceOrgs.json +7 -0
  58. data/schemas/instancePatch.json +4 -0
  59. data/schemas/instanceSandbox.json +6 -0
  60. data/schemas/instanceSandboxes.json +6 -0
  61. data/schemas/instances.json +7 -0
  62. data/schemas/me.json +6 -0
  63. data/schemas/notebook.json +9 -0
  64. data/schemas/notebookPatch.json +9 -0
  65. data/schemas/notebookPost.json +9 -0
  66. data/schemas/notebooks.json +9 -0
  67. data/schemas/org.json +7 -0
  68. data/schemas/orgs.json +7 -0
  69. data/schemas/samlResponse.json +12 -2
  70. data/schemas/suggestFunctionResponse.json +13 -1
  71. data/schemas/userCredentials.json +12 -2
  72. data/schemas/userPost.json +12 -2
  73. metadata +8 -2
@@ -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
@@ -21,5 +21,5 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  module PlatformRest
24
- VERSION = "1.22.4"
24
+ VERSION = "1.23.0"
25
25
  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"
@@ -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",
@@ -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
@@ -10,6 +10,10 @@
10
10
  "type": "boolean",
11
11
  "default": false
12
12
  },
13
+ "includePrivateFiles": {
14
+ "type": "boolean",
15
+ "default": false
16
+ },
13
17
  "includeDataTableRows": {
14
18
  "type": "boolean",
15
19
  "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
@@ -930,8 +930,10 @@
930
930
  "vegaLite3",
931
931
  "vegaLite4",
932
932
  "vegaLite5",
933
+ "vegaLite6",
933
934
  "vega4",
934
- "vega5"
935
+ "vega5",
936
+ "vega6"
935
937
  ]
936
938
  },
937
939
  "tooltipEventSubscribe": {
@@ -6,6 +6,10 @@
6
6
  "type": "boolean",
7
7
  "default": false
8
8
  },
9
+ "includePrivateFiles": {
10
+ "type": "boolean",
11
+ "default": false
12
+ },
9
13
  "includeDataTableRows": {
10
14
  "type": "boolean",
11
15
  "default": false
@@ -97,6 +97,7 @@
97
97
  "Global",
98
98
  "Integration",
99
99
  "Notebook",
100
+ "PrivateFile",
100
101
  "Webhook",
101
102
  "ResourceJob"
102
103
  ]
@@ -158,6 +159,7 @@
158
159
  "Global",
159
160
  "Integration",
160
161
  "Notebook",
162
+ "PrivateFile",
161
163
  "Webhook",
162
164
  "ResourceJob"
163
165
  ]
@@ -167,6 +167,10 @@
167
167
  "type": "boolean",
168
168
  "default": false
169
169
  },
170
+ "includePrivateFiles": {
171
+ "type": "boolean",
172
+ "default": false
173
+ },
170
174
  "includeDataTableRows": {
171
175
  "type": "boolean",
172
176
  "default": false
@@ -152,6 +152,10 @@
152
152
  "type": "boolean",
153
153
  "default": false
154
154
  },
155
+ "includePrivateFiles": {
156
+ "type": "boolean",
157
+ "default": false
158
+ },
155
159
  "includeDataTableRows": {
156
160
  "type": "boolean",
157
161
  "default": false
@@ -111,6 +111,9 @@
111
111
  "notebookCount": {
112
112
  "type": "integer"
113
113
  },
114
+ "privateFileCount": {
115
+ "type": "integer"
116
+ },
114
117
  "resourceJobCount": {
115
118
  "type": "integer"
116
119
  },
@@ -118,6 +118,9 @@
118
118
  "notebookCount": {
119
119
  "type": "integer"
120
120
  },
121
+ "privateFileCount": {
122
+ "type": "integer"
123
+ },
121
124
  "resourceJobCount": {
122
125
  "type": "integer"
123
126
  },
@@ -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
@@ -62,6 +62,7 @@
62
62
  "Flow",
63
63
  "Integration",
64
64
  "Notebook",
65
+ "PrivateFile",
65
66
  "ResourceJob",
66
67
  "Webhook"
67
68
  ]
@@ -60,6 +60,7 @@
60
60
  "Flow",
61
61
  "Integration",
62
62
  "Notebook",
63
+ "PrivateFile",
63
64
  "ResourceJob",
64
65
  "Webhook"
65
66
  ]
@@ -69,6 +69,7 @@
69
69
  "Flow",
70
70
  "Integration",
71
71
  "Notebook",
72
+ "PrivateFile",
72
73
  "ResourceJob",
73
74
  "Webhook"
74
75
  ]
@@ -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
@@ -1136,8 +1136,10 @@
1136
1136
  "vegaLite3",
1137
1137
  "vegaLite4",
1138
1138
  "vegaLite5",
1139
+ "vegaLite6",
1139
1140
  "vega4",
1140
- "vega5"
1141
+ "vega5",
1142
+ "vega6"
1141
1143
  ]
1142
1144
  },
1143
1145
  "tooltipEventSubscribe": {