files.com 1.0.145 → 1.0.150
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/docs/usage_snapshot.md +2 -0
- data/docs/webhook_test.md +50 -0
- data/lib/files.com.rb +1 -0
- data/lib/files.com/errors.rb +16 -0
- data/lib/files.com/models/usage_snapshot.rb +5 -0
- data/lib/files.com/models/webhook_test.rb +140 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 940c377b195416e86507580f31199480f7c5c6584376b98aeefc79db3b3701fb
|
4
|
+
data.tar.gz: 11dd4c65a619afa1f88117aa742a5485fd458f296d735efd3566c225d757ce2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2194b7f45aeed071a28b319fc48180a38d232d6423f9d9c57af01627049e8559aa0a8ee0c0e0f4a36e7e947236bbc9e93b72329c0a3c57c1ddab1be21132c93b
|
7
|
+
data.tar.gz: a349c39f0d7c92cee235ebd0a3843e72c970017b4bdcf5d585d0d85160335f5b0cbcf08c932a4d96d607df30e129f85697e867234ff11025a62e3600577acade
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.150
|
data/docs/usage_snapshot.md
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
"start_at": "2000-01-01T01:00:00Z",
|
9
9
|
"end_at": "2000-01-01T01:00:00Z",
|
10
10
|
"created_at": "2000-01-01T01:00:00Z",
|
11
|
+
"high_water_user_count": 1.0,
|
11
12
|
"current_storage": 1.0,
|
12
13
|
"high_water_storage": 1.0,
|
13
14
|
"total_downloads": 1,
|
@@ -24,6 +25,7 @@
|
|
24
25
|
* `start_at` (date-time): Site usage report start date/time
|
25
26
|
* `end_at` (date-time): Site usage report end date/time
|
26
27
|
* `created_at` (date-time): Site usage report created at date/time
|
28
|
+
* `high_water_user_count` (double): Site usage report highest usage in time period
|
27
29
|
* `current_storage` (double): Current site usage as of report
|
28
30
|
* `high_water_storage` (double): Site usage report highest usage in time period
|
29
31
|
* `total_downloads` (int64): Number of downloads in report time period
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# WebhookTest
|
2
|
+
|
3
|
+
## Example WebhookTest Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"code": 200,
|
8
|
+
"message": "",
|
9
|
+
"status": "",
|
10
|
+
"data": "",
|
11
|
+
"success": true
|
12
|
+
}
|
13
|
+
```
|
14
|
+
|
15
|
+
* `code` (int64): Status HTTP code
|
16
|
+
* `message` (string): Error message
|
17
|
+
* `status` (string): Status message
|
18
|
+
* `data`: Additional data
|
19
|
+
* `success` (boolean): The success status of the webhook test
|
20
|
+
* `url` (string): URL for testing the webhook.
|
21
|
+
* `method` (string): HTTP method(GET or POST).
|
22
|
+
* `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data).
|
23
|
+
* `headers` (object): Additional request headers.
|
24
|
+
* `body` (object): Additional body parameters.
|
25
|
+
* `action` (string): action for test body
|
26
|
+
|
27
|
+
|
28
|
+
---
|
29
|
+
|
30
|
+
## Create Webhook Test
|
31
|
+
|
32
|
+
```
|
33
|
+
Files::WebhookTest.create(
|
34
|
+
url: "https://www.site.com/...",
|
35
|
+
method: "GET",
|
36
|
+
encoding: "RAW",
|
37
|
+
headers: "x-test-header => testvalue",
|
38
|
+
body: "test-param => testvalue",
|
39
|
+
action: "test"
|
40
|
+
)
|
41
|
+
```
|
42
|
+
|
43
|
+
### Parameters
|
44
|
+
|
45
|
+
* `url` (string): Required - URL for testing the webhook.
|
46
|
+
* `method` (string): HTTP method(GET or POST).
|
47
|
+
* `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data).
|
48
|
+
* `headers` (object): Additional request headers.
|
49
|
+
* `body` (object): Additional body parameters.
|
50
|
+
* `action` (string): action for test body
|
data/lib/files.com.rb
CHANGED
@@ -90,6 +90,7 @@ require "files.com/models/usage_snapshot"
|
|
90
90
|
require "files.com/models/user"
|
91
91
|
require "files.com/models/user_cipher_use"
|
92
92
|
require "files.com/models/user_request"
|
93
|
+
require "files.com/models/webhook_test"
|
93
94
|
|
94
95
|
require "files.com/models/dir"
|
95
96
|
require "files.com/models/file_utils"
|
data/lib/files.com/errors.rb
CHANGED
@@ -64,7 +64,9 @@ module Files
|
|
64
64
|
class DatetimeParseError < BadRequestError; end
|
65
65
|
class DestinationSameError < BadRequestError; end
|
66
66
|
class FolderMustNotBeAFileError < BadRequestError; end
|
67
|
+
class InvalidBodyError < BadRequestError; end
|
67
68
|
class InvalidCursorError < BadRequestError; end
|
69
|
+
class InvalidEtagsError < BadRequestError; end
|
68
70
|
class InvalidFilterCombinationError < BadRequestError; end
|
69
71
|
class InvalidFilterFieldError < BadRequestError; end
|
70
72
|
class InvalidInputEncodingError < BadRequestError; end
|
@@ -72,8 +74,12 @@ module Files
|
|
72
74
|
class InvalidOauthProviderError < BadRequestError; end
|
73
75
|
class InvalidReturnToUrlError < BadRequestError; end
|
74
76
|
class InvalidUploadOffsetError < BadRequestError; end
|
77
|
+
class InvalidUploadPartGapError < BadRequestError; end
|
78
|
+
class InvalidUploadPartSizeError < BadRequestError; end
|
79
|
+
class MethodNotAllowedError < BadRequestError; end
|
75
80
|
class NoValidInputParamsError < BadRequestError; end
|
76
81
|
class OperationOnNonScimResourceError < BadRequestError; end
|
82
|
+
class PartNumberTooLargeError < BadRequestError; end
|
77
83
|
class ReauthenticationNeededFieldsError < BadRequestError; end
|
78
84
|
class RequestParamPathCannotHaveTrailingWhitespaceError < BadRequestError; end
|
79
85
|
class RequestParamsContainInvalidCharacterError < BadRequestError; end
|
@@ -106,6 +112,7 @@ module Files
|
|
106
112
|
class ApiKeyOnlyForDesktopAppError < NotAuthorizedError; end
|
107
113
|
class ApiKeyOnlyForOfficeIntegrationError < NotAuthorizedError; end
|
108
114
|
class BillingPermissionRequiredError < NotAuthorizedError; end
|
115
|
+
class BundleMaximumUsesReachedError < NotAuthorizedError; end
|
109
116
|
class CannotLoginWhileUsingKeyError < NotAuthorizedError; end
|
110
117
|
class CantActForOtherUserError < NotAuthorizedError; end
|
111
118
|
class ContactAdminForPasswordChangeHelpError < NotAuthorizedError; end
|
@@ -147,23 +154,32 @@ module Files
|
|
147
154
|
|
148
155
|
class ProcessingFailureError < APIError; end
|
149
156
|
class DestinationExistsError < ProcessingFailureError; end
|
157
|
+
class DestinationFolderLimitedError < ProcessingFailureError; end
|
150
158
|
class DestinationParentConflictError < ProcessingFailureError; end
|
151
159
|
class DestinationParentDoesNotExistError < ProcessingFailureError; end
|
160
|
+
class ExpiredPublicKeyError < ProcessingFailureError; end
|
152
161
|
class FailedToChangePasswordError < ProcessingFailureError; end
|
153
162
|
class FileLockedError < ProcessingFailureError; end
|
154
163
|
class FileNotUploadedError < ProcessingFailureError; end
|
155
164
|
class FilePendingProcessingError < ProcessingFailureError; end
|
165
|
+
class FileUploadedToWrongRegionError < ProcessingFailureError; end
|
156
166
|
class FolderLockedError < ProcessingFailureError; end
|
157
167
|
class FolderNotEmptyError < ProcessingFailureError; end
|
158
168
|
class HistoryExportFailureError < ProcessingFailureError; end
|
159
169
|
class HistoryExportNotReadyError < ProcessingFailureError; end
|
160
170
|
class HistoryUnavailableError < ProcessingFailureError; end
|
161
171
|
class InvalidBundleCodeError < ProcessingFailureError; end
|
172
|
+
class InvalidFileTypeError < ProcessingFailureError; end
|
173
|
+
class InvalidFilenameError < ProcessingFailureError; end
|
174
|
+
class InvalidRangeError < ProcessingFailureError; end
|
162
175
|
class ModelSaveErrorError < ProcessingFailureError; end
|
176
|
+
class MultipartUploadsRequiredForRemotesError < ProcessingFailureError; end
|
177
|
+
class MultipleProcessingErrorsError < ProcessingFailureError; end
|
163
178
|
class RemoteServerErrorError < ProcessingFailureError; end
|
164
179
|
class ResourceLockedError < ProcessingFailureError; end
|
165
180
|
class SubfolderLockedError < ProcessingFailureError; end
|
166
181
|
class TwoFactorAuthenticationCodeAlreadySentError < ProcessingFailureError; end
|
182
|
+
class UpdatesNotAllowedForRemotesError < ProcessingFailureError; end
|
167
183
|
|
168
184
|
class RateLimitedError < APIError; end
|
169
185
|
class ReauthenticationRateLimitedError < RateLimitedError; end
|
@@ -29,6 +29,11 @@ module Files
|
|
29
29
|
@attributes[:created_at]
|
30
30
|
end
|
31
31
|
|
32
|
+
# double - Site usage report highest usage in time period
|
33
|
+
def high_water_user_count
|
34
|
+
@attributes[:high_water_user_count]
|
35
|
+
end
|
36
|
+
|
32
37
|
# double - Current site usage as of report
|
33
38
|
def current_storage
|
34
39
|
@attributes[:current_storage]
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class WebhookTest
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# int64 - Status HTTP code
|
13
|
+
def code
|
14
|
+
@attributes[:code]
|
15
|
+
end
|
16
|
+
|
17
|
+
def code=(value)
|
18
|
+
@attributes[:code] = value
|
19
|
+
end
|
20
|
+
|
21
|
+
# string - Error message
|
22
|
+
def message
|
23
|
+
@attributes[:message]
|
24
|
+
end
|
25
|
+
|
26
|
+
def message=(value)
|
27
|
+
@attributes[:message] = value
|
28
|
+
end
|
29
|
+
|
30
|
+
# string - Status message
|
31
|
+
def status
|
32
|
+
@attributes[:status]
|
33
|
+
end
|
34
|
+
|
35
|
+
def status=(value)
|
36
|
+
@attributes[:status] = value
|
37
|
+
end
|
38
|
+
|
39
|
+
# Additional data
|
40
|
+
def data
|
41
|
+
@attributes[:data]
|
42
|
+
end
|
43
|
+
|
44
|
+
def data=(value)
|
45
|
+
@attributes[:data] = value
|
46
|
+
end
|
47
|
+
|
48
|
+
# boolean - The success status of the webhook test
|
49
|
+
def success
|
50
|
+
@attributes[:success]
|
51
|
+
end
|
52
|
+
|
53
|
+
def success=(value)
|
54
|
+
@attributes[:success] = value
|
55
|
+
end
|
56
|
+
|
57
|
+
# string - URL for testing the webhook.
|
58
|
+
def url
|
59
|
+
@attributes[:url]
|
60
|
+
end
|
61
|
+
|
62
|
+
def url=(value)
|
63
|
+
@attributes[:url] = value
|
64
|
+
end
|
65
|
+
|
66
|
+
# string - HTTP method(GET or POST).
|
67
|
+
def method
|
68
|
+
@attributes[:method]
|
69
|
+
end
|
70
|
+
|
71
|
+
def method=(value)
|
72
|
+
@attributes[:method] = value
|
73
|
+
end
|
74
|
+
|
75
|
+
# string - HTTP encoding method. Can be JSON, XML, or RAW (form data).
|
76
|
+
def encoding
|
77
|
+
@attributes[:encoding]
|
78
|
+
end
|
79
|
+
|
80
|
+
def encoding=(value)
|
81
|
+
@attributes[:encoding] = value
|
82
|
+
end
|
83
|
+
|
84
|
+
# object - Additional request headers.
|
85
|
+
def headers
|
86
|
+
@attributes[:headers]
|
87
|
+
end
|
88
|
+
|
89
|
+
def headers=(value)
|
90
|
+
@attributes[:headers] = value
|
91
|
+
end
|
92
|
+
|
93
|
+
# object - Additional body parameters.
|
94
|
+
def body
|
95
|
+
@attributes[:body]
|
96
|
+
end
|
97
|
+
|
98
|
+
def body=(value)
|
99
|
+
@attributes[:body] = value
|
100
|
+
end
|
101
|
+
|
102
|
+
# string - action for test body
|
103
|
+
def action
|
104
|
+
@attributes[:action]
|
105
|
+
end
|
106
|
+
|
107
|
+
def action=(value)
|
108
|
+
@attributes[:action] = value
|
109
|
+
end
|
110
|
+
|
111
|
+
def save
|
112
|
+
if @attributes[:id]
|
113
|
+
raise NotImplementedError.new("The WebhookTest object doesn't support updates.")
|
114
|
+
else
|
115
|
+
new_obj = WebhookTest.create(@attributes, @options)
|
116
|
+
@attributes = new_obj.attributes
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# Parameters:
|
121
|
+
# url (required) - string - URL for testing the webhook.
|
122
|
+
# method - string - HTTP method(GET or POST).
|
123
|
+
# encoding - string - HTTP encoding method. Can be JSON, XML, or RAW (form data).
|
124
|
+
# headers - object - Additional request headers.
|
125
|
+
# body - object - Additional body parameters.
|
126
|
+
# action - string - action for test body
|
127
|
+
def self.create(params = {}, options = {})
|
128
|
+
raise InvalidParameterError.new("Bad parameter: url must be an String") if params.dig(:url) and !params.dig(:url).is_a?(String)
|
129
|
+
raise InvalidParameterError.new("Bad parameter: method must be an String") if params.dig(:method) and !params.dig(:method).is_a?(String)
|
130
|
+
raise InvalidParameterError.new("Bad parameter: encoding must be an String") if params.dig(:encoding) and !params.dig(:encoding).is_a?(String)
|
131
|
+
raise InvalidParameterError.new("Bad parameter: headers must be an Hash") if params.dig(:headers) and !params.dig(:headers).is_a?(Hash)
|
132
|
+
raise InvalidParameterError.new("Bad parameter: body must be an Hash") if params.dig(:body) and !params.dig(:body).is_a?(Hash)
|
133
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
134
|
+
raise MissingParameterError.new("Parameter missing: url") unless params.dig(:url)
|
135
|
+
|
136
|
+
response, options = Api.send_request("/webhook_tests", :post, params, options)
|
137
|
+
WebhookTest.new(response.data, options)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
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.150
|
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-03-
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- docs/user.md
|
151
151
|
- docs/user_cipher_use.md
|
152
152
|
- docs/user_request.md
|
153
|
+
- docs/webhook_test.md
|
153
154
|
- files.com.gemspec
|
154
155
|
- lib/files.com.rb
|
155
156
|
- lib/files.com/api.rb
|
@@ -221,6 +222,7 @@ files:
|
|
221
222
|
- lib/files.com/models/user.rb
|
222
223
|
- lib/files.com/models/user_cipher_use.rb
|
223
224
|
- lib/files.com/models/user_request.rb
|
225
|
+
- lib/files.com/models/webhook_test.rb
|
224
226
|
- lib/files.com/response.rb
|
225
227
|
- lib/files.com/sizable_io.rb
|
226
228
|
- lib/files.com/system_profiler.rb
|