files.com 1.0.101 → 1.0.102

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e715ef5d2664eec58ebfa067ff3014018b9f386cfc149a8238e2e9d8bb549331
4
- data.tar.gz: d135e40db26bd6c064822453b2999d4f33ea2df40c93096496acc7e4f8db2919
3
+ metadata.gz: c04971f6d00a131b02f05177190f6ecd61e1e78a85cff414c3a6f1bab9fc1642
4
+ data.tar.gz: 81edb2e009ebb9ac34454491ae49661951e2ba430043977b4eff5cf1cd27823a
5
5
  SHA512:
6
- metadata.gz: 5afec2ddef519a7a3c72659adf683d9a2ec227de7bfb511fbe850cda970b25c5055c661bff8ec5a0b42bef24f56a9d91224accc4c9600c885ea21542daacaaff
7
- data.tar.gz: 920892400a280447dc341b269e0c48d2f15284e326869ccf4f7a2e64f0a2ed9c3c7a2db356cc40671ad3ce4b3ac0ce7272bc5f0647dffac8ea43229f5f2f0e51
6
+ metadata.gz: 710b6f10d4ea051a4bfde7be422019d535ee49700fc0816d3f49d5c5a7dc54d579169462ca3eb01bb3819f815d66569815f36284212c27044be9d4f55bae4b09
7
+ data.tar.gz: 75eb37ba02f5e83e2d9d6ee690ce1b70c8e02c527533caf9ad12bd3e908ea913ffdc8c522cda4268b041820c20b0abbd46ea02af5e1cb81fe2f37a2e76a4043d
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.101
1
+ 1.0.102
@@ -26,7 +26,8 @@
26
26
  "query_target_user_id": 1,
27
27
  "query_target_username": "jerry",
28
28
  "query_target_platform": "windows",
29
- "query_target_permission_set": "desktop_app"
29
+ "query_target_permission_set": "desktop_app",
30
+ "results_url": "https://files.com/history_results.csv"
30
31
  }
