files.com 1.0.103 → 1.0.108

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/_VERSION +1 -1
  3. data/docs/api_key.md +18 -2
  4. data/docs/app.md +2 -0
  5. data/docs/as2_key.md +1 -0
  6. data/docs/bandwidth_snapshot.md +8 -0
  7. data/docs/bundle_download.md +1 -0
  8. data/docs/bundle_recipient.md +1 -0
  9. data/docs/clickwrap.md +1 -0
  10. data/docs/dns_record.md +1 -0
  11. data/docs/external_event.md +43 -0
  12. data/docs/file.md +2 -4
  13. data/docs/file_comment.md +1 -0
  14. data/docs/file_part_upload.md +12 -10
  15. data/docs/folder.md +2 -4
  16. data/docs/group_user.md +1 -0
  17. data/docs/history_export.md +20 -20
  18. data/docs/history_export_result.md +0 -1
  19. data/docs/invoice.md +1 -0
  20. data/docs/ip_address.md +2 -0
  21. data/docs/lock.md +1 -0
  22. data/docs/message.md +1 -0
  23. data/docs/message_comment.md +1 -0
  24. data/docs/message_comment_reaction.md +1 -0
  25. data/docs/message_reaction.md +1 -0
  26. data/docs/payment.md +1 -0
  27. data/docs/project.md +1 -0
  28. data/docs/public_key.md +1 -0
  29. data/docs/remote_server.md +1 -0
  30. data/docs/session.md +10 -2
  31. data/docs/site.md +18 -2
  32. data/docs/sso_strategy.md +3 -0
  33. data/docs/usage_snapshot.md +1 -0
  34. data/docs/user_cipher_use.md +1 -0
  35. data/docs/user_request.md +1 -0
  36. data/lib/files.com.rb +1 -0
  37. data/lib/files.com/api_client.rb +7 -2
  38. data/lib/files.com/models/api_key.rb +12 -0
  39. data/lib/files.com/models/app.rb +5 -0
  40. data/lib/files.com/models/as2_key.rb +4 -3
  41. data/lib/files.com/models/bandwidth_snapshot.rb +18 -3
  42. data/lib/files.com/models/bundle_download.rb +4 -3
  43. data/lib/files.com/models/bundle_recipient.rb +4 -3
  44. data/lib/files.com/models/clickwrap.rb +4 -3
  45. data/lib/files.com/models/dns_record.rb +4 -3
  46. data/lib/files.com/models/external_event.rb +66 -0
  47. data/lib/files.com/models/file.rb +6 -15
  48. data/lib/files.com/models/file_comment.rb +4 -3
  49. data/lib/files.com/models/file_part_upload.rb +10 -5
  50. data/lib/files.com/models/folder.rb +3 -12
  51. data/lib/files.com/models/group_user.rb +4 -3
  52. data/lib/files.com/models/history_export.rb +15 -15
  53. data/lib/files.com/models/history_export_result.rb +0 -2
  54. data/lib/files.com/models/invoice.rb +4 -3
  55. data/lib/files.com/models/ip_address.rb +8 -6
  56. data/lib/files.com/models/lock.rb +4 -3
  57. data/lib/files.com/models/message.rb +4 -3
  58. data/lib/files.com/models/message_comment.rb +4 -3
  59. data/lib/files.com/models/message_comment_reaction.rb +4 -3
  60. data/lib/files.com/models/message_reaction.rb +4 -3
  61. data/lib/files.com/models/payment.rb +4 -3
  62. data/lib/files.com/models/project.rb +4 -3
  63. data/lib/files.com/models/public_key.rb +4 -3
  64. data/lib/files.com/models/remote_server.rb +4 -3
  65. data/lib/files.com/models/session.rb +6 -0
  66. data/lib/files.com/models/site.rb +12 -0
  67. data/lib/files.com/models/sso_strategy.rb +9 -3
  68. data/lib/files.com/models/usage_snapshot.rb +4 -3
  69. data/lib/files.com/models/user_cipher_use.rb +4 -3
  70. data/lib/files.com/models/user_request.rb +4 -3
  71. metadata +4 -2
