files.com 1.0.97 → 1.0.102

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97acc17f725e6c4192466ee9ad47a82d8fb264e5341e0c9f4edd501719597d34
4
- data.tar.gz: 7bf768e1363aac2b3dc58754af05d79f84c4697cbd7244d9fbfa9d9cbd71de12
3
+ metadata.gz: c04971f6d00a131b02f05177190f6ecd61e1e78a85cff414c3a6f1bab9fc1642
4
+ data.tar.gz: 81edb2e009ebb9ac34454491ae49661951e2ba430043977b4eff5cf1cd27823a
5
5
  SHA512:
6
- metadata.gz: 2f037534260b2520f47f35292441261fa6a739c3d3b17da19dab2de77aadf2b1503c1ad6f79cf915474c1230f4a9f6eefa8d683877657eb67ecad8e46344628f
7
- data.tar.gz: 5c998a4d55661a9d6c42afe46957e5b40331aeda753b131eda1d8b58eaba33906d9268a56f1f74133fa60d22f521164e5d507cf80b1c03ce77da2c51cfb3f0a7
6
+ metadata.gz: 710b6f10d4ea051a4bfde7be422019d535ee49700fc0816d3f49d5c5a7dc54d579169462ca3eb01bb3819f815d66569815f36284212c27044be9d4f55bae4b09
7
+ data.tar.gz: 75eb37ba02f5e83e2d9d6ee690ce1b70c8e02c527533caf9ad12bd3e908ea913ffdc8c522cda4268b041820c20b0abbd46ea02af5e1cb81fe2f37a2e76a4043d
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.97
1
+ 1.0.102
@@ -0,0 +1,45 @@
1
+ # BandwidthSnapshot
2
+
3
+ ## Example BandwidthSnapshot Object
4
+
5
+ ```
6
+ {
7
+ "id": 1,
8
+ "bytes_received": 1.0,
9
+ "bytes_sent": 1.0,
10
+ "requests_get": 1.0,
11
+ "requests_put": 1.0,
12
+ "requests_other": 1.0,
13
+ "logged_at": "2000-01-01T01:00:00Z",
14
+ "created_at": "2000-01-01T01:00:00Z",
15
+ "updated_at": "2000-01-01T01:00:00Z"
16
+ }
17
+ ```
18
+
19
+ * `id` (int64): Site bandwidth ID
20
+ * `bytes_received` (double): Site bandwidth report bytes received
21
+ * `bytes_sent` (double): Site bandwidth report bytes sent
22
+ * `requests_get` (double): Site bandwidth report get requests
23
+ * `requests_put` (double): Site bandwidth report put requests
24
+ * `requests_other` (double): Site bandwidth report other requests
25
+ * `logged_at` (date-time): Time the site bandwidth report was logged
26
+ * `created_at` (date-time): Site bandwidth report created at date/time
27
+ * `updated_at` (date-time): The last time this site bandwidth report was updated
28
+
29
+
30
+ ---
31
+
32
+ ## List Bandwidth Snapshots
33
+
34
+ ```
35
+ Files::BandwidthSnapshot.list(
36
+ page: 1,
37
+ per_page: 1
38
+ )
39
+ ```
40
+
41
+ ### Parameters
42
+
43
+ * `page` (int64): Current page number.
44
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
45
+ * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
@@ -44,7 +44,7 @@ Files::Group.list(
44
44
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
45
45
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
46
46
  * `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.
47
- * `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 `active`, `deleted_at`, `site_id` or `name`.
47
+ * `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 `active`, `site_id` or `name`.
48
48
  * `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`.
49
49
  * `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name`.
50
50
  * `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name`.
@@ -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.
@@ -30,7 +30,7 @@
30
30
  ## List Permissions
31
31
 
32
32
  ```
33
- Files::Permission.list(path,
33
+ Files::Permission.list(
34
34
  page: 1,
35
35
  per_page: 1,
36
36
  group_id: 1,
@@ -63,7 +63,7 @@ Files::Permission.list(path,
63
63
  ## Create Permission
64
64
 
65
65
  ```
66
- Files::Permission.create(path,
66
+ Files::Permission.create(
67
67
  group_id: 1,
68
68
  permission: "full",
69
69
  recursive: true,
@@ -93,3 +93,18 @@ Files::Permission.delete(id)
93
93
  ### Parameters
94
94
 
95
95
  * `id` (int64): Required - Permission ID.
96
+
97
+
98
+ ---
99
+
100
+ ## Delete Permission
101
+
102
+ ```
103
+ permission = Files::Permission.list_for(path).first
104
+
105
+ permission.delete
106
+ ```
107
+
108
+ ### Parameters
109
+
110
+ * `id` (int64): Required - Permission ID.
@@ -28,7 +28,7 @@
28
28
  ## List Requests
29
29
 
30
30
  ```
31
- Files::Request.list(path,
31
+ Files::Request.list(
32
32
  page: 1,
33
33
  per_page: 1,
34
34
  mine: true
@@ -51,7 +51,7 @@ Files::Request.list(path,
51
51
  ## List Requests
52
52
 
53
53
  ```
54
- Files::Request.find_folder(path,
54
+ Files::Request.get_folder(path,
55
55
  page: 1,
56
56
  per_page: 1,
57
57
  mine: true
@@ -74,7 +74,8 @@ Files::Request.find_folder(path,
74
74
  ## Create Request
75
75
 
76
76
  ```
77
- Files::Request.create(path,
77
+ Files::Request.create(
78
+ path: "path",
78
79
  destination: "destination"
79
80
  )
80
81
  ```
@@ -98,3 +99,18 @@ Files::Request.delete(id)
98
99
  ### Parameters
99
100
 
100
101
  * `id` (int64): Required - Request ID.
102
+
103
+
104
+ ---
105
+
106
+ ## Delete Request
107
+
108
+ ```
109
+ request = Files::Request.list_for(path).first
110
+
111
+ request.delete
112
+ ```
113
+
114
+ ### Parameters
115
+
116
+ * `id` (int64): Required - Request ID.
@@ -33,6 +33,7 @@ require "files.com/models/app"
33
33
  require "files.com/models/as2_key"
34
34
  require "files.com/models/auto"
35
35
  require "files.com/models/automation"
36
+ require "files.com/models/bandwidth_snapshot"
36
37
  require "files.com/models/behavior"
37
38
  require "files.com/models/bundle"
38
39
  require "files.com/models/bundle_download"
@@ -50,6 +51,7 @@ require "files.com/models/group"
50
51
  require "files.com/models/group_user"
51
52
  require "files.com/models/history"
52
53
  require "files.com/models/history_export"
54
+ require "files.com/models/history_export_result"
53
55
  require "files.com/models/image"
54
56
  require "files.com/models/invoice"
55
57
  require "files.com/models/invoice_line_item"
@@ -169,7 +169,7 @@ module Files
169
169
  end
170
170
 
171
171
  private def api_url(url = "", base_url = nil)
172
- (base_url || Files.base_url) + "/api/rest/v1" + url
172
+ Addressable::URI.parse((base_url || Files.base_url) + "/api/rest/v1" + url).normalize!.to_s
173
173
  end
174
174
 
175
175
  private def check_api_key!(api_key)
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class BandwidthSnapshot
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Site bandwidth ID
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ # double - Site bandwidth report bytes received
18
+ def bytes_received
19
+ @attributes[:bytes_received]
20
+ end
21
+
22
+ # double - Site bandwidth report bytes sent
23
+ def bytes_sent
24
+ @attributes[:bytes_sent]
25
+ end
26
+
27
+ # double - Site bandwidth report get requests
28
+ def requests_get
29
+ @attributes[:requests_get]
30
+ end
31
+
32
+ # double - Site bandwidth report put requests
33
+ def requests_put
34
+ @attributes[:requests_put]
35
+ end
36
+
37
+ # double - Site bandwidth report other requests
38
+ def requests_other
39
+ @attributes[:requests_other]
40
+ end
41
+
42
+ # date-time - Time the site bandwidth report was logged
43
+ def logged_at
44
+ @attributes[:logged_at]
45
+ end
46
+
47
+ # date-time - Site bandwidth report created at date/time
48
+ def created_at
49
+ @attributes[:created_at]
50
+ end
51
+
52
+ # date-time - The last time this site bandwidth report was updated
53
+ def updated_at
54
+ @attributes[:updated_at]
55
+ end
56
+
57
+ # Parameters:
58
+ # page - int64 - Current page number.
59
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
61
+ def self.list(params = {}, options = {})
62
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
63
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
64
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
65
+
66
+ response, options = Api.send_request("/bandwidth_snapshots", :get, params, options)
67
+ response.data.map do |entity_data|
68
+ BandwidthSnapshot.new(entity_data, options)
69
+ end
70
+ end
71
+
72
+ def self.all(params = {}, options = {})
73
+ list(params, options)
74
+ end
75
+ end
76
+ end
@@ -873,12 +873,8 @@ module Files
873
873
  end
874
874
 
875
875
  def save
876
- if @attributes[:path]
877
- update(@attributes)
878
- else
879
- new_obj = File.create(@attributes, @options)
880
- @attributes = new_obj.attributes
881
- end
876
+ new_obj = File.create(path, @attributes, @options)
877
+ @attributes = new_obj.attributes
882
878
  end
883
879
 
884
880
  # Download file
@@ -304,12 +304,8 @@ module Files
304
304
  end
305
305
 
306
306
  def save
307
- if @attributes[:path]
308
- raise NotImplementedError.new("The Folder object doesn't support updates.")
309
- else
310
- new_obj = Folder.create(@attributes, @options)
311
- @attributes = new_obj.attributes
312
- end
307
+ new_obj = Folder.create(path, @attributes, @options)
308
+ @attributes = new_obj.attributes
313
309
  end
314
310
 
315
311
  # Parameters:
@@ -110,7 +110,7 @@ module Files
110
110
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
111
111
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
112
112
  # 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.
113
- # 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 `active`, `deleted_at`, `site_id` or `name`.
113
+ # 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 `active`, `site_id` or `name`.
114
114
  # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`.
115
115
  # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name`.
116
116
  # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name`.
@@ -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
@@ -109,12 +109,8 @@ module Files
109
109
  end
110
110
 
111
111
  def save
112
- if @attributes[:path]
113
- raise NotImplementedError.new("The Lock object doesn't support updates.")
114
- else
115
- new_obj = Lock.create(@attributes, @options)
116
- @attributes = new_obj.attributes
117
- end
112
+ new_obj = Lock.create(path, @attributes, @options)
113
+ @attributes = new_obj.attributes
118
114
  end
119
115
 
120
116
  # Parameters:
@@ -81,8 +81,22 @@ module Files
81
81
  @attributes[:recursive] = value
82
82
  end
83
83
 
84
+ def delete(params = {})
85
+ params ||= {}
86
+ params[:id] = @attributes[:id]
87
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
88
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
89
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
90
+
91
+ Api.send_request("/permissions/#{@attributes[:id]}", :delete, params, @options)
92
+ end
93
+
94
+ def destroy(params = {})
95
+ delete(params)
96
+ end
97
+
84
98
  def save
85
- if @attributes[:path]
99
+ if @attributes[:id]
86
100
  raise NotImplementedError.new("The Permission object doesn't support updates.")
87
101
  else
88
102
  new_obj = Permission.create(@attributes, @options)
@@ -106,9 +120,7 @@ module Files
106
120
  # group_id - string - DEPRECATED: Group ID. If provided, will scope permissions to this group. Use `filter[group_id]` instead.`
107
121
  # user_id - string - DEPRECATED: User ID. If provided, will scope permissions to this user. Use `filter[user_id]` instead.`
108
122
  # include_groups - boolean - If searching by user or group, also include user's permissions that are inherited from its groups?
109
- def self.list(path, params = {}, options = {})
110
- params ||= {}
111
- params[:path] = path
123
+ def self.list(params = {}, options = {})
112
124
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
113
125
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
114
126
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
@@ -129,8 +141,8 @@ module Files
129
141
  end
130
142
  end
131
143
 
132
- def self.all(path, params = {}, options = {})
133
- list(path, params, options)
144
+ def self.all(params = {}, options = {})
145
+ list(params, options)
134
146
  end
135
147
 
136
148
  # Parameters:
@@ -140,9 +152,7 @@ module Files
140
152
  # recursive - boolean - Apply to subfolders recursively?
141
153
  # user_id - int64 - User ID. Provide `username` or `user_id`
142
154
  # username - string - User username. Provide `username` or `user_id`
143
- def self.create(path, params = {}, options = {})
144
- params ||= {}
145
- params[:path] = path
155
+ def self.create(params = {}, options = {})
146
156
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
147
157
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
148
158
  raise InvalidParameterError.new("Bad parameter: permission must be an String") if params.dig(:permission) and !params.dig(:permission).is_a?(String)
@@ -153,8 +163,6 @@ module Files
153
163
  Permission.new(response.data, options)
154
164
  end
155
165
 
156
- # Parameters:
157
- # id (required) - int64 - Permission ID.
158
166
  def self.delete(id, params = {}, options = {})
159
167
  params ||= {}
160
168
  params[:id] = id
@@ -81,8 +81,22 @@ module Files
81
81
  @attributes[:group_ids] = value
82
82
  end
83
83
 
84
+ def delete(params = {})
85
+ params ||= {}
86
+ params[:id] = @attributes[:id]
87
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
88
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
89
+ raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
90
+
91
+ Api.send_request("/requests/#{@attributes[:id]}", :delete, params, @options)
92
+ end
93
+
94
+ def destroy(params = {})
95
+ delete(params)
96
+ end
97
+
84
98
  def save
85
- if @attributes[:path]
99
+ if @attributes[:id]
86
100
  raise NotImplementedError.new("The Request object doesn't support updates.")
87
101
  else
88
102
  new_obj = Request.create(@attributes, @options)
@@ -98,9 +112,7 @@ module Files
98
112
  # 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 `site_id`, `folder_id` or `destination`.
99
113
  # mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
100
114
  # path - string - Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
101
- def self.list(path, params = {}, options = {})
102
- params ||= {}
103
- params[:path] = path
115
+ def self.list(params = {}, options = {})
104
116
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
105
117
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
106
118
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
@@ -113,8 +125,8 @@ module Files
113
125
  end
114
126
  end
115
127
 
116
- def self.all(path, params = {}, options = {})
117
- list(path, params, options)
128
+ def self.all(params = {}, options = {})
129
+ list(params, options)
118
130
  end
119
131
 
120
132
  # Parameters:
@@ -125,7 +137,7 @@ module Files
125
137
  # 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 `site_id`, `folder_id` or `destination`.
126
138
  # mine - boolean - Only show requests of the current user? (Defaults to true if current user is not a site admin.)
127
139
  # path (required) - string - Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory.
128
- def self.find_folder(path, params = {}, options = {})
140
+ def self.get_folder(path, params = {}, options = {})
129
141
  params ||= {}
130
142
  params[:path] = path
131
143
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
@@ -146,9 +158,7 @@ module Files
146
158
  # destination (required) - string - Destination filename (without extension) to request.
147
159
  # user_ids - string - A list of user IDs to request the file from. If sent as a string, it should be comma-delimited.
148
160
  # group_ids - string - A list of group IDs to request the file from. If sent as a string, it should be comma-delimited.
149
- def self.create(path, params = {}, options = {})
150
- params ||= {}
151
- params[:path] = path
161
+ def self.create(params = {}, options = {})
152
162
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
153
163
  raise InvalidParameterError.new("Bad parameter: destination must be an String") if params.dig(:destination) and !params.dig(:destination).is_a?(String)
154
164
  raise InvalidParameterError.new("Bad parameter: user_ids must be an String") if params.dig(:user_ids) and !params.dig(:user_ids).is_a?(String)
@@ -160,8 +170,6 @@ module Files
160
170
  Request.new(response.data, options)
161
171
  end
162
172
 
163
- # Parameters:
164
- # id (required) - int64 - Request ID.
165
173
  def self.delete(id, params = {}, options = {})
166
174
  params ||= {}
167
175
  params[:id] = id
@@ -2,20 +2,20 @@ require "spec_helper"
2
2
  require "tempfile"
3
3
 
4
4
  RSpec.describe Files::File, :with_test_folder do
5
- describe "#read" do
5
+ xdescribe "#read" do
6
6
  before do
7
- Files::File.open(test_folder.join("read.txt").to_s, 'w', options) do |f|
7
+ Files::File.open(test_folder.join("[[strange stuff]]#yes.text").to_s, 'w', options) do |f|
8
8
  f.write("contents")
9
9
  end
10
10
  end
11
11
 
12
12
  it "returns the body of the file" do
13
- file = Files::File.find(test_folder.join("read.txt").to_s, {}, options)
13
+ file = Files::File.find(test_folder.join("[[strange stuff]]#yes.text").to_s, {}, options)
14
14
  expect(file.read).to eq("contents")
15
15
  end
16
16
  end
17
17
 
18
- describe "#read_io" do
18
+ xdescribe "#read_io" do
19
19
  before do
20
20
  Files::File.open(test_folder.join("read.txt").to_s, 'w', options) do |f|
21
21
  f.write("contents")
@@ -30,7 +30,7 @@ RSpec.describe Files::File, :with_test_folder do
30
30
  end
31
31
  end
32
32
 
33
- describe "#write" do
33
+ xdescribe "#write" do
34
34
  it "can take string" do
35
35
  Files::File.open(test_folder.join("write-as-string.txt").to_s, 'w', options) do |f|
36
36
  f.write("I am a string")
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Files::Folder, :with_test_folder do
4
- describe "#list_for" do
4
+ xdescribe "#list_for" do
5
5
  before do
6
6
  Files::File.open(test_folder.join("example.txt").to_s, 'w', options) do |f|
7
7
  f.write("my text")
@@ -22,7 +22,7 @@ RSpec.describe Files::Folder, :with_test_folder do
22
22
  end
23
23
  end
24
24
 
25
- describe "#delete" do
25
+ xdescribe "#delete" do
26
26
  it "deletes a folder" do
27
27
  Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options)
28
28
  Files::Folder.delete(test_folder.join("my-new-folder").to_s, {}, options)
@@ -31,7 +31,7 @@ RSpec.describe Files::Folder, :with_test_folder do
31
31
  end
32
32
  end
33
33
 
34
- describe "mkdir" do
34
+ xdescribe "mkdir" do
35
35
  it "makes a new folder" do
36
36
  Files::Folder.mkdir(test_folder.join("my-new-folder").to_s, {}, options)
37
37
  expect(Files::Folder.exist?(test_folder.join("my-new-folder").to_s, options)).to eq(true)
data/test.sh CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "bundler"
3
- Bundler.with_clean_env do
3
+ Bundler.with_unbundled_env do
4
4
  Dir.chdir("generated/ruby") do
5
5
  system "bundle install" if ARGV[0] == "true"
6
6
  system "bundle exec rspec"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.97
4
+ version: 1.0.102
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-29 00:00:00.000000000 Z
11
+ date: 2020-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -92,6 +92,7 @@ files:
92
92
  - docs/as2_key.md
93
93
  - docs/auto.md
94
94
  - docs/automation.md
95
+ - docs/bandwidth_snapshot.md
95
96
  - docs/behavior.md
96
97
  - docs/bundle.md
97
98
  - docs/bundle_download.md
@@ -110,6 +111,7 @@ files:
110
111
  - docs/group_user.md
111
112
  - docs/history.md
112
113
  - docs/history_export.md
114
+ - docs/history_export_result.md
113
115
  - docs/image.md
114
116
  - docs/invoice.md
115
117
  - docs/invoice_line_item.md
@@ -153,6 +155,7 @@ files:
153
155
  - lib/files.com/models/as2_key.rb
154
156
  - lib/files.com/models/auto.rb
155
157
  - lib/files.com/models/automation.rb
158
+ - lib/files.com/models/bandwidth_snapshot.rb
156
159
  - lib/files.com/models/behavior.rb
157
160
  - lib/files.com/models/bundle.rb
158
161
  - lib/files.com/models/bundle_download.rb
@@ -172,6 +175,7 @@ files:
172
175
  - lib/files.com/models/group_user.rb
173
176
  - lib/files.com/models/history.rb
174
177
  - lib/files.com/models/history_export.rb
178
+ - lib/files.com/models/history_export_result.rb
175
179
  - lib/files.com/models/image.rb
176
180
  - lib/files.com/models/invoice.rb
177
181
  - lib/files.com/models/invoice_line_item.rb