31
32
  ```
32
33
 
@@ -53,29 +54,10 @@
53
54
  * `query_target_username` (string): If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username.
54
55
  * `query_target_platform` (string): If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform.
55
56
  * `query_target_permission_set` (string): If searching for Histories about API keys, this parameter restricts results to API keys with this permission set.
57
+ * `results_url` (string): If `status` is `ready` and the query succeeded, this will be a URL where all the results can be downloaded at once as a CSV.
56
58
  * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
57
59
 
58
60
 
59
- ---
60
-
61
- ## List History Exports
62
-
63
- ```
64
- Files::HistoryExport.list(
65
- user_id: 1,
66
- page: 1,
67
- per_page: 1
68
- )
69
- ```
70
-
71
- ### Parameters
72
-
73
- * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
74
- * `page` (int64): Current page number.
75
- * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
76
- * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
77
-
78
-
79
61
  ---
80
62
 
81
63
  ## Show History Export
@@ -144,31 +126,3 @@ Files::HistoryExport.create(
144
126
  * `query_target_username` (string): If searching for Histories about API keys, this parameter restricts results to API keys created by/for this username.
145
127
  * `query_target_platform` (string): If searching for Histories about API keys, this parameter restricts results to API keys associated with this platform.
146
128
  * `query_target_permission_set` (string): If searching for Histories about API keys, this parameter restricts results to API keys with this permission set.
147
-
148
-
149
- ---
150
-
151
- ## Delete History Export
152
-
153
- ```
154
- Files::HistoryExport.delete(id)
155
- ```
156
-
157
- ### Parameters
158
-
159
- * `id` (int64): Required - History Export ID.
160
-
161
-
162
- ---
163
-
164
- ## Delete History Export
165
-
166
- ```
167
- history_export = Files::HistoryExport.list_for(path).first
168
-
169
- history_export.delete
170
- ```
171
-
172
- ### Parameters
173
-
174
- * `id` (int64): Required - History Export ID.
@@ -0,0 +1,80 @@
1
+ # HistoryExportResult
2
+
3
+ ## Example HistoryExportResult Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "created_at": 1,
9
+ "user_id": 1,
10
+ "file_id": 1,
11
+ "parent_id": 1,
12
+ "path": "MyFile.txt",
13
+ "folder": "Folder",
14
+ "src": "SrcFolder",
15
+ "destination": "DestFolder",
16
+ "ip": "127.0.0.1",
17
+ "username": "jerry",
18
+ "action": "read",
19
+ "failure_type": "bad_password",
20
+ "interface": "ftp",
21
+ "target_id": 1,
22
+ "target_name": "full",
23
+ "target_permission": "full",
24
+ "target_recursive": true,
25
+ "target_expires_at": 1,
26
+ "target_permission_set": "desktop_app",
27
+ "target_platform": "windows",
28
+ "target_username": "jerry",
29
+ "target_user_id": 1
30
+ }
31
+ ```
32
+
33
+ * `id` (int64): Action ID
34
+ * `created_at` (int64): When the action happened
35
+ * `user_id` (int64): User ID
36
+ * `file_id` (int64): File ID related to the action
37
+ * `parent_id` (int64): ID of the parent folder
38
+ * `path` (string): Path of the related action This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
39
+ * `folder` (string): Folder in which the action occurred
40
+ * `src` (string): File move originated from this path
41
+ * `destination` (string): File moved to this destination folder
42
+ * `ip` (string): Client IP that performed the action
43
+ * `username` (string): Username of the user that performed the action
44
+ * `action` (string): What action was taken. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`
45
+ * `failure_type` (string): The type of login failure, if applicable. Valid values: `expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_directory`, `errno_enoent`, `no_sftp_permission`, `no_dav_permission`, `no_restapi_permission`, `key_mismatch`, `region_mismatch`, `expired_access`, `desktop_ip_mismatch`, `desktop_api_key_not_used_quickly_enough`, `disabled`
46
+ * `interface` (string): Inteface through which the action was taken. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`
47
+ * `target_id` (int64): ID of the object (such as Users, or API Keys) on which the action was taken
48
+ * `target_name` (string): Name of the User, Group or other object with a name related to this action
49
+ * `target_permission` (string): Permission level of the action
50
+ * `target_recursive` (boolean): Whether or not the action was recursive
51
+ * `target_expires_at` (int64): If searching for Histories about API keys, this is when the API key will expire
52
+ * `target_permission_set` (string): If searching for Histories about API keys, this represents the permission set of the associated API key
53
+ * `target_platform` (string): If searching for Histories about API keys, this is the platform on which the action was taken
54
+ * `target_username` (string): If searching for Histories about API keys, this is the username on which the action was taken
55
+ * `target_user_id` (int64): If searching for Histories about API keys, this is the User ID on which the action was taken
56
+
57
+
58
+ ---
59
+
60
+ ## List History Export Results
61
+
62
+ ```
63
+ Files::HistoryExportResult.list(
64
+ user_id: 1,
65
+ page: 1,
66
+ per_page: 1,
67
+ action: "read",
68
+ history_export_id: 1
69
+ )
70
+ ```
71
+
72
+ ### Parameters
73
+
74
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
75
+ * `page` (int64): Current page number.
76
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
77
+ * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
78
+ * `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
79
+ * `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `created_at`.
80
+ * `history_export_id` (int64): Required - ID of the associated history export.
@@ -51,6 +51,7 @@ require "files.com/models/group"
51
51
  require "files.com/models/group_user"
52
52
  require "files.com/models/history"
53
53
  require "files.com/models/history_export"
54
+ require "files.com/models/history_export_result"
54
55
  require "files.com/models/image"
55
56
  require "files.com/models/invoice"
56
57
  require "files.com/models/invoice_line_item"
