files.com 1.0.68 → 1.0.73

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +82 -0
  4. data/_VERSION +1 -1
  5. data/docs/remote_server.md +53 -4
  6. data/files.com.gemspec +3 -3
  7. data/lib/files.com.rb +1 -1
  8. data/lib/files.com/models/api_key.rb +3 -0
  9. data/lib/files.com/models/as2_key.rb +3 -0
  10. data/lib/files.com/models/automation.rb +3 -0
  11. data/lib/files.com/models/behavior.rb +8 -2
  12. data/lib/files.com/models/bundle.rb +3 -0
  13. data/lib/files.com/models/dns_record.rb +3 -0
  14. data/lib/files.com/models/file.rb +6 -5
  15. data/lib/files.com/models/file_action.rb +3 -1
  16. data/lib/files.com/models/file_comment.rb +3 -0
  17. data/lib/files.com/models/folder.rb +1 -0
  18. data/lib/files.com/models/group.rb +3 -0
  19. data/lib/files.com/models/group_user.rb +3 -0
  20. data/lib/files.com/models/history.rb +15 -0
  21. data/lib/files.com/models/history_export.rb +3 -0
  22. data/lib/files.com/models/invoice.rb +3 -0
  23. data/lib/files.com/models/ip_address.rb +3 -0
  24. data/lib/files.com/models/lock.rb +3 -0
  25. data/lib/files.com/models/message.rb +3 -0
  26. data/lib/files.com/models/message_comment.rb +3 -0
  27. data/lib/files.com/models/message_comment_reaction.rb +3 -0
  28. data/lib/files.com/models/message_reaction.rb +3 -0
  29. data/lib/files.com/models/notification.rb +3 -0
  30. data/lib/files.com/models/payment.rb +3 -0
  31. data/lib/files.com/models/permission.rb +3 -0
  32. data/lib/files.com/models/project.rb +3 -0
  33. data/lib/files.com/models/public_key.rb +3 -0
  34. data/lib/files.com/models/remote_server.rb +117 -0
  35. data/lib/files.com/models/request.rb +6 -0
  36. data/lib/files.com/models/session.rb +1 -0
  37. data/lib/files.com/models/site.rb +1 -0
  38. data/lib/files.com/models/sso_strategy.rb +3 -0
  39. data/lib/files.com/models/usage_daily_snapshot.rb +3 -0
  40. data/lib/files.com/models/usage_snapshot.rb +3 -0
  41. data/lib/files.com/models/user.rb +3 -0
  42. data/lib/files.com/models/user_cipher_use.rb +3 -0
  43. data/lib/files.com/sizable_io.rb +2 -2
  44. data/spec/spec_helper.rb +2 -3
  45. data/test/test.rb +1 -1
  46. metadata +16 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1bc10c4ee7f7a4dde44f2dcf5468a4369b2eae54d5eb33eea3bb8fb85da7e92
4
- data.tar.gz: a3e69711ae7ef0514fa365a3bafc3ffdec6b646128f9ab3ac2793f270a3fc61c
3
+ metadata.gz: '090d0a1af5f6c02e5d9324089a250496c92d37c49ee73d58034bae466f0aeffa'
4
+ data.tar.gz: 8924e6463aba4cab5d5cabfd15ed6f152e90565071155fc5f3a99f13d6fa4b68
5
5
  SHA512:
6
- metadata.gz: b123b1e3c76388294b474f5948f719d0effc7556c8611bdcfbb8f172aa5638c4053b4ad98bce36b1888205b40fb1594e8d84098affbbb5e2409cee42cd7030f9
7
- data.tar.gz: 35ea82953c0f3e540c0a4fc9043c34e7a188f8a941050e091a1885d64c2ad922edced2364ea3256029e3ed0e49abb75258ccab48ed4b126ba341de5d0efa95e2
6
+ metadata.gz: 41a353435d34c93d622516829eda77a903fde0e24f619785dc39286eac2557920928a5b910324810f60a59dc08fcdccd548c40ef81b98da2adcd75fbc55506be
7
+ data.tar.gz: 541976698c4ea4a92982b7c1fdd50066a2e4ab77cb7428a19e530318f8ed8ada2389b14ef2a62d8a016654e24790503cb0030acbfb26b2ff150906efd197f33f
data/Gemfile CHANGED
@@ -3,10 +3,10 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
+ gem 'memory_profiler'
6
7
  gem 'pry'
7
8
  gem 'pry-byebug'
8
9
  gem 'rake', '~> 12.0.0'
9
10
  gem 'rspec', '~> 3.9.0'
10
11
  gem 'rubocop'
11
- gem 'memory_profiler'
12
12
  end
@@ -0,0 +1,82 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ files.com (1.0)
5
+ addressable (>= 2.7.0)
6
+ concurrent-ruby (>= 1.1.3)
7
+ faraday (>= 1.0.1)
8
+ net-http-persistent
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ addressable (2.7.0)
14
+ public_suffix (>= 2.0.2, < 5.0)
15
+ ast (2.4.1)
16
+ byebug (11.1.3)
17
+ coderay (1.1.2)
18
+ concurrent-ruby (1.1.6)
19
+ connection_pool (2.2.3)
20
+ diff-lcs (1.3)
21
+ faraday (1.0.1)
22
+ multipart-post (>= 1.2, < 3)
23
+ memory_profiler (0.9.14)
24
+ method_source (1.0.0)
25
+ multipart-post (2.1.1)
26
+ net-http-persistent (4.0.0)
27
+ connection_pool (~> 2.2)
28
+ parallel (1.19.2)
29
+ parser (2.7.1.4)
30
+ ast (~> 2.4.1)
31
+ pry (0.13.1)
32
+ coderay (~> 1.1)
33
+ method_source (~> 1.0)
34
+ pry-byebug (3.9.0)
35
+ byebug (~> 11.0)
36
+ pry (~> 0.13.0)
37
+ public_suffix (4.0.5)
38
+ rainbow (3.0.0)
39
+ rake (12.0.0)
40
+ regexp_parser (1.7.1)
41
+ rexml (3.2.4)
42
+ rspec (3.9.0)
43
+ rspec-core (~> 3.9.0)
44
+ rspec-expectations (~> 3.9.0)
45
+ rspec-mocks (~> 3.9.0)
46
+ rspec-core (3.9.1)
47
+ rspec-support (~> 3.9.1)
48
+ rspec-expectations (3.9.0)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.9.0)
51
+ rspec-mocks (3.9.1)
52
+ diff-lcs (>= 1.2.0, < 2.0)
53
+ rspec-support (~> 3.9.0)
54
+ rspec-support (3.9.3)
55
+ rubocop (0.85.1)
56
+ parallel (~> 1.10)
57
+ parser (>= 2.7.0.1)
58
+ rainbow (>= 2.2.2, < 4.0)
59
+ regexp_parser (>= 1.7)
60
+ rexml
61
+ rubocop-ast (>= 0.0.3)
62
+ ruby-progressbar (~> 1.7)
63
+ unicode-display_width (>= 1.4.0, < 2.0)
64
+ rubocop-ast (0.0.3)
65
+ parser (>= 2.7.0.1)
66
+ ruby-progressbar (1.10.1)
67
+ unicode-display_width (1.7.0)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ files.com!
74
+ memory_profiler
75
+ pry
76
+ pry-byebug
77
+ rake (~> 12.0.0)
78
+ rspec (~> 3.9.0)
79
+ rubocop
80
+
81
+ BUNDLED WITH
82
+ 2.1.4
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.68
1
+ 1.0.73
@@ -22,7 +22,14 @@
22
22
  "backblaze_b2_s3_endpoint": "s3.us-west-001.backblazeb2.com",
