files.com 1.0.94 → 1.0.99
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/docs/account_line_item.md +2 -2
- data/docs/action.md +1 -1
- data/docs/bundle.md +25 -17
- data/docs/bundle_recipient.md +41 -0
- data/docs/file_part_upload.md +1 -1
- data/docs/group.md +1 -1
- data/docs/history.md +1 -1
- data/docs/invoice.md +2 -2
- data/docs/invoice_line_item.md +1 -1
- data/docs/lock.md +1 -1
- data/docs/notification.md +2 -4
- data/docs/payment.md +2 -2
- data/docs/payment_line_item.md +1 -1
- data/docs/settings_change.md +41 -0
- data/docs/site.md +1 -1
- data/docs/usage_snapshot.md +5 -5
- data/lib/files.com.rb +2 -0
- data/lib/files.com/api_client.rb +1 -1
- data/lib/files.com/models/bundle.rb +28 -16
- data/lib/files.com/models/bundle_recipient.rb +61 -0
- data/lib/files.com/models/group.rb +1 -1
- data/lib/files.com/models/settings_change.rb +61 -0
- data/spec/models/file_spec.rb +2 -2
- data/test.sh +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d61d5f715d4e894f0102913b5180614d20c07774fd57df8cb2d93cfa4f83ad9
|
4
|
+
data.tar.gz: ebde8436aa8818e3332660352998e4bc1ef57564a523a4a1614e8e085b275ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 175cb4d587cb172d326a5bd3ea213e042dcd023d8816cb91da5f23510abffcd8de34083484e577d6cdef12d6b15b4f935d16c1394a80e76b7411f73ec8cc3426
|
7
|
+
data.tar.gz: fe5baf51329e93cd9a6edf8e9396f764b2fb90df7781e09326441f67f3f3e2276b6aa0e4ec3ec16a17522c56d0cd4b996c4f71860b8b03e7c73c5e6f840c55e5
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.99
|
data/docs/account_line_item.md
CHANGED
data/docs/action.md
CHANGED
data/docs/bundle.md
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
"description": "The public description of the bundle.",
|
10
10
|
"password_protected": true,
|
11
11
|
"require_registration": true,
|
12
|
+
"require_share_recipient": true,
|
12
13
|
"clickwrap_body": "[Legal text]",
|
13
14
|
"id": 1,
|
14
15
|
"created_at": "2000-01-01T01:00:00Z",
|
@@ -30,6 +31,7 @@
|
|
30
31
|
* `description` (string): Public description
|
31
32
|
* `password_protected` (boolean): Is this bundle password protected?
|
32
33
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
34
|
+
* `require_share_recipient` (boolean): Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
33
35
|
* `clickwrap_body` (string): Legal text that must be agreed to prior to accessing Bundle.
|
34
36
|
* `id` (int64): Bundle ID
|
35
37
|
* `created_at` (date-time): Bundle created at date/time
|
@@ -101,7 +103,8 @@ Files::Bundle.create(
|
|
101
103
|
code: "abc123",
|
102
104
|
require_registration: true,
|
103
105
|
clickwrap_id: 1,
|
104
|
-
inbox_id: 1
|
106
|
+
inbox_id: 1,
|
107
|
+
require_share_recipient: true
|
105
108
|
)
|
106
109
|
```
|
107
110
|
|
@@ -118,6 +121,7 @@ Files::Bundle.create(
|
|
118
121
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
119
122
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
120
123
|
* `inbox_id` (int64): ID of the associated inbox, if available.
|
124
|
+
* `require_share_recipient` (boolean): Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
121
125
|
|
122
126
|
|
123
127
|
---
|
@@ -145,14 +149,15 @@ Files::Bundle.share(id,
|
|
145
149
|
```
|
146
150
|
Files::Bundle.update(id,
|
147
151
|
password: "Password",
|
152
|
+
clickwrap_id: 1,
|
153
|
+
code: "abc123",
|
154
|
+
description: "The public description of the bundle.",
|
148
155
|
expires_at: "2000-01-01T01:00:00Z",
|
156
|
+
inbox_id: 1,
|
149
157
|
max_uses: 1,
|
150
|
-
description: "The public description of the bundle.",
|
151
158
|
note: "The internal note on the bundle.",
|
152
|
-
code: "abc123",
|
153
159
|
require_registration: true,
|
154
|
-
|
155
|
-
inbox_id: 1
|
160
|
+
require_share_recipient: true
|
156
161
|
)
|
157
162
|
```
|
158
163
|
|
@@ -160,14 +165,15 @@ Files::Bundle.update(id,
|
|
160
165
|
|
161
166
|
* `id` (int64): Required - Bundle ID.
|
162
167
|
* `password` (string): Password for this bundle.
|
168
|
+
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
169
|
+
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
170
|
+
* `description` (string): Public description
|
163
171
|
* `expires_at` (string): Bundle expiration date/time
|
172
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
164
173
|
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
165
|
-
* `description` (string): Public description
|
166
174
|
* `note` (string): Bundle internal note
|
167
|
-
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
168
175
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
169
|
-
* `
|
170
|
-
* `inbox_id` (int64): ID of the associated inbox, if available.
|
176
|
+
* `require_share_recipient` (boolean): Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
171
177
|
|
172
178
|
|
173
179
|
---
|
@@ -212,14 +218,15 @@ bundle = Files::Bundle.list_for(path).first
|
|
212
218
|
|
213
219
|
bundle.update(
|
214
220
|
password: "Password",
|
221
|
+
clickwrap_id: 1,
|
222
|
+
code: "abc123",
|
223
|
+
description: "The public description of the bundle.",
|
215
224
|
expires_at: "2000-01-01T01:00:00Z",
|
225
|
+
inbox_id: 1,
|
216
226
|
max_uses: 1,
|
217
|
-
description: "The public description of the bundle.",
|
218
227
|
note: "The internal note on the bundle.",
|
219
|
-
code: "abc123",
|
220
228
|
require_registration: true,
|
221
|
-
|
222
|
-
inbox_id: 1
|
229
|
+
require_share_recipient: true
|
223
230
|
)
|
224
231
|
```
|
225
232
|
|
@@ -227,14 +234,15 @@ bundle.update(
|
|
227
234
|
|
228
235
|
* `id` (int64): Required - Bundle ID.
|
229
236
|
* `password` (string): Password for this bundle.
|
237
|
+
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
238
|
+
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
239
|
+
* `description` (string): Public description
|
230
240
|
* `expires_at` (string): Bundle expiration date/time
|
241
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
231
242
|
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
232
|
-
* `description` (string): Public description
|
233
243
|
* `note` (string): Bundle internal note
|
234
|
-
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
235
244
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
236
|
-
* `
|
237
|
-
* `inbox_id` (int64): ID of the associated inbox, if available.
|
245
|
+
* `require_share_recipient` (boolean): Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
238
246
|
|
239
247
|
|
240
248
|
---
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# BundleRecipient
|
2
|
+
|
3
|
+
## Example BundleRecipient Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"company": "Acme Inc.",
|
8
|
+
"name": "John Doe",
|
9
|
+
"note": "Some note.",
|
10
|
+
"recipient": "john.doe@example.com",
|
11
|
+
"sent_at": "2000-01-01T01:00:00Z"
|
12
|
+
}
|
13
|
+
```
|
14
|
+
|
15
|
+
* `company` (string): The recipient's company.
|
16
|
+
* `name` (string): The recipient's name.
|
17
|
+
* `note` (string): A note sent to the recipient with the bundle.
|
18
|
+
* `recipient` (string): The recipient's email address.
|
19
|
+
* `sent_at` (date-time): When the Bundle was shared with this recipient.
|
20
|
+
|
21
|
+
|
22
|
+
---
|
23
|
+
|
24
|
+
## List Bundle Recipients
|
25
|
+
|
26
|
+
```
|
27
|
+
Files::BundleRecipient.list(
|
28
|
+
user_id: 1,
|
29
|
+
page: 1,
|
30
|
+
per_page: 1,
|
31
|
+
bundle_id: 1
|
32
|
+
)
|
33
|
+
```
|
34
|
+
|
35
|
+
### Parameters
|
36
|
+
|
37
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
38
|
+
* `page` (int64): Current page number.
|
39
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
40
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
41
|
+
* `bundle_id` (int64): Required - List recipients for the bundle with this ID.
|
data/docs/file_part_upload.md
CHANGED
data/docs/group.md
CHANGED
@@ -44,7 +44,7 @@ Files::Group.list(
|
|
44
44
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
45
45
|
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
46
46
|
* `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
47
|
-
* `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `
|
47
|
+
* `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `site_id` or `name`.
|
48
48
|
* `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`.
|
49
49
|
* `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name`.
|
50
50
|
* `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name`.
|
data/docs/history.md
CHANGED
data/docs/invoice.md
CHANGED
data/docs/invoice_line_item.md
CHANGED
data/docs/lock.md
CHANGED
data/docs/notification.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
```
|
6
6
|
{
|
7
7
|
"id": 1,
|
8
|
-
"path": "
|
8
|
+
"path": "",
|
9
9
|
"group_id": 1,
|
10
10
|
"group_name": "",
|
11
11
|
"notify_user_actions": true,
|
@@ -15,7 +15,7 @@
|
|
15
15
|
"unsubscribed_reason": "",
|
16
16
|
"user_id": 1,
|
17
17
|
"username": "User",
|
18
|
-
"suppressed_email":
|
18
|
+
"suppressed_email": true
|
19
19
|
}
|
20
20
|
```
|
21
21
|
|
@@ -43,7 +43,6 @@ Files::Notification.list(
|
|
43
43
|
page: 1,
|
44
44
|
per_page: 1,
|
45
45
|
group_id: 1,
|
46
|
-
path: "path",
|
47
46
|
include_ancestors: true
|
48
47
|
)
|
49
48
|
```
|
@@ -91,7 +90,6 @@ Files::Notification.create(
|
|
91
90
|
notify_user_actions: true,
|
92
91
|
send_interval: "daily",
|
93
92
|
group_id: 1,
|
94
|
-
path: "path",
|
95
93
|
username: "User"
|
96
94
|
)
|
97
95
|
```
|
data/docs/payment.md
CHANGED
data/docs/payment_line_item.md
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# SettingsChange
|
2
|
+
|
3
|
+
## Example SettingsChange Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"change_details": "{ domain: [\"olddomain.com', \"newdomain.com\"] }",
|
8
|
+
"created_at": "2000-01-01T01:00:00Z",
|
9
|
+
"user_id": 1
|
10
|
+
}
|
11
|
+
```
|
12
|
+
|
13
|
+
* `change_details` (object): Specifics on what changed.
|
14
|
+
* `created_at` (date-time): The time this change was made
|
15
|
+
* `user_id` (int64): The user id responsible for this change
|
16
|
+
|
17
|
+
|
18
|
+
---
|
19
|
+
|
20
|
+
## List Settings Changes
|
21
|
+
|
22
|
+
```
|
23
|
+
Files::SettingsChange.list(
|
24
|
+
page: 1,
|
25
|
+
per_page: 1
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
29
|
+
### Parameters
|
30
|
+
|
31
|
+
* `page` (int64): Current page number.
|
32
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
33
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
34
|
+
* `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
35
|
+
* `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `site_id`, `api_key_id`, `created_at` or `user_id`.
|
36
|
+
* `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
37
|
+
* `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `api_key_id` and `user_id`.
|
38
|
+
* `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
39
|
+
* `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
40
|
+
* `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `api_key_id` and `user_id`.
|
41
|
+
* `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
data/docs/site.md
CHANGED
data/docs/usage_snapshot.md
CHANGED
@@ -8,15 +8,15 @@
|
|
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
|
-
"current_storage":
|
12
|
-
"high_water_storage":
|
11
|
+
"current_storage": 1.0,
|
12
|
+
"high_water_storage": 1.0,
|
13
13
|
"total_downloads": 1,
|
14
14
|
"total_uploads": 1,
|
15
15
|
"updated_at": "2000-01-01T01:00:00Z",
|
16
16
|
"usage_by_top_level_dir": "",
|
17
|
-
"root_storage":
|
18
|
-
"deleted_files_counted_in_minimum":
|
19
|
-
"deleted_files_storage":
|
17
|
+
"root_storage": 1.0,
|
18
|
+
"deleted_files_counted_in_minimum": 1.0,
|
19
|
+
"deleted_files_storage": 1.0
|
20
20
|
}
|
21
21
|
```
|
22
22
|
|
data/lib/files.com.rb
CHANGED
@@ -36,6 +36,7 @@ require "files.com/models/automation"
|
|
36
36
|
require "files.com/models/behavior"
|
37
37
|
require "files.com/models/bundle"
|
38
38
|
require "files.com/models/bundle_download"
|
39
|
+
require "files.com/models/bundle_recipient"
|
39
40
|
require "files.com/models/clickwrap"
|
40
41
|
require "files.com/models/dns_record"
|
41
42
|
require "files.com/models/errors"
|
@@ -69,6 +70,7 @@ require "files.com/models/public_key"
|
|
69
70
|
require "files.com/models/remote_server"
|
70
71
|
require "files.com/models/request"
|
71
72
|
require "files.com/models/session"
|
73
|
+
require "files.com/models/settings_change"
|
72
74
|
require "files.com/models/site"
|
73
75
|
require "files.com/models/sso_strategy"
|
74
76
|
require "files.com/models/status"
|
data/lib/files.com/api_client.rb
CHANGED
@@ -169,7 +169,7 @@ module Files
|
|
169
169
|
end
|
170
170
|
|
171
171
|
private def api_url(url = "", base_url = nil)
|
172
|
-
(base_url || Files.base_url) + "/api/rest/v1" + url
|
172
|
+
Addressable::URI.parse((base_url || Files.base_url) + "/api/rest/v1" + url).normalize!.to_s
|
173
173
|
end
|
174
174
|
|
175
175
|
private def check_api_key!(api_key)
|
@@ -54,6 +54,15 @@ module Files
|
|
54
54
|
@attributes[:require_registration] = value
|
55
55
|
end
|
56
56
|
|
57
|
+
# boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
58
|
+
def require_share_recipient
|
59
|
+
@attributes[:require_share_recipient]
|
60
|
+
end
|
61
|
+
|
62
|
+
def require_share_recipient=(value)
|
63
|
+
@attributes[:require_share_recipient] = value
|
64
|
+
end
|
65
|
+
|
57
66
|
# string - Legal text that must be agreed to prior to accessing Bundle.
|
58
67
|
def clickwrap_body
|
59
68
|
@attributes[:clickwrap_body]
|
@@ -178,27 +187,28 @@ module Files
|
|
178
187
|
|
179
188
|
# Parameters:
|
180
189
|
# password - string - Password for this bundle.
|
190
|
+
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
191
|
+
# code - string - Bundle code. This code forms the end part of the Public URL.
|
192
|
+
# description - string - Public description
|
181
193
|
# expires_at - string - Bundle expiration date/time
|
194
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
182
195
|
# max_uses - int64 - Maximum number of times bundle can be accessed
|
183
|
-
# description - string - Public description
|
184
196
|
# note - string - Bundle internal note
|
185
|
-
# code - string - Bundle code. This code forms the end part of the Public URL.
|
186
197
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
187
|
-
#
|
188
|
-
# inbox_id - int64 - ID of the associated inbox, if available.
|
198
|
+
# require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
189
199
|
def update(params = {})
|
190
200
|
params ||= {}
|
191
201
|
params[:id] = @attributes[:id]
|
192
202
|
raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
|
193
203
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
194
204
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
205
|
+
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
206
|
+
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
207
|
+
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
195
208
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
209
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
196
210
|
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
197
|
-
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
198
211
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
199
|
-
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
200
|
-
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
201
|
-
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
202
212
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
203
213
|
|
204
214
|
Api.send_request("/bundles/#{@attributes[:id]}", :patch, params, @options)
|
@@ -291,6 +301,7 @@ module Files
|
|
291
301
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
292
302
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
293
303
|
# inbox_id - int64 - ID of the associated inbox, if available.
|
304
|
+
# require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
294
305
|
def self.create(params = {}, options = {})
|
295
306
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
296
307
|
raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params.dig(:paths) and !params.dig(:paths).is_a?(Array)
|
@@ -328,26 +339,27 @@ module Files
|
|
328
339
|
|
329
340
|
# Parameters:
|
330
341
|
# password - string - Password for this bundle.
|
342
|
+
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
343
|
+
# code - string - Bundle code. This code forms the end part of the Public URL.
|
344
|
+
# description - string - Public description
|
331
345
|
# expires_at - string - Bundle expiration date/time
|
346
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
332
347
|
# max_uses - int64 - Maximum number of times bundle can be accessed
|
333
|
-
# description - string - Public description
|
334
348
|
# note - string - Bundle internal note
|
335
|
-
# code - string - Bundle code. This code forms the end part of the Public URL.
|
336
349
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
337
|
-
#
|
338
|
-
# inbox_id - int64 - ID of the associated inbox, if available.
|
350
|
+
# require_share_recipient - boolean - Only allow access to recipients who have explicitly received the share via an email sent through the Files.com UI?
|
339
351
|
def self.update(id, params = {}, options = {})
|
340
352
|
params ||= {}
|
341
353
|
params[:id] = id
|
342
354
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
343
355
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
356
|
+
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
357
|
+
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
358
|
+
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
344
359
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
360
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
345
361
|
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
346
|
-
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
347
362
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
348
|
-
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
349
|
-
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
350
|
-
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
351
363
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
352
364
|
|
353
365
|
response, options = Api.send_request("/bundles/#{params[:id]}", :patch, params, options)
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class BundleRecipient
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# string - The recipient's company.
|
13
|
+
def company
|
14
|
+
@attributes[:company]
|
15
|
+
end
|
16
|
+
|
17
|
+
# string - The recipient's name.
|
18
|
+
def name
|
19
|
+
@attributes[:name]
|
20
|
+
end
|
21
|
+
|
22
|
+
# string - A note sent to the recipient with the bundle.
|
23
|
+
def note
|
24
|
+
@attributes[:note]
|
25
|
+
end
|
26
|
+
|
27
|
+
# string - The recipient's email address.
|
28
|
+
def recipient
|
29
|
+
@attributes[:recipient]
|
30
|
+
end
|
31
|
+
|
32
|
+
# date-time - When the Bundle was shared with this recipient.
|
33
|
+
def sent_at
|
34
|
+
@attributes[:sent_at]
|
35
|
+
end
|
36
|
+
|
37
|
+
# Parameters:
|
38
|
+
# user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
39
|
+
# page - int64 - Current page number.
|
40
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
41
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
42
|
+
# bundle_id (required) - int64 - List recipients for the bundle with this ID.
|
43
|
+
def self.list(params = {}, options = {})
|
44
|
+
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
45
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
46
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
47
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
48
|
+
raise InvalidParameterError.new("Bad parameter: bundle_id must be an Integer") if params.dig(:bundle_id) and !params.dig(:bundle_id).is_a?(Integer)
|
49
|
+
raise MissingParameterError.new("Parameter missing: bundle_id") unless params.dig(:bundle_id)
|
50
|
+
|
51
|
+
response, options = Api.send_request("/bundle_recipients", :get, params, options)
|
52
|
+
response.data.map do |entity_data|
|
53
|
+
BundleRecipient.new(entity_data, options)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.all(params = {}, options = {})
|
58
|
+
list(params, options)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -110,7 +110,7 @@ module Files
|
|
110
110
|
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
111
111
|
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
112
112
|
# cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
113
|
-
# sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `
|
113
|
+
# sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `site_id` or `name`.
|
114
114
|
# filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `name`.
|
115
115
|
# filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `name`.
|
116
116
|
# filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `name`.
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class SettingsChange
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# object - Specifics on what changed.
|
13
|
+
def change_details
|
14
|
+
@attributes[:change_details]
|
15
|
+
end
|
16
|
+
|
17
|
+
# date-time - The time this change was made
|
18
|
+
def created_at
|
19
|
+
@attributes[:created_at]
|
20
|
+
end
|
21
|
+
|
22
|
+
# int64 - The user id responsible for this change
|
23
|
+
def user_id
|
24
|
+
@attributes[:user_id]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Parameters:
|
28
|
+
# page - int64 - Current page number.
|
29
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
30
|
+
# action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
31
|
+
# cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
|
32
|
+
# sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `site_id`, `api_key_id`, `created_at` or `user_id`.
|
33
|
+
# filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
34
|
+
# filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `api_key_id` and `user_id`.
|
35
|
+
# filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
36
|
+
# filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
37
|
+
# filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `api_key_id` and `user_id`.
|
38
|
+
# filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `api_key_id` and `user_id`.
|
39
|
+
def self.list(params = {}, options = {})
|
40
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
41
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
42
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
43
|
+
raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
|
44
|
+
raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params.dig(:sort_by) and !params.dig(:sort_by).is_a?(Hash)
|
45
|
+
raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params.dig(:filter) and !params.dig(:filter).is_a?(Hash)
|
46
|
+
raise InvalidParameterError.new("Bad parameter: filter_gt must be an Hash") if params.dig(:filter_gt) and !params.dig(:filter_gt).is_a?(Hash)
|
47
|
+
raise InvalidParameterError.new("Bad parameter: filter_gteq must be an Hash") if params.dig(:filter_gteq) and !params.dig(:filter_gteq).is_a?(Hash)
|
48
|
+
raise InvalidParameterError.new("Bad parameter: filter_like must be an Hash") if params.dig(:filter_like) and !params.dig(:filter_like).is_a?(Hash)
|
49
|
+
raise InvalidParameterError.new("Bad parameter: filter_lt must be an Hash") if params.dig(:filter_lt) and !params.dig(:filter_lt).is_a?(Hash)
|
50
|
+
raise InvalidParameterError.new("Bad parameter: filter_lteq must be an Hash") if params.dig(:filter_lteq) and !params.dig(:filter_lteq).is_a?(Hash)
|
51
|
+
|
52
|
+
List.new(SettingsChange, params) do
|
53
|
+
Api.send_request("/settings_changes", :get, params, options)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.all(params = {}, options = {})
|
58
|
+
list(params, options)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
data/spec/models/file_spec.rb
CHANGED
@@ -4,13 +4,13 @@ require "tempfile"
|
|
4
4
|
RSpec.describe Files::File, :with_test_folder do
|
5
5
|
describe "#read" do
|
6
6
|
before do
|
7
|
-
Files::File.open(test_folder.join("
|
7
|
+
Files::File.open(test_folder.join("[[strange stuff]]#yes.text").to_s, 'w', options) do |f|
|
8
8
|
f.write("contents")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
it "returns the body of the file" do
|
13
|
-
file = Files::File.find(test_folder.join("
|
13
|
+
file = Files::File.find(test_folder.join("[[strange stuff]]#yes.text").to_s, {}, options)
|
14
14
|
expect(file.read).to eq("contents")
|
15
15
|
end
|
16
16
|
end
|
data/test.sh
CHANGED
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.99
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- docs/behavior.md
|
96
96
|
- docs/bundle.md
|
97
97
|
- docs/bundle_download.md
|
98
|
+
- docs/bundle_recipient.md
|
98
99
|
- docs/clickwrap.md
|
99
100
|
- docs/dns_record.md
|
100
101
|
- docs/errors.md
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- docs/remote_server.md
|
130
131
|
- docs/request.md
|
131
132
|
- docs/session.md
|
133
|
+
- docs/settings_change.md
|
132
134
|
- docs/site.md
|
133
135
|
- docs/sso_strategy.md
|
134
136
|
- docs/status.md
|
@@ -154,6 +156,7 @@ files:
|
|
154
156
|
- lib/files.com/models/behavior.rb
|
155
157
|
- lib/files.com/models/bundle.rb
|
156
158
|
- lib/files.com/models/bundle_download.rb
|
159
|
+
- lib/files.com/models/bundle_recipient.rb
|
157
160
|
- lib/files.com/models/clickwrap.rb
|
158
161
|
- lib/files.com/models/dir.rb
|
159
162
|
- lib/files.com/models/dns_record.rb
|
@@ -189,6 +192,7 @@ files:
|
|
189
192
|
- lib/files.com/models/remote_server.rb
|
190
193
|
- lib/files.com/models/request.rb
|
191
194
|
- lib/files.com/models/session.rb
|
195
|
+
- lib/files.com/models/settings_change.rb
|
192
196
|
- lib/files.com/models/site.rb
|
193
197
|
- lib/files.com/models/sso_strategy.rb
|
194
198
|
- lib/files.com/models/status.rb
|
@@ -228,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
232
|
- !ruby/object:Gem::Version
|
229
233
|
version: '0'
|
230
234
|
requirements: []
|
231
|
-
rubygems_version: 3.1.
|
235
|
+
rubygems_version: 3.1.4
|
232
236
|
signing_key:
|
233
237
|
specification_version: 4
|
234
238
|
summary: Files.com Ruby client.
|