@@ -216,6 +216,15 @@ module Files
216
216
  @attributes[:query_target_permission_set] = value
217
217
  end
218
218
 
219
+ # string - If `status` is `ready` and the query succeeded, this will be a URL where all the results can be downloaded at once as a CSV.
220
+ def results_url
221
+ @attributes[:results_url]
222
+ end
223
+
224
+ def results_url=(value)
225
+ @attributes[:results_url] = value
226
+ end
227
+
219
228
  # int64 - User ID. Provide a value of `0` to operate the current session's user.
220
229
  def user_id
221
230
  @attributes[:user_id]
@@ -225,20 +234,6 @@ module Files
225
234
  @attributes[:user_id] = value
226
235
  end
227
236
 
228
- def delete(params = {})
229
- params ||= {}
230
- params[:id] = @attributes[:id]
231
- raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
232
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
233
- raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
234
-
235
- Api.send_request("/history_exports/#{@attributes[:id]}", :delete, params, @options)
236
- end
237
-
238
- def destroy(params = {})
239
- delete(params)
240
- end
241
-
242
237
  def save
243
238
  if @attributes[:id]
244
239
  raise NotImplementedError.new("The HistoryExport object doesn't support updates.")
@@ -248,27 +243,6 @@ module Files
248
243
  end
249
244
  end
250
245
 
251
- # Parameters:
252
- # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
253
- # page - int64 - Current page number.
254
- # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
255
- # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
256
- def self.list(params = {}, options = {})
257
- raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
258
- raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
259
- raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
260
- raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
261
-
262
- response, options = Api.send_request("/history_exports", :get, params, options)
263
- response.data.map do |entity_data|
264
- HistoryExport.new(entity_data, options)
265
- end
266
- end
267
-
268
- def self.all(params = {}, options = {})
269
- list(params, options)
270
- end
271
-
272
246
  # Parameters:
273
247
  # id (required) - int64 - History Export ID.
274
248
  def self.find(id, params = {}, options = {})
@@ -335,19 +309,5 @@ module Files
335
309
  response, options = Api.send_request("/history_exports", :post, params, options)
336
310
  HistoryExport.new(response.data, options)
337
311
  end
338
-
339
- def self.delete(id, params = {}, options = {})
340
- params ||= {}
341
- params[:id] = id
342
- raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
343
- raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
344
-
345
- response, _options = Api.send_request("/history_exports/#{params[:id]}", :delete, params, options)
346
- response.data
347
- end
348
-
349
- def self.destroy(id, params = {}, options = {})
350
- delete(id, params, options)
351
- end
352
312
  end
353
313
  end