23
23
  "backblaze_b2_bucket": "my-bucket",
24
24
  "wasabi_bucket": "us-west-1",
25
- "wasabi_region": "my-bucket"
25
+ "wasabi_region": "my-bucket",
26
+ "rackspace_username": "rackspaceuser",
27
+ "rackspace_region": "dfw",
28
+ "rackspace_container": "my-container",
29
+ "auth_setup_link": "auth/:provider",
30
+ "auth_status": "in_setup",
31
+ "auth_account_name": "me@example.com",
32
+ "one_drive_account_type": "personnel"
26
33
  }
27
34
  ```
28
35
 
@@ -45,6 +52,13 @@
45
52
  * `backblaze_b2_bucket` (string): Backblaze B2 Cloud Storage Bucket name
46
53
  * `wasabi_bucket` (string): Wasabi region
47
54
  * `wasabi_region` (string): Wasabi Bucket name
55
+ * `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
56
+ * `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
57
+ * `rackspace_container` (string): The name of the container (top level directory) where files will sync.
58
+ * `auth_setup_link` (string): Returns link to login with an Oauth provider
59
+ * `auth_status` (string): Either `in_setup` or `complete`
60
+ * `auth_account_name` (string): Describes the authorized account
61
+ * `one_drive_account_type` (string): Either personnel or business_other account types
48
62
  * `aws_access_key` (string): AWS Access Key.
49
63
  * `aws_secret_key` (string): AWS secret key.
50
64
  * `password` (string): Password if needed.
@@ -54,6 +68,8 @@
54
68
  * `wasabi_secret_key` (string): Wasabi secret key.
55
69
  * `backblaze_b2_key_id` (string): Backblaze B2 Cloud Storage keyID.
56
70
  * `backblaze_b2_application_key` (string): Backblaze B2 Cloud Storage applicationKey.
71
+ * `rackspace_api_key` (string): Rackspace API key from the Rackspace Cloud Control Panel.
72
+ * `reset_authentication` (boolean): Reset authenticated account
57
73
 
58
74
 
59
75
  ---
@@ -93,6 +109,7 @@ Files::RemoteServer.find(id)
93
109
 
94
110
  ```
