files.com 1.0.76 → 1.0.77
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/bundle.md +19 -3
- data/docs/bundle_download.md +35 -0
- data/lib/files.com.rb +1 -0
- data/lib/files.com/models/bundle.rb +30 -0
- data/lib/files.com/models/bundle_download.rb +49 -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: d9a51f85cdfb6f53328a7ba37b464c4c1e92f741707e0598b4ed4b70a608b5dc
|
4
|
+
data.tar.gz: 5e3d7b201f518ff1f65c0ddc1943dee7f549693141935f950786b0293396c368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28568c4de2bcf15925978fa9c645be7c4614bd276287103226bcafb949e001de1d07946274d82239c80b87ad1153bc9d1c8c194f64d5f75b1a0635265f97bb0b
|
7
|
+
data.tar.gz: 0e1a26eba12d2567865ef7d0555d088dce57710064eac501db9a6a9b870dfe7749800a7c9633bb75dbb03b036c1879063e499fd0b88dd7e29e3e5b4bc95d2610
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.77
|
data/docs/bundle.md
CHANGED
@@ -13,10 +13,12 @@
|
|
13
13
|
"id": 1,
|
14
14
|
"created_at": "2000-01-01T01:00:00Z",
|
15
15
|
"expires_at": "2000-01-01T01:00:00Z",
|
16
|
+
"max_uses": 1,
|
16
17
|
"note": "The internal note on the bundle.",
|
17
18
|
"user_id": 1,
|
18
19
|
"username": "user",
|
19
20
|
"clickwrap_id": 1,
|
21
|
+
"inbox_id": 1,
|
20
22
|
"paths": [
|
21
23
|
|
22
24
|
]
|
@@ -32,10 +34,12 @@
|
|
32
34
|
* `id` (int64): Bundle ID
|
33
35
|
* `created_at` (date-time): Bundle created at date/time
|
34
36
|
* `expires_at` (date-time): Bundle expiration date/time
|
37
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
35
38
|
* `note` (string): Bundle internal note
|
36
39
|
* `user_id` (int64): Bundle creator user ID
|
37
40
|
* `username` (string): Bundle creator username
|
38
41
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
42
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
39
43
|
* `paths` (array): A list of paths in this bundle
|
40
44
|
* `password` (string): Password for this bundle.
|
41
45
|
|
@@ -83,11 +87,13 @@ Files::Bundle.create(
|
|
83
87
|
paths: ["file.txt"],
|
84
88
|
password: "Password",
|
85
89
|
expires_at: "2000-01-01T01:00:00Z",
|
90
|
+
max_uses: 1,
|
86
91
|
description: "The public description of the bundle.",
|
87
92
|
note: "The internal note on the bundle.",
|
88
93
|
code: "abc123",
|
89
94
|
require_registration: true,
|
90
|
-
clickwrap_id: 1
|
95
|
+
clickwrap_id: 1,
|
96
|
+
inbox_id: 1
|
91
97
|
)
|
92
98
|
```
|
93
99
|
|
@@ -97,11 +103,13 @@ Files::Bundle.create(
|
|
97
103
|
* `paths` (array(string)): Required - A list of paths to include in this bundle.
|
98
104
|
* `password` (string): Password for this bundle.
|
99
105
|
* `expires_at` (string): Bundle expiration date/time
|
106
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
100
107
|
* `description` (string): Public description
|
101
108
|
* `note` (string): Bundle internal note
|
102
109
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
103
110
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
104
111
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
112
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
105
113
|
|
106
114
|
|
107
115
|
---
|
@@ -130,11 +138,13 @@ Files::Bundle.share(id,
|
|
130
138
|
Files::Bundle.update(id,
|
131
139
|
password: "Password",
|
132
140
|
expires_at: "2000-01-01T01:00:00Z",
|
141
|
+
max_uses: 1,
|
133
142
|
description: "The public description of the bundle.",
|
134
143
|
note: "The internal note on the bundle.",
|
135
144
|
code: "abc123",
|
136
145
|
require_registration: true,
|
137
|
-
clickwrap_id: 1
|
146
|
+
clickwrap_id: 1,
|
147
|
+
inbox_id: 1
|
138
148
|
)
|
139
149
|
```
|
140
150
|
|
@@ -143,11 +153,13 @@ Files::Bundle.update(id,
|
|
143
153
|
* `id` (int64): Required - Bundle ID.
|
144
154
|
* `password` (string): Password for this bundle.
|
145
155
|
* `expires_at` (string): Bundle expiration date/time
|
156
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
146
157
|
* `description` (string): Public description
|
147
158
|
* `note` (string): Bundle internal note
|
148
159
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
149
160
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
150
161
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
162
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
151
163
|
|
152
164
|
|
153
165
|
---
|
@@ -193,11 +205,13 @@ bundle = Files::Bundle.list_for(path).first
|
|
193
205
|
bundle.update(
|
194
206
|
password: "Password",
|
195
207
|
expires_at: "2000-01-01T01:00:00Z",
|
208
|
+
max_uses: 1,
|
196
209
|
description: "The public description of the bundle.",
|
197
210
|
note: "The internal note on the bundle.",
|
198
211
|
code: "abc123",
|
199
212
|
require_registration: true,
|
200
|
-
clickwrap_id: 1
|
213
|
+
clickwrap_id: 1,
|
214
|
+
inbox_id: 1
|
201
215
|
)
|
202
216
|
```
|
203
217
|
|
@@ -206,11 +220,13 @@ bundle.update(
|
|
206
220
|
* `id` (int64): Required - Bundle ID.
|
207
221
|
* `password` (string): Password for this bundle.
|
208
222
|
* `expires_at` (string): Bundle expiration date/time
|
223
|
+
* `max_uses` (int64): Maximum number of times bundle can be accessed
|
209
224
|
* `description` (string): Public description
|
210
225
|
* `note` (string): Bundle internal note
|
211
226
|
* `code` (string): Bundle code. This code forms the end part of the Public URL.
|
212
227
|
* `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
|
213
228
|
* `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
|
229
|
+
* `inbox_id` (int64): ID of the associated inbox, if available.
|
214
230
|
|
215
231
|
|
216
232
|
---
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# BundleDownload
|
2
|
+
|
3
|
+
## Example BundleDownload Object
|
4
|
+
|
5
|
+
```
|
6
|
+
{
|
7
|
+
"download_method": "file",
|
8
|
+
"path": "a/b/test.txt",
|
9
|
+
"created_at": "2020-01-01 00:00:00"
|
10
|
+
}
|
11
|
+
```
|
12
|
+
|
13
|
+
* `download_method` (string): Download method (file or full_zip)
|
14
|
+
* `path` (string): Download path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
15
|
+
* `created_at` (date-time): Download date/time
|
16
|
+
|
17
|
+
|
18
|
+
---
|
19
|
+
|
20
|
+
## List Bundle Downloads
|
21
|
+
|
22
|
+
```
|
23
|
+
Files::BundleDownload.list(
|
24
|
+
page: 1,
|
25
|
+
per_page: 1,
|
26
|
+
bundle_registration_id: 1
|
27
|
+
)
|
28
|
+
```
|
29
|
+
|
30
|
+
### Parameters
|
31
|
+
|
32
|
+
* `page` (int64): Current page number.
|
33
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
34
|
+
* `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
|
35
|
+
* `bundle_registration_id` (int64): Required - BundleRegistration ID
|
data/lib/files.com.rb
CHANGED
@@ -34,6 +34,7 @@ require "files.com/models/auto"
|
|
34
34
|
require "files.com/models/automation"
|
35
35
|
require "files.com/models/behavior"
|
36
36
|
require "files.com/models/bundle"
|
37
|
+
require "files.com/models/bundle_download"
|
37
38
|
require "files.com/models/clickwrap"
|
38
39
|
require "files.com/models/dns_record"
|
39
40
|
require "files.com/models/errors"
|
@@ -86,6 +86,15 @@ module Files
|
|
86
86
|
@attributes[:expires_at] = value
|
87
87
|
end
|
88
88
|
|
89
|
+
# int64 - Maximum number of times bundle can be accessed
|
90
|
+
def max_uses
|
91
|
+
@attributes[:max_uses]
|
92
|
+
end
|
93
|
+
|
94
|
+
def max_uses=(value)
|
95
|
+
@attributes[:max_uses] = value
|
96
|
+
end
|
97
|
+
|
89
98
|
# string - Bundle internal note
|
90
99
|
def note
|
91
100
|
@attributes[:note]
|
@@ -122,6 +131,15 @@ module Files
|
|
122
131
|
@attributes[:clickwrap_id] = value
|
123
132
|
end
|
124
133
|
|
134
|
+
# int64 - ID of the associated inbox, if available.
|
135
|
+
def inbox_id
|
136
|
+
@attributes[:inbox_id]
|
137
|
+
end
|
138
|
+
|
139
|
+
def inbox_id=(value)
|
140
|
+
@attributes[:inbox_id] = value
|
141
|
+
end
|
142
|
+
|
125
143
|
# array - A list of paths in this bundle
|
126
144
|
def paths
|
127
145
|
@attributes[:paths]
|
@@ -161,11 +179,13 @@ module Files
|
|
161
179
|
# Parameters:
|
162
180
|
# password - string - Password for this bundle.
|
163
181
|
# expires_at - string - Bundle expiration date/time
|
182
|
+
# max_uses - int64 - Maximum number of times bundle can be accessed
|
164
183
|
# description - string - Public description
|
165
184
|
# note - string - Bundle internal note
|
166
185
|
# code - string - Bundle code. This code forms the end part of the Public URL.
|
167
186
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
168
187
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
188
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
169
189
|
def update(params = {})
|
170
190
|
params ||= {}
|
171
191
|
params[:id] = @attributes[:id]
|
@@ -173,10 +193,12 @@ module Files
|
|
173
193
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
174
194
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
175
195
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
196
|
+
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
176
197
|
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
177
198
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
178
199
|
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
179
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)
|
180
202
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
181
203
|
|
182
204
|
Api.send_request("/bundles/#{@attributes[:id]}", :patch, params, @options)
|
@@ -247,20 +269,24 @@ module Files
|
|
247
269
|
# paths (required) - array(string) - A list of paths to include in this bundle.
|
248
270
|
# password - string - Password for this bundle.
|
249
271
|
# expires_at - string - Bundle expiration date/time
|
272
|
+
# max_uses - int64 - Maximum number of times bundle can be accessed
|
250
273
|
# description - string - Public description
|
251
274
|
# note - string - Bundle internal note
|
252
275
|
# code - string - Bundle code. This code forms the end part of the Public URL.
|
253
276
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
254
277
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
278
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
255
279
|
def self.create(params = {}, options = {})
|
256
280
|
raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
|
257
281
|
raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params.dig(:paths) and !params.dig(:paths).is_a?(Array)
|
258
282
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
259
283
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
284
|
+
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
260
285
|
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
261
286
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
262
287
|
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
263
288
|
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
289
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
264
290
|
raise MissingParameterError.new("Parameter missing: paths") unless params.dig(:paths)
|
265
291
|
|
266
292
|
response, options = Api.send_request("/bundles", :post, params, options)
|
@@ -288,21 +314,25 @@ module Files
|
|
288
314
|
# Parameters:
|
289
315
|
# password - string - Password for this bundle.
|
290
316
|
# expires_at - string - Bundle expiration date/time
|
317
|
+
# max_uses - int64 - Maximum number of times bundle can be accessed
|
291
318
|
# description - string - Public description
|
292
319
|
# note - string - Bundle internal note
|
293
320
|
# code - string - Bundle code. This code forms the end part of the Public URL.
|
294
321
|
# require_registration - boolean - Show a registration page that captures the downloader's name and email address?
|
295
322
|
# clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
|
323
|
+
# inbox_id - int64 - ID of the associated inbox, if available.
|
296
324
|
def self.update(id, params = {}, options = {})
|
297
325
|
params ||= {}
|
298
326
|
params[:id] = id
|
299
327
|
raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer)
|
300
328
|
raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String)
|
301
329
|
raise InvalidParameterError.new("Bad parameter: expires_at must be an String") if params.dig(:expires_at) and !params.dig(:expires_at).is_a?(String)
|
330
|
+
raise InvalidParameterError.new("Bad parameter: max_uses must be an Integer") if params.dig(:max_uses) and !params.dig(:max_uses).is_a?(Integer)
|
302
331
|
raise InvalidParameterError.new("Bad parameter: description must be an String") if params.dig(:description) and !params.dig(:description).is_a?(String)
|
303
332
|
raise InvalidParameterError.new("Bad parameter: note must be an String") if params.dig(:note) and !params.dig(:note).is_a?(String)
|
304
333
|
raise InvalidParameterError.new("Bad parameter: code must be an String") if params.dig(:code) and !params.dig(:code).is_a?(String)
|
305
334
|
raise InvalidParameterError.new("Bad parameter: clickwrap_id must be an Integer") if params.dig(:clickwrap_id) and !params.dig(:clickwrap_id).is_a?(Integer)
|
335
|
+
raise InvalidParameterError.new("Bad parameter: inbox_id must be an Integer") if params.dig(:inbox_id) and !params.dig(:inbox_id).is_a?(Integer)
|
306
336
|
raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id)
|
307
337
|
|
308
338
|
response, options = Api.send_request("/bundles/#{params[:id]}", :patch, params, options)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Files
|
4
|
+
class BundleDownload
|
5
|
+
attr_reader :options, :attributes
|
6
|
+
|
7
|
+
def initialize(attributes = {}, options = {})
|
8
|
+
@attributes = attributes || {}
|
9
|
+
@options = options || {}
|
10
|
+
end
|
11
|
+
|
12
|
+
# string - Download method (file or full_zip)
|
13
|
+
def download_method
|
14
|
+
@attributes[:download_method]
|
15
|
+
end
|
16
|
+
|
17
|
+
# string - Download path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
18
|
+
def path
|
19
|
+
@attributes[:path]
|
20
|
+
end
|
21
|
+
|
22
|
+
# date-time - Download date/time
|
23
|
+
def created_at
|
24
|
+
@attributes[:created_at]
|
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
|
+
# bundle_registration_id (required) - int64 - BundleRegistration ID
|
32
|
+
def self.list(params = {}, options = {})
|
33
|
+
raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
|
34
|
+
raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
|
35
|
+
raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
|
36
|
+
raise InvalidParameterError.new("Bad parameter: bundle_registration_id must be an Integer") if params.dig(:bundle_registration_id) and !params.dig(:bundle_registration_id).is_a?(Integer)
|
37
|
+
raise MissingParameterError.new("Parameter missing: bundle_registration_id") unless params.dig(:bundle_registration_id)
|
38
|
+
|
39
|
+
response, options = Api.send_request("/bundle_downloads", :get, params, options)
|
40
|
+
response.data.map do |entity_data|
|
41
|
+
BundleDownload.new(entity_data, options)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.all(params = {}, options = {})
|
46
|
+
list(params, options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
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.77
|
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-06-
|
11
|
+
date: 2020-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- docs/automation.md
|
93
93
|
- docs/behavior.md
|
94
94
|
- docs/bundle.md
|
95
|
+
- docs/bundle_download.md
|
95
96
|
- docs/clickwrap.md
|
96
97
|
- docs/dns_record.md
|
97
98
|
- docs/errors.md
|
@@ -147,6 +148,7 @@ files:
|
|
147
148
|
- lib/files.com/models/automation.rb
|
148
149
|
- lib/files.com/models/behavior.rb
|
149
150
|
- lib/files.com/models/bundle.rb
|
151
|
+
- lib/files.com/models/bundle_download.rb
|
150
152
|
- lib/files.com/models/clickwrap.rb
|
151
153
|
- lib/files.com/models/dir.rb
|
152
154
|
- lib/files.com/models/dns_record.rb
|