@@ -0,0 +1,154 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class HistoryExportResult
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Action ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # int64 - When the action happened
18
+ def created_at
19
+ @attributes[:created_at]
20
+ end
21
+
22
+ # int64 - User ID
23
+ def user_id
24
+ @attributes[:user_id]
25
+ end
26
+
27
+ # int64 - File ID related to the action
28
+ def file_id
29
+ @attributes[:file_id]
30
+ end
31
+
32
+ # int64 - ID of the parent folder
33
+ def parent_id
34
+ @attributes[:parent_id]
35
+ end
36
+
37
+ # string - Path of the related action This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
38
+ def path
39
+ @attributes[:path]
40
+ end
41
+
42
+ # string - Folder in which the action occurred
43
+ def folder
44
+ @attributes[:folder]
45
+ end
46
+
47
+ # string - File move originated from this path
48
+ def src
49
+ @attributes[:src]
50
+ end
51
+
52
+ # string - File moved to this destination folder
53
+ def destination
54
+ @attributes[:destination]
55
+ end
56
+
57
+ # string - Client IP that performed the action
58
+ def ip
59
+ @attributes[:ip]
60
+ end
61
+
62
+ # string - Username of the user that performed the action
63
+ def username
64
+ @attributes[:username]
65
+ end
66
+
67
+ # string - What action was taken. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`
68
+ def action
69
+ @attributes[:action]
70
+ end
71
+
72
+ # string - The type of login failure, if applicable. Valid values: `expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_directory`, `errno_enoent`, `no_sftp_permission`, `no_dav_permission`, `no_restapi_permission`, `key_mismatch`, `region_mismatch`, `expired_access`, `desktop_ip_mismatch`, `desktop_api_key_not_used_quickly_enough`, `disabled`
73
+ def failure_type
74
+ @attributes[:failure_type]
75
+ end
76
+
77
+ # string - Inteface through which the action was taken. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`
78
+ def interface
79
+ @attributes[:interface]
80
+ end
81
+
82
+ # int64 - ID of the object (such as Users, or API Keys) on which the action was taken
83
+ def target_id
84
+ @attributes[:target_id]
85
+ end
86
+
87
+ # string - Name of the User, Group or other object with a name related to this action
88
+ def target_name
89
+ @attributes[:target_name]
90
+ end
91
+
92
+ # string - Permission level of the action
93
+ def target_permission
94
+ @attributes[:target_permission]
95
+ end
96
+
97
+ # boolean - Whether or not the action was recursive
98
+ def target_recursive
99
+ @attributes[:target_recursive]
100
+ end
101
+
102
+ # int64 - If searching for Histories about API keys, this is when the API key will expire
103
+ def target_expires_at
104
+ @attributes[:target_expires_at]
105
+ end
106
+
107
+ # string - If searching for Histories about API keys, this represents the permission set of the associated API key
108
+ def target_permission_set
109
+ @attributes[:target_permission_set]
110
+ end
111
+
112
+ # string - If searching for Histories about API keys, this is the platform on which the action was taken
113
+ def target_platform
114
+ @attributes[:target_platform]
115
+ end
116
+
117
+ # string - If searching for Histories about API keys, this is the username on which the action was taken
118
+ def target_username
119
+ @attributes[:target_username]
120
+ end
121
+
122
+ # int64 - If searching for Histories about API keys, this is the User ID on which the action was taken
123
+ def target_user_id
124
+ @attributes[:target_user_id]
125
+ end
126
+
127
+ # Parameters:
128
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
129
+ # page - int64 - Current page number.
130
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
131
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
132
+ # cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
133
+ # sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `created_at`.
134
+ # history_export_id (required) - int64 - ID of the associated history export.
135
+ def self.list(params = {}, options = {})
136
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
137
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
138
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
139
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
140
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
141
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
142
+ raise InvalidParameterError.new("Bad parameter: history_export_id must be an Integer") if params.dig(:history_export_id) and !params.dig(:history_export_id).is_a?(Integer)
143
+ raise MissingParameterError.new("Parameter missing: history_export_id") unless params.dig(:history_export_id)
144
+
145
+ List.new(HistoryExportResult, params) do
146
+ Api.send_request("/history_export_results", :get, params, options)
147
+ end
148
+ end
149
+
150
+ def self.all(params = {}, options = {})
151
+ list(params, options)
152
+ end
153
+ end
154
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.101
4
+ version: 1.0.102
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
@@ -111,6 +111,7 @@ files:
111
111
  - docs/group_user.md
112
112
  - docs/history.md
113
113
  - docs/history_export.md
114
+ - docs/history_export_result.md
114
115
  - docs/image.md
115
116
  - docs/invoice.md
116
117
  - docs/invoice_line_item.md
@@ -174,6 +175,7 @@ files:
174
175
  - lib/files.com/models/group_user.rb
175
176
  - lib/files.com/models/history.rb
176
177
  - lib/files.com/models/history_export.rb
178
+ - lib/files.com/models/history_export_result.rb
177
179
  - lib/files.com/models/image.rb
178
180
  - lib/files.com/models/invoice.rb
179
181
  - lib/files.com/models/invoice_line_item.rb