files.com 1.1.110 → 1.1.112
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +438 -63
- data/_VERSION +1 -1
- data/docs/file.md +2 -2
- data/docs/file_action.md +1 -1
- data/docs/sftp_host_key.md +1 -1
- data/lib/files.com/models/file.rb +2 -2
- data/lib/files.com/models/file_action.rb +1 -1
- data/lib/files.com/models/sftp_host_key.rb +1 -1
- data/lib/files.com/version.rb +1 -1
- data/lib/files.com.rb +0 -1
- metadata +2 -4
- data/docs/action_webhook_failure.md +0 -28
- data/lib/files.com/models/action_webhook_failure.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18fa64da839810ed00562ec71c7c1a27eb4ffad729020b79fe33a7eec54f701d
|
4
|
+
data.tar.gz: 57e6b2336a33a39806e80bf1da896dac16c7951825233eafe90bb033ad9fec93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 672a3b4894c4f3fc3d80eb2ab6471ac8e0ef9b7e2339762cfe7e58e8b369c078d4aa052a813700fbd649ddc7bc214126218aa946a5221a1e68af2718e0d9a3e8
|
7
|
+
data.tar.gz: 62d5ac9edea75c1bbfed744271014df953234190f73e621d4ea059a7381be34a52b0f608c3cdb86d52d73b1dc9b81f3d5d398ea6e1ec71d1fc22ce5036dafe47
|
data/README.md
CHANGED
@@ -1,18 +1,24 @@
|
|
1
1
|
# Files.com Ruby Client
|
2
2
|
|
3
|
-
The
|
3
|
+
The content included here should be enough to get started, but please visit our
|
4
|
+
[Developer Documentation Website](https://developers.files.com/ruby/) for the complete documentation.
|
5
|
+
|
6
|
+
## Introduction
|
4
7
|
|
8
|
+
The Files.com Ruby client library provides convenient access to the Files.com API from applications written in the Ruby language.
|
5
9
|
|
6
|
-
|
10
|
+
### Installation
|
7
11
|
|
8
12
|
To install the package:
|
9
13
|
|
10
|
-
|
11
|
-
|
14
|
+
```bash
|
15
|
+
gem install files.com
|
16
|
+
````
|
12
17
|
Or add this to your app's Gemfile:
|
13
18
|
|
14
|
-
|
15
|
-
|
19
|
+
```ruby
|
20
|
+
gem 'files.com', '~> 1.0'
|
21
|
+
````
|
16
22
|
|
17
23
|
### Requirements
|
18
24
|
|
@@ -20,107 +26,476 @@ Or add this to your app's Gemfile:
|
|
20
26
|
|
21
27
|
Ruby 2.x is now considered end-of-life by the Ruby project. As a policy, Files.com does not support integrations which are considered end-of-life by their vendor.
|
22
28
|
|
29
|
+
<Note title="Repository">
|
30
|
+
Explore the [files-sdk-ruby](https://github.com/Files-com/files-sdk-ruby) code on GitHub.
|
31
|
+
</Note>
|
23
32
|
|
24
|
-
|
33
|
+
### Getting Support
|
25
34
|
|
26
|
-
|
35
|
+
The Files.com team is happy to help with any SDK Integration challenges you
|
36
|
+
may face.
|
27
37
|
|
28
|
-
|
38
|
+
Just email support@files.com and we'll get the process started.
|
29
39
|
|
40
|
+
## Authentication
|
30
41
|
|
31
|
-
|
42
|
+
### Authenticate with an API Key
|
32
43
|
|
33
|
-
|
44
|
+
Authenticating with an API key is the recommended authentication method for most scenarios, and is
|
45
|
+
the method used in the examples on this site.
|
34
46
|
|
35
|
-
|
47
|
+
To use the API or SDKs with an API Key, first generate an API key from the [web
|
48
|
+
interface](https://www.files.com/docs/sdk-and-apis/api-keys) or [via the API or an
|
49
|
+
SDK](/ruby/resources/developers/api-keys).
|
36
50
|
|
51
|
+
Note that when using a user-specific API key, if the user is an administrator, you will have full
|
52
|
+
access to the entire API. If the user is not an administrator, you will only be able to access files
|
53
|
+
that user can access, and no access will be granted to site administration functions in the API.
|
37
54
|
|
38
|
-
|
55
|
+
```ruby title="Example Request"
|
56
|
+
Files.api_key = 'YOUR_API_KEY'
|
39
57
|
|
40
|
-
|
41
|
-
|
58
|
+
## Alternatively, you can specify the API key on a per-request basis in the final parameter to any method or initializer.
|
59
|
+
Files::User.new(params, api_key: 'YOUR_API_KEY')
|
60
|
+
```
|
42
61
|
|
43
|
-
|
62
|
+
<Note>
|
63
|
+
Don't forget to replace the placeholder, `YOUR_API_KEY`, with your actual API key.
|
64
|
+
</Note>
|
44
65
|
|
45
|
-
|
46
|
-
on models returned from the API.
|
66
|
+
### Authenticate with a Session
|
47
67
|
|
68
|
+
You can also authenticate to the REST API or SDKs by creating a user session using the username and
|
69
|
+
password of an active user. If the user is an administrator, the session will have full access to
|
70
|
+
the entire API. Sessions created from regular user accounts will only be able to access files that
|
71
|
+
user can access, and no access will be granted to site administration functions.
|
48
72
|
|
49
|
-
|
73
|
+
API sessions use the exact same session timeout settings as web interface sessions. When an API
|
74
|
+
session times out, simply create a new session and resume where you left off. This process is not
|
75
|
+
automatically handled by SDKs because we do not want to store password information in memory without
|
76
|
+
your explicit consent.
|
50
77
|
|
51
|
-
|
78
|
+
#### Logging in
|
52
79
|
|
53
|
-
|
80
|
+
To create a session, the `create` method is called on the `Files::Session` object with the user's username and
|
81
|
+
password.
|
54
82
|
|
55
|
-
|
83
|
+
This returns a session object that can be used to authenticate SDK method calls.
|
56
84
|
|
57
|
-
|
85
|
+
```ruby title="Example Request"
|
86
|
+
session = Files::Session.create(username: "username", password: "password")
|
87
|
+
```
|
58
88
|
|
59
|
-
|
89
|
+
#### Using a session
|
60
90
|
|
61
|
-
|
91
|
+
Once a session has been created, you can store the session globally, use the session per object, or use the session per request to authenticate SDK operations.
|
62
92
|
|
93
|
+
```ruby title="Example Requests"
|
94
|
+
## You may set the returned session to be used by default for subsequent requests.
|
95
|
+
Files.session = Files::Session.create(username: "username", password: "password")
|
63
96
|
|
64
|
-
|
97
|
+
## Alternatively, you can specify the session ID on a per-object basis in the second parameter to a model constructor.
|
98
|
+
user = Files::User.new(params, session_id: session.id)
|
65
99
|
|
66
|
-
You
|
100
|
+
## You may also specify the session ID on a per-request basis in the final parameter to static methods.
|
101
|
+
Files::Group.list({}, session_id: session.id)
|
67
102
|
|
68
|
-
|
69
|
-
* `Files.open_timeout` - open timeout in seconds (default: 30)
|
70
|
-
* `Files.read_timeout` - read timeout in seconds (default: 80)
|
71
|
-
* `Files.initial_network_retry_delay` - initial retry delay in seconds (default: 0.5)
|
72
|
-
* `Files.max_network_retries` - max retries (default: 3)
|
73
|
-
* `Files.max_network_retry_delay` - max retry delay in seconds (default: 2)
|
74
|
-
* `Files.base_url` - Set client to use your site subdomain if your site is configured to disable global acceleration.
|
75
|
-
Otherwise, don't change this setting for production. For dev/CI, you can point this to the mock server.
|
76
|
-
* `Files.proxy` - proxy configuration (uses Faraday format)
|
103
|
+
````
|
77
104
|
|
105
|
+
#### Logging out
|
78
106
|
|
79
|
-
|
107
|
+
User sessions can be ended calling the `destroy` method on the `session` object.
|
80
108
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
Files::Folder).
|
109
|
+
```ruby title="Example Request"
|
110
|
+
session.destroy()
|
111
|
+
```
|
85
112
|
|
113
|
+
## Configuration
|
86
114
|
|
87
|
-
|
115
|
+
### Configuration options
|
88
116
|
|
89
|
-
|
90
|
-
puts file.path
|
91
|
-
end
|
117
|
+
#### Base URL
|
92
118
|
|
119
|
+
Setting the base URL for the API is required if your site is configured to disable global acceleration.
|
120
|
+
This can also be set to use a mock server in development or CI.
|
93
121
|
|
94
|
-
|
122
|
+
```ruby title="Example setting"
|
123
|
+
Files.base_url = "https://SUBDOMAIN.files.com"
|
124
|
+
```
|
95
125
|
|
96
|
-
|
126
|
+
#### Log level
|
97
127
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
128
|
+
Supported values:
|
129
|
+
* `nil`
|
130
|
+
* "info"
|
131
|
+
* "debug"
|
103
132
|
|
133
|
+
```ruby title="Example setting"
|
134
|
+
Files.log_level = 'info'
|
135
|
+
```
|
104
136
|
|
105
|
-
####
|
137
|
+
#### Proxy
|
106
138
|
|
107
|
-
|
139
|
+
Proxy configuration in Faraday format.
|
108
140
|
|
141
|
+
```ruby title="Example setting"
|
142
|
+
Files.proxy = {
|
143
|
+
uri: 'https://proxy.example.com',
|
144
|
+
user: 'proxy_me',
|
145
|
+
password: 'my_password',
|
146
|
+
}
|
147
|
+
```
|
109
148
|
|
110
|
-
|
149
|
+
#### Open timeout
|
111
150
|
|
112
|
-
|
113
|
-
in the `docs/` subdirectory of this directory.
|
151
|
+
Open timeout in seconds. The default value is 30.
|
114
152
|
|
153
|
+
```ruby title="Example setting"
|
154
|
+
Files.open_timeout = 60
|
155
|
+
```
|
115
156
|
|
116
|
-
|
157
|
+
#### Read timeout
|
117
158
|
|
118
|
-
|
159
|
+
Read timeout in seconds. The default value is 80.
|
119
160
|
|
161
|
+
```ruby title="Example setting"
|
162
|
+
Files.read_timeout = 90
|
163
|
+
```
|
120
164
|
|
121
|
-
|
165
|
+
#### Initial network retry delay
|
122
166
|
|
123
|
-
|
124
|
-
may face.
|
167
|
+
Initial retry delay in seconds. The default value is 0.5.
|
125
168
|
|
126
|
-
|
169
|
+
```ruby title="Example setting"
|
170
|
+
Files.initial_network_retry_delay = 1
|
171
|
+
```
|
172
|
+
|
173
|
+
#### Maximum retry delay
|
174
|
+
|
175
|
+
Maximum network retry delay in seconds. The default value is 2.
|
176
|
+
|
177
|
+
```ruby title="Example setting"
|
178
|
+
Files.max_network_retry_delay = 5
|
179
|
+
```
|
180
|
+
|
181
|
+
#### Maximum network retries
|
182
|
+
|
183
|
+
Maximum number of retries. The default value is 3.
|
184
|
+
|
185
|
+
```ruby title="Example setting"
|
186
|
+
Files.max_network_retries = 5
|
187
|
+
```
|
188
|
+
|
189
|
+
### Logging
|
190
|
+
|
191
|
+
The Files.com SDK is compatible with the standard log4j logging scheme.
|
192
|
+
|
193
|
+
Add `com.files` logger to your `Loggers` root in the `log4j2.xml` file.
|
194
|
+
|
195
|
+
```xml title="log4j2.xml"
|
196
|
+
<Loggers>
|
197
|
+
<!-- set preferred level -->
|
198
|
+
<Logger name="com.files" level="TRACE" />
|
199
|
+
<!-- to enable network request -->
|
200
|
+
<Logger name="okhttp3.logging.wire" level="INFO"/>
|
201
|
+
</Loggers>
|
202
|
+
```
|
203
|
+
|
204
|
+
Create a `resources/log4j2.xml` file.
|
205
|
+
|
206
|
+
```xml title="resources/log4j2.xml"
|
207
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
208
|
+
<Configuration>
|
209
|
+
<Appenders>
|
210
|
+
<Console name="Console" target="SYSTEM_OUT">
|
211
|
+
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
|
212
|
+
</Console>
|
213
|
+
</Appenders>
|
214
|
+
<Loggers>
|
215
|
+
<!-- set preferred level -->
|
216
|
+
<Logger name="com.files" level="TRACE"/>
|
217
|
+
<!-- to enable network request -->
|
218
|
+
<Logger name="okhttp3.logging.wire" level="INFO"/>
|
219
|
+
</Loggers>
|
220
|
+
</Configuration>
|
221
|
+
```
|
222
|
+
|
223
|
+
You can read more about [log4j2 configuration](https://logging.apache.org/log4j/2.x/manual/configuration.html).
|
224
|
+
|
225
|
+
## Errors
|
226
|
+
|
227
|
+
The Files.com Ruby SDK will return errors by raising exceptions. There are many exception classes defined in the Files SDK that correspond
|
228
|
+
to specific errors.
|
229
|
+
|
230
|
+
The raised exceptions come from two categories:
|
231
|
+
|
232
|
+
1. SDK Exceptions - errors that originate within the SDK
|
233
|
+
2. API Exceptions - errors that occur due to the response from the Files.com API. These errors are grouped into common error types.
|
234
|
+
|
235
|
+
There are several types of exceptions within each category. Exception classes indicate different types of errors and are named in a
|
236
|
+
fashion that describe the general premise of the originating error. More details can be found in the `message` attribute of
|
237
|
+
the capture exception object.
|
238
|
+
|
239
|
+
Use standard Ruby exception handling to detect and deal with errors. It is generally recommended to rescue for specific errors first, then
|
240
|
+
rescue for general `Files::Error` as a catch-all.
|
241
|
+
|
242
|
+
```ruby title="Example Error Handling"
|
243
|
+
begin
|
244
|
+
session = Files::Session.create(username: "USERNAME", password: "BADPASSWORD")
|
245
|
+
rescue Files::NotAuthenticatedError => e
|
246
|
+
puts "An Authentication Error has occured (#{e.class.to_s}): " + e.message
|
247
|
+
rescue Files::Error => e
|
248
|
+
puts "An Unknown Error has occured (#{e.class.to_s}): " + e.message
|
249
|
+
end
|
250
|
+
```
|
251
|
+
|
252
|
+
### Error Types
|
253
|
+
|
254
|
+
#### SDK Errors
|
255
|
+
|
256
|
+
SDK errors are general errors that occure within the SDK code. Each exception class inherits from a standard `Error` base class.
|
257
|
+
|
258
|
+
```ruby title="Example SDK Exception Class Inheritance Structure"
|
259
|
+
Files::APIConnectionError -> Files::Error -> StandardError
|
260
|
+
```
|
261
|
+
##### SDK Exception Classes
|
262
|
+
|
263
|
+
| Error Class Name| Description |
|
264
|
+
| --------------- | ------------ |
|
265
|
+
| `APIConnectionError`| The Files.com API cannot be reached |
|
266
|
+
| `AuthenticationError`| Not enough authentication information has been provided |
|
267
|
+
| `InvalidParameterError`| A passed in parameter is invalid |
|
268
|
+
| `MissingParameterError`| A method parameter is missing |
|
269
|
+
| `NotImplementedError`| The called method has not be implemented by the SDK |
|
270
|
+
|
271
|
+
#### API Errors
|
272
|
+
|
273
|
+
API errors are errors returned by the Files.com API. Each exception class inherits from an error group base class.
|
274
|
+
The error group base class indicates a particular type of error.
|
275
|
+
|
276
|
+
```ruby title="Example API Exception Class Inheritance Structure"
|
277
|
+
Files::FolderAdminPermissionRequiredError -> Files::NotAuthorizedError -> Files::Error -> StandardError
|
278
|
+
```
|
279
|
+
##### API Exception Classes
|
280
|
+
|
281
|
+
| Error Class Name | Error Group |
|
282
|
+
| --------- | --------- |
|
283
|
+
|`AgentUpgradeRequiredError`| `BadRequestError` |
|
284
|
+
|`AttachmentTooLargeError`| `BadRequestError` |
|
285
|
+
|`CannotDownloadDirectoryError`| `BadRequestError` |
|
286
|
+
|`CantMoveWithMultipleLocationsError`| `BadRequestError` |
|
287
|
+
|`DatetimeParseError`| `BadRequestError` |
|
288
|
+
|`DestinationSameError`| `BadRequestError` |
|
289
|
+
|`FolderMustNotBeAFileError`| `BadRequestError` |
|
290
|
+
|`InvalidBodyError`| `BadRequestError` |
|
291
|
+
|`InvalidCursorError`| `BadRequestError` |
|
292
|
+
|`InvalidCursorTypeForSortError`| `BadRequestError` |
|
293
|
+
|`InvalidEtagsError`| `BadRequestError` |
|
294
|
+
|`InvalidFilterAliasCombinationError`| `BadRequestError` |
|
295
|
+
|`InvalidFilterCombinationError`| `BadRequestError` |
|
296
|
+
|`InvalidFilterFieldError`| `BadRequestError` |
|
297
|
+
|`InvalidFilterParamError`| `BadRequestError` |
|
298
|
+
|`InvalidFilterParamValueError`| `BadRequestError` |
|
299
|
+
|`InvalidInputEncodingError`| `BadRequestError` |
|
300
|
+
|`InvalidInterfaceError`| `BadRequestError` |
|
301
|
+
|`InvalidOauthProviderError`| `BadRequestError` |
|
302
|
+
|`InvalidPathError`| `BadRequestError` |
|
303
|
+
|`InvalidReturnToUrlError`| `BadRequestError` |
|
304
|
+
|`InvalidUploadOffsetError`| `BadRequestError` |
|
305
|
+
|`InvalidUploadPartGapError`| `BadRequestError` |
|
306
|
+
|`InvalidUploadPartSizeError`| `BadRequestError` |
|
307
|
+
|`MethodNotAllowedError`| `BadRequestError` |
|
308
|
+
|`NoValidInputParamsError`| `BadRequestError` |
|
309
|
+
|`PartNumberTooLargeError`| `BadRequestError` |
|
310
|
+
|`PathCannotHaveTrailingWhitespaceError`| `BadRequestError` |
|
311
|
+
|`ReauthenticationNeededFieldsError`| `BadRequestError` |
|
312
|
+
|`RequestParamsContainInvalidCharacterError`| `BadRequestError` |
|
313
|
+
|`RequestParamsInvalidError`| `BadRequestError` |
|
314
|
+
|`RequestParamsRequiredError`| `BadRequestError` |
|
315
|
+
|`SearchAllOnChildPathError`| `BadRequestError` |
|
316
|
+
|`UnsupportedCurrencyError`| `BadRequestError` |
|
317
|
+
|`UnsupportedHttpResponseFormatError`| `BadRequestError` |
|
318
|
+
|`UnsupportedMediaTypeError`| `BadRequestError` |
|
319
|
+
|`UserIdInvalidError`| `BadRequestError` |
|
320
|
+
|`UserIdOnUserEndpointError`| `BadRequestError` |
|
321
|
+
|`UserRequiredError`| `BadRequestError` |
|
322
|
+
|`AdditionalAuthenticationRequiredError`| `NotAuthenticatedError` |
|
323
|
+
|`AuthenticationRequiredError`| `NotAuthenticatedError` |
|
324
|
+
|`BundleRegistrationCodeFailedError`| `NotAuthenticatedError` |
|
325
|
+
|`FilesAgentTokenFailedError`| `NotAuthenticatedError` |
|
326
|
+
|`InboxRegistrationCodeFailedError`| `NotAuthenticatedError` |
|
327
|
+
|`InvalidCredentialsError`| `NotAuthenticatedError` |
|
328
|
+
|`InvalidOauthError`| `NotAuthenticatedError` |
|
329
|
+
|`InvalidOrExpiredCodeError`| `NotAuthenticatedError` |
|
330
|
+
|`InvalidSessionError`| `NotAuthenticatedError` |
|
331
|
+
|`InvalidUsernameOrPasswordError`| `NotAuthenticatedError` |
|
332
|
+
|`LockedOutError`| `NotAuthenticatedError` |
|
333
|
+
|`LockoutRegionMismatchError`| `NotAuthenticatedError` |
|
334
|
+
|`OneTimePasswordIncorrectError`| `NotAuthenticatedError` |
|
335
|
+
|`TwoFactorAuthenticationErrorError`| `NotAuthenticatedError` |
|
336
|
+
|`TwoFactorAuthenticationSetupExpiredError`| `NotAuthenticatedError` |
|
337
|
+
|`ApiKeyIsDisabledError`| `NotAuthorizedError` |
|
338
|
+
|`ApiKeyIsPathRestrictedError`| `NotAuthorizedError` |
|
339
|
+
|`ApiKeyOnlyForDesktopAppError`| `NotAuthorizedError` |
|
340
|
+
|`ApiKeyOnlyForMobileAppError`| `NotAuthorizedError` |
|
341
|
+
|`ApiKeyOnlyForOfficeIntegrationError`| `NotAuthorizedError` |
|
342
|
+
|`BillingPermissionRequiredError`| `NotAuthorizedError` |
|
343
|
+
|`BundleMaximumUsesReachedError`| `NotAuthorizedError` |
|
344
|
+
|`CannotLoginWhileUsingKeyError`| `NotAuthorizedError` |
|
345
|
+
|`CantActForOtherUserError`| `NotAuthorizedError` |
|
346
|
+
|`ContactAdminForPasswordChangeHelpError`| `NotAuthorizedError` |
|
347
|
+
|`FilesAgentFailedAuthorizationError`| `NotAuthorizedError` |
|
348
|
+
|`FolderAdminOrBillingPermissionRequiredError`| `NotAuthorizedError` |
|
349
|
+
|`FolderAdminPermissionRequiredError`| `NotAuthorizedError` |
|
350
|
+
|`FullPermissionRequiredError`| `NotAuthorizedError` |
|
351
|
+
|`HistoryPermissionRequiredError`| `NotAuthorizedError` |
|
352
|
+
|`InsufficientPermissionForParamsError`| `NotAuthorizedError` |
|
353
|
+
|`InsufficientPermissionForSiteError`| `NotAuthorizedError` |
|
354
|
+
|`MustAuthenticateWithApiKeyError`| `NotAuthorizedError` |
|
355
|
+
|`NeedAdminPermissionForInboxError`| `NotAuthorizedError` |
|
356
|
+
|`NonAdminsMustQueryByFolderOrPathError`| `NotAuthorizedError` |
|
357
|
+
|`NotAllowedToCreateBundleError`| `NotAuthorizedError` |
|
358
|
+
|`PasswordChangeNotRequiredError`| `NotAuthorizedError` |
|
359
|
+
|`PasswordChangeRequiredError`| `NotAuthorizedError` |
|
360
|
+
|`ReadOnlySessionError`| `NotAuthorizedError` |
|
361
|
+
|`ReadPermissionRequiredError`| `NotAuthorizedError` |
|
362
|
+
|`ReauthenticationFailedError`| `NotAuthorizedError` |
|
363
|
+
|`ReauthenticationFailedFinalError`| `NotAuthorizedError` |
|
364
|
+
|`ReauthenticationNeededActionError`| `NotAuthorizedError` |
|
365
|
+
|`RecaptchaFailedError`| `NotAuthorizedError` |
|
366
|
+
|`SelfManagedRequiredError`| `NotAuthorizedError` |
|
367
|
+
|`SiteAdminRequiredError`| `NotAuthorizedError` |
|
368
|
+
|`SiteFilesAreImmutableError`| `NotAuthorizedError` |
|
369
|
+
|`TwoFactorAuthenticationRequiredError`| `NotAuthorizedError` |
|
370
|
+
|`UserIdWithoutSiteAdminError`| `NotAuthorizedError` |
|
371
|
+
|`WriteAndBundlePermissionRequiredError`| `NotAuthorizedError` |
|
372
|
+
|`WritePermissionRequiredError`| `NotAuthorizedError` |
|
373
|
+
|`ZipDownloadIpMismatchError`| `NotAuthorizedError` |
|
374
|
+
|`ApiKeyNotFoundError`| `NotFoundError` |
|
375
|
+
|`BundlePathNotFoundError`| `NotFoundError` |
|
376
|
+
|`BundleRegistrationNotFoundError`| `NotFoundError` |
|
377
|
+
|`CodeNotFoundError`| `NotFoundError` |
|
378
|
+
|`FileNotFoundError`| `NotFoundError` |
|
379
|
+
|`FileUploadNotFoundError`| `NotFoundError` |
|
380
|
+
|`FolderNotFoundError`| `NotFoundError` |
|
381
|
+
|`GroupNotFoundError`| `NotFoundError` |
|
382
|
+
|`InboxNotFoundError`| `NotFoundError` |
|
383
|
+
|`NestedNotFoundError`| `NotFoundError` |
|
384
|
+
|`PlanNotFoundError`| `NotFoundError` |
|
385
|
+
|`SiteNotFoundError`| `NotFoundError` |
|
386
|
+
|`UserNotFoundError`| `NotFoundError` |
|
387
|
+
|`AlreadyCompletedError`| `ProcessingFailureError` |
|
388
|
+
|`AutomationCannotBeRunManuallyError`| `ProcessingFailureError` |
|
389
|
+
|`BehaviorNotAllowedOnRemoteServerError`| `ProcessingFailureError` |
|
390
|
+
|`BundleOnlyAllowsPreviewsError`| `ProcessingFailureError` |
|
391
|
+
|`BundleOperationRequiresSubfolderError`| `ProcessingFailureError` |
|
392
|
+
|`CouldNotCreateParentError`| `ProcessingFailureError` |
|
393
|
+
|`DestinationExistsError`| `ProcessingFailureError` |
|
394
|
+
|`DestinationFolderLimitedError`| `ProcessingFailureError` |
|
395
|
+
|`DestinationParentConflictError`| `ProcessingFailureError` |
|
396
|
+
|`DestinationParentDoesNotExistError`| `ProcessingFailureError` |
|
397
|
+
|`ExpiredPrivateKeyError`| `ProcessingFailureError` |
|
398
|
+
|`ExpiredPublicKeyError`| `ProcessingFailureError` |
|
399
|
+
|`ExportFailureError`| `ProcessingFailureError` |
|
400
|
+
|`ExportNotReadyError`| `ProcessingFailureError` |
|
401
|
+
|`FailedToChangePasswordError`| `ProcessingFailureError` |
|
402
|
+
|`FileLockedError`| `ProcessingFailureError` |
|
403
|
+
|`FileNotUploadedError`| `ProcessingFailureError` |
|
404
|
+
|`FilePendingProcessingError`| `ProcessingFailureError` |
|
405
|
+
|`FileProcessingErrorError`| `ProcessingFailureError` |
|
406
|
+
|`FileTooBigToDecryptError`| `ProcessingFailureError` |
|
407
|
+
|`FileTooBigToEncryptError`| `ProcessingFailureError` |
|
408
|
+
|`FileUploadedToWrongRegionError`| `ProcessingFailureError` |
|
409
|
+
|`FilenameTooLongError`| `ProcessingFailureError` |
|
410
|
+
|`FolderLockedError`| `ProcessingFailureError` |
|
411
|
+
|`FolderNotEmptyError`| `ProcessingFailureError` |
|
412
|
+
|`HistoryUnavailableError`| `ProcessingFailureError` |
|
413
|
+
|`InvalidBundleCodeError`| `ProcessingFailureError` |
|
414
|
+
|`InvalidFileTypeError`| `ProcessingFailureError` |
|
415
|
+
|`InvalidFilenameError`| `ProcessingFailureError` |
|
416
|
+
|`InvalidPriorityColorError`| `ProcessingFailureError` |
|
417
|
+
|`InvalidRangeError`| `ProcessingFailureError` |
|
418
|
+
|`ModelSaveErrorError`| `ProcessingFailureError` |
|
419
|
+
|`MultipleProcessingErrorsError`| `ProcessingFailureError` |
|
420
|
+
|`PathTooLongError`| `ProcessingFailureError` |
|
421
|
+
|`RecipientAlreadySharedError`| `ProcessingFailureError` |
|
422
|
+
|`RemoteServerErrorError`| `ProcessingFailureError` |
|
423
|
+
|`ResourceLockedError`| `ProcessingFailureError` |
|
424
|
+
|`SubfolderLockedError`| `ProcessingFailureError` |
|
425
|
+
|`TwoFactorAuthenticationCodeAlreadySentError`| `ProcessingFailureError` |
|
426
|
+
|`TwoFactorAuthenticationCountryBlacklistedError`| `ProcessingFailureError` |
|
427
|
+
|`TwoFactorAuthenticationGeneralErrorError`| `ProcessingFailureError` |
|
428
|
+
|`TwoFactorAuthenticationUnsubscribedRecipientError`| `ProcessingFailureError` |
|
429
|
+
|`UpdatesNotAllowedForRemotesError`| `ProcessingFailureError` |
|
430
|
+
|`DuplicateShareRecipientError`| `RateLimitedError` |
|
431
|
+
|`ReauthenticationRateLimitedError`| `RateLimitedError` |
|
432
|
+
|`TooManyConcurrentLoginsError`| `RateLimitedError` |
|
433
|
+
|`TooManyConcurrentRequestsError`| `RateLimitedError` |
|
434
|
+
|`TooManyLoginAttemptsError`| `RateLimitedError` |
|
435
|
+
|`TooManyRequestsError`| `RateLimitedError` |
|
436
|
+
|`TooManySharesError`| `RateLimitedError` |
|
437
|
+
|`AgentUnavailableError`| `ServiceUnavailableError` |
|
438
|
+
|`AutomationsUnavailableError`| `ServiceUnavailableError` |
|
439
|
+
|`MigrationInProgressError`| `ServiceUnavailableError` |
|
440
|
+
|`SiteDisabledError`| `ServiceUnavailableError` |
|
441
|
+
|`UploadsUnavailableError`| `ServiceUnavailableError` |
|
442
|
+
|`AccountAlreadyExistsError`| `SiteConfigurationError` |
|
443
|
+
|`AccountOverdueError`| `SiteConfigurationError` |
|
444
|
+
|`NoAccountForSiteError`| `SiteConfigurationError` |
|
445
|
+
|`SiteWasRemovedError`| `SiteConfigurationError` |
|
446
|
+
|`TrialExpiredError`| `SiteConfigurationError` |
|
447
|
+
|`TrialLockedError`| `SiteConfigurationError` |
|
448
|
+
|`UserRequestsEnabledRequiredError`| `SiteConfigurationError` |
|
449
|
+
|
450
|
+
## Examples
|
451
|
+
|
452
|
+
### File Operations
|
453
|
+
|
454
|
+
The Files::File and Files::Dir models implement the standard Ruby API
|
455
|
+
for File and Dir, respectively. (Note that the Files.com SDK uses the
|
456
|
+
word Folder, not Dir, and Files::Dir is simply an alias for
|
457
|
+
Files::Folder).
|
458
|
+
|
459
|
+
#### List root folder
|
460
|
+
|
461
|
+
```ruby
|
462
|
+
Files::Folder.list_for("/").each do |file|
|
463
|
+
puts file.path
|
464
|
+
end
|
465
|
+
```
|
466
|
+
|
467
|
+
#### Writing a file
|
468
|
+
|
469
|
+
```ruby
|
470
|
+
Files::upload_file("local.txt", "/remote.txt")
|
471
|
+
|
472
|
+
File.open("local.txt") do |local_file|
|
473
|
+
Files::File.open("remote.txt", "w") do |remote_file|
|
474
|
+
remote_file.write(local_file.read)
|
475
|
+
end
|
476
|
+
end
|
477
|
+
```
|
478
|
+
|
479
|
+
#### Reading a file
|
480
|
+
|
481
|
+
```ruby
|
482
|
+
Files::File.find("foo.txt").read
|
483
|
+
```
|
484
|
+
|
485
|
+
## Mock Server
|
486
|
+
|
487
|
+
Files.com publishes a Files.com API server, which is useful for testing your use of the Files.com
|
488
|
+
SDKs and other direct integrations against the Files.com API in an integration test environment.
|
489
|
+
|
490
|
+
It is a Ruby app that operates as a minimal server for the purpose of testing basic network
|
491
|
+
operations and JSON encoding for your SDK or API client. It does not maintain state and it does not
|
492
|
+
deeply inspect your submissions for correctness.
|
493
|
+
|
494
|
+
Eventually we will add more features intended for integration testing, such as the ability to
|
495
|
+
intentionally provoke errors.
|
496
|
+
|
497
|
+
Download the server as a Docker image via [Docker Hub](https://hub.docker.com/r/filescom/files-mock-server).
|
498
|
+
|
499
|
+
The Source Code is also available on [GitHub](https://github.com/Files-com/files-mock-server).
|
500
|
+
|
501
|
+
A README is available on the GitHub link.
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.112
|
data/docs/file.md
CHANGED
@@ -246,7 +246,7 @@ Files::File.move(path,
|
|
246
246
|
|
247
247
|
---
|
248
248
|
|
249
|
-
## Begin
|
249
|
+
## Begin File Upload
|
250
250
|
|
251
251
|
```
|
252
252
|
Files::File.begin_upload(path,
|
@@ -379,7 +379,7 @@ file.move(
|
|
379
379
|
|
380
380
|
---
|
381
381
|
|
382
|
-
## Begin
|
382
|
+
## Begin File Upload
|
383
383
|
|
384
384
|
```
|
385
385
|
file = Files::File.find(path)
|
data/docs/file_action.md
CHANGED
@@ -10,4 +10,4 @@
|
|
10
10
|
```
|
11
11
|
|
12
12
|
* `status` (string): Status of file operation.
|
13
|
-
* `file_migration_id` (int64): If status is pending, this is the id of the
|
13
|
+
* `file_migration_id` (int64): If status is pending, this is the id of the File Migration to check for status updates.
|
data/docs/sftp_host_key.md
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
}
|
12
12
|
```
|
13
13
|
|
14
|
-
* `id` (int64):
|
14
|
+
* `id` (int64): SFTP Host Key ID
|
15
15
|
* `name` (string): The friendly name of this SFTP Host Key.
|
16
16
|
* `fingerprint_md5` (string): MD5 Fingerpint of the public key
|
17
17
|
* `fingerprint_sha256` (string): SHA256 Fingerpint of the public key
|
@@ -1029,7 +1029,7 @@ module Files
|
|
1029
1029
|
Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
|
1030
1030
|
end
|
1031
1031
|
|
1032
|
-
# Begin
|
1032
|
+
# Begin File Upload
|
1033
1033
|
#
|
1034
1034
|
# Parameters:
|
1035
1035
|
# mkdir_parents - boolean - Create parent directories if they do not exist?
|
@@ -1204,7 +1204,7 @@ module Files
|
|
1204
1204
|
FileAction.new(response.data, options)
|
1205
1205
|
end
|
1206
1206
|
|
1207
|
-
# Begin
|
1207
|
+
# Begin File Upload
|
1208
1208
|
#
|
1209
1209
|
# Parameters:
|
1210
1210
|
# mkdir_parents - boolean - Create parent directories if they do not exist?
|
@@ -14,7 +14,7 @@ module Files
|
|
14
14
|
@attributes[:status]
|
15
15
|
end
|
16
16
|
|
17
|
-
# int64 - If status is pending, this is the id of the
|
17
|
+
# int64 - If status is pending, this is the id of the File Migration to check for status updates.
|
18
18
|
def file_migration_id
|
19
19
|
@attributes[:file_migration_id]
|
20
20
|
end
|
data/lib/files.com/version.rb
CHANGED
data/lib/files.com.rb
CHANGED
@@ -36,7 +36,6 @@ require "files.com/models/account_line_item"
|
|
36
36
|
require "files.com/models/action"
|
37
37
|
require "files.com/models/action_notification_export"
|
38
38
|
require "files.com/models/action_notification_export_result"
|
39
|
-
require "files.com/models/action_webhook_failure"
|
40
39
|
require "files.com/models/api_key"
|
41
40
|
require "files.com/models/api_request_log"
|
42
41
|
require "files.com/models/app"
|
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.
|
4
|
+
version: 1.1.112
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -118,7 +118,6 @@ files:
|
|
118
118
|
- docs/action.md
|
119
119
|
- docs/action_notification_export.md
|
120
120
|
- docs/action_notification_export_result.md
|
121
|
-
- docs/action_webhook_failure.md
|
122
121
|
- docs/api_key.md
|
123
122
|
- docs/api_request_log.md
|
124
123
|
- docs/app.md
|
@@ -220,7 +219,6 @@ files:
|
|
220
219
|
- lib/files.com/models/action.rb
|
221
220
|
- lib/files.com/models/action_notification_export.rb
|
222
221
|
- lib/files.com/models/action_notification_export_result.rb
|
223
|
-
- lib/files.com/models/action_webhook_failure.rb
|
224
222
|
- lib/files.com/models/api_key.rb
|
225
223
|
- lib/files.com/models/api_request_log.rb
|
226
224
|
- lib/files.com/models/app.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
---
|
4
|
-
|
5
|
-
## retry Action Webhook Failure
|
6
|
-
|
7
|
-
```
|
8
|
-
Files::ActionWebhookFailure.retry(id)
|
9
|
-
```
|
10
|
-
|
11
|
-
### Parameters
|
12
|
-
|
13
|
-
* `id` (int64): Required - Action Webhook Failure ID.
|
14
|
-
|
15
|
-
|
16
|
-
---
|
17
|
-
|
18
|
-
## retry Action Webhook Failure
|
19
|
-
|
20
|
-
```
|
21
|
-
action_webhook_failure = Files::ActionWebhookFailure.new
|
22
|
-
|
23
|
-
action_webhook_failure.retry
|
24
|
-
```
|
25
|
-
|
26
|
-
### Parameters
|
27
|
-
|
28
|
-
* `id` (int64): Required - Action Webhook Failure ID.
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Files
|
4
|
-
class ActionWebhookFailure
|
5
|
-
attr_reader :options, :attributes
|
6
|
-
|
7
|
-
def initialize(attributes = {}, options = {})
|
8
|
-
@attributes = attributes || {}
|
9
|
-
@options = options || {}
|
10
|
-
end
|
11
|
-
|
12
|
-
# retry Action Webhook Failure
|
13
|
-
def retry(params = {})
|
14
|
-
params ||= {}
|
15
|
-
params[:id] = @attributes[:id]
|
16
|
-
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
17
|
-
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
18
|
-
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
19
|
-
|
20
|
-
Api.send_request("/action_webhook_failures/#{@attributes[:id]}/retry", :post, params, @options)
|
21
|
-
end
|
22
|
-
|
23
|
-
# retry Action Webhook Failure
|
24
|
-
def self.retry(id, params = {}, options = {})
|
25
|
-
params ||= {}
|
26
|
-
params[:id] = id
|
27
|
-
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
|
28
|
-
raise MissingParameterError.new("Parameter missing: id") unless params[:id]
|
29
|
-
|
30
|
-
Api.send_request("/action_webhook_failures/#{params[:id]}/retry", :post, params, options)
|
31
|
-
nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|