95
111
  Files::RemoteServer.create(
112
+ reset_authentication: true,
96
113
  hostname: "remote-server.com",
97
114
  name: "My Remote server",
98
115
  max_connections: 1,
@@ -109,7 +126,11 @@ Files::RemoteServer.create(
109
126
  backblaze_b2_bucket: "my-bucket",
110
127
  backblaze_b2_s3_endpoint: "s3.us-west-001.backblazeb2.com",
111
128
  wasabi_bucket: "us-west-1",
112
- wasabi_region: "my-bucket"
129
+ wasabi_region: "my-bucket",
130
+ rackspace_username: "rackspaceuser",
131
+ rackspace_region: "dfw",
132
+ rackspace_container: "my-container",
133
+ one_drive_account_type: "personnel"
113
134
  )
114
135
  ```
115
136
 
@@ -124,6 +145,8 @@ Files::RemoteServer.create(
124
145
  * `wasabi_secret_key` (string): Wasabi secret key.
125
146
  * `backblaze_b2_key_id` (string): Backblaze B2 Cloud Storage keyID.
126
147
  * `backblaze_b2_application_key` (string): Backblaze B2 Cloud Storage applicationKey.
148
+ * `rackspace_api_key` (string): Rackspace API key from the Rackspace Cloud Control Panel.
149
+ * `reset_authentication` (boolean): Reset authenticated account
127
150
  * `hostname` (string): Hostname or IP address
128
151
  * `name` (string): Internal name for your reference
129
152
  * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
@@ -141,6 +164,10 @@ Files::RemoteServer.create(
141
164
  * `backblaze_b2_s3_endpoint` (string): Backblaze B2 Cloud Storage S3 Endpoint
142
165
  * `wasabi_bucket` (string): Wasabi region
143
166
  * `wasabi_region` (string): Wasabi Bucket name
167
+ * `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
168
+ * `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
169
+ * `rackspace_container` (string): The name of the container (top level directory) where files will sync.
170
+ * `one_drive_account_type` (string): Either personnel or business_other account types
144
171
 
145
172
 
146
173
  ---
@@ -149,6 +176,7 @@ Files::RemoteServer.create(
149
176
 
150
177
  ```
151
178
  Files::RemoteServer.update(id,
179
+ reset_authentication: true,
152
180
  hostname: "remote-server.com",
153
181
  name: "My Remote server",
154
182
  max_connections: 1,
@@ -165,7 +193,11 @@ Files::RemoteServer.update(id,
165
193
  backblaze_b2_bucket: "my-bucket",
166
194
  backblaze_b2_s3_endpoint: "s3.us-west-001.backblazeb2.com",
167
195
  wasabi_bucket: "us-west-1",
168
- wasabi_region: "my-bucket"
196
+ wasabi_region: "my-bucket",
197
+ rackspace_username: "rackspaceuser",
198
+ rackspace_region: "dfw",
199
+ rackspace_container: "my-container",
200
+ one_drive_account_type: "personnel"
169
201
  )
170
202
  ```
171
203
 
@@ -181,6 +213,8 @@ Files::RemoteServer.update(id,
181
213
  * `wasabi_secret_key` (string): Wasabi secret key.
182
214
  * `backblaze_b2_key_id` (string): Backblaze B2 Cloud Storage keyID.
183
215
  * `backblaze_b2_application_key` (string): Backblaze B2 Cloud Storage applicationKey.
216
+ * `rackspace_api_key` (string): Rackspace API key from the Rackspace Cloud Control Panel.
217
+ * `reset_authentication` (boolean): Reset authenticated account
184
218
  * `hostname` (string): Hostname or IP address
185
219
  * `name` (string): Internal name for your reference
186
220
  * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
@@ -198,6 +232,10 @@ Files::RemoteServer.update(id,
198
232
  * `backblaze_b2_s3_endpoint` (string): Backblaze B2 Cloud Storage S3 Endpoint
199
233
  * `wasabi_bucket` (string): Wasabi region
200
234
  * `wasabi_region` (string): Wasabi Bucket name
235
+ * `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
236
+ * `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
237
+ * `rackspace_container` (string): The name of the container (top level directory) where files will sync.
238
+ * `one_drive_account_type` (string): Either personnel or business_other account types
201
239
 
202
240
 
203
241
  ---
@@ -221,6 +259,7 @@ Files::RemoteServer.delete(id)
221
259
  remote_server = Files::RemoteServer.list_for(path).first
222
260
 
223
261
  remote_server.update(
262
+ reset_authentication: true,
224
263
  hostname: "remote-server.com",
225
264
  name: "My Remote server",
226
265
  max_connections: 1,
@@ -237,7 +276,11 @@ remote_server.update(
237
276
  backblaze_b2_bucket: "my-bucket",
238
277
  backblaze_b2_s3_endpoint: "s3.us-west-001.backblazeb2.com",
239
278
  wasabi_bucket: "us-west-1",
240
- wasabi_region: "my-bucket"
279
+ wasabi_region: "my-bucket",
280
+ rackspace_username: "rackspaceuser",
281
+ rackspace_region: "dfw",
282
+ rackspace_container: "my-container",
283
+ one_drive_account_type: "personnel"
241
284
  )
242
285
  ```
243
286
 
@@ -253,6 +296,8 @@ remote_server.update(
253
296
  * `wasabi_secret_key` (string): Wasabi secret key.
254
297
  * `backblaze_b2_key_id` (string): Backblaze B2 Cloud Storage keyID.
255
298
  * `backblaze_b2_application_key` (string): Backblaze B2 Cloud Storage applicationKey.
299
+ * `rackspace_api_key` (string): Rackspace API key from the Rackspace Cloud Control Panel.
300
+ * `reset_authentication` (boolean): Reset authenticated account
256
301
  * `hostname` (string): Hostname or IP address
257
302
  * `name` (string): Internal name for your reference
258
303
  * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
@@ -270,6 +315,10 @@ remote_server.update(
270
315
  * `backblaze_b2_s3_endpoint` (string): Backblaze B2 Cloud Storage S3 Endpoint
271
316
  * `wasabi_bucket` (string): Wasabi region
272
317
  * `wasabi_region` (string): Wasabi Bucket name
318
+ * `rackspace_username` (string): Rackspace username used to login to the Rackspace Cloud Control Panel.
319
+ * `rackspace_region` (string): Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
320
+ * `rackspace_container` (string): The name of the container (top level directory) where files will sync.
321
+ * `one_drive_account_type` (string): Either personnel or business_other account types
273
322
 
274
323
 
275
324
  ---
@@ -10,11 +10,11 @@ Gem::Specification.new do |s|
10
10
  s.summary = "Files.com Ruby client."
11
11
  s.description = "The Files.com Ruby client."
12
12
  s.license = "MIT"
13
- s.required_ruby_version = ">= 2.3"
13
+ s.required_ruby_version = ">= 2.5"
14
+ s.add_dependency 'addressable', ">= 2.7.0"
15
+ s.add_dependency 'concurrent-ruby', ">= 1.1.3"
14
16
  s.add_dependency 'faraday', ">= 1.0.1"
15
17
  s.add_dependency 'net-http-persistent'
16
- s.add_dependency 'addressable', ">= 2.7.0"
17
- s.add_dependency 'concurrent-ruby', ">= 1.1.6"
18
18
 
19
19
  s.files = `find *`.split("\n").uniq.sort.reject(&:empty?)
20
20
  s.executables = [ "files", "files-console" ]
@@ -94,7 +94,7 @@ module Files
94
94
  @read_timeout = 80
95
95
 
96
96
  class << self
97
- attr_accessor :api_key, :base_url, :initial_network_retry_delay, :max_network_retries, :max_network_retry_delay, :open_timeout, :read_timeout, :proxy, :session_id
97
+ attr_accessor :api_key, :base_url, :initial_network_retry_delay, :max_network_retry_delay, :open_timeout, :read_timeout, :proxy, :session_id
98
98
  end
99
99
 
100
100
  # map to the same values as the standard library's logger
@@ -147,6 +147,9 @@ module Files
147
147
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
148
148
 
149
149
  response, options = Api.send_request("/api_keys", :get, params, options)
150
+ response.data.map do |entity_data|
151
+ ApiKey.new(entity_data, options)
152
+ end
150
153
  end
151
154
 
152
155
  def self.all(params = {}, options = {})
@@ -108,6 +108,9 @@ module Files
108
108
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
109
109
 
110
110
  response, options = Api.send_request("/as2_keys", :get, params, options)
111
+ response.data.map do |entity_data|
112
+ As2Key.new(entity_data, options)
113
+ end
111
114
  end
112
115
 
113
116
  def self.all(params = {}, options = {})
@@ -191,6 +191,9 @@ module Files
191
191
  raise InvalidParameterError.new("Bad parameter: automation must be an String") if params.dig(:automation) and !params.dig(:automation).is_a?(String)
192
192
 
193
193
  response, options = Api.send_request("/automations", :get, params, options)
194
+ response.data.map do |entity_data|
195
+ Automation.new(entity_data, options)
196
+ end
194
197
  end
195
198
 
196
199
  def self.all(params = {}, options = {})
@@ -112,6 +112,9 @@ module Files
112
112
  raise InvalidParameterError.new("Bad parameter: behavior must be an String") if params.dig(:behavior) and !params.dig(:behavior).is_a?(String)
113
113
 
114
114
  response, options = Api.send_request("/behaviors", :get, params, options)
115
+ response.data.map do |entity_data|
116
+ Behavior.new(entity_data, options)
117
+ end
115
118
  end
116
119
 
117
120
  def self.all(params = {}, options = {})
@@ -137,6 +140,9 @@ module Files
137
140
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
138
141
 
139
142
  response, options = Api.send_request("/behaviors/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
143
+ response.data.map do |entity_data|
144
+ Behavior.new(entity_data, options)
145
+ end
140
146
  end
141
147
 
142
148
  # Parameters:
@@ -195,9 +201,9 @@ module Files
195
201
  def self.update(id, params = {}, options = {})
196
202
  params ||= {}
197
203
  params[:id] = id
198
- raise InvalidParameterError.new("Bad parameter: id must be one of String, Integer, Hash") if params.dig(:id) and [String, Integer, Hash].none? { |klass| params.dig(:id).is_a?(klass) }
204
+ raise InvalidParameterError.new("Bad parameter: id must be one of String, Integer, Hash") if params.dig(:id) and [ String, Integer, Hash ].none? { |klass| params.dig(:id).is_a?(klass) }
199
205
  raise InvalidParameterError.new("Bad parameter: value must be an String") if params.dig(:value) and !params.dig(:value).is_a?(String)
200
- raise InvalidParameterError.new("Bad parameter: attachment_file must be one of String, Integer, Hash") if params.dig(:attachment_file) and [String, Integer, Hash].none? { |klass| params.dig(:attachment_file).is_a?(klass) }
206
+ raise InvalidParameterError.new("Bad parameter: attachment_file must be one of String, Integer, Hash") if params.dig(:attachment_file) and [ String, Integer, Hash ].none? { |klass| params.dig(:attachment_file).is_a?(klass) }
201
207
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
202
208
 
203
209
  response, options = Api.send_request("/behaviors/#{params[:id]}", :patch, params, options)
@@ -197,6 +197,9 @@ module Files
197
197
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
198
198
 
199
199
  response, options = Api.send_request("/bundles", :get, params, options)
200
+ response.data.map do |entity_data|
201
+ Bundle.new(entity_data, options)
202
+ end
200
203
  end
201
204
 
202
205
  def self.all(params = {}, options = {})
@@ -39,6 +39,9 @@ module Files
39
39
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
40
40
 
41
41
  response, options = Api.send_request("/dns_records", :get, params, options)
42
+ response.data.map do |entity_data|
43
+ DnsRecord.new(entity_data, options)
44
+ end
42
45
  end
43
46
 
44
47
  def self.all(params = {}, options = {})
@@ -90,7 +90,7 @@ module Files
90
90
  new(path).mtime
91
91
  end
92
92
 
93
- def self.open(path, mode = "r", options={}, &block)
93
+ def self.open(path, mode = "r", options = {}, &block)
94
94
  file = new(path, mode, options)
95
95
  if block
96
96
  yield file
@@ -151,7 +151,8 @@ module Files
151
151
  etags ||= []
152
152
  bytes_written = 0
153
153
  loop do
154
- upload = FileAction.begin_upload(path, { ref: upload&.ref, part: (upload&.part_number || 0) + 1 }, options)
154
+ begin_upload = FileAction.begin_upload(path, { ref: upload&.ref, part: (upload&.part_number || 0) + 1 }, options)
155
+ upload = begin_upload.is_a?(Enumerable) ? begin_upload.first : begin_upload
155
156
  buf = io.read(upload.partsize) || ""
156
157
  bytes_written += buf.length
157
158
  method = upload.http_method.downcase.to_sym
@@ -305,7 +306,7 @@ module Files
305
306
  end
306
307
 
307
308
  def download_content(io)
308
- Files::ApiClient::download_client.stream_download(download_uri_with_load, io)
309
+ Files::ApiClient.download_client.stream_download(download_uri_with_load, io)
309
310
  end
310
311
 
311
312
  def each(*args, &block)
@@ -570,13 +571,13 @@ module Files
570
571
  end
571
572
 
572
573
  def upload_file(local_file)
573
- File.upload_file(local_file. path)
574
+ File.upload_file(local_file.path)
574
575
  end
575
576
 
576
577
  def write(*args)
577
578
  @mode ||= 'w'
578
579
  if args[0].respond_to?(:read)
579
- flush if @write_io.size > 0
580
+ flush if @write_io.size > 0 # rubocop:disable Style/ZeroLengthPredicate
580
581
  @write_io = args[0]
581
582
  else
582
583
  @write_io.write *args
@@ -116,7 +116,9 @@ module Files
116
116
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
117
117
 
118
118
  response, options = Api.send_request("/file_actions/begin_upload/#{Addressable::URI.encode_component(params[:path])}", :post, params, options)
119
- FilePartUpload.new(response.data, options)
119
+ response.data.map do |entity_data|
120
+ FilePartUpload.new(entity_data, options)
121
+ end
120
122
  end
121
123
  end
122
124
  end
@@ -97,6 +97,9 @@ module Files
97
97
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
98
98
 
99
99
  response, options = Api.send_request("/file_comments/files/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
100
+ response.data.map do |entity_data|
101
+ FileComment.new(entity_data, options)
102
+ end
100
103
  end
101
104
 
102
105
  # Parameters:
@@ -3,6 +3,7 @@
3
3
  module Files
4
4
  class Folder
5
5
  attr_reader :options, :attributes
6
+
6
7
  def self.[](*_)
7
8
  raise NotImplementedError
8
9
  end
@@ -117,6 +117,9 @@ module Files
117
117
  raise InvalidParameterError.new("Bad parameter: ids must be an String") if params.dig(:ids) and !params.dig(:ids).is_a?(String)
118
118
 
119
119
  response, options = Api.send_request("/groups", :get, params, options)
120
+ response.data.map do |entity_data|
121
+ Group.new(entity_data, options)
122
+ end
120
123
  end
121
124
 
122
125
  def self.all(params = {}, options = {})
@@ -113,6 +113,9 @@ module Files
113
113
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
114
114
 
115
115
  response, options = Api.send_request("/group_users", :get, params, options)
116
+ response.data.map do |entity_data|
117
+ GroupUser.new(entity_data, options)
118
+ end
116
119
  end
117
120
 
118
121
  def self.all(params = {}, options = {})
@@ -95,6 +95,9 @@ module Files
95
95
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
96
96
 
97
97
  response, options = Api.send_request("/history/files(/*path)", :get, params, options)
98
+ response.data.map do |entity_data|
99
+ Action.new(entity_data, options)
100
+ end
98
101
  end
99
102
 
100
103
  # Parameters:
@@ -118,6 +121,9 @@ module Files
118
121
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
119
122
 
120
123
  response, options = Api.send_request("/history/folders(/*path)", :get, params, options)
124
+ response.data.map do |entity_data|
125
+ Action.new(entity_data, options)
126
+ end
121
127
  end
122
128
 
123
129
  # Parameters:
@@ -141,6 +147,9 @@ module Files
141
147
  raise MissingParameterError.new("Parameter missing: user_id") unless params.dig(:user_id)
142
148
 
143
149
  response, options = Api.send_request("/history/users/#{params[:user_id]}", :get, params, options)
150
+ response.data.map do |entity_data|
151
+ Action.new(entity_data, options)
152
+ end
144
153
  end
145
154
 
146
155
  # Parameters:
@@ -159,6 +168,9 @@ module Files
159
168
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
160
169
 
161
170
  response, options = Api.send_request("/history/login", :get, params, options)
171
+ response.data.map do |entity_data|
172
+ Action.new(entity_data, options)
173
+ end
162
174
  end
163
175
 
164
176
  # Parameters:
@@ -177,6 +189,9 @@ module Files
177
189
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
178
190
 
179
191
  response, options = Api.send_request("/history", :get, params, options)
192
+ response.data.map do |entity_data|
193
+ Action.new(entity_data, options)
194
+ end
180
195
  end
181
196
 
182
197
  def self.all(params = {}, options = {})
@@ -260,6 +260,9 @@ module Files
260
260
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
261
261
 
262
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
263
266
  end
264
267
 
265
268
  def self.all(params = {}, options = {})
@@ -89,6 +89,9 @@ module Files
89
89
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
90
90
 
91
91
  response, options = Api.send_request("/invoices", :get, params, options)
92
+ response.data.map do |entity_data|
93
+ AccountLineItem.new(entity_data, options)
94
+ end
92
95
  end
93
96
 
94
97
  def self.all(params = {}, options = {})
@@ -39,6 +39,9 @@ module Files
39
39
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
40
40
 
41
41
  response, options = Api.send_request("/ip_addresses", :get, params, options)
42
+ response.data.map do |entity_data|
43
+ IpAddress.new(entity_data, options)
44
+ end
42
45
  end
43
46
 
44
47
  def self.all(params = {}, options = {})
@@ -133,6 +133,9 @@ module Files
133
133
  raise MissingParameterError.new("Parameter missing: path") unless params.dig(:path)
134
134
 
135
135
  response, options = Api.send_request("/locks/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
136
+ response.data.map do |entity_data|
137
+ Lock.new(entity_data, options)
138
+ end
136
139
  end
137
140
 
138
141
  # Parameters:
@@ -121,6 +121,9 @@ module Files
121
121
  raise MissingParameterError.new("Parameter missing: project_id") unless params.dig(:project_id)
122
122
 
123
123
  response, options = Api.send_request("/messages", :get, params, options)
124
+ response.data.map do |entity_data|
125
+ Message.new(entity_data, options)
126
+ end
124
127
  end
125
128
 
126
129
  def self.all(params = {}, options = {})
@@ -97,6 +97,9 @@ module Files
97
97
  raise MissingParameterError.new("Parameter missing: message_id") unless params.dig(:message_id)
98
98
 
99
99
  response, options = Api.send_request("/message_comments", :get, params, options)
100
+ response.data.map do |entity_data|
101
+ MessageComment.new(entity_data, options)
102
+ end
100
103
  end
101
104
 
102
105
  def self.all(params = {}, options = {})
@@ -74,6 +74,9 @@ module Files
74
74
  raise MissingParameterError.new("Parameter missing: message_comment_id") unless params.dig(:message_comment_id)
75
75
 
76
76
  response, options = Api.send_request("/message_comment_reactions", :get, params, options)
77
+ response.data.map do |entity_data|
78
+ MessageCommentReaction.new(entity_data, options)
79
+ end
77
80
  end
78
81
 
79
82
  def self.all(params = {}, options = {})
@@ -74,6 +74,9 @@ module Files
74
74
  raise MissingParameterError.new("Parameter missing: message_id") unless params.dig(:message_id)
75
75
 
76
76
  response, options = Api.send_request("/message_reactions", :get, params, options)
77
+ response.data.map do |entity_data|
78
+ MessageReaction.new(entity_data, options)
79
+ end
77
80
  end
78
81
 
79
82
  def self.all(params = {}, options = {})
@@ -172,6 +172,9 @@ module Files
172
172
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
173
173
 
174
174
  response, options = Api.send_request("/notifications", :get, params, options)
175
+ response.data.map do |entity_data|
176
+ Notification.new(entity_data, options)
177
+ end
175
178
  end
176
179
 
177
180
  def self.all(params = {}, options = {})
@@ -89,6 +89,9 @@ module Files
89
89
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
90
90
 
91
91
  response, options = Api.send_request("/payments", :get, params, options)
92
+ response.data.map do |entity_data|
93
+ AccountLineItem.new(entity_data, options)
94
+ end
92
95
  end
93
96
 
94
97
  def self.all(params = {}, options = {})
@@ -109,6 +109,9 @@ module Files
109
109
  raise InvalidParameterError.new("Bad parameter: user_id must be an String") if params.dig(:user_id) and !params.dig(:user_id).is_a?(String)
110
110
 
111
111
  response, options = Api.send_request("/permissions", :get, params, options)
112
+ response.data.map do |entity_data|
113
+ Permission.new(entity_data, options)
114
+ end
112
115
  end
113
116
 
114
117
  def self.all(path, params = {}, options = {})
@@ -74,6 +74,9 @@ module Files
74
74
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
75
75
 
76
76
  response, options = Api.send_request("/projects", :get, params, options)
77
+ response.data.map do |entity_data|
78
+ Project.new(entity_data, options)
79
+ end
77
80
  end
78
81
 
79
82
  def self.all(params = {}, options = {})
@@ -108,6 +108,9 @@ module Files
108
108
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
109
109
 
110
110
  response, options = Api.send_request("/public_keys", :get, params, options)
111
+ response.data.map do |entity_data|
112
+ PublicKey.new(entity_data, options)
113
+ end
111
114
  end
112
115
 
113
116
  def self.all(params = {}, options = {})
@@ -180,6 +180,69 @@ module Files
180
180
  @attributes[:wasabi_region] = value
181
181
  end
182
182
 
183
+ # string - Rackspace username used to login to the Rackspace Cloud Control Panel.
184
+ def rackspace_username
185
+ @attributes[:rackspace_username]
186
+ end
187
+
188
+ def rackspace_username=(value)
189
+ @attributes[:rackspace_username] = value
190
+ end
191
+
192
+ # string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
193
+ def rackspace_region
194
+ @attributes[:rackspace_region]
195
+ end
196
+
197
+ def rackspace_region=(value)
198
+ @attributes[:rackspace_region] = value
199
+ end
200
+
201
+ # string - The name of the container (top level directory) where files will sync.
202
+ def rackspace_container
203
+ @attributes[:rackspace_container]
204
+ end
205
+
206
+ def rackspace_container=(value)
207
+ @attributes[:rackspace_container] = value
208
+ end
209
+
210
+ # string - Returns link to login with an Oauth provider
211
+ def auth_setup_link
212
+ @attributes[:auth_setup_link]
213
+ end
214
+
215
+ def auth_setup_link=(value)
216
+ @attributes[:auth_setup_link] = value
217
+ end
218
+
219
+ # string - Either `in_setup` or `complete`
220
+ def auth_status
221
+ @attributes[:auth_status]
222
+ end
223
+
224
+ def auth_status=(value)
225
+ @attributes[:auth_status] = value
226
+ end
227
+
228
+ # string - Describes the authorized account
229
+ def auth_account_name
230
+ @attributes[:auth_account_name]
231
+ end
232
+
233
+ def auth_account_name=(value)
234
+ @attributes[:auth_account_name] = value
235
+ end
236
+
237
+ # string - Either personnel or business_other account types
238
+ def one_drive_account_type
239
+ @attributes[:one_drive_account_type]
240
+ end
241
+
242
+ def one_drive_account_type=(value)
243
+ @attributes[:one_drive_account_type] = value
244
+ end
245
+
183
246
  # string - AWS Access Key.
184
247
  def aws_access_key
185
248
  @attributes[:aws_access_key]
@@ -261,6 +324,24 @@ module Files
261
324
  @attributes[:backblaze_b2_application_key] = value
262
325
  end
263
326
 
327
+ # string - Rackspace API key from the Rackspace Cloud Control Panel.
328
+ def rackspace_api_key
329
+ @attributes[:rackspace_api_key]
330
+ end
331
+
332
+ def rackspace_api_key=(value)
333
+ @attributes[:rackspace_api_key] = value
334
+ end
335
+
336
+ # boolean - Reset authenticated account
337
+ def reset_authentication
338
+ @attributes[:reset_authentication]
339
+ end
340
+
341
+ def reset_authentication=(value)
342
+ @attributes[:reset_authentication] = value
343
+ end
344
+
264
345
  # Parameters:
265
346
  # aws_access_key - string - AWS Access Key.
266
347
  # aws_secret_key - string - AWS secret key.
@@ -271,6 +352,8 @@ module Files
271
352
  # wasabi_secret_key - string - Wasabi secret key.
272
353
  # backblaze_b2_key_id - string - Backblaze B2 Cloud Storage keyID.
273
354
  # backblaze_b2_application_key - string - Backblaze B2 Cloud Storage applicationKey.
355
+ # rackspace_api_key - string - Rackspace API key from the Rackspace Cloud Control Panel.
356
+ # reset_authentication - boolean - Reset authenticated account
274
357
  # hostname - string - Hostname or IP address
275
358
  # name - string - Internal name for your reference
276
359
  # max_connections - int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
@@ -288,6 +371,10 @@ module Files
288
371
  # backblaze_b2_s3_endpoint - string - Backblaze B2 Cloud Storage S3 Endpoint
289
372
  # wasabi_bucket - string - Wasabi region
290
373
  # wasabi_region - string - Wasabi Bucket name
374
+ # rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
375
+ # rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
376
+ # rackspace_container - string - The name of the container (top level directory) where files will sync.
377
+ # one_drive_account_type - string - Either personnel or business_other account types
291
378
  def update(params = {})
292
379
  params ||= {}
293
380
  params[:id] = @attributes[:id]
@@ -302,6 +389,7 @@ module Files
302
389
  raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params.dig(:wasabi_secret_key) and !params.dig(:wasabi_secret_key).is_a?(String)
303
390
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_key_id must be an String") if params.dig(:backblaze_b2_key_id) and !params.dig(:backblaze_b2_key_id).is_a?(String)
304
391
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_application_key must be an String") if params.dig(:backblaze_b2_application_key) and !params.dig(:backblaze_b2_application_key).is_a?(String)
392
+ raise InvalidParameterError.new("Bad parameter: rackspace_api_key must be an String") if params.dig(:rackspace_api_key) and !params.dig(:rackspace_api_key).is_a?(String)
305
393
  raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params.dig(:hostname) and !params.dig(:hostname).is_a?(String)
306
394
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
307
395
  raise InvalidParameterError.new("Bad parameter: max_connections must be an Integer") if params.dig(:max_connections) and !params.dig(:max_connections).is_a?(Integer)
@@ -319,6 +407,10 @@ module Files
319
407
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_s3_endpoint must be an String") if params.dig(:backblaze_b2_s3_endpoint) and !params.dig(:backblaze_b2_s3_endpoint).is_a?(String)
320
408
  raise InvalidParameterError.new("Bad parameter: wasabi_bucket must be an String") if params.dig(:wasabi_bucket) and !params.dig(:wasabi_bucket).is_a?(String)
321
409
  raise InvalidParameterError.new("Bad parameter: wasabi_region must be an String") if params.dig(:wasabi_region) and !params.dig(:wasabi_region).is_a?(String)
410
+ raise InvalidParameterError.new("Bad parameter: rackspace_username must be an String") if params.dig(:rackspace_username) and !params.dig(:rackspace_username).is_a?(String)
411
+ raise InvalidParameterError.new("Bad parameter: rackspace_region must be an String") if params.dig(:rackspace_region) and !params.dig(:rackspace_region).is_a?(String)
412
+ raise InvalidParameterError.new("Bad parameter: rackspace_container must be an String") if params.dig(:rackspace_container) and !params.dig(:rackspace_container).is_a?(String)
413
+ raise InvalidParameterError.new("Bad parameter: one_drive_account_type must be an String") if params.dig(:one_drive_account_type) and !params.dig(:one_drive_account_type).is_a?(String)
322
414
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
323
415
 
324
416
  Api.send_request("/remote_servers/#{@attributes[:id]}", :patch, params, @options)
@@ -357,6 +449,9 @@ module Files
357
449
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
358
450
 
359
451
  response, options = Api.send_request("/remote_servers", :get, params, options)
452
+ response.data.map do |entity_data|
453
+ RemoteServer.new(entity_data, options)
454
+ end
360
455
  end
361
456
 
362
457
  def self.all(params = {}, options = {})
@@ -389,6 +484,8 @@ module Files
389
484
  # wasabi_secret_key - string - Wasabi secret key.
390
485
  # backblaze_b2_key_id - string - Backblaze B2 Cloud Storage keyID.
391
486
  # backblaze_b2_application_key - string - Backblaze B2 Cloud Storage applicationKey.
487
+ # rackspace_api_key - string - Rackspace API key from the Rackspace Cloud Control Panel.
488
+ # reset_authentication - boolean - Reset authenticated account
392
489
  # hostname - string - Hostname or IP address
393
490
  # name - string - Internal name for your reference
394
491
  # max_connections - int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
@@ -406,6 +503,10 @@ module Files
406
503
  # backblaze_b2_s3_endpoint - string - Backblaze B2 Cloud Storage S3 Endpoint
407
504
  # wasabi_bucket - string - Wasabi region
408
505
  # wasabi_region - string - Wasabi Bucket name
506
+ # rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
507
+ # rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
508
+ # rackspace_container - string - The name of the container (top level directory) where files will sync.
509
+ # one_drive_account_type - string - Either personnel or business_other account types
409
510
  def self.create(params = {}, options = {})
410
511
  raise InvalidParameterError.new("Bad parameter: aws_access_key must be an String") if params.dig(:aws_access_key) and !params.dig(:aws_access_key).is_a?(String)
411
512
  raise InvalidParameterError.new("Bad parameter: aws_secret_key must be an String") if params.dig(:aws_secret_key) and !params.dig(:aws_secret_key).is_a?(String)
@@ -416,6 +517,7 @@ module Files
416
517
  raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params.dig(:wasabi_secret_key) and !params.dig(:wasabi_secret_key).is_a?(String)
417
518
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_key_id must be an String") if params.dig(:backblaze_b2_key_id) and !params.dig(:backblaze_b2_key_id).is_a?(String)
418
519
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_application_key must be an String") if params.dig(:backblaze_b2_application_key) and !params.dig(:backblaze_b2_application_key).is_a?(String)
520
+ raise InvalidParameterError.new("Bad parameter: rackspace_api_key must be an String") if params.dig(:rackspace_api_key) and !params.dig(:rackspace_api_key).is_a?(String)
419
521
  raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params.dig(:hostname) and !params.dig(:hostname).is_a?(String)
420
522
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
421
523
  raise InvalidParameterError.new("Bad parameter: max_connections must be an Integer") if params.dig(:max_connections) and !params.dig(:max_connections).is_a?(Integer)
@@ -433,6 +535,10 @@ module Files
433
535
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_s3_endpoint must be an String") if params.dig(:backblaze_b2_s3_endpoint) and !params.dig(:backblaze_b2_s3_endpoint).is_a?(String)
434
536
  raise InvalidParameterError.new("Bad parameter: wasabi_bucket must be an String") if params.dig(:wasabi_bucket) and !params.dig(:wasabi_bucket).is_a?(String)
435
537
  raise InvalidParameterError.new("Bad parameter: wasabi_region must be an String") if params.dig(:wasabi_region) and !params.dig(:wasabi_region).is_a?(String)
538
+ raise InvalidParameterError.new("Bad parameter: rackspace_username must be an String") if params.dig(:rackspace_username) and !params.dig(:rackspace_username).is_a?(String)
539
+ raise InvalidParameterError.new("Bad parameter: rackspace_region must be an String") if params.dig(:rackspace_region) and !params.dig(:rackspace_region).is_a?(String)
540
+ raise InvalidParameterError.new("Bad parameter: rackspace_container must be an String") if params.dig(:rackspace_container) and !params.dig(:rackspace_container).is_a?(String)
541
+ raise InvalidParameterError.new("Bad parameter: one_drive_account_type must be an String") if params.dig(:one_drive_account_type) and !params.dig(:one_drive_account_type).is_a?(String)
436
542
 
437
543
  response, options = Api.send_request("/remote_servers", :post, params, options)
438
544
  RemoteServer.new(response.data, options)
@@ -448,6 +554,8 @@ module Files
448
554
  # wasabi_secret_key - string - Wasabi secret key.
449
555
  # backblaze_b2_key_id - string - Backblaze B2 Cloud Storage keyID.
450
556
  # backblaze_b2_application_key - string - Backblaze B2 Cloud Storage applicationKey.
557
+ # rackspace_api_key - string - Rackspace API key from the Rackspace Cloud Control Panel.
558
+ # reset_authentication - boolean - Reset authenticated account
451
559
  # hostname - string - Hostname or IP address
452
560
  # name - string - Internal name for your reference
453
561
  # max_connections - int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
@@ -465,6 +573,10 @@ module Files
465
573
  # backblaze_b2_s3_endpoint - string - Backblaze B2 Cloud Storage S3 Endpoint
466
574
  # wasabi_bucket - string - Wasabi region
467
575
  # wasabi_region - string - Wasabi Bucket name
576
+ # rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
577
+ # rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
578
+ # rackspace_container - string - The name of the container (top level directory) where files will sync.
579
+ # one_drive_account_type - string - Either personnel or business_other account types
468
580
  def self.update(id, params = {}, options = {})
469
581
  params ||= {}
470
582
  params[:id] = id
@@ -478,6 +590,7 @@ module Files
478
590
  raise InvalidParameterError.new("Bad parameter: wasabi_secret_key must be an String") if params.dig(:wasabi_secret_key) and !params.dig(:wasabi_secret_key).is_a?(String)
479
591
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_key_id must be an String") if params.dig(:backblaze_b2_key_id) and !params.dig(:backblaze_b2_key_id).is_a?(String)
480
592
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_application_key must be an String") if params.dig(:backblaze_b2_application_key) and !params.dig(:backblaze_b2_application_key).is_a?(String)
593
+ raise InvalidParameterError.new("Bad parameter: rackspace_api_key must be an String") if params.dig(:rackspace_api_key) and !params.dig(:rackspace_api_key).is_a?(String)
481
594
  raise InvalidParameterError.new("Bad parameter: hostname must be an String") if params.dig(:hostname) and !params.dig(:hostname).is_a?(String)
482
595
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
483
596
  raise InvalidParameterError.new("Bad parameter: max_connections must be an Integer") if params.dig(:max_connections) and !params.dig(:max_connections).is_a?(Integer)
@@ -495,6 +608,10 @@ module Files
495
608
  raise InvalidParameterError.new("Bad parameter: backblaze_b2_s3_endpoint must be an String") if params.dig(:backblaze_b2_s3_endpoint) and !params.dig(:backblaze_b2_s3_endpoint).is_a?(String)
496
609
  raise InvalidParameterError.new("Bad parameter: wasabi_bucket must be an String") if params.dig(:wasabi_bucket) and !params.dig(:wasabi_bucket).is_a?(String)
497
610
  raise InvalidParameterError.new("Bad parameter: wasabi_region must be an String") if params.dig(:wasabi_region) and !params.dig(:wasabi_region).is_a?(String)
611
+ raise InvalidParameterError.new("Bad parameter: rackspace_username must be an String") if params.dig(:rackspace_username) and !params.dig(:rackspace_username).is_a?(String)
612
+ raise InvalidParameterError.new("Bad parameter: rackspace_region must be an String") if params.dig(:rackspace_region) and !params.dig(:rackspace_region).is_a?(String)
613
+ raise InvalidParameterError.new("Bad parameter: rackspace_container must be an String") if params.dig(:rackspace_container) and !params.dig(:rackspace_container).is_a?(String)
614
+ raise InvalidParameterError.new("Bad parameter: one_drive_account_type must be an String") if params.dig(:one_drive_account_type) and !params.dig(:one_drive_account_type).is_a?(String)
498
615
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
499
616
 
500
617
  response, options = Api.send_request("/remote_servers/#{params[:id]}", :patch, params, options)
@@ -124,6 +124,9 @@ module Files
124
124
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
125
125
 
126
126
  response, options = Api.send_request("/requests", :get, params, options)
127
+ response.data.map do |entity_data|
128
+ Request.new(entity_data, options)
129
+ end
127
130
  end
128
131
 
129
132
  def self.all(path, params = {}, options = {})
@@ -146,6 +149,9 @@ module Files
146
149
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
147
150
 
148
151
  response, options = Api.send_request("/requests/folders/#{Addressable::URI.encode_component(params[:path])}", :get, params, options)
152
+ response.data.map do |entity_data|
153
+ Request.new(entity_data, options)
154
+ end
149
155
  end
150
156
 
151
157
  # Parameters:
@@ -3,6 +3,7 @@
3
3
  module Files
4
4
  class Session
5
5
  attr_reader :options, :attributes
6
+
6
7
  def destroy(params = {}, options = {})
7
8
  Session.destroy(params, options.merge(session: self, session_id: nil))
8
9
  end
@@ -666,6 +666,7 @@ module Files
666
666
  raise InvalidParameterError.new("Bad parameter: default_time_zone must be an String") if params.dig(:default_time_zone) and !params.dig(:default_time_zone).is_a?(String)
667
667
  raise InvalidParameterError.new("Bad parameter: desktop_app_session_lifetime must be an Integer") if params.dig(:desktop_app_session_lifetime) and !params.dig(:desktop_app_session_lifetime).is_a?(Integer)
668
668
  raise InvalidParameterError.new("Bad parameter: welcome_screen must be an String") if params.dig(:welcome_screen) and !params.dig(:welcome_screen).is_a?(String)
669
+ raise InvalidParameterError.new("Bad parameter: session_expiry must be an Float") if params.dig(:session_expiry) and !params.dig(:session_expiry).is_a?(Float)
669
670
  raise InvalidParameterError.new("Bad parameter: user_lockout_tries must be an Integer") if params.dig(:user_lockout_tries) and !params.dig(:user_lockout_tries).is_a?(Integer)
670
671
  raise InvalidParameterError.new("Bad parameter: user_lockout_within must be an Integer") if params.dig(:user_lockout_within) and !params.dig(:user_lockout_within).is_a?(Integer)
671
672
  raise InvalidParameterError.new("Bad parameter: user_lockout_lock_period must be an Integer") if params.dig(:user_lockout_lock_period) and !params.dig(:user_lockout_lock_period).is_a?(Integer)
@@ -199,6 +199,9 @@ module Files
199
199
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
200
200
 
201
201
  response, options = Api.send_request("/sso_strategies", :get, params, options)
202
+ response.data.map do |entity_data|
203
+ SsoStrategy.new(entity_data, options)
204
+ end
202
205
  end
203
206
 
204
207
  def self.all(params = {}, options = {})
@@ -39,6 +39,9 @@ module Files
39
39
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
40
40
 
41
41
  response, options = Api.send_request("/usage_daily_snapshots", :get, params, options)
42
+ response.data.map do |entity_data|
43
+ UsageDailySnapshot.new(entity_data, options)
44
+ end
42
45
  end
43
46
 
44
47
  def self.all(params = {}, options = {})
@@ -84,6 +84,9 @@ module Files
84
84
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
85
85
 
86
86
  response, options = Api.send_request("/usage_snapshots", :get, params, options)
87
+ response.data.map do |entity_data|
88
+ UsageSnapshot.new(entity_data, options)
89
+ end
87
90
  end
88
91
 
89
92
  def self.all(params = {}, options = {})
@@ -621,6 +621,9 @@ module Files
621
621
  raise InvalidParameterError.new("Bad parameter: search must be an String") if params.dig(:search) and !params.dig(:search).is_a?(String)
622
622
 
623
623
  response, options = Api.send_request("/users", :get, params, options)
624
+ response.data.map do |entity_data|
625
+ User.new(entity_data, options)
626
+ end
624
627
  end
625
628
 
626
629
  def self.all(params = {}, options = {})
@@ -51,6 +51,9 @@ module Files
51
51
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
52
52
 
53
53
  response, options = Api.send_request("/user_cipher_uses", :get, params, options)
54
+ response.data.map do |entity_data|
55
+ UserCipherUse.new(entity_data, options)
56
+ end
54
57
  end
55
58
 
56
59
  def self.all(params = {}, options = {})
@@ -5,7 +5,7 @@ module Files
5
5
 
6
6
  w.instance_variable_set(:@read_io, r)
7
7
 
8
- [r, w]
8
+ [ r, w ]
9
9
  end
10
10
 
11
11
  def size
@@ -29,4 +29,4 @@ module Files
29
29
  @read_io || self
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -16,9 +16,7 @@ RSpec.configure do |config|
16
16
  let(:options) { { api_key: api_key } }
17
17
  end
18
18
 
19
- RSpec.configure do |config|
20
- config.include_context "API Helpers", :with_test_folder
21
- end
19
+ config.include_context "API Helpers", :with_test_folder
22
20
 
23
21
  config.around(:example, :with_test_folder) do |all|
24
22
  @api_key = ENV["TEST_API_KEY"] || File.read("../../config/test_api_key.txt")
@@ -27,6 +25,7 @@ RSpec.configure do |config|
27
25
  Files::Folder.mkdir("files_regional_worker", {}, api_key: @api_key) unless Files::Folder.exist?("files_regional_worker", api_key: @api_key)
28
26
  Files::Folder.mkdir(@test_folder.to_s, {}, api_key: @api_key)
29
27
  all.run
28
+ ensure
30
29
  Files::Folder.delete(@test_folder.to_s, { recursive: true }, api_key: @api_key)
31
30
  end
32
31
 
@@ -63,7 +63,7 @@ end
63
63
 
64
64
  def test_sessions
65
65
  session = Files::Session.create(username: "sessionuser", password: "sessionuserpassword")
66
- user = Files::ApiKey.list({ user_id: 0 }, session: session)
66
+ Files::ApiKey.list({ user_id: 0 }, session: session)
67
67
  session.destroy
68
68
  end
69
69
 
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.68
4
+ version: 1.0.73
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-06-17 00:00:00.000000000 Z
11
+ date: 2020-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: faraday
14
+ name: addressable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.1
19
+ version: 2.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.1
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: net-http-persistent
28
+ name: concurrent-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.1.3
41
41
  - !ruby/object:Gem::Dependency
42
- name: addressable
42
+ name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.7.0
47
+ version: 1.0.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 2.7.0
54
+ version: 1.0.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: concurrent-ruby
56
+ name: net-http-persistent
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.6
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.1.6
68
+ version: '0'
69
69
  description: The Files.com Ruby client.
70
70
  email:
71
71
  - support@files.com
@@ -77,6 +77,7 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - CONTRIBUTORS
79
79
  - Gemfile
80
+ - Gemfile.lock
80
81
  - LICENSE
81
82
  - README.md
82
83
  - Rakefile
@@ -209,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
210
  requirements:
210
211
  - - ">="
211
212
  - !ruby/object:Gem::Version
212
- version: '2.3'
213
+ version: '2.5'
213
214
  required_rubygems_version: !ruby/object:Gem::Requirement
214
215
  requirements:
215
216
  - - ">="