files.com 1.0.147 → 1.0.152
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/api_key.md +18 -2
- data/docs/bundle.md +4 -1
- data/docs/form_field_set.md +25 -1
- data/docs/group_user.md +19 -0
- data/docs/session.md +9 -1
- data/docs/site.md +18 -2
- 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/models/api_key.rb +12 -0
- data/lib/files.com/models/form_field_set.rb +36 -0
- data/lib/files.com/models/group_user.rb +20 -1
- data/lib/files.com/models/session.rb +6 -0
- data/lib/files.com/models/site.rb +12 -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: 80890845ebda55975f177b54c85c82f1ed106086e750eded6907488daf879cce
|
|
4
|
+
data.tar.gz: bf99ca9501f9813393e23dba23a54acdedaf70528f6d24bc3fa6a94adcda7757
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9cc02ddb3685c4ccb7c980ba891f171c354dfd0f122fd2779d02d7259bd7a96b661a84f01e06e617d8637475c4daa35b4513795a58b0f9a269f3f2f782fbd6a3
|
|
7
|
+
data.tar.gz: 5c499037e94937095e8a52b0811398a341b81dd8f3cbd33ed7345b30028403060043faea5692be969388d1923a3c8ff1d34f1ff03c122684fcebe5cfb0b3e8cc
|
data/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.152
|
data/docs/api_key.md
CHANGED
|
@@ -61,9 +61,17 @@ Files::ApiKey.list(
|
|
|
61
61
|
## Show information about current API key. (Requires current API connection to be using an API key.)
|
|
62
62
|
|
|
63
63
|
```
|
|
64
|
-
Files::ApiKey.find_current
|
|
64
|
+
Files::ApiKey.find_current(
|
|
65
|
+
format: "",
|
|
66
|
+
api_key: ""
|
|
67
|
+
)
|
|
65
68
|
```
|
|
66
69
|
|
|
70
|
+
### Parameters
|
|
71
|
+
|
|
72
|
+
* `format` (string):
|
|
73
|
+
* `api_key` (object):
|
|
74
|
+
|
|
67
75
|
|
|
68
76
|
---
|
|
69
77
|
|
|
@@ -145,9 +153,17 @@ Files::ApiKey.update(id,
|
|
|
145
153
|
## Delete current API key. (Requires current API connection to be using an API key.)
|
|
146
154
|
|
|
147
155
|
```
|
|
148
|
-
Files::ApiKey.delete_current
|
|
156
|
+
Files::ApiKey.delete_current(
|
|
157
|
+
format: "",
|
|
158
|
+
api_key: ""
|
|
159
|
+
)
|
|
149
160
|
```
|
|
150
161
|
|
|
162
|
+
### Parameters
|
|
163
|
+
|
|
164
|
+
* `format` (string):
|
|
165
|
+
* `api_key` (object):
|
|
166
|
+
|
|
151
167
|
|
|
152
168
|
---
|
|
153
169
|
|
data/docs/bundle.md
CHANGED
data/docs/form_field_set.md
CHANGED
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
"default_option": "red",
|
|
28
28
|
"form_field_set_id": 1
|
|
29
29
|
}
|
|
30
|
-
]
|
|
30
|
+
],
|
|
31
|
+
"skip_name": true,
|
|
32
|
+
"skip_email": true,
|
|
33
|
+
"skip_company": true
|
|
31
34
|
}
|
|
32
35
|
```
|
|
33
36
|
|
|
@@ -35,6 +38,9 @@
|
|
|
35
38
|
* `title` (string): Title to be displayed
|
|
36
39
|
* `form_layout` (int64): Layout of the form
|
|
37
40
|
* `form_fields` (array): Associated form fields
|
|
41
|
+
* `skip_name` (boolean): Any associated InboxRegistrations or BundleRegistrations can be saved without providing name
|
|
42
|
+
* `skip_email` (boolean): Any associated InboxRegistrations or BundleRegistrations can be saved without providing email
|
|
43
|
+
* `skip_company` (boolean): Any associated InboxRegistrations or BundleRegistrations can be saved without providing company
|
|
38
44
|
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
39
45
|
|
|
40
46
|
|
|
@@ -77,6 +83,9 @@ Files::FormFieldSet.find(id)
|
|
|
77
83
|
Files::FormFieldSet.create(
|
|
78
84
|
user_id: 1,
|
|
79
85
|
title: "Sample Form Title",
|
|
86
|
+
skip_email: true,
|
|
87
|
+
skip_name: true,
|
|
88
|
+
skip_company: true,
|
|
80
89
|
form_fields: [{"label":"Sample Label","required":true,"help_text":"Help Text","field_type":"text","options_for_select":["red","green","blue"],"default_option":"red","form_field_set_id":1}]
|
|
81
90
|
)
|
|
82
91
|
```
|
|
@@ -85,6 +94,9 @@ Files::FormFieldSet.create(
|
|
|
85
94
|
|
|
86
95
|
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
87
96
|
* `title` (string): Title to be displayed
|
|
97
|
+
* `skip_email` (boolean): Skip validating form email
|
|
98
|
+
* `skip_name` (boolean): Skip validating form name
|
|
99
|
+
* `skip_company` (boolean): Skip validating company
|
|
88
100
|
* `form_fields` (array(object)):
|
|
89
101
|
|
|
90
102
|
|
|
@@ -95,6 +107,9 @@ Files::FormFieldSet.create(
|
|
|
95
107
|
```
|
|
96
108
|
Files::FormFieldSet.update(id,
|
|
97
109
|
title: "Sample Form Title",
|
|
110
|
+
skip_email: true,
|
|
111
|
+
skip_name: true,
|
|
112
|
+
skip_company: true,
|
|
98
113
|
form_fields: [{"id":1,"label":"Sample Label","required":true,"help_text":"Help Text","field_type":"text","options_for_select":["red","green","blue"],"default_option":"red","form_field_set_id":1}]
|
|
99
114
|
)
|
|
100
115
|
```
|
|
@@ -103,6 +118,9 @@ Files::FormFieldSet.update(id,
|
|
|
103
118
|
|
|
104
119
|
* `id` (int64): Required - Form Field Set ID.
|
|
105
120
|
* `title` (string): Title to be displayed
|
|
121
|
+
* `skip_email` (boolean): Skip validating form email
|
|
122
|
+
* `skip_name` (boolean): Skip validating form name
|
|
123
|
+
* `skip_company` (boolean): Skip validating company
|
|
106
124
|
* `form_fields` (array(object)):
|
|
107
125
|
|
|
108
126
|
|
|
@@ -128,6 +146,9 @@ form_field_set = Files::FormFieldSet.list_for(path).first
|
|
|
128
146
|
|
|
129
147
|
form_field_set.update(
|
|
130
148
|
title: "Sample Form Title",
|
|
149
|
+
skip_email: true,
|
|
150
|
+
skip_name: true,
|
|
151
|
+
skip_company: true,
|
|
131
152
|
form_fields: [{"id":1,"label":"Sample Label","required":true,"help_text":"Help Text","field_type":"text","options_for_select":["red","green","blue"],"default_option":"red","form_field_set_id":1}]
|
|
132
153
|
)
|
|
133
154
|
```
|
|
@@ -136,6 +157,9 @@ form_field_set.update(
|
|
|
136
157
|
|
|
137
158
|
* `id` (int64): Required - Form Field Set ID.
|
|
138
159
|
* `title` (string): Title to be displayed
|
|
160
|
+
* `skip_email` (boolean): Skip validating form email
|
|
161
|
+
* `skip_name` (boolean): Skip validating form name
|
|
162
|
+
* `skip_company` (boolean): Skip validating company
|
|
139
163
|
* `form_fields` (array(object)):
|
|
140
164
|
|
|
141
165
|
|
data/docs/group_user.md
CHANGED
|
@@ -42,6 +42,25 @@ Files::GroupUser.list(
|
|
|
42
42
|
* `group_id` (int64): Group ID. If provided, will return group_users of this group.
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Create Group User
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Files::GroupUser.create(
|
|
51
|
+
group_id: 1,
|
|
52
|
+
user_id: 1,
|
|
53
|
+
admin: true
|
|
54
|
+
)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Parameters
|
|
58
|
+
|
|
59
|
+
* `group_id` (int64): Required - Group ID to add user to.
|
|
60
|
+
* `user_id` (int64): Required - User ID to add to group.
|
|
61
|
+
* `admin` (boolean): Is the user a group administrator?
|
|
62
|
+
|
|
63
|
+
|
|
45
64
|
---
|
|
46
65
|
|
|
47
66
|
## Update Group User
|
data/docs/session.md
CHANGED
data/docs/site.md
CHANGED
|
@@ -324,18 +324,34 @@
|
|
|
324
324
|
## Show site settings
|
|
325
325
|
|
|
326
326
|
```
|
|
327
|
-
Files::Site.get
|
|
327
|
+
Files::Site.get(
|
|
328
|
+
format: "",
|
|
329
|
+
site: ""
|
|
330
|
+
)
|
|
328
331
|
```
|
|
329
332
|
|
|
333
|
+
### Parameters
|
|
334
|
+
|
|
335
|
+
* `format` (string):
|
|
336
|
+
* `site` (object):
|
|
337
|
+
|
|
330
338
|
|
|
331
339
|
---
|
|
332
340
|
|
|
333
341
|
## Get the most recent usage snapshot (usage data for billing purposes) for a Site
|
|
334
342
|
|
|
335
343
|
```
|
|
336
|
-
Files::Site.get_usage
|
|
344
|
+
Files::Site.get_usage(
|
|
345
|
+
format: "",
|
|
346
|
+
site: ""
|
|
347
|
+
)
|
|
337
348
|
```
|
|
338
349
|
|
|
350
|
+
### Parameters
|
|
351
|
+
|
|
352
|
+
* `format` (string):
|
|
353
|
+
* `site` (object):
|
|
354
|
+
|
|
339
355
|
|
|
340
356
|
---
|
|
341
357
|
|
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"
|
|
@@ -176,7 +176,13 @@ module Files
|
|
|
176
176
|
list(params, options)
|
|
177
177
|
end
|
|
178
178
|
|
|
179
|
+
# Parameters:
|
|
180
|
+
# format - string
|
|
181
|
+
# api_key - object
|
|
179
182
|
def self.find_current(params = {}, options = {})
|
|
183
|
+
raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
|
|
184
|
+
raise InvalidParameterError.new("Bad parameter: api_key must be an Hash") if params.dig(:api_key) and !params.dig(:api_key).is_a?(Hash)
|
|
185
|
+
|
|
180
186
|
response, options = Api.send_request("/api_key", :get, params, options)
|
|
181
187
|
ApiKey.new(response.data, options)
|
|
182
188
|
end
|
|
@@ -244,7 +250,13 @@ module Files
|
|
|
244
250
|
ApiKey.new(response.data, options)
|
|
245
251
|
end
|
|
246
252
|
|
|
253
|
+
# Parameters:
|
|
254
|
+
# format - string
|
|
255
|
+
# api_key - object
|
|
247
256
|
def self.delete_current(params = {}, options = {})
|
|
257
|
+
raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
|
|
258
|
+
raise InvalidParameterError.new("Bad parameter: api_key must be an Hash") if params.dig(:api_key) and !params.dig(:api_key).is_a?(Hash)
|
|
259
|
+
|
|
248
260
|
response, _options = Api.send_request("/api_key", :delete, params, options)
|
|
249
261
|
response.data
|
|
250
262
|
end
|
|
@@ -45,6 +45,33 @@ module Files
|
|
|
45
45
|
@attributes[:form_fields] = value
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
# boolean - Any associated InboxRegistrations or BundleRegistrations can be saved without providing name
|
|
49
|
+
def skip_name
|
|
50
|
+
@attributes[:skip_name]
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def skip_name=(value)
|
|
54
|
+
@attributes[:skip_name] = value
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# boolean - Any associated InboxRegistrations or BundleRegistrations can be saved without providing email
|
|
58
|
+
def skip_email
|
|
59
|
+
@attributes[:skip_email]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def skip_email=(value)
|
|
63
|
+
@attributes[:skip_email] = value
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# boolean - Any associated InboxRegistrations or BundleRegistrations can be saved without providing company
|
|
67
|
+
def skip_company
|
|
68
|
+
@attributes[:skip_company]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def skip_company=(value)
|
|
72
|
+
@attributes[:skip_company] = value
|
|
73
|
+
end
|
|
74
|
+
|
|
48
75
|
# int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
49
76
|
def user_id
|
|
50
77
|
@attributes[:user_id]
|
|
@@ -56,6 +83,9 @@ module Files
|
|
|
56
83
|
|
|
57
84
|
# Parameters:
|
|
58
85
|
# title - string - Title to be displayed
|
|
86
|
+
# skip_email - boolean - Skip validating form email
|
|
87
|
+
# skip_name - boolean - Skip validating form name
|
|
88
|
+
# skip_company - boolean - Skip validating company
|
|
59
89
|
# form_fields - array(object)
|
|
60
90
|
def update(params = {})
|
|
61
91
|
params ||= {}
|
|
@@ -129,6 +159,9 @@ module Files
|
|
|
129
159
|
# Parameters:
|
|
130
160
|
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
131
161
|
# title - string - Title to be displayed
|
|
162
|
+
# skip_email - boolean - Skip validating form email
|
|
163
|
+
# skip_name - boolean - Skip validating form name
|
|
164
|
+
# skip_company - boolean - Skip validating company
|
|
132
165
|
# form_fields - array(object)
|
|
133
166
|
def self.create(params = {}, options = {})
|
|
134
167
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
|
@@ -141,6 +174,9 @@ module Files
|
|
|
141
174
|
|
|
142
175
|
# Parameters:
|
|
143
176
|
# title - string - Title to be displayed
|
|
177
|
+
# skip_email - boolean - Skip validating form email
|
|
178
|
+
# skip_name - boolean - Skip validating form name
|
|
179
|
+
# skip_company - boolean - Skip validating company
|
|
144
180
|
# form_fields - array(object)
|
|
145
181
|
def self.update(id, params = {}, options = {})
|
|
146
182
|
params ||= {}
|
|
@@ -103,7 +103,12 @@ module Files
|
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
def save
|
|
106
|
-
|
|
106
|
+
if @attributes[:id]
|
|
107
|
+
update(@attributes)
|
|
108
|
+
else
|
|
109
|
+
new_obj = GroupUser.create(@attributes, @options)
|
|
110
|
+
@attributes = new_obj.attributes
|
|
111
|
+
end
|
|
107
112
|
end
|
|
108
113
|
|
|
109
114
|
# Parameters:
|
|
@@ -126,6 +131,20 @@ module Files
|
|
|
126
131
|
list(params, options)
|
|
127
132
|
end
|
|
128
133
|
|
|
134
|
+
# Parameters:
|
|
135
|
+
# group_id (required) - int64 - Group ID to add user to.
|
|
136
|
+
# user_id (required) - int64 - User ID to add to group.
|
|
137
|
+
# admin - boolean - Is the user a group administrator?
|
|
138
|
+
def self.create(params = {}, options = {})
|
|
139
|
+
raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
|
|
140
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
|
141
|
+
raise MissingParameterError.new("Parameter missing: group_id") unless params.dig(:group_id)
|
|
142
|
+
raise MissingParameterError.new("Parameter missing: user_id") unless params.dig(:user_id)
|
|
143
|
+
|
|
144
|
+
response, options = Api.send_request("/group_users", :post, params, options)
|
|
145
|
+
GroupUser.new(response.data, options)
|
|
146
|
+
end
|
|
147
|
+
|
|
129
148
|
# Parameters:
|
|
130
149
|
# group_id (required) - int64 - Group ID to add user to.
|
|
131
150
|
# user_id (required) - int64 - User ID to add to group.
|
|
@@ -235,7 +235,13 @@ module Files
|
|
|
235
235
|
Session.new(response.data, options)
|
|
236
236
|
end
|
|
237
237
|
|
|
238
|
+
# Parameters:
|
|
239
|
+
# format - string
|
|
240
|
+
# session - object
|
|
238
241
|
def self.delete(params = {}, options = {})
|
|
242
|
+
raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
|
|
243
|
+
raise InvalidParameterError.new("Bad parameter: session must be an Hash") if params.dig(:session) and !params.dig(:session).is_a?(Hash)
|
|
244
|
+
|
|
239
245
|
response, _options = Api.send_request("/sessions", :delete, params, options)
|
|
240
246
|
response.data
|
|
241
247
|
end
|
|
@@ -574,12 +574,24 @@ module Files
|
|
|
574
574
|
@attributes[:disable_users_from_inactivity_period_days]
|
|
575
575
|
end
|
|
576
576
|
|
|
577
|
+
# Parameters:
|
|
578
|
+
# format - string
|
|
579
|
+
# site - object
|
|
577
580
|
def self.get(params = {}, options = {})
|
|
581
|
+
raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
|
|
582
|
+
raise InvalidParameterError.new("Bad parameter: site must be an Hash") if params.dig(:site) and !params.dig(:site).is_a?(Hash)
|
|
583
|
+
|
|
578
584
|
response, options = Api.send_request("/site", :get, params, options)
|
|
579
585
|
Site.new(response.data, options)
|
|
580
586
|
end
|
|
581
587
|
|
|
588
|
+
# Parameters:
|
|
589
|
+
# format - string
|
|
590
|
+
# site - object
|
|
582
591
|
def self.get_usage(params = {}, options = {})
|
|
592
|
+
raise InvalidParameterError.new("Bad parameter: format must be an String") if params.dig(:format) and !params.dig(:format).is_a?(String)
|
|
593
|
+
raise InvalidParameterError.new("Bad parameter: site must be an Hash") if params.dig(:site) and !params.dig(:site).is_a?(Hash)
|
|
594
|
+
|
|
583
595
|
response, options = Api.send_request("/site/usage", :get, params, options)
|
|
584
596
|
UsageSnapshot.new(response.data, options)
|
|
585
597
|
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.152
|
|
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-26 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
|