@@ -33,6 +33,7 @@ Files::MessageReaction.list(
33
33
  * `page` (int64): Current page number.
34
34
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
35
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
36
+ * `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.
36
37
  * `message_id` (int64): Required - Message to return reactions for.
37
38
 
38
39
 
@@ -57,6 +57,7 @@ Files::Payment.list(
57
57
  * `page` (int64): Current page number.
58
58
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
59
59
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
60
+ * `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.
60
61
 
61
62
 
62
63
  ---
@@ -29,6 +29,7 @@ Files::Project.list(
29
29
  * `page` (int64): Current page number.
30
30
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
31
31
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
32
+ * `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.
32
33
 
33
34
 
34
35
  ---
@@ -37,6 +37,7 @@ Files::PublicKey.list(
37
37
  * `page` (int64): Current page number.
38
38
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
39
39
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
40
+ * `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.
40
41
 
41
42
 
42
43
  ---
@@ -93,6 +93,7 @@ Files::RemoteServer.list(
93
93
  * `page` (int64): Current page number.
94
94
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
95
95
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
96
+ * `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.
96
97
 
97
98
 
98
99
  ---
@@ -10,7 +10,7 @@
10
10
  "login_token_domain": "https://mysite.files.com",
11
11
  "max_dir_listing_size": 1,
12
12
  "multiple_regions": true,
13
- "read_only": "en",
13
+ "read_only": true,
14
14
  "root_path": "",
15
15
  "site_id": 1,
16
16
  "ssl_required": true,
@@ -74,5 +74,13 @@ Files::Session.create(
74
74
  ## Delete user session (log out)
75
75
 
76
76
  ```
77
- Files::Session.delete
77
+ Files::Session.delete(
78
+ format: "",
79
+ session: ""
80
+ )
78
81
  ```
82
+
83
+ ### Parameters
84
+
85
+ * `format` (string):
86
+ * `session` (object):
@@ -234,18 +234,34 @@
234
234
  ## Show site settings
235
235
 
236
236
  ```
237
- Files::Site.get
237
+ Files::Site.get(
238
+ format: "",
239
+ site: ""
240
+ )
238
241
  ```
239
242
 
243
+ ### Parameters
244
+
245
+ * `format` (string):
246
+ * `site` (object):
247
+
240
248
 
241
249
  ---
242
250
 
243
251
  ## Get the most recent usage snapshot (usage data for billing purposes) for a Site
244
252
 
245
253
  ```
246
- Files::Site.get_usage
254
+ Files::Site.get_usage(
255
+ format: "",
256
+ site: ""
257
+ )
247
258
  ```
248
259
 
260
+ ### Parameters
261
+
262
+ * `format` (string):
263
+ * `site` (object):
264
+
249
265
 
250
266
  ---
251
267
 
@@ -23,6 +23,7 @@
23
23
  "provision_groups": true,
24
24
  "deprovision_users": true,
25
25
  "deprovision_groups": true,
26
+ "deprovision_behavior": "disable",
26
27
  "provision_group_default": "Employees",
27
28
  "provision_group_exclusion": "Employees",
28
29
  "provision_group_inclusion": "Employees",
@@ -62,6 +63,7 @@
62
63
  * `provision_groups` (boolean): Auto-provision group membership based on group memberships on the SSO side?
63
64
  * `deprovision_users` (boolean): Auto-deprovision users?
64
65
  * `deprovision_groups` (boolean): Auto-deprovision group membership based on group memberships on the SSO side?
66
+ * `deprovision_behavior` (string): Method used for deprovisioning users.
65
67
  * `provision_group_default` (string): Comma-separated list of group names for groups to automatically add all auto-provisioned users to.
66
68
  * `provision_group_exclusion` (string): Comma-separated list of group names for groups (with optional wildcards) that will be excluded from auto-provisioning.
67
69
  * `provision_group_inclusion` (string): Comma-separated list of group names for groups (with optional wildcards) that will be auto-provisioned.
@@ -99,6 +101,7 @@ Files::SsoStrategy.list(
99
101
  * `page` (int64): Current page number.
100
102
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
101
103
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
104
+ * `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.
102
105
 
103
106
 
104
107
  ---
@@ -51,3 +51,4 @@ Files::UsageSnapshot.list(
51
51
  * `page` (int64): Current page number.
52
52
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
53
53
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
54
+ * `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.
@@ -39,3 +39,4 @@ Files::UserCipherUse.list(
39
39
  * `page` (int64): Current page number.
40
40
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
41
41
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
42
+ * `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.
@@ -33,6 +33,7 @@ Files::UserRequest.list(
33
33
  * `page` (int64): Current page number.
34
34
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
35
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
36
+ * `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.
36
37
 
37
38
 
38
39
  ---
@@ -41,6 +41,7 @@ require "files.com/models/bundle_recipient"
41
41
  require "files.com/models/clickwrap"
42
42
  require "files.com/models/dns_record"
43
43
  require "files.com/models/errors"
44
+ require "files.com/models/external_event"
44
45
  require "files.com/models/file"
45
46
  require "files.com/models/file_action"
46
47
  require "files.com/models/file_comment"
@@ -145,11 +145,12 @@ module Files
145
145
  end
146
146
  end
147
147
 
148
- def stream_download(uri, io)
148
+ def stream_download(uri, io, range)
149
149
  if conn.adapter == Faraday::Adapter::NetHttp
150
150
  uri = URI(uri)
151
151
  Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
152
152
  request = Net::HTTP::Get.new uri
153
+ request["RANGE"] = "bytes=#{range[0]}-#{range[1]}" if range
153
154
  http.request request do |response|
154
155
  io.fulfill_content_length(response.content_length) if io.respond_to?(:fulfill_content_length)
155
156
  response.read_body do |chunk|
@@ -169,7 +170,11 @@ module Files
169
170
  end
170
171
 
171
172
  private def api_url(url = "", base_url = nil)
172
- Addressable::URI.parse((base_url || Files.base_url) + "/api/rest/v1" + url).normalize!.to_s
173
+ uri = Addressable::URI.new
174
+ uri.host = Addressable::URI.parse(base_url).host
175
+ uri.path = "/api/rest/v1" + url
176
+ uri.scheme = Addressable::URI.parse(base_url).scheme
177
+ uri.normalize!.to_s
173
178
  end
174
179
 
175
180
  private def check_api_key!(api_key)
@@ -180,7 +180,13 @@ module Files
180
180
  list(params, options)
181
181
  end
182
182
 
183
+ # Parameters:
184
+ # format - string
185
+ # api_key - object
183
186
  def self.find_current(params = {}, options = {})
187
+ raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
188
+ raise InvalidParameterError.new("Bad parameter: api_key must be an Hash") if params.dig(:api_key) and !params.dig(:api_key).is_a?(Hash)
189
+
184
190
  response, options = Api.send_request("/api_key", :get, params, options)
185
191
  ApiKey.new(response.data, options)
186
192
  end
@@ -248,7 +254,13 @@ module Files
248
254
  ApiKey.new(response.data, options)
249
255
  end
250
256
 
257
+ # Parameters:
258
+ # format - string
259
+ # api_key - object
251
260
  def self.delete_current(params = {}, options = {})
261
+ raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
262
+ raise InvalidParameterError.new("Bad parameter: api_key must be an Hash") if params.dig(:api_key) and !params.dig(:api_key).is_a?(Hash)
263
+
252
264
  response, _options = Api.send_request("/api_key", :delete, params, options)
253
265
  response.data
254
266
  end
@@ -34,6 +34,11 @@ module Files
34
34
  @attributes[:logo_url]
35
35
  end
36
36
 
37
+ # string - Screenshots of the App
38
+ def screenshot_list_urls
39
+ @attributes[:screenshot_list_urls]
40
+ end
41
+
37
42
  # string - Logo thumbnail for the App
38
43
  def logo_thumbnail_url
39
44
  @attributes[:logo_thumbnail_url]
@@ -101,15 +101,16 @@ module Files
101
101
  # page - int64 - Current page number.
102
102
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
103
103
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
104
+ # 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.
104
105
  def self.list(params = {}, options = {})
105
106
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
106
107
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
107
108
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
108
109
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
110
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
109
111
 
110
- response, options = Api.send_request("/as2_keys", :get, params, options)
111
- response.data.map do |entity_data|
112
- As2Key.new(entity_data, options)
112
+ List.new(As2Key, params) do
113
+ Api.send_request("/as2_keys", :get, params, options)
113
114
  end
114
115
  end
115
116
 
@@ -58,14 +58,29 @@ module Files
58
58
  # page - int64 - Current page number.
59
59
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
60
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
61
+ # 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.
62
+ # 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` and `logged_at`.
63
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `logged_at`.
64
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `logged_at`.
65
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `logged_at`.
66
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `logged_at`.
67
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `logged_at`.
68
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `logged_at`.
61
69
  def self.list(params = {}, options = {})
62
70
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
63
71
  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
72
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
73
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
74
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
75
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
76
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
77
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
78
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
79
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
80
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
65
81
 
66
- response, options = Api.send_request("/bandwidth_snapshots", :get, params, options)
67
- response.data.map do |entity_data|
68
- BandwidthSnapshot.new(entity_data, options)
82
+ List.new(BandwidthSnapshot, params) do
83
+ Api.send_request("/bandwidth_snapshots", :get, params, options)
69
84
  end
70
85
  end
71
86
 
@@ -28,17 +28,18 @@ module Files
28
28
  # page - int64 - Current page number.
29
29
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
30
30
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
31
+ # 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.
31
32
  # bundle_registration_id (required) - int64 - BundleRegistration ID
32
33
  def self.list(params = {}, options = {})
33
34
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
34
35
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
35
36
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
37
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
36
38
  raise InvalidParameterError.new("Bad parameter: bundle_registration_id must be an Integer") if params.dig(:bundle_registration_id) and !params.dig(:bundle_registration_id).is_a?(Integer)
37
39
  raise MissingParameterError.new("Parameter missing: bundle_registration_id") unless params.dig(:bundle_registration_id)
38
40
 
39
- response, options = Api.send_request("/bundle_downloads", :get, params, options)
40
- response.data.map do |entity_data|
41
- BundleDownload.new(entity_data, options)
41
+ List.new(BundleDownload, params) do
42
+ Api.send_request("/bundle_downloads", :get, params, options)
42
43
  end
43
44
  end
44
45
 
@@ -39,18 +39,19 @@ module Files
39
39
  # page - int64 - Current page number.
40
40
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
41
41
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
42
+ # 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.
42
43
  # bundle_id (required) - int64 - List recipients for the bundle with this ID.
43
44
  def self.list(params = {}, options = {})
44
45
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
45
46
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
46
47
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
47
48
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
49
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
48
50
  raise InvalidParameterError.new("Bad parameter: bundle_id must be an Integer") if params.dig(:bundle_id) and !params.dig(:bundle_id).is_a?(Integer)
49
51
  raise MissingParameterError.new("Parameter missing: bundle_id") unless params.dig(:bundle_id)
50
52
 
51
- response, options = Api.send_request("/bundle_recipients", :get, params, options)
52
- response.data.map do |entity_data|
53
- BundleRecipient.new(entity_data, options)
53
+ List.new(BundleRecipient, params) do
54
+ Api.send_request("/bundle_recipients", :get, params, options)
54
55
  end
55
56
  end
56
57
 
@@ -111,14 +111,15 @@ module Files
111
111
  # page - int64 - Current page number.
112
112
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
113
113
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
114
+ # 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.
114
115
  def self.list(params = {}, options = {})
115
116
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
116
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)
117
118
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
119
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
118
120
 
119
- response, options = Api.send_request("/clickwraps", :get, params, options)
120
- response.data.map do |entity_data|
121
- Clickwrap.new(entity_data, options)
121
+ List.new(Clickwrap, params) do
122
+ Api.send_request("/clickwraps", :get, params, options)
122
123
  end
123
124
  end
124
125
 
@@ -33,14 +33,15 @@ module Files
33
33
  # page - int64 - Current page number.
34
34
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
35
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
36
+ # 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.
36
37
  def self.list(params = {}, options = {})
37
38
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
38
39
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
39
40
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
41
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
40
42
 
41
- response, options = Api.send_request("/dns_records", :get, params, options)
42
- response.data.map do |entity_data|
43
- DnsRecord.new(entity_data, options)
43
+ List.new(DnsRecord, params) do
44
+ Api.send_request("/dns_records", :get, params, options)
44
45
  end
45
46
  end
46
47
 
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class ExternalEvent
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # string - Type of event being recorded. Valid values: `remote_server_sync`, `lockout`, `ldap_login`, `saml_login`
13
+ def event_type
14
+ @attributes[:event_type]
15
+ end
16
+
17
+ # string - Status of event. Valid values: `error`
18
+ def status
19
+ @attributes[:status]
20
+ end
21
+
22
+ # string - Event body
23
+ def body
24
+ @attributes[:body]
25
+ end
26
+
27
+ # date-time - External event create date/time
28
+ def created_at
29
+ @attributes[:created_at]
30
+ end
31
+
32
+ # Parameters:
33
+ # page - int64 - Current page number.
34
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
35
+ # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
36
+ # 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.
37
+ # 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 `remote_server_type`, `site_id`, `event_type`, `created_at` or `status`.
38
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type` or `status`.
39
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type` or `status`.
40
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type` or `status`.
41
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type` or `status`.
42
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type` or `status`.
43
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `created_at`, `event_type`, `remote_server_type` or `status`.
44
+ def self.list(params = {}, options = {})
45
+ raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
46
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
47
+ raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
48
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
49
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
50
+ raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
51
+ raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
52
+ raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
53
+ raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
54
+ raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
55
+ raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
56
+
57
+ List.new(ExternalEvent, params) do
58
+ Api.send_request("/external_events", :get, params, options)
59
+ end
60
+ end
61
+
62
+ def self.all(params = {}, options = {})
63
+ list(params, options)
64
+ end
65
+ end
66
+ end
@@ -305,8 +305,8 @@ module Files
305
305
  end
306
306
  end
307
307
 
308
- def download_content(io)
309
- Files::ApiClient.download_client.stream_download(download_uri_with_load, io)
308
+ def download_content(io, range: [])
309
+ Files::ApiClient.download_client.stream_download(download_uri_with_load, io, range)
310
310
  end
311
311
 
312
312
  def each(*args, &block)
@@ -388,11 +388,11 @@ module Files
388
388
  read_io.gets *args
389
389
  end
390
390
 
391
- def read_io
391
+ def read_io(**options)
392
392
  @read_io ||= begin
393
393
  r, w = SizableIO.pipe
394
394
  Thread.new do
395
- download_content(w)
395
+ download_content(w, **options)
396
396
  ensure
397
397
  w.close
398
398
  end
@@ -588,15 +588,6 @@ module Files
588
588
  @write_io.write_nonblock *args
589
589
  end
590
590
 
591
- # int64 - File/Folder ID
592
- def id
593
- @attributes[:id]
594
- end
595
-
596
- def id=(value)
597
- @attributes[:id] = value
598
- end
599
-
600
591
  # string - File/Folder path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
601
592
  def path
602
593
  @attributes[:path]
@@ -857,7 +848,7 @@ module Files
857
848
  end
858
849
 
859
850
  # Parameters:
860
- # recursive - boolean - If true, will recursively delete folers. Otherwise, will error on non-empty folders. For legacy reasons, this parameter may also be provided as the HTTP header `Depth: Infinity`
851
+ # recursive - boolean - If true, will recursively delete folers. Otherwise, will error on non-empty folders.
861
852
  def delete(params = {})
862
853
  params ||= {}
863
854
  params[:path] = @attributes[:path]
@@ -946,7 +937,7 @@ module Files
946
937
  end
947
938
 
948
939
  # Parameters:
949
- # recursive - boolean - If true, will recursively delete folers. Otherwise, will error on non-empty folders. For legacy reasons, this parameter may also be provided as the HTTP header `Depth: Infinity`
940
+ # recursive - boolean - If true, will recursively delete folers. Otherwise, will error on non-empty folders.
950
941
  def self.delete(path, params = {}, options = {})
951
942
  params ||= {}
952
943
  params[:path] = path