files.com 1.0.134 → 1.0.135
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 +4 -4
- data/_VERSION +1 -1
- data/lib/files.com/api_client.rb +6 -10
- data/lib/files.com/errors.rb +155 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccb28d4c84b10799be2a3dcff04ba20905fc345e5cb55eb4de5835b4a41dc28b
|
4
|
+
data.tar.gz: 0725050ba80223d42bc5308251cbf3369e03d3467174dc859162f02d11c27a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19a2a75b5cf51cadfde6273e77c0b15a80ba232107e8b4dd30d4ee79345cd3255a0592d305bf1abaabaac1575482d0e42ed8b89a4dd26e3919b3d463feb39ad6
|
7
|
+
data.tar.gz: 7f169810b745da556da7edf365c23bd1b3d99ad07d932240939f1fb22878e21922cb1610ad64414bb9fcd4e1f087d3c7aa1709bcdb352216aef96cd4cca69067
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.135
|
data/lib/files.com/api_client.rb
CHANGED
@@ -277,16 +277,12 @@ module Files
|
|
277
277
|
code: error_data[:code] || resp.http_status,
|
278
278
|
}
|
279
279
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
PermissionError.new(error_data[:message], opts)
|
287
|
-
when 429
|
288
|
-
RateLimitError.new(error_data[:message], opts)
|
289
|
-
else
|
280
|
+
return APIError.new(error_data[:message], opts) unless resp&.data&.dig(:type)
|
281
|
+
|
282
|
+
begin
|
283
|
+
error_class = Files.const_get(resp.data[:type].split("/").map { |piece| piece.split("-").map(&:capitalize).join('') + 'Error' }.join("::"))
|
284
|
+
error_class.new(error_data[:message], opts)
|
285
|
+
rescue NameError
|
290
286
|
APIError.new(error_data[:message], opts)
|
291
287
|
end
|
292
288
|
end
|
data/lib/files.com/errors.rb
CHANGED
@@ -26,16 +26,162 @@ module Files
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
class
|
29
|
+
class APIConnectionError < Error; end
|
30
30
|
class AuthenticationError < Error; end
|
31
|
-
class
|
32
|
-
class
|
31
|
+
class InvalidParameterError < Error; end
|
32
|
+
class MissingParameterError < Error; end
|
33
33
|
class NotImplementedError < Error; end
|
34
|
-
class PermissionError < Error; end
|
35
|
-
class RateLimitError < Error; end
|
36
|
-
class TooManyRequestsError < Error; end
|
37
|
-
class ValidationError < Error; end
|
38
34
|
|
39
|
-
class
|
40
|
-
|
35
|
+
class APIError < Error
|
36
|
+
attr_reader :detail
|
37
|
+
attr_reader :error
|
38
|
+
attr_reader :errors
|
39
|
+
attr_reader :http_code
|
40
|
+
attr_reader :instance
|
41
|
+
attr_reader :model_errors
|
42
|
+
attr_reader :title
|
43
|
+
attr_reader :type
|
44
|
+
|
45
|
+
def initialize(message = nil, **kwargs)
|
46
|
+
@detail = kwargs.dig(:json_body, 'detail')
|
47
|
+
@error = kwargs.dig(:json_body, 'error')
|
48
|
+
@errors = kwargs.dig(:json_body, 'errors')
|
49
|
+
@http_code = kwargs.dig(:json_body, 'http-code')
|
50
|
+
@instance = kwargs.dig(:json_body, 'instance')
|
51
|
+
@model_errors = kwargs.dig(:json_body, 'model_errors')
|
52
|
+
@title = kwargs.dig(:json_body, 'title')
|
53
|
+
@type = kwargs.dig(:json_body, 'type')
|
54
|
+
|
55
|
+
super(message, **kwargs)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class ProcessingPendingError < APIError; end
|
60
|
+
|
61
|
+
class AccountInBadStandingError < APIError; end
|
62
|
+
class AccountOverdueError < AccountInBadStandingError; end
|
63
|
+
|
64
|
+
class BadRequestError < APIError; end
|
65
|
+
class AttachmentTooLargeError < BadRequestError; end
|
66
|
+
class CannotDownloadDirectoryError < BadRequestError; end
|
67
|
+
class CantMoveWithMultipleLocationsError < BadRequestError; end
|
68
|
+
class DatetimeParseError < BadRequestError; end
|
69
|
+
class DestinationSameError < BadRequestError; end
|
70
|
+
class FolderMustNotBeAFileError < BadRequestError; end
|
71
|
+
class InvalidFilterCombinationError < BadRequestError; end
|
72
|
+
class InvalidFilterFieldError < BadRequestError; end
|
73
|
+
class InvalidInputEncodingError < BadRequestError; end
|
74
|
+
class InvalidInterfaceError < BadRequestError; end
|
75
|
+
class InvalidOauthError < BadRequestError; end
|
76
|
+
class InvalidOauthProviderError < BadRequestError; end
|
77
|
+
class InvalidReturnToUrlError < BadRequestError; end
|
78
|
+
class InvalidUploadOffsetError < BadRequestError; end
|
79
|
+
class InvalidUsernameOrPasswordError < BadRequestError; end
|
80
|
+
class OperationOnNonScimResourceError < BadRequestError; end
|
81
|
+
class UnsupportedHttpResponseFormatError < BadRequestError; end
|
82
|
+
class UnsupportedMediaTypeError < BadRequestError; end
|
83
|
+
class UserIdInvalidError < BadRequestError; end
|
84
|
+
class UserIdOnUserEndpointError < BadRequestError; end
|
85
|
+
class UserRequiredError < BadRequestError; end
|
86
|
+
|
87
|
+
class InvalidParamsError < APIError; end
|
88
|
+
class NoValidInputParamsError < InvalidParamsError; end
|
89
|
+
class ReauthenticationNeededFieldsError < InvalidParamsError; end
|
90
|
+
class RequestParamPathCannotHaveTrailingWhitespaceError < InvalidParamsError; end
|
91
|
+
class RequestParamsContainInvalidCharacterError < InvalidParamsError; end
|
92
|
+
class RequestParamsInvalidError < InvalidParamsError; end
|
93
|
+
class RequestParamsRequiredError < InvalidParamsError; end
|
94
|
+
class UnsupportedCurrencyError < InvalidParamsError; end
|
95
|
+
|
96
|
+
class LockedError < APIError; end
|
97
|
+
class FileLockedError < LockedError; end
|
98
|
+
class FolderLockedError < LockedError; end
|
99
|
+
class ResourceLockedError < LockedError; end
|
100
|
+
class SubfolderLockedError < LockedError; end
|
101
|
+
|
102
|
+
class NotAuthenticatedError < APIError; end
|
103
|
+
class OneTimePasswordIncorrectError < NotAuthenticatedError; end
|
104
|
+
class TwoFactorAuthenticationErrorError < NotAuthenticatedError; end
|
105
|
+
class TwoFactorAuthenticationRequiredError < NotAuthenticatedError; end
|
106
|
+
class TwoFactorAuthenticationSetupExpiredError < NotAuthenticatedError; end
|
107
|
+
|
108
|
+
class NotAuthorizedError < APIError; end
|
109
|
+
class ApiKeyIsDisabledError < NotAuthorizedError; end
|
110
|
+
class ApiKeyIsPathRestrictedError < NotAuthorizedError; end
|
111
|
+
class ApiKeyOnlyForDesktopAppError < NotAuthorizedError; end
|
112
|
+
class ApiKeyOnlyForOfficeIntegrationError < NotAuthorizedError; end
|
113
|
+
class AuthenticationRequiredError < NotAuthorizedError; end
|
114
|
+
class CannotLoginWhileUsingKeyError < NotAuthorizedError; end
|
115
|
+
class CantActForOtherUserError < NotAuthorizedError; end
|
116
|
+
class ContactAdminForPasswordChangeHelpError < NotAuthorizedError; end
|
117
|
+
class FolderAdminOrBillingPermissionError < NotAuthorizedError; end
|
118
|
+
class FolderAdminPermissionRequiredError < NotAuthorizedError; end
|
119
|
+
class HistoryExportNonAdminsMustQueryByFolderOrPathError < NotAuthorizedError; end
|
120
|
+
class HistoryPermissionRequiredError < NotAuthorizedError; end
|
121
|
+
class InsufficientPermissionForParamsError < NotAuthorizedError; end
|
122
|
+
class LockedOutError < NotAuthorizedError; end
|
123
|
+
class LockoutIpFailuresError < NotAuthorizedError; end
|
124
|
+
class LockoutRegionMismatchError < NotAuthorizedError; end
|
125
|
+
class MustAuthenticateWithApiKeyError < NotAuthorizedError; end
|
126
|
+
class NeedAdminPermissionForInboxError < NotAuthorizedError; end
|
127
|
+
class NoBillingPermissionError < NotAuthorizedError; end
|
128
|
+
class NotAllowedToCreateBundleError < NotAuthorizedError; end
|
129
|
+
class PasswordChangeNotRequiredError < NotAuthorizedError; end
|
130
|
+
class PasswordChangeRequiredError < NotAuthorizedError; end
|
131
|
+
class ReadOnlySessionError < NotAuthorizedError; end
|
132
|
+
class ReadPermissionRequiredError < NotAuthorizedError; end
|
133
|
+
class ReauthenticationFailedError < NotAuthorizedError; end
|
134
|
+
class ReauthenticationFailedFinalError < NotAuthorizedError; end
|
135
|
+
class ReauthenticationNeededActionError < NotAuthorizedError; end
|
136
|
+
class SelfManagedRequiredError < NotAuthorizedError; end
|
137
|
+
class UnauthorizedError < NotAuthorizedError; end
|
138
|
+
class UserIdWithoutSiteAdminError < NotAuthorizedError; end
|
139
|
+
class WritePermissionRequiredError < NotAuthorizedError; end
|
140
|
+
class ZipDownloadIpMismatchError < NotAuthorizedError; end
|
141
|
+
|
142
|
+
class NotFoundError < APIError; end
|
143
|
+
class ApiKeyNotFoundError < NotFoundError; end
|
144
|
+
class BundlePathNotFoundError < NotFoundError; end
|
145
|
+
class CodeNotFoundError < NotFoundError; end
|
146
|
+
class FileNotFoundError < NotFoundError; end
|
147
|
+
class FileUploadNotFoundError < NotFoundError; end
|
148
|
+
class FolderNotFoundError < NotFoundError; end
|
149
|
+
class GroupNotFoundError < NotFoundError; end
|
150
|
+
class HistoryExportNotReadyError < NotFoundError; end
|
151
|
+
class InboxNotFoundError < NotFoundError; end
|
152
|
+
class NestedNotFoundError < NotFoundError; end
|
153
|
+
class PlanNotFoundError < NotFoundError; end
|
154
|
+
class SiteNotFoundError < NotFoundError; end
|
155
|
+
class UserNotFoundError < NotFoundError; end
|
156
|
+
|
157
|
+
class ProcessingFailureError < APIError; end
|
158
|
+
class BundleRegistrationCodeFailedError < ProcessingFailureError; end
|
159
|
+
class DestinationExistsError < ProcessingFailureError; end
|
160
|
+
class DestinationParentConflictError < ProcessingFailureError; end
|
161
|
+
class DestinationParentDoesNotExistError < ProcessingFailureError; end
|
162
|
+
class FailedToChangePasswordError < ProcessingFailureError; end
|
163
|
+
class FileNotUploadedError < ProcessingFailureError; end
|
164
|
+
class FolderNotEmptyError < ProcessingFailureError; end
|
165
|
+
class HistoryExportFailureError < ProcessingFailureError; end
|
166
|
+
class HistoryUnavailableError < ProcessingFailureError; end
|
167
|
+
class InboxRegistrationCodeFailedError < ProcessingFailureError; end
|
168
|
+
class InvalidBundleCodeError < ProcessingFailureError; end
|
169
|
+
class InvalidOrExpiredCodeError < ProcessingFailureError; end
|
170
|
+
class ModelSaveErrorError < ProcessingFailureError; end
|
171
|
+
class RemoteServerErrorError < ProcessingFailureError; end
|
172
|
+
class TwoFactorAuthenticationCodeAlreadySentError < ProcessingFailureError; end
|
173
|
+
class UnprocessableEntityError < ProcessingFailureError; end
|
174
|
+
|
175
|
+
class RateLimitedError < APIError; end
|
176
|
+
class ReauthenticationRateLimitedError < RateLimitedError; end
|
177
|
+
class TooManyRequestsError < RateLimitedError; end
|
178
|
+
|
179
|
+
class SiteConfigurationError < APIError; end
|
180
|
+
class AccountAlreadyExistsError < SiteConfigurationError; end
|
181
|
+
class NoAccountForSiteError < SiteConfigurationError; end
|
182
|
+
class SiteAdminRequiredError < SiteConfigurationError; end
|
183
|
+
class SiteWasRemovedError < SiteConfigurationError; end
|
184
|
+
class TrialExpiredError < SiteConfigurationError; end
|
185
|
+
class TrialLockedError < SiteConfigurationError; end
|
186
|
+
class UserRequestsEnabledRequiredError < SiteConfigurationError; end
|
41
187
|
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.0.
|
4
|
+
version: 1.0.135
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|