files.com 1.1.248 → 1.1.250

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: a7a0d4ae2ef14b51cbaa2db633936546e2aad83ef4f3f9c7d3a954f00137d5eb
4
- data.tar.gz: b6eaeeef6c8b9591b1e08efd65a153fb4954481a0b59199aca714cf5c9fd1f51
3
+ metadata.gz: 98805d730e8daca6c153de77617d11faee90e48adec0b25dec18ad78b317df3e
4
+ data.tar.gz: b33bcf640dc80be6556bc619df8335187eb98d79048ee29ed05074c605a2339e
5
5
  SHA512:
6
- metadata.gz: a3ebd733d8ff359f4253ebcf4b863f8a9d268ea53c92f6e9fe39aa09d21ce2a38a27971e36e56a66d7a2fa0176a4a5ed22c24db7b71a64fcfa17aced9d546d06
7
- data.tar.gz: d9b953f723438554603319812a47518870878401ad03540055046f2e1aba46db0a3fd56c1ff50c4b911f14686513a1b4614e8b5612bcaea2d0177d02620913f2
6
+ metadata.gz: 58ca2f7dcb116582d7d2e218f87fe182affa718badcbbdf717aea620e47bf932aad051a2f433d34057fd8667703598ae0bc268762f238de57f7ba0c32351df11
7
+ data.tar.gz: d47cede62ff9c887a6d6d20ecbe9a9bf38f0a8c3f695ae4f771070d7d45073aa4cf7be27b793a63496968da37e1db4da05be33da87d48b178d886bf274134b10
data/README.md CHANGED
@@ -338,6 +338,12 @@ and error descriptions.
338
338
 
339
339
  If the specified language is not supported or the value is omitted, the API defaults to English.
340
340
 
341
+ ```shell title="Example Request"
342
+ require 'files.com'
343
+
344
+ Files.language = 'es'
345
+ ```
346
+
341
347
  ## Errors
342
348
 
343
349
  The Files.com Ruby SDK will return errors by raising exceptions. There are many exception classes defined in the Files SDK that correspond
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.248
1
+ 1.1.250
@@ -41,12 +41,14 @@
41
41
 
42
42
  ```
43
43
  Files::AutomationRun.list(
44
+ user_id: 1,
44
45
  automation_id: 1
45
46
  )
46
47
  ```
47
48
 
48
49
  ### Parameters
49
50
 
51
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
50
52
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
51
53
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
52
54
  * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation_id`, `created_at` or `status`.
@@ -42,11 +42,14 @@
42
42
  ## List Bundle Actions
43
43
 
44
44
  ```
45
- Files::BundleAction.list
45
+ Files::BundleAction.list(
46
+ user_id: 1
47
+ )
46
48
  ```
47
49
 
48
50
  ### Parameters
49
51
 
52
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
50
53
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
51
54
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
52
55
  * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
@@ -43,12 +43,14 @@
43
43
 
44
44
  ```
45
45
  Files::BundleRegistration.list(
46
+ user_id: 1,
46
47
  bundle_id: 1
47
48
  )
48
49
  ```
49
50
 
50
51
  ### Parameters
51
52
 
53
+ * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
52
54
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
53
55
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
54
56
  * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
@@ -35,6 +35,6 @@ Files::UserCipherUse.list(
35
35
 
36
36
  ### Parameters
37
37
 
38
- * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
38
+ * `user_id` (int64): User ID. If provided, will return uses for this user.
39
39
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
40
40
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
@@ -31,6 +31,6 @@ Files::UserSftpClientUse.list(
31
31
 
32
32
  ### Parameters
33
33
 
34
- * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
34
+ * `user_id` (int64): User ID. If provided, will return uses for this user.
35
35
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
36
36
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
@@ -332,6 +332,7 @@ module Files
332
332
 
333
333
  headers["X-FilesAPI-Key"] = api_key if api_key
334
334
  headers["X-FilesAPI-Auth"] = session_id if session_id
335
+ headers["Accept-Language"] = Files.language if Files.language
335
336
 
336
337
  user_agent = @system_profiler.user_agent
337
338
  begin
@@ -75,12 +75,14 @@ module Files
75
75
  end
76
76
 
77
77
  # Parameters:
78
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
78
79
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
79
80
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
80
81
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation_id`, `created_at` or `status`.
81
82
  # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `automation_id`. Valid field combinations are `[ automation_id, status ]`.
82
83
  # automation_id (required) - int64 - ID of the associated Automation.
83
84
  def self.list(params = {}, options = {})
85
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
84
86
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
85
87
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
86
88
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
@@ -40,6 +40,7 @@ module Files
40
40
  end
41
41
 
42
42
  # Parameters:
43
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
43
44
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
44
45
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
45
46
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
@@ -49,6 +50,7 @@ module Files
49
50
  # filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
50
51
  # filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
51
52
  def self.list(params = {}, options = {})
53
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
52
54
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
53
55
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
54
56
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
@@ -75,11 +75,13 @@ module Files
75
75
  end
76
76
 
77
77
  # Parameters:
78
+ # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
78
79
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
79
80
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
80
81
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
81
82
  # bundle_id - int64 - ID of the associated Bundle
82
83
  def self.list(params = {}, options = {})
84
+ raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params[:user_id] and !params[:user_id].is_a?(Integer)
83
85
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
84
86
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
85
87
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
@@ -61,8 +61,8 @@ module Files
61
61
  new(name).each(*args, &block)
62
62
  end
63
63
 
64
- def self.from_path(path)
65
- File.find(path)
64
+ def self.from_path(path, options = {})
65
+ find(path, {}, options)
66
66
  end
67
67
 
68
68
  def self.identical?(path1, path2)
@@ -45,7 +45,7 @@ module Files
45
45
  end
46
46
 
47
47
  # Parameters:
48
- # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
48
+ # user_id - int64 - User ID. If provided, will return uses for this user.
49
49
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
50
50
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
51
51
  def self.list(params = {}, options = {})
@@ -35,7 +35,7 @@ module Files
35
35
  end
36
36
 
37
37
  # Parameters:
38
- # user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
38
+ # user_id - int64 - User ID. If provided, will return uses for this user.
39
39
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
40
40
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
41
41
  def self.list(params = {}, options = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.248"
4
+ VERSION = "1.1.250"
5
5
  end
data/lib/files.com.rb CHANGED
@@ -138,6 +138,7 @@ module Files
138
138
  @api_key = nil
139
139
  @app_info = nil
140
140
  @base_url = "https://app.files.com"
141
+ @language = nil
141
142
  @log_level = nil
142
143
  @logger = nil
143
144
  @proxy = nil
@@ -152,7 +153,7 @@ module Files
152
153
  @read_timeout = 60
153
154
 
154
155
  class << self
155
- attr_accessor :api_key, :base_url, :default_headers, :initial_network_retry_delay, :max_network_retry_delay, :open_timeout, :read_timeout, :proxy, :session_id
156
+ attr_accessor :api_key, :base_url, :default_headers, :initial_network_retry_delay, :language, :max_network_retry_delay, :open_timeout, :read_timeout, :proxy, :session_id
156
157
  end
157
158
 
158
159
  # map to the same values as the standard library's logger
@@ -0,0 +1,14 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe 'Language setting', :with_test_folder do
4
+ it 'sets the language' do
5
+ # Set language and verify
6
+ Files.language = 'es'
7
+ expect(Files.language).to eq('es')
8
+ begin
9
+ Files::File.find(test_folder.join("read.txt").to_s, {}, options)
10
+ rescue StandardError => e
11
+ expect(e.message).to include('No se ha encontrado')
12
+ end
13
+ end
14
+ end
@@ -97,9 +97,6 @@ RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
97
97
 
98
98
  file = Files::File.find(test_folder.join("with_rename_test.txt").to_s, {}, options)
99
99
  expect(file.read).to eq("I am a string via IO")
100
-
101
- file = Files::File.find(test_folder.join("with_rename_test_1.txt").to_s, {}, options)
102
- expect(file.read).to eq("I am a string via IO")
103
100
  end
104
101
  end
105
102
 
@@ -122,12 +119,12 @@ RSpec.describe Files::File, :with_test_folder, skip: ENV.fetch("GITLAB", nil) do
122
119
  Files::File.open(test_folder.join("read.txt").to_s, 'w', options) do |f|
123
120
  f.write("contents")
124
121
  end
125
- expect(Files::File.from_path(test_folder.join("read.txt").to_s).type).to eq("file")
122
+ expect(Files::File.from_path(test_folder.join("read.txt").to_s, options).type).to eq("file")
126
123
  end
127
124
 
128
125
  it "returns a directory type" do
129
- Files::Folder.mkdir("testdir") unless Files::Folder.exist?("testdir")
130
- expect(Files::File.from_path("testdir").type).to eq("directory")
126
+ Files::Folder.mkdir("testdir", {}, options) unless Files::Folder.exist?("testdir", options)
127
+ expect(Files::File.from_path("testdir", options).type).to eq("directory")
131
128
  end
132
129
  end
133
130
  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.248
4
+ version: 1.1.250
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-05 00:00:00.000000000 Z
11
+ date: 2025-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -330,6 +330,7 @@ files:
330
330
  - shared/header_test_data.json
331
331
  - shared/normalization_for_comparison_test_data.json
332
332
  - shared/url_test_data.json
333
+ - spec/language_spec.rb
333
334
  - spec/lib/api_client_spec.rb
334
335
  - spec/list_spec.rb
335
336
  - spec/models/file_spec.rb