files.com 1.1.659 → 1.1.660

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: b36753869a0e4f64a0feb2ff8e58d04ce3310b76925b0f035373d5d355d35052
4
- data.tar.gz: aa9037ee2eedf8c928b2389859faea3615c91ce341e4715a5ffee06ec0c921a1
3
+ metadata.gz: 82209e3d411a0f6df1666efe608ea199a5293809e6cb7a20d4acbe7093e42695
4
+ data.tar.gz: 88273779926a5da5cb0f365bee0a3eaedcca4964883477897f6c60da311ecd64
5
5
  SHA512:
6
- metadata.gz: 61e797a9c2f9beab60fe3f55223f2ab673d78af23710245ea369702b2924235ae997917714cca4f3eb8bf8f1b7951e27d7aae388510c0878dc506be95f8d0073
7
- data.tar.gz: 4775a3a6d5d9ebd9dcba86c2a9f89b64b8583c7135d7c42483da7d9cd90b052e602ada496ff0963487e935598ad20ad828ae7b14a758458a7a50829f7d75cb05
6
+ metadata.gz: 80f6239481ce085d7b19ebfd1f62c2d2b81f055ca5481cf8edf30813a63407ff3cad3e0df3c7cfa6609f44aec30eeebeb8705077d3b047c421fd3d99a919144b
7
+ data.tar.gz: 9d105b1d03b25af9bb3d0d1ccabb08c1645baff7c83f34d53c87b28e728042a5fbd8b1860a7b851cd2e15e4376eb30401441d181d2b8cda11750f17e3ced7d18
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.659
1
+ 1.1.660
data/docs/file.md CHANGED
@@ -268,6 +268,32 @@ Files::File.move(path,
268
268
  * `overwrite` (boolean): Overwrite existing file(s) in the destination?
269
269
 
270
270
 
271
+ ---
272
+
273
+ ## Transform a file and save the output to a destination path
274
+
275
+ ```
276
+ Files::File.transform(path,
277
+ destination: "destination",
278
+ transform_type: "transform_type",
279
+ target_format: "target_format",
280
+ width: 1,
281
+ height: 1,
282
+ overwrite: false
283
+ )
284
+ ```
285
+
286
+ ### Parameters
287
+
288
+ * `path` (string): Required - Path to operate on.
289
+ * `destination` (string): Required - Destination file path for the transformed output.
290
+ * `transform_type` (string): Required - Transform type. Supported values are `image_convert` and `document_convert`.
291
+ * `target_format` (string): Required - Destination format to create.
292
+ * `width` (int64): Maximum output width for image_convert.
293
+ * `height` (int64): Maximum output height for image_convert.
294
+ * `overwrite` (boolean): Overwrite existing file in the destination?
295
+
296
+
271
297
  ---
272
298
 
273
299
  ## Decrypt a GPG-encrypted file and save it to a destination path
@@ -507,6 +533,34 @@ file.move(
507
533
  * `overwrite` (boolean): Overwrite existing file(s) in the destination?
508
534
 
509
535
 
536
+ ---
537
+
538
+ ## Transform a file and save the output to a destination path
539
+
540
+ ```
541
+ file = Files::File.find(path)
542
+
543
+ file.transform(
544
+ destination: "destination",
545
+ transform_type: "transform_type",
546
+ target_format: "target_format",
547
+ width: 1,
548
+ height: 1,
549
+ overwrite: false
550
+ )
551
+ ```
552
+
553
+ ### Parameters
554
+
555
+ * `path` (string): Required - Path to operate on.
556
+ * `destination` (string): Required - Destination file path for the transformed output.
557
+ * `transform_type` (string): Required - Transform type. Supported values are `image_convert` and `document_convert`.
558
+ * `target_format` (string): Required - Destination format to create.
559
+ * `width` (int64): Maximum output width for image_convert.
560
+ * `height` (int64): Maximum output height for image_convert.
561
+ * `overwrite` (boolean): Overwrite existing file in the destination?
562
+
563
+
510
564
  ---
511
565
 
512
566
  ## Decrypt a GPG-encrypted file and save it to a destination path
@@ -1075,6 +1075,33 @@ module Files
1075
1075
  Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
1076
1076
  end
1077
1077
 
1078
+ # Transform a file and save the output to a destination path
1079
+ #
1080
+ # Parameters:
1081
+ # destination (required) - string - Destination file path for the transformed output.
1082
+ # transform_type (required) - string - Transform type. Supported values are `image_convert` and `document_convert`.
1083
+ # target_format (required) - string - Destination format to create.
1084
+ # width - int64 - Maximum output width for image_convert.
1085
+ # height - int64 - Maximum output height for image_convert.
1086
+ # overwrite - boolean - Overwrite existing file in the destination?
1087
+ def transform(params = {})
1088
+ params ||= {}
1089
+ params[:path] = @attributes[:path]
1090
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
1091
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
1092
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params[:destination] and !params[:destination].is_a?(String)
1093
+ raise InvalidParameterError.new("Bad parameter: transform_type must be an String") if params[:transform_type] and !params[:transform_type].is_a?(String)
1094
+ raise InvalidParameterError.new("Bad parameter: target_format must be an String") if params[:target_format] and !params[:target_format].is_a?(String)
1095
+ raise InvalidParameterError.new("Bad parameter: width must be an Integer") if params[:width] and !params[:width].is_a?(Integer)
1096
+ raise InvalidParameterError.new("Bad parameter: height must be an Integer") if params[:height] and !params[:height].is_a?(Integer)
1097
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
1098
+ raise MissingParameterError.new("Parameter missing: destination") unless params[:destination]
1099
+ raise MissingParameterError.new("Parameter missing: transform_type") unless params[:transform_type]
1100
+ raise MissingParameterError.new("Parameter missing: target_format") unless params[:target_format]
1101
+
1102
+ Api.send_request("/file_actions/transform/#{@attributes[:path]}", :post, params, @options)
1103
+ end
1104
+
1078
1105
  # Decrypt a GPG-encrypted file and save it to a destination path
1079
1106
  #
1080
1107
  # Parameters:
@@ -1331,6 +1358,33 @@ module Files
1331
1358
  FileAction.new(response.data, options)
1332
1359
  end
1333
1360
 
1361
+ # Transform a file and save the output to a destination path
1362
+ #
1363
+ # Parameters:
1364
+ # destination (required) - string - Destination file path for the transformed output.
1365
+ # transform_type (required) - string - Transform type. Supported values are `image_convert` and `document_convert`.
1366
+ # target_format (required) - string - Destination format to create.
1367
+ # width - int64 - Maximum output width for image_convert.
1368
+ # height - int64 - Maximum output height for image_convert.
1369
+ # overwrite - boolean - Overwrite existing file in the destination?
1370
+ def self.transform(path, params = {}, options = {})
1371
+ params ||= {}
1372
+ params[:path] = path
1373
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
1374
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params[:destination] and !params[:destination].is_a?(String)
1375
+ raise InvalidParameterError.new("Bad parameter: transform_type must be an String") if params[:transform_type] and !params[:transform_type].is_a?(String)
1376
+ raise InvalidParameterError.new("Bad parameter: target_format must be an String") if params[:target_format] and !params[:target_format].is_a?(String)
1377
+ raise InvalidParameterError.new("Bad parameter: width must be an Integer") if params[:width] and !params[:width].is_a?(Integer)
1378
+ raise InvalidParameterError.new("Bad parameter: height must be an Integer") if params[:height] and !params[:height].is_a?(Integer)
1379
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
1380
+ raise MissingParameterError.new("Parameter missing: destination") unless params[:destination]
1381
+ raise MissingParameterError.new("Parameter missing: transform_type") unless params[:transform_type]
1382
+ raise MissingParameterError.new("Parameter missing: target_format") unless params[:target_format]
1383
+
1384
+ response, options = Api.send_request("/file_actions/transform/#{params[:path]}", :post, params, options)
1385
+ FileAction.new(response.data, options)
1386
+ end
1387
+
1334
1388
  # Decrypt a GPG-encrypted file and save it to a destination path
1335
1389
  #
1336
1390
  # Parameters:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.659"
4
+ VERSION = "1.1.660"
5
5
  end
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.1.659
4
+ version: 1.1.660
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-24 00:00:00.000000000 Z
11
+ date: 2026-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable