files.com 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3662ad242ba8d52d628208345b8ccf8485a525f92912ea6abe7a0a7035932ed
4
- data.tar.gz: 5d6a0c4555fe8155fbf3f6e53d76d62e1dd513bed593cd97b91c09c8f2dfc558
3
+ metadata.gz: 7e84034851ff6d741050f980f8a8964bc8dafaa8299fc775d2899d1b9f48b5f2
4
+ data.tar.gz: 06e44469c7b61155a9e569e998dfecd3204076840b9d70b1641aad93d1beb9f7
5
5
  SHA512:
6
- metadata.gz: a965e23e2734e9ea448f0cfcd248cfbe6d985ba5b0226ba273c192713ae21426366f4ce6550a24fe3aae22f9c206b50912a82bd8fc6b3845717ec74a3b960e31
7
- data.tar.gz: 21edc0fa760395ed9a98ee444d013e6f52a3ab2644feb1666e45b939687cf340aa292d9b35a05c9c2999d60907d532a07e4c64798a2fd40f9a91af85f6a1e921
6
+ metadata.gz: 5754b9cfac5104f671ee86430860e71880d12c134765c56efe2fd6635295b5e9bda36a1b3ca7f12be079f841731a32953d6dca1bbfb988d3240cf9d0e9adffb7
7
+ data.tar.gz: c6915d3683fa561dbc5daccf38b82504d1c03a1c9c7c2cc49f8ee669bd49a2663746e0e142510ac3eeadcac984d3d796fbe2ff1d8fc59a97aeab6040555ee8f1
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.28
1
+ 1.0.29
@@ -15,7 +15,10 @@
15
15
  "server_certificate": "[certificate]",
16
16
  "server_type": "s3",
17
17
  "ssl": "always",
18
- "username": "user"
18
+ "username": "user",
19
+ "google_cloud_storage_bucket": "my-bucket",
20
+ "google_cloud_storage_project_id": "my-project",
21
+ "google_cloud_storage_credentials_json": "{}"
19
22
  }
20
23
  ```
21
24
 
@@ -24,13 +27,16 @@
24
27
  * `hostname` (string): Hostname or IP address
25
28
  * `name` (string): Internal name for your reference
26
29
  * `port` (int64): Port for remote server. Not needed for S3.
27
- * `max_connections` (int64): Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
30
+ * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
28
31
  * `s3_bucket` (string): S3 bucket name
29
32
  * `s3_region` (string): S3 region
30
33
  * `server_certificate` (string): Remote server certificate
31
34
  * `server_type` (string): Remote server type.
32
35
  * `ssl` (string): Should we require SSL?
33
36
  * `username` (string): Remote server username. Not needed for S3 buckets.
37
+ * `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
38
+ * `google_cloud_storage_project_id` (string): Google Cloud Project ID
39
+ * `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
34
40
  * `aws_access_key` (string): AWS Access Key.
35
41
  * `aws_secret_key` (string): AWS secret key.
36
42
  * `password` (string): Password if needed.
@@ -83,7 +89,10 @@ Files::RemoteServer.create(
83
89
  server_certificate: "[certificate]",
84
90
  server_type: "s3",
85
91
  ssl: "always",
86
- username: "user"
92
+ username: "user",
93
+ google_cloud_storage_bucket: "my-bucket",
94
+ google_cloud_storage_project_id: "my-project",
95
+ google_cloud_storage_credentials_json: "{}"
87
96
  )
88
97
  ```
89
98
 
@@ -95,7 +104,7 @@ Files::RemoteServer.create(
95
104
  * `private_key` (string): Private key if needed.
96
105
  * `hostname` (string): Hostname or IP address
97
106
  * `name` (string): Internal name for your reference
98
- * `max_connections` (int64): Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
107
+ * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
99
108
  * `port` (int64): Port for remote server. Not needed for S3.
100
109
  * `s3_bucket` (string): S3 bucket name
101
110
  * `s3_region` (string): S3 region
@@ -103,6 +112,9 @@ Files::RemoteServer.create(
103
112
  * `server_type` (string): Remote server type.
104
113
  * `ssl` (string): Should we require SSL?
105
114
  * `username` (string): Remote server username. Not needed for S3 buckets.
115
+ * `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
116
+ * `google_cloud_storage_project_id` (string): Google Cloud Project ID
117
+ * `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
106
118
 
107
119
 
108
120
  ---
@@ -120,7 +132,10 @@ Files::RemoteServer.update(id,
120
132
  server_certificate: "[certificate]",
121
133
  server_type: "s3",
122
134
  ssl: "always",
123
- username: "user"
135
+ username: "user",
136
+ google_cloud_storage_bucket: "my-bucket",
137
+ google_cloud_storage_project_id: "my-project",
138
+ google_cloud_storage_credentials_json: "{}"
124
139
  )
125
140
  ```
126
141
 
@@ -133,7 +148,7 @@ Files::RemoteServer.update(id,
133
148
  * `private_key` (string): Private key if needed.
134
149
  * `hostname` (string): Hostname or IP address
135
150
  * `name` (string): Internal name for your reference
136
- * `max_connections` (int64): Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
151
+ * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
137
152
  * `port` (int64): Port for remote server. Not needed for S3.
138
153
  * `s3_bucket` (string): S3 bucket name
139
154
  * `s3_region` (string): S3 region
@@ -141,6 +156,9 @@ Files::RemoteServer.update(id,
141
156
  * `server_type` (string): Remote server type.
142
157
  * `ssl` (string): Should we require SSL?
143
158
  * `username` (string): Remote server username. Not needed for S3 buckets.
159
+ * `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
160
+ * `google_cloud_storage_project_id` (string): Google Cloud Project ID
161
+ * `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
144
162
 
145
163
 
146
164
  ---
@@ -172,7 +190,10 @@ remote_server.update(
172
190
  server_certificate: "[certificate]",
173
191
  server_type: "s3",
174
192
  ssl: "always",
175
- username: "user"
193
+ username: "user",
194
+ google_cloud_storage_bucket: "my-bucket",
195
+ google_cloud_storage_project_id: "my-project",
196
+ google_cloud_storage_credentials_json: "{}"
176
197
  )
177
198
  ```
178
199
 
@@ -185,7 +206,7 @@ remote_server.update(
185
206
  * `private_key` (string): Private key if needed.
186
207
  * `hostname` (string): Hostname or IP address
187
208
  * `name` (string): Internal name for your reference
188
- * `max_connections` (int64): Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
209
+ * `max_connections` (int64): Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
189
210
  * `port` (int64): Port for remote server. Not needed for S3.
190
211
  * `s3_bucket` (string): S3 bucket name
191
212
  * `s3_region` (string): S3 region
@@ -193,6 +214,9 @@ remote_server.update(
193
214
  * `server_type` (string): Remote server type.
194
215
  * `ssl` (string): Should we require SSL?
195
216
  * `username` (string): Remote server username. Not needed for S3 buckets.
217
+ * `google_cloud_storage_bucket` (string): Google Cloud Storage bucket name
218
+ * `google_cloud_storage_project_id` (string): Google Cloud Project ID
219
+ * `google_cloud_storage_credentials_json` (string): A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
196
220
 
197
221
 
198
222
  ---
@@ -248,7 +248,7 @@ module Files
248
248
  "size": @bytes_written
249
249
  }
250
250
 
251
- file = File.create(path, end_options)
251
+ file = File.create(path, end_options, @options)
252
252
  @attributes = file.attributes
253
253
  @upload = nil
254
254
  end
@@ -360,7 +360,8 @@ module Files
360
360
 
361
361
  def flush(*_args)
362
362
  if mode.include? "w"
363
- @write_io.rewind
363
+ @write_io.rewind if @write_io.is_a?(StringIO)
364
+
364
365
  @bytes_written += @write_io.size
365
366
  @upload, @etags = File.upload_chunks(@write_io, path, options, @upload, @etags)
366
367
  elsif mode.include? "a"
@@ -568,7 +569,13 @@ module Files
568
569
  end
569
570
 
570
571
  def write(*args)
571
- @write_io.write *args
572
+ @mode ||= 'w'
573
+ if args[0].respond_to?(:read)
574
+ flush if @write_io.size > 0
575
+ @write_io = args[0]
576
+ else
577
+ @write_io.write *args
578
+ end
572
579
  end
573
580
 
574
581
  def write_nonblock(*args)
@@ -54,7 +54,7 @@ module Files
54
54
  @attributes[:port] = value
55
55
  end
56
56
 
57
- # int64 - Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
57
+ # int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
58
58
  def max_connections
59
59
  @attributes[:max_connections]
60
60
  end
@@ -117,6 +117,33 @@ module Files
117
117
  @attributes[:username] = value
118
118
  end
119
119
 
120
+ # string - Google Cloud Storage bucket name
121
+ def google_cloud_storage_bucket
122
+ @attributes[:google_cloud_storage_bucket]
123
+ end
124
+
125
+ def google_cloud_storage_bucket=(value)
126
+ @attributes[:google_cloud_storage_bucket] = value
127
+ end
128
+
129
+ # string - Google Cloud Project ID
130
+ def google_cloud_storage_project_id
131
+ @attributes[:google_cloud_storage_project_id]
132
+ end
133
+
134
+ def google_cloud_storage_project_id=(value)
135
+ @attributes[:google_cloud_storage_project_id] = value
136
+ end
137
+
138
+ # string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
139
+ def google_cloud_storage_credentials_json
140
+ @attributes[:google_cloud_storage_credentials_json]
141
+ end
142
+
143
+ def google_cloud_storage_credentials_json=(value)
144
+ @attributes[:google_cloud_storage_credentials_json] = value
145
+ end
146
+
120
147
  # string - AWS Access Key.
121
148
  def aws_access_key
122
149
  @attributes[:aws_access_key]
@@ -160,7 +187,7 @@ module Files
160
187
  # private_key - string - Private key if needed.
161
188
  # hostname - string - Hostname or IP address
162
189
  # name - string - Internal name for your reference
163
- # max_connections - integer - Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
190
+ # max_connections - integer - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
164
191
  # port - integer - Port for remote server. Not needed for S3.
165
192
  # s3_bucket - string - S3 bucket name
166
193
  # s3_region - string - S3 region
@@ -168,6 +195,9 @@ module Files
168
195
  # server_type - string - Remote server type.
169
196
  # ssl - string - Should we require SSL?
170
197
  # username - string - Remote server username. Not needed for S3 buckets.
198
+ # google_cloud_storage_bucket - string - Google Cloud Storage bucket name
199
+ # google_cloud_storage_project_id - string - Google Cloud Project ID
200
+ # google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
171
201
  def update(params = {})
172
202
  params ||= {}
173
203
  params[:id] = @attributes[:id]
@@ -187,6 +217,9 @@ module Files
187
217
  raise InvalidParameterError.new("Bad parameter: server_type must be an String") if params.dig(:server_type) and !params.dig(:server_type).is_a?(String)
188
218
  raise InvalidParameterError.new("Bad parameter: ssl must be an String") if params.dig(:ssl) and !params.dig(:ssl).is_a?(String)
189
219
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
220
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_bucket must be an String") if params.dig(:google_cloud_storage_bucket) and !params.dig(:google_cloud_storage_bucket).is_a?(String)
221
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_project_id must be an String") if params.dig(:google_cloud_storage_project_id) and !params.dig(:google_cloud_storage_project_id).is_a?(String)
222
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params.dig(:google_cloud_storage_credentials_json) and !params.dig(:google_cloud_storage_credentials_json).is_a?(String)
190
223
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
191
224
 
192
225
  Api.send_request("/remote_servers/#{@attributes[:id]}", :patch, params, @options)
@@ -255,7 +288,7 @@ module Files
255
288
  # private_key - string - Private key if needed.
256
289
  # hostname - string - Hostname or IP address
257
290
  # name - string - Internal name for your reference
258
- # max_connections - integer - Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
291
+ # max_connections - integer - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
259
292
  # port - integer - Port for remote server. Not needed for S3.
260
293
  # s3_bucket - string - S3 bucket name
261
294
  # s3_region - string - S3 region
@@ -263,6 +296,9 @@ module Files
263
296
  # server_type - string - Remote server type.
264
297
  # ssl - string - Should we require SSL?
265
298
  # username - string - Remote server username. Not needed for S3 buckets.
299
+ # google_cloud_storage_bucket - string - Google Cloud Storage bucket name
300
+ # google_cloud_storage_project_id - string - Google Cloud Project ID
301
+ # google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
266
302
  def self.create(params = {}, options = {})
267
303
  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)
268
304
  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)
@@ -278,6 +314,9 @@ module Files
278
314
  raise InvalidParameterError.new("Bad parameter: server_type must be an String") if params.dig(:server_type) and !params.dig(:server_type).is_a?(String)
279
315
  raise InvalidParameterError.new("Bad parameter: ssl must be an String") if params.dig(:ssl) and !params.dig(:ssl).is_a?(String)
280
316
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
317
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_bucket must be an String") if params.dig(:google_cloud_storage_bucket) and !params.dig(:google_cloud_storage_bucket).is_a?(String)
318
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_project_id must be an String") if params.dig(:google_cloud_storage_project_id) and !params.dig(:google_cloud_storage_project_id).is_a?(String)
319
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params.dig(:google_cloud_storage_credentials_json) and !params.dig(:google_cloud_storage_credentials_json).is_a?(String)
281
320
 
282
321
  response, options = Api.send_request("/remote_servers", :post, params, options)
283
322
  RemoteServer.new(response.data, options)
@@ -290,7 +329,7 @@ module Files
290
329
  # private_key - string - Private key if needed.
291
330
  # hostname - string - Hostname or IP address
292
331
  # name - string - Internal name for your reference
293
- # max_connections - integer - Max number of parallel connetions. Ignored for S3 connections (we will parallelize these as much as possible).
332
+ # max_connections - integer - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
294
333
  # port - integer - Port for remote server. Not needed for S3.
295
334
  # s3_bucket - string - S3 bucket name
296
335
  # s3_region - string - S3 region
@@ -298,6 +337,9 @@ module Files
298
337
  # server_type - string - Remote server type.
299
338
  # ssl - string - Should we require SSL?
300
339
  # username - string - Remote server username. Not needed for S3 buckets.
340
+ # google_cloud_storage_bucket - string - Google Cloud Storage bucket name
341
+ # google_cloud_storage_project_id - string - Google Cloud Project ID
342
+ # google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
301
343
  def self.update(id, params = {}, options = {})
302
344
  params ||= {}
303
345
  params[:id] = id
@@ -316,6 +358,9 @@ module Files
316
358
  raise InvalidParameterError.new("Bad parameter: server_type must be an String") if params.dig(:server_type) and !params.dig(:server_type).is_a?(String)
317
359
  raise InvalidParameterError.new("Bad parameter: ssl must be an String") if params.dig(:ssl) and !params.dig(:ssl).is_a?(String)
318
360
  raise InvalidParameterError.new("Bad parameter: username must be an String") if params.dig(:username) and !params.dig(:username).is_a?(String)
361
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_bucket must be an String") if params.dig(:google_cloud_storage_bucket) and !params.dig(:google_cloud_storage_bucket).is_a?(String)
362
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_project_id must be an String") if params.dig(:google_cloud_storage_project_id) and !params.dig(:google_cloud_storage_project_id).is_a?(String)
363
+ raise InvalidParameterError.new("Bad parameter: google_cloud_storage_credentials_json must be an String") if params.dig(:google_cloud_storage_credentials_json) and !params.dig(:google_cloud_storage_credentials_json).is_a?(String)
319
364
  raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
320
365
 
321
366
  response, options = Api.send_request("/remote_servers/#{params[:id]}", :patch, params, options)
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.28
4
+ version: 1.0.29
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-04-15 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday