files.com 1.0.339 → 1.0.341

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c9903f39779bdd4ee071f3e20bad03cc6f637658496651ad275fbf9f2e84294
4
- data.tar.gz: f63f18f6335b363a7a146174362d867dd471963ed94ac7afc346e41b0de15451
3
+ metadata.gz: 42facb096cac23769533241c08e783056751f132a0a1d5021da0e2f35f8d7d36
4
+ data.tar.gz: 3d160c69bcf1af9966be73e4f62706045af6fa903f948623b63354ddf3a73881
5
5
  SHA512:
6
- metadata.gz: 726f0afe2a22250d49f1755cf138f9df1cea98c712f7d37e47d2ded8580482fd39995b379c96c957c3b953daad61d73a9cb78b6a0c34012002d19d33abbee05f
7
- data.tar.gz: 953ba4283f48d1ebf207ef2633d83703dbc8f7d1047047dc8ba653e370f2c990536ff2d51e6df6d26e2fb28f960ae7933cc4d7d86c552e78dd9cf386fada6d74
6
+ metadata.gz: 8092f446d0281ad11b4d6541d162dd06dcd9a7be8fb1ffcd7635c25b2617394cf3bad31c89471bbf4f9865369238857544245c3fbf517ce9b2a523bbef436dab
7
+ data.tar.gz: 9b89571030ea82226be5cf6e719c139a5cf9eaac1ec693b43b1c876ef1632bb21410fe80bc0fa8cbcdff20e135c93398c9a1b290905921f4992f2a7d26c5ad69
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.339
1
+ 1.0.341
data/docs/bundle.md CHANGED
@@ -40,6 +40,7 @@
40
40
  "note": "The internal note on the bundle.",
41
41
  "path_template": "{{name}}_{{ip}}",
42
42
  "send_email_receipt_to_uploader": true,
43
+ "snapshot_id": 1,
43
44
  "user_id": 1,
44
45
  "username": "user",
45
46
  "clickwrap_id": 1,
@@ -76,6 +77,7 @@
76
77
  * `note` (string): Bundle internal note
77
78
  * `path_template` (string): Template for creating submission subfolders. Can use the uploader's name, email address, ip, company, and any custom form data.
78
79
  * `send_email_receipt_to_uploader` (boolean): Send delivery receipt to the uploader. Note: For writable share only
80
+ * `snapshot_id` (int64): ID of the snapshot containing this bundle's contents.
79
81
  * `user_id` (int64): Bundle creator user ID
80
82
  * `username` (string): Bundle creator username
81
83
  * `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
@@ -86,6 +88,8 @@
86
88
  * `paths` (array): A list of paths in this bundle. For performance reasons, this is not provided when listing bundles.
87
89
  * `password` (string): Password for this bundle.
88
90
  * `form_field_set_id` (int64): Id of Form Field Set to use with this bundle
91
+ * `create_snapshot` (boolean): If true, create a snapshot of this bundle's contents.
92
+ * `finalize_snapshot` (boolean): If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
89
93
  * `watermark_attachment_file` (file): Preview watermark image applied to all bundle items.
90
94
  * `watermark_attachment_delete` (boolean): If true, will delete the file stored in watermark_attachment
91
95
 
@@ -137,8 +141,10 @@ Files::Bundle.create(
137
141
  paths: ["file.txt"],
138
142
  password: "Password",
139
143
  form_field_set_id: 1,
144
+ create_snapshot: true,
140
145
  dont_separate_submissions_by_folder: true,
141
146
  expires_at: "2000-01-01T01:00:00Z",
147
+ finalize_snapshot: true,
142
148
  max_uses: 1,
143
149
  description: "The public description of the bundle.",
144
150
  note: "The internal note on the bundle.",
@@ -163,8 +169,10 @@ Files::Bundle.create(
163
169
  * `paths` (array(string)): Required - A list of paths to include in this bundle.
164
170
  * `password` (string): Password for this bundle.
165
171
  * `form_field_set_id` (int64): Id of Form Field Set to use with this bundle
172
+ * `create_snapshot` (boolean): If true, create a snapshot of this bundle's contents.
166
173
  * `dont_separate_submissions_by_folder` (boolean): Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
167
174
  * `expires_at` (string): Bundle expiration date/time
175
+ * `finalize_snapshot` (boolean): If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
168
176
  * `max_uses` (int64): Maximum number of times bundle can be accessed
169
177
  * `description` (string): Public description
170
178
  * `note` (string): Bundle internal note
@@ -214,9 +222,11 @@ Files::Bundle.update(id,
214
222
  form_field_set_id: 1,
215
223
  clickwrap_id: 1,
216
224
  code: "abc123",
225
+ create_snapshot: true,
217
226
  description: "The public description of the bundle.",
218
227
  dont_separate_submissions_by_folder: true,
219
228
  expires_at: "2000-01-01T01:00:00Z",
229
+ finalize_snapshot: true,
220
230
  inbox_id: 1,
221
231
  max_uses: 1,
222
232
  note: "The internal note on the bundle.",
@@ -241,9 +251,11 @@ Files::Bundle.update(id,
241
251
  * `form_field_set_id` (int64): Id of Form Field Set to use with this bundle
242
252
  * `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
243
253
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
254
+ * `create_snapshot` (boolean): If true, create a snapshot of this bundle's contents.
244
255
  * `description` (string): Public description
245
256
  * `dont_separate_submissions_by_folder` (boolean): Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
246
257
  * `expires_at` (string): Bundle expiration date/time
258
+ * `finalize_snapshot` (boolean): If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
247
259
  * `inbox_id` (int64): ID of the associated inbox, if available.
248
260
  * `max_uses` (int64): Maximum number of times bundle can be accessed
249
261
  * `note` (string): Bundle internal note
@@ -308,9 +320,11 @@ bundle.update(
308
320
  form_field_set_id: 1,
309
321
  clickwrap_id: 1,
310
322
  code: "abc123",
323
+ create_snapshot: true,
311
324
  description: "The public description of the bundle.",
312
325
  dont_separate_submissions_by_folder: true,
313
326
  expires_at: "2000-01-01T01:00:00Z",
327
+ finalize_snapshot: true,
314
328
  inbox_id: 1,
315
329
  max_uses: 1,
316
330
  note: "The internal note on the bundle.",
@@ -335,9 +349,11 @@ bundle.update(
335
349
  * `form_field_set_id` (int64): Id of Form Field Set to use with this bundle
336
350
  * `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
337
351
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
352
+ * `create_snapshot` (boolean): If true, create a snapshot of this bundle's contents.
338
353
  * `description` (string): Public description
339
354
  * `dont_separate_submissions_by_folder` (boolean): Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
340
355
  * `expires_at` (string): Bundle expiration date/time
356
+ * `finalize_snapshot` (boolean): If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
341
357
  * `inbox_id` (int64): ID of the associated inbox, if available.
342
358
  * `max_uses` (int64): Maximum number of times bundle can be accessed
343
359
  * `note` (string): Bundle internal note
data/docs/folder.md CHANGED
@@ -77,6 +77,7 @@ Files::Folder.list_for(path,
77
77
  * `path` (string): Required - Path to operate on.
78
78
  * `filter` (string): If specified, will filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here.
79
79
  * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
80
+ * `sort_by` (object): Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
80
81
  * `search` (string): If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
81
82
  * `search_all` (boolean): Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the UI. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
82
83
  * `with_previews` (boolean): Include file previews?
data/docs/snapshot.md ADDED
@@ -0,0 +1,97 @@
1
+ # Snapshot
2
+
3
+ * `id` (int64): Snapshot ID.
4
+
5
+
6
+ ---
7
+
8
+ ## List Snapshots
9
+
10
+ ```
11
+ Files::Snapshot.list(
12
+ per_page: 1
13
+ )
14
+ ```
15
+
16
+ ### Parameters
17
+
18
+ * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
19
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
20
+
21
+
22
+ ---
23
+
24
+ ## Show Snapshot
25
+
26
+ ```
27
+ Files::Snapshot.find(id)
28
+ ```
29
+
30
+ ### Parameters
31
+
32
+ * `id` (int64): Required - Snapshot ID.
33
+
34
+
35
+ ---
36
+
37
+ ## Create Snapshot
38
+
39
+ ```
40
+ Files::Snapshot.create
41
+ ```
42
+
43
+
44
+ ---
45
+
46
+ ## Update Snapshot
47
+
48
+ ```
49
+ Files::Snapshot.update(id)
50
+ ```
51
+
52
+ ### Parameters
53
+
54
+ * `id` (int64): Required - Snapshot ID.
55
+
56
+
57
+ ---
58
+
59
+ ## Delete Snapshot
60
+
61
+ ```
62
+ Files::Snapshot.delete(id)
63
+ ```
64
+
65
+ ### Parameters
66
+
67
+ * `id` (int64): Required - Snapshot ID.
68
+
69
+
70
+ ---
71
+
72
+ ## Update Snapshot
73
+
74
+ ```
75
+ snapshot = Files::Snapshot.list.first
76
+
77
+ snapshot.update
78
+ ```
79
+
80
+ ### Parameters
81
+
82
+ * `id` (int64): Required - Snapshot ID.
83
+
84
+
85
+ ---
86
+
87
+ ## Delete Snapshot
88
+
89
+ ```
90
+ snapshot = Files::Snapshot.list.first
91
+
92
+ snapshot.delete
93
+ ```
94
+
95
+ ### Parameters
96
+
97
+ * `id` (int64): Required - Snapshot ID.
@@ -194,6 +194,15 @@ module Files
194
194
  @attributes[:send_email_receipt_to_uploader] = value
195
195
  end
196
196
 
197
+ # int64 - ID of the snapshot containing this bundle's contents.
198
+ def snapshot_id
199
+ @attributes[:snapshot_id]
200
+ end
201
+
202
+ def snapshot_id=(value)
203
+ @attributes[:snapshot_id] = value
204
+ end
205
+
197
206
  # int64 - Bundle creator user ID
198
207
  def user_id
199
208
  @attributes[:user_id]
@@ -284,6 +293,24 @@ module Files
284
293
  @attributes[:form_field_set_id] = value
285
294
  end
286
295
 
296
+ # boolean - If true, create a snapshot of this bundle's contents.
297
+ def create_snapshot
298
+ @attributes[:create_snapshot]
299
+ end
300
+
301
+ def create_snapshot=(value)
302
+ @attributes[:create_snapshot] = value
303
+ end
304
+
305
+ # boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
306
+ def finalize_snapshot
307
+ @attributes[:finalize_snapshot]
308
+ end
309
+
310
+ def finalize_snapshot=(value)
311
+ @attributes[:finalize_snapshot] = value
312
+ end
313
+
287
314
  # file - Preview watermark image applied to all bundle items.
288
315
  def watermark_attachment_file
289
316
  @attributes[:watermark_attachment_file]
@@ -327,9 +354,11 @@ module Files
327
354
  # form_field_set_id - int64 - Id of Form Field Set to use with this bundle
328
355
  # clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
329
356
  # code - string - Bundle code. This code forms the end part of the Public URL.
357
+ # create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
330
358
  # description - string - Public description
331
359
  # dont_separate_submissions_by_folder - boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
332
360
  # expires_at - string - Bundle expiration date/time
361
+ # finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
333
362
  # inbox_id - int64 - ID of the associated inbox, if available.
334
363
  # max_uses - int64 - Maximum number of times bundle can be accessed
335
364
  # note - string - Bundle internal note
@@ -440,8 +469,10 @@ module Files
440
469
  # paths (required) - array(string) - A list of paths to include in this bundle.
441
470
  # password - string - Password for this bundle.
442
471
  # form_field_set_id - int64 - Id of Form Field Set to use with this bundle
472
+ # create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
443
473
  # dont_separate_submissions_by_folder - boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
444
474
  # expires_at - string - Bundle expiration date/time
475
+ # finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
445
476
  # max_uses - int64 - Maximum number of times bundle can be accessed
446
477
  # description - string - Public description
447
478
  # note - string - Bundle internal note
@@ -503,9 +534,11 @@ module Files
503
534
  # form_field_set_id - int64 - Id of Form Field Set to use with this bundle
504
535
  # clickwrap_id - int64 - ID of the clickwrap to use with this bundle.
505
536
  # code - string - Bundle code. This code forms the end part of the Public URL.
537
+ # create_snapshot - boolean - If true, create a snapshot of this bundle's contents.
506
538
  # description - string - Public description
507
539
  # dont_separate_submissions_by_folder - boolean - Do not create subfolders for files uploaded to this share. Note: there are subtle security pitfalls with allowing anonymous uploads from multiple users to live in the same folder. We strongly discourage use of this option unless absolutely required.
508
540
  # expires_at - string - Bundle expiration date/time
541
+ # finalize_snapshot - boolean - If true, finalize the snapshot of this bundle's contents. Note that `create_snapshot` must also be true.
509
542
  # inbox_id - int64 - ID of the associated inbox, if available.
510
543
  # max_uses - int64 - Maximum number of times bundle can be accessed
511
544
  # note - string - Bundle internal note
@@ -328,6 +328,7 @@ module Files
328
328
  # path (required) - string - Path to operate on.
329
329
  # filter - string - If specified, will filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here.
330
330
  # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
331
+ # sort_by - object - Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
331
332
  # search - string - If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
332
333
  # search_all - boolean - Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the UI. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
333
334
  # with_previews - boolean - Include file previews?
@@ -340,6 +341,7 @@ module Files
340
341
  raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
341
342
  raise InvalidParameterError.new("Bad parameter: filter must be an String") if params[:filter] and !params[:filter].is_a?(String)
342
343
  raise InvalidParameterError.new("Bad parameter: preview_size must be an String") if params[:preview_size] and !params[:preview_size].is_a?(String)
344
+ raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
343
345
  raise InvalidParameterError.new("Bad parameter: search must be an String") if params[:search] and !params[:search].is_a?(String)
344
346
  raise MissingParameterError.new("Parameter missing: path") unless params[:path]
345
347
 
@@ -0,0 +1,114 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class Snapshot
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # int64 - Snapshot ID.
13
+ def id
14
+ @attributes[:id]
15
+ end
16
+
17
+ def id=(value)
18
+ @attributes[:id] = value
19
+ end
20
+
21
+ def update(params = {})
22
+ params ||= {}
23
+ params[:id] = @attributes[:id]
24
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
25
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
26
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
27
+
28
+ Api.send_request("/snapshots/#{@attributes[:id]}", :patch, params, @options)
29
+ end
30
+
31
+ def delete(params = {})
32
+ params ||= {}
33
+ params[:id] = @attributes[:id]
34
+ raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
35
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
36
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
37
+
38
+ Api.send_request("/snapshots/#{@attributes[:id]}", :delete, params, @options)
39
+ end
40
+
41
+ def destroy(params = {})
42
+ delete(params)
43
+ end
44
+
45
+ def save
46
+ if @attributes[:id]
47
+ update(@attributes)
48
+ else
49
+ new_obj = Snapshot.create(@attributes, @options)
50
+ @attributes = new_obj.attributes
51
+ end
52
+ end
53
+
54
+ # Parameters:
55
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
56
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
57
+ def self.list(params = {}, options = {})
58
+ raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
59
+ raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
60
+
61
+ response, _options = Api.send_request("/snapshots", :get, params, options)
62
+ response.data
63
+ end
64
+
65
+ def self.all(params = {}, options = {})
66
+ list(params, options)
67
+ end
68
+
69
+ # Parameters:
70
+ # id (required) - int64 - Snapshot ID.
71
+ def self.find(id, params = {}, options = {})
72
+ params ||= {}
73
+ params[:id] = id
74
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
75
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
76
+
77
+ response, _options = Api.send_request("/snapshots/#{params[:id]}", :get, params, options)
78
+ response.data
79
+ end
80
+
81
+ def self.get(id, params = {}, options = {})
82
+ find(id, params, options)
83
+ end
84
+
85
+ def self.create(params = {}, options = {})
86
+ response, _options = Api.send_request("/snapshots", :post, params, options)
87
+ response.data
88
+ end
89
+
90
+ def self.update(id, params = {}, options = {})
91
+ params ||= {}
92
+ params[:id] = id
93
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
94
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
95
+
96
+ response, _options = Api.send_request("/snapshots/#{params[:id]}", :patch, params, options)
97
+ response.data
98
+ end
99
+
100
+ def self.delete(id, params = {}, options = {})
101
+ params ||= {}
102
+ params[:id] = id
103
+ raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
104
+ raise MissingParameterError.new("Parameter missing: id") unless params[:id]
105
+
106
+ response, _options = Api.send_request("/snapshots/#{params[:id]}", :delete, params, options)
107
+ response.data
108
+ end
109
+
110
+ def self.destroy(id, params = {}, options = {})
111
+ delete(id, params, options)
112
+ end
113
+ end
114
+ end
data/lib/files.com.rb CHANGED
@@ -100,6 +100,7 @@ require "files.com/models/session"
100
100
  require "files.com/models/settings_change"
101
101
  require "files.com/models/sftp_host_key"
102
102
  require "files.com/models/site"
103
+ require "files.com/models/snapshot"
103
104
  require "files.com/models/sso_strategy"
104
105
  require "files.com/models/status"
105
106
  require "files.com/models/style"
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.339
4
+ version: 1.0.341
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-17 00:00:00.000000000 Z
11
+ date: 2023-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -183,6 +183,7 @@ files:
183
183
  - docs/settings_change.md
184
184
  - docs/sftp_host_key.md
185
185
  - docs/site.md
186
+ - docs/snapshot.md
186
187
  - docs/sso_strategy.md
187
188
  - docs/status.md
188
189
  - docs/style.md
@@ -268,6 +269,7 @@ files:
268
269
  - lib/files.com/models/settings_change.rb
269
270
  - lib/files.com/models/sftp_host_key.rb
270
271
  - lib/files.com/models/site.rb
272
+ - lib/files.com/models/snapshot.rb
271
273
  - lib/files.com/models/sso_strategy.rb
272
274
  - lib/files.com/models/status.rb
273
275
  - lib/files.com/models/style.rb