filestack 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/README.md +2 -2
  4. data/VERSION +1 -1
  5. data/docs/AV.html +557 -0
  6. data/docs/Filestack.html +115 -0
  7. data/docs/Filestack/Ruby.html +115 -0
  8. data/docs/FilestackClient.html +702 -0
  9. data/docs/FilestackCommon.html +884 -0
  10. data/docs/FilestackConfig.html +197 -0
  11. data/docs/FilestackFilelink.html +1277 -0
  12. data/docs/FilestackSecurity.html +654 -0
  13. data/docs/IntelligentState.html +729 -0
  14. data/docs/IntelligentUtils.html +1639 -0
  15. data/docs/MultipartUploadUtils.html +1543 -0
  16. data/docs/Transform.html +1152 -0
  17. data/docs/TransformConfig.html +138 -0
  18. data/docs/TransformUtils.html +272 -0
  19. data/docs/UploadUtils.html +673 -0
  20. data/docs/_index.html +227 -0
  21. data/docs/class_list.html +51 -0
  22. data/docs/css/common.css +1 -0
  23. data/docs/css/full_list.css +58 -0
  24. data/docs/css/style.css +492 -0
  25. data/docs/file.README.html +210 -0
  26. data/docs/file_list.html +56 -0
  27. data/docs/frames.html +17 -0
  28. data/docs/index.html +210 -0
  29. data/docs/js/app.js +248 -0
  30. data/docs/js/full_list.js +216 -0
  31. data/docs/js/jquery.js +4 -0
  32. data/docs/method_list.html +643 -0
  33. data/docs/top-level-namespace.html +145 -0
  34. data/examples/file_transformations.rb +6 -0
  35. data/examples/intelligent_upload.rb +7 -0
  36. data/examples/normal_upload.rb +5 -0
  37. data/examples/upload_external_url.rb +7 -0
  38. data/examples/upload_with_security.rb +6 -0
  39. data/examples/video_convert.rb +10 -0
  40. data/filestack-ruby.gemspec +1 -0
  41. data/lib/filestack/config.rb +9 -5
  42. data/lib/filestack/mixins/filestack_common.rb +17 -1
  43. data/lib/filestack/models/filelink.rb +8 -1
  44. data/lib/filestack/models/filestack_client.rb +17 -3
  45. data/lib/filestack/ruby/version.rb +1 -1
  46. data/lib/filestack/utils/multipart_upload_utils.rb +91 -36
  47. data/lib/filestack/utils/utils.rb +309 -1
  48. metadata +52 -3
@@ -0,0 +1,1543 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: MultipartUploadUtils
8
+
9
+ &mdash; Documentation by YARD 0.9.9
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ pathId = "MultipartUploadUtils";
19
+ relpath = '';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="_index.html">Index (M)</a> &raquo;
40
+
41
+
42
+ <span class="title">MultipartUploadUtils</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: MultipartUploadUtils
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dl>
78
+ <dt>Included in:</dt>
79
+ <dd><span class='object_link'><a href="FilestackClient.html" title="FilestackClient (class)">FilestackClient</a></span></dd>
80
+ </dl>
81
+
82
+
83
+
84
+ <dl>
85
+ <dt>Defined in:</dt>
86
+ <dd>lib/filestack/utils/multipart_upload_utils.rb</dd>
87
+ </dl>
88
+
89
+ </div>
90
+
91
+ <h2>Overview</h2><div class="docstring">
92
+ <div class="discussion">
93
+
94
+ <p>Includes all the utility functions for Filestack multipart uploads</p>
95
+
96
+
97
+ </div>
98
+ </div>
99
+ <div class="tags">
100
+
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>
111
+ Instance Method Summary
112
+ <small><a href="#" class="summary_toggle">collapse</a></small>
113
+ </h2>
114
+
115
+ <ul class="summary">
116
+
117
+ <li class="public ">
118
+ <span class="summary_signature">
119
+
120
+ <a href="#create_upload_jobs-instance_method" title="#create_upload_jobs (instance method)">#<strong>create_upload_jobs</strong>(apikey, filename, filepath, filesize, start_response, options) &#x21d2; Array </a>
121
+
122
+
123
+
124
+ </span>
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+ <span class="summary_desc"><div class='inline'>
135
+ <p>Create array of jobs for parallel uploading.</p>
136
+ </div></span>
137
+
138
+ </li>
139
+
140
+
141
+ <li class="public ">
142
+ <span class="summary_signature">
143
+
144
+ <a href="#get_file_info-instance_method" title="#get_file_info (instance method)">#<strong>get_file_info</strong>(file) &#x21d2; Object </a>
145
+
146
+
147
+
148
+ </span>
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+ <span class="summary_desc"><div class='inline'></div></span>
159
+
160
+ </li>
161
+
162
+
163
+ <li class="public ">
164
+ <span class="summary_signature">
165
+
166
+ <a href="#multipart_complete-instance_method" title="#multipart_complete (instance method)">#<strong>multipart_complete</strong>(apikey, filename, filesize, mimetype, start_response, parts_and_etags, options, intelligent = false) &#x21d2; Unirest::Response </a>
167
+
168
+
169
+
170
+ </span>
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+ <span class="summary_desc"><div class='inline'>
181
+ <p>Send complete call to multipart endpoint.</p>
182
+ </div></span>
183
+
184
+ </li>
185
+
186
+
187
+ <li class="public ">
188
+ <span class="summary_signature">
189
+
190
+ <a href="#multipart_start-instance_method" title="#multipart_start (instance method)">#<strong>multipart_start</strong>(apikey, filename, filesize, mimetype, security, options) &#x21d2; Unirest::Response </a>
191
+
192
+
193
+
194
+ </span>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+ <span class="summary_desc"><div class='inline'>
205
+ <p>Send start response to multipart endpoint.</p>
206
+ </div></span>
207
+
208
+ </li>
209
+
210
+
211
+ <li class="public ">
212
+ <span class="summary_signature">
213
+
214
+ <a href="#multipart_upload-instance_method" title="#multipart_upload (instance method)">#<strong>multipart_upload</strong>(apikey, filepath, security, options, timeout, intelligent: false) &#x21d2; Unirest::Response </a>
215
+
216
+
217
+
218
+ </span>
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+ <span class="summary_desc"><div class='inline'>
229
+ <p>Run entire multipart process through with file and options.</p>
230
+ </div></span>
231
+
232
+ </li>
233
+
234
+
235
+ <li class="public ">
236
+ <span class="summary_signature">
237
+
238
+ <a href="#run_uploads-instance_method" title="#run_uploads (instance method)">#<strong>run_uploads</strong>(jobs, apikey, filepath, options) &#x21d2; Array </a>
239
+
240
+
241
+
242
+ </span>
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+ <span class="summary_desc"><div class='inline'>
253
+ <p>Runs all jobs in parallel.</p>
254
+ </div></span>
255
+
256
+ </li>
257
+
258
+
259
+ <li class="public ">
260
+ <span class="summary_signature">
261
+
262
+ <a href="#upload_chunk-instance_method" title="#upload_chunk (instance method)">#<strong>upload_chunk</strong>(job, apikey, filepath, options) &#x21d2; Unirest::Response </a>
263
+
264
+
265
+
266
+ </span>
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <span class="summary_desc"><div class='inline'>
277
+ <p>Uploads one chunk of the file.</p>
278
+ </div></span>
279
+
280
+ </li>
281
+
282
+
283
+ </ul>
284
+
285
+
286
+
287
+
288
+ <div id="instance_method_details" class="method_details_list">
289
+ <h2>Instance Method Details</h2>
290
+
291
+
292
+ <div class="method_details first">
293
+ <h3 class="signature first" id="create_upload_jobs-instance_method">
294
+
295
+ #<strong>create_upload_jobs</strong>(apikey, filename, filepath, filesize, start_response, options) &#x21d2; <tt>Array</tt>
296
+
297
+
298
+
299
+
300
+
301
+ </h3><div class="docstring">
302
+ <div class="discussion">
303
+
304
+ <p>Create array of jobs for parallel uploading</p>
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <div class="tags">
310
+ <p class="tag_title">Parameters:</p>
311
+ <ul class="param">
312
+
313
+ <li>
314
+
315
+ <span class='name'>apikey</span>
316
+
317
+
318
+ <span class='type'>(<tt>String</tt>)</span>
319
+
320
+
321
+
322
+ &mdash;
323
+ <div class='inline'>
324
+ <p>Filestack API key</p>
325
+ </div>
326
+
327
+ </li>
328
+
329
+ <li>
330
+
331
+ <span class='name'>filename</span>
332
+
333
+
334
+ <span class='type'>(<tt>String</tt>)</span>
335
+
336
+
337
+
338
+ &mdash;
339
+ <div class='inline'>
340
+ <p>Name of incoming file</p>
341
+ </div>
342
+
343
+ </li>
344
+
345
+ <li>
346
+
347
+ <span class='name'>filepath</span>
348
+
349
+
350
+ <span class='type'>(<tt>String</tt>)</span>
351
+
352
+
353
+
354
+ &mdash;
355
+ <div class='inline'>
356
+ <p>Local path to file</p>
357
+ </div>
358
+
359
+ </li>
360
+
361
+ <li>
362
+
363
+ <span class='name'>filesize</span>
364
+
365
+
366
+ <span class='type'>(<tt>Int</tt>)</span>
367
+
368
+
369
+
370
+ &mdash;
371
+ <div class='inline'>
372
+ <p>Size of incoming file</p>
373
+ </div>
374
+
375
+ </li>
376
+
377
+ <li>
378
+
379
+ <span class='name'>start_response</span>
380
+
381
+
382
+ <span class='type'>(<tt>Unirest::Response</tt>)</span>
383
+
384
+
385
+
386
+ &mdash;
387
+ <div class='inline'>
388
+ <p>Response body from multipart_start</p>
389
+ </div>
390
+
391
+ </li>
392
+
393
+ <li>
394
+
395
+ <span class='name'>options</span>
396
+
397
+
398
+ <span class='type'>(<tt>Hash</tt>)</span>
399
+
400
+
401
+
402
+ &mdash;
403
+ <div class='inline'>
404
+ <p>User-defined options for multipart uploads</p>
405
+ </div>
406
+
407
+ </li>
408
+
409
+ </ul>
410
+
411
+ <p class="tag_title">Returns:</p>
412
+ <ul class="return">
413
+
414
+ <li>
415
+
416
+
417
+ <span class='type'>(<tt>Array</tt>)</span>
418
+
419
+
420
+
421
+ </li>
422
+
423
+ </ul>
424
+
425
+ </div><table class="source_code">
426
+ <tr>
427
+ <td>
428
+ <pre class="lines">
429
+
430
+
431
+ 79
432
+ 80
433
+ 81
434
+ 82
435
+ 83
436
+ 84
437
+ 85
438
+ 86
439
+ 87
440
+ 88
441
+ 89
442
+ 90
443
+ 91
444
+ 92
445
+ 93
446
+ 94
447
+ 95
448
+ 96
449
+ 97
450
+ 98
451
+ 99
452
+ 100
453
+ 101
454
+ 102
455
+ 103
456
+ 104
457
+ 105
458
+ 106
459
+ 107
460
+ 108
461
+ 109
462
+ 110</pre>
463
+ </td>
464
+ <td>
465
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 79</span>
466
+
467
+ <span class='kw'>def</span> <span class='id identifier rubyid_create_upload_jobs'>create_upload_jobs</span><span class='lparen'>(</span><span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
468
+ <span class='id identifier rubyid_jobs'>jobs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
469
+ <span class='id identifier rubyid_part'>part</span> <span class='op'>=</span> <span class='int'>1</span>
470
+ <span class='id identifier rubyid_seek_point'>seek_point</span> <span class='op'>=</span> <span class='int'>0</span>
471
+ <span class='kw'>while</span> <span class='id identifier rubyid_seek_point'>seek_point</span> <span class='op'>&lt;</span> <span class='id identifier rubyid_filesize'>filesize</span>
472
+ <span class='id identifier rubyid_part_info'>part_info</span> <span class='op'>=</span> <span class='lbrace'>{</span>
473
+ <span class='label'>seek:</span> <span class='id identifier rubyid_seek_point'>seek_point</span><span class='comma'>,</span>
474
+ <span class='label'>filepath:</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span>
475
+ <span class='label'>filename:</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span>
476
+ <span class='label'>apikey:</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span>
477
+ <span class='label'>part:</span> <span class='id identifier rubyid_part'>part</span><span class='comma'>,</span>
478
+ <span class='label'>filesize:</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span>
479
+ <span class='label'>uri:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>uri</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
480
+ <span class='label'>region:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>region</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
481
+ <span class='label'>upload_id:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>upload_id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
482
+ <span class='label'>location_url:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>location_url</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
483
+ <span class='label'>start_response:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span>
484
+ <span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span>
485
+ <span class='label'>store_location:</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>s3</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:store_location</span><span class='rbracket'>]</span>
486
+ <span class='rbrace'>}</span>
487
+ <span class='kw'>if</span> <span class='id identifier rubyid_seek_point'>seek_point</span> <span class='op'>+</span> <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#DEFAULT_CHUNK_SIZE-constant" title="FilestackConfig::DEFAULT_CHUNK_SIZE (constant)">DEFAULT_CHUNK_SIZE</a></span></span> <span class='op'>&gt;</span> <span class='id identifier rubyid_filesize'>filesize</span>
488
+ <span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='id identifier rubyid_filesize'>filesize</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='id identifier rubyid_seek_point'>seek_point</span><span class='rparen'>)</span>
489
+ <span class='kw'>else</span>
490
+ <span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#DEFAULT_CHUNK_SIZE-constant" title="FilestackConfig::DEFAULT_CHUNK_SIZE (constant)">DEFAULT_CHUNK_SIZE</a></span></span>
491
+ <span class='kw'>end</span>
492
+ <span class='id identifier rubyid_part_info'>part_info</span><span class='lbracket'>[</span><span class='symbol'>:size</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_size'>size</span>
493
+ <span class='id identifier rubyid_jobs'>jobs</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_part_info'>part_info</span><span class='rparen'>)</span>
494
+ <span class='id identifier rubyid_part'>part</span> <span class='op'>+=</span> <span class='int'>1</span>
495
+ <span class='id identifier rubyid_seek_point'>seek_point</span> <span class='op'>+=</span> <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#DEFAULT_CHUNK_SIZE-constant" title="FilestackConfig::DEFAULT_CHUNK_SIZE (constant)">DEFAULT_CHUNK_SIZE</a></span></span>
496
+ <span class='kw'>end</span>
497
+ <span class='id identifier rubyid_jobs'>jobs</span>
498
+ <span class='kw'>end</span></pre>
499
+ </td>
500
+ </tr>
501
+ </table>
502
+ </div>
503
+
504
+ <div class="method_details ">
505
+ <h3 class="signature " id="get_file_info-instance_method">
506
+
507
+ #<strong>get_file_info</strong>(file) &#x21d2; <tt>Object</tt>
508
+
509
+
510
+
511
+
512
+
513
+ </h3><table class="source_code">
514
+ <tr>
515
+ <td>
516
+ <pre class="lines">
517
+
518
+
519
+ 16
520
+ 17
521
+ 18
522
+ 19
523
+ 20
524
+ 21
525
+ 22
526
+ 23
527
+ 24</pre>
528
+ </td>
529
+ <td>
530
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 16</span>
531
+
532
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_file_info'>get_file_info</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
533
+ <span class='id identifier rubyid_filename'>filename</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
534
+ <span class='id identifier rubyid_filesize'>filesize</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
535
+ <span class='id identifier rubyid_mimetype'>mimetype</span> <span class='op'>=</span> <span class='const'>MimeMagic</span><span class='period'>.</span><span class='id identifier rubyid_by_magic'>by_magic</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='rparen'>)</span><span class='rparen'>)</span>
536
+ <span class='kw'>if</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
537
+ <span class='id identifier rubyid_mimetype'>mimetype</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>application/octet-stream</span><span class='tstring_end'>&#39;</span></span>
538
+ <span class='kw'>end</span>
539
+ <span class='lbracket'>[</span><span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span>
540
+ <span class='kw'>end</span></pre>
541
+ </td>
542
+ </tr>
543
+ </table>
544
+ </div>
545
+
546
+ <div class="method_details ">
547
+ <h3 class="signature " id="multipart_complete-instance_method">
548
+
549
+ #<strong>multipart_complete</strong>(apikey, filename, filesize, mimetype, start_response, parts_and_etags, options, intelligent = false) &#x21d2; <tt>Unirest::Response</tt>
550
+
551
+
552
+
553
+
554
+
555
+ </h3><div class="docstring">
556
+ <div class="discussion">
557
+
558
+ <p>Send complete call to multipart endpoint</p>
559
+
560
+
561
+ </div>
562
+ </div>
563
+ <div class="tags">
564
+ <p class="tag_title">Parameters:</p>
565
+ <ul class="param">
566
+
567
+ <li>
568
+
569
+ <span class='name'>apikey</span>
570
+
571
+
572
+ <span class='type'>(<tt>String</tt>)</span>
573
+
574
+
575
+
576
+ &mdash;
577
+ <div class='inline'>
578
+ <p>Filestack API key</p>
579
+ </div>
580
+
581
+ </li>
582
+
583
+ <li>
584
+
585
+ <span class='name'>filename</span>
586
+
587
+
588
+ <span class='type'>(<tt>String</tt>)</span>
589
+
590
+
591
+
592
+ &mdash;
593
+ <div class='inline'>
594
+ <p>Name of incoming file</p>
595
+ </div>
596
+
597
+ </li>
598
+
599
+ <li>
600
+
601
+ <span class='name'>filesize</span>
602
+
603
+
604
+ <span class='type'>(<tt>Int</tt>)</span>
605
+
606
+
607
+
608
+ &mdash;
609
+ <div class='inline'>
610
+ <p>Size of incoming file</p>
611
+ </div>
612
+
613
+ </li>
614
+
615
+ <li>
616
+
617
+ <span class='name'>mimetype</span>
618
+
619
+
620
+ <span class='type'>(<tt>String</tt>)</span>
621
+
622
+
623
+
624
+ &mdash;
625
+ <div class='inline'>
626
+ <p>Mimetype of incoming file</p>
627
+ </div>
628
+
629
+ </li>
630
+
631
+ <li>
632
+
633
+ <span class='name'>start_response</span>
634
+
635
+
636
+ <span class='type'>(<tt>Unirest::Response</tt>)</span>
637
+
638
+
639
+
640
+ &mdash;
641
+ <div class='inline'>
642
+ <p>Response body from multipart_start</p>
643
+ </div>
644
+
645
+ </li>
646
+
647
+ <li>
648
+
649
+ <span class='name'>security</span>
650
+
651
+
652
+ <span class='type'>(<tt><span class='object_link'><a href="FilestackSecurity.html" title="FilestackSecurity (class)">FilestackSecurity</a></span></tt>)</span>
653
+
654
+
655
+
656
+ &mdash;
657
+ <div class='inline'>
658
+ <p>Security object with policy/signature</p>
659
+ </div>
660
+
661
+ </li>
662
+
663
+ <li>
664
+
665
+ <span class='name'>parts_and_etags</span>
666
+
667
+
668
+ <span class='type'>(<tt>Array</tt>)</span>
669
+
670
+
671
+
672
+ &mdash;
673
+ <div class='inline'>
674
+ <p>Array of strings defining etags and their associated part numbers</p>
675
+ </div>
676
+
677
+ </li>
678
+
679
+ <li>
680
+
681
+ <span class='name'>options</span>
682
+
683
+
684
+ <span class='type'>(<tt>Hash</tt>)</span>
685
+
686
+
687
+
688
+ &mdash;
689
+ <div class='inline'>
690
+ <p>User-defined options for multipart uploads</p>
691
+ </div>
692
+
693
+ </li>
694
+
695
+ </ul>
696
+
697
+ <p class="tag_title">Returns:</p>
698
+ <ul class="return">
699
+
700
+ <li>
701
+
702
+
703
+ <span class='type'>(<tt>Unirest::Response</tt>)</span>
704
+
705
+
706
+
707
+ </li>
708
+
709
+ </ul>
710
+
711
+ </div><table class="source_code">
712
+ <tr>
713
+ <td>
714
+ <pre class="lines">
715
+
716
+
717
+ 193
718
+ 194
719
+ 195
720
+ 196
721
+ 197
722
+ 198
723
+ 199
724
+ 200
725
+ 201
726
+ 202
727
+ 203
728
+ 204
729
+ 205
730
+ 206
731
+ 207
732
+ 208
733
+ 209
734
+ 210
735
+ 211
736
+ 212
737
+ 213
738
+ 214
739
+ 215
740
+ 216
741
+ 217
742
+ 218
743
+ 219
744
+ 220
745
+ 221
746
+ 222
747
+ 223
748
+ 224
749
+ 225
750
+ 226
751
+ 227</pre>
752
+ </td>
753
+ <td>
754
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 193</span>
755
+
756
+ <span class='kw'>def</span> <span class='id identifier rubyid_multipart_complete'>multipart_complete</span><span class='lparen'>(</span><span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span> <span class='id identifier rubyid_parts_and_etags'>parts_and_etags</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_intelligent'>intelligent</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
757
+ <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_intelligent'>intelligent</span>
758
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span>
759
+ <span class='label'>apikey:</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span>
760
+ <span class='label'>uri:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>uri</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
761
+ <span class='label'>region:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>region</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
762
+ <span class='label'>upload_id:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>upload_id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
763
+ <span class='label'>filename:</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span>
764
+ <span class='label'>size:</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span>
765
+ <span class='label'>mimetype:</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span>
766
+ <span class='label'>parts:</span> <span class='id identifier rubyid_parts_and_etags'>parts_and_etags</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='comma'>,</span>
767
+ <span class='label'>store_location:</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>s3</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:store_location</span><span class='rbracket'>]</span><span class='comma'>,</span>
768
+ <span class='label'>file:</span> <span class='const'>Tempfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span>
769
+ <span class='rbrace'>}</span>
770
+ <span class='kw'>else</span>
771
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span>
772
+ <span class='label'>apikey:</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span>
773
+ <span class='label'>uri:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>uri</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
774
+ <span class='label'>region:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>region</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
775
+ <span class='label'>upload_id:</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>upload_id</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span>
776
+ <span class='label'>filename:</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span>
777
+ <span class='label'>size:</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span>
778
+ <span class='label'>mimetype:</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span>
779
+ <span class='label'>store_location:</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>s3</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:store_location</span><span class='rbracket'>]</span><span class='comma'>,</span>
780
+ <span class='label'>file:</span> <span class='const'>Tempfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span><span class='comma'>,</span>
781
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>multipart</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>true</span><span class='tstring_end'>&#39;</span></span>
782
+ <span class='rbrace'>}</span>
783
+ <span class='kw'>end</span>
784
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span>
785
+
786
+ <span class='const'>Unirest</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span>
787
+ <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#MULTIPART_COMPLETE_URL-constant" title="FilestackConfig::MULTIPART_COMPLETE_URL (constant)">MULTIPART_COMPLETE_URL</a></span></span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span>
788
+ <span class='label'>headers:</span> <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#HEADERS-constant" title="FilestackConfig::HEADERS (constant)">HEADERS</a></span></span>
789
+ <span class='rparen'>)</span>
790
+ <span class='kw'>end</span></pre>
791
+ </td>
792
+ </tr>
793
+ </table>
794
+ </div>
795
+
796
+ <div class="method_details ">
797
+ <h3 class="signature " id="multipart_start-instance_method">
798
+
799
+ #<strong>multipart_start</strong>(apikey, filename, filesize, mimetype, security, options) &#x21d2; <tt>Unirest::Response</tt>
800
+
801
+
802
+
803
+
804
+
805
+ </h3><div class="docstring">
806
+ <div class="discussion">
807
+
808
+ <p>Send start response to multipart endpoint</p>
809
+
810
+
811
+ </div>
812
+ </div>
813
+ <div class="tags">
814
+ <p class="tag_title">Parameters:</p>
815
+ <ul class="param">
816
+
817
+ <li>
818
+
819
+ <span class='name'>apikey</span>
820
+
821
+
822
+ <span class='type'>(<tt>String</tt>)</span>
823
+
824
+
825
+
826
+ &mdash;
827
+ <div class='inline'>
828
+ <p>Filestack API key</p>
829
+ </div>
830
+
831
+ </li>
832
+
833
+ <li>
834
+
835
+ <span class='name'>filename</span>
836
+
837
+
838
+ <span class='type'>(<tt>String</tt>)</span>
839
+
840
+
841
+
842
+ &mdash;
843
+ <div class='inline'>
844
+ <p>Name of incoming file</p>
845
+ </div>
846
+
847
+ </li>
848
+
849
+ <li>
850
+
851
+ <span class='name'>filesize</span>
852
+
853
+
854
+ <span class='type'>(<tt>Int</tt>)</span>
855
+
856
+
857
+
858
+ &mdash;
859
+ <div class='inline'>
860
+ <p>Size of incoming file</p>
861
+ </div>
862
+
863
+ </li>
864
+
865
+ <li>
866
+
867
+ <span class='name'>mimetype</span>
868
+
869
+
870
+ <span class='type'>(<tt>String</tt>)</span>
871
+
872
+
873
+
874
+ &mdash;
875
+ <div class='inline'>
876
+ <p>Mimetype of incoming file</p>
877
+ </div>
878
+
879
+ </li>
880
+
881
+ <li>
882
+
883
+ <span class='name'>security</span>
884
+
885
+
886
+ <span class='type'>(<tt><span class='object_link'><a href="FilestackSecurity.html" title="FilestackSecurity (class)">FilestackSecurity</a></span></tt>)</span>
887
+
888
+
889
+
890
+ &mdash;
891
+ <div class='inline'>
892
+ <p>Security object with policy/signature</p>
893
+ </div>
894
+
895
+ </li>
896
+
897
+ <li>
898
+
899
+ <span class='name'>options</span>
900
+
901
+
902
+ <span class='type'>(<tt>Hash</tt>)</span>
903
+
904
+
905
+
906
+ &mdash;
907
+ <div class='inline'>
908
+ <p>User-defined options for multipart uploads</p>
909
+ </div>
910
+
911
+ </li>
912
+
913
+ </ul>
914
+
915
+ <p class="tag_title">Returns:</p>
916
+ <ul class="return">
917
+
918
+ <li>
919
+
920
+
921
+ <span class='type'>(<tt>Unirest::Response</tt>)</span>
922
+
923
+
924
+
925
+ </li>
926
+
927
+ </ul>
928
+
929
+ </div><table class="source_code">
930
+ <tr>
931
+ <td>
932
+ <pre class="lines">
933
+
934
+
935
+ 38
936
+ 39
937
+ 40
938
+ 41
939
+ 42
940
+ 43
941
+ 44
942
+ 45
943
+ 46
944
+ 47
945
+ 48
946
+ 49
947
+ 50
948
+ 51
949
+ 52
950
+ 53
951
+ 54
952
+ 55
953
+ 56
954
+ 57
955
+ 58
956
+ 59
957
+ 60
958
+ 61
959
+ 62
960
+ 63
961
+ 64
962
+ 65</pre>
963
+ </td>
964
+ <td>
965
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 38</span>
966
+
967
+ <span class='kw'>def</span> <span class='id identifier rubyid_multipart_start'>multipart_start</span><span class='lparen'>(</span><span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
968
+ <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span>
969
+ <span class='label'>apikey:</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span>
970
+ <span class='label'>filename:</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span>
971
+ <span class='label'>mimetype:</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span>
972
+ <span class='label'>size:</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span>
973
+ <span class='label'>store_location:</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>s3</span><span class='tstring_end'>&#39;</span></span> <span class='op'>:</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:store_location</span><span class='rbracket'>]</span><span class='comma'>,</span>
974
+ <span class='label'>file:</span> <span class='const'>Tempfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span><span class='comma'>,</span>
975
+ <span class='label'>options:</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span>
976
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>multipart</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>true</span><span class='tstring_end'>&#39;</span></span>
977
+ <span class='rbrace'>}</span>
978
+ <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span>
979
+
980
+ <span class='kw'>unless</span> <span class='id identifier rubyid_security'>security</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
981
+ <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:policy</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_security'>security</span><span class='period'>.</span><span class='id identifier rubyid_policy'>policy</span>
982
+ <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:signature</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_security'>security</span><span class='period'>.</span><span class='id identifier rubyid_signature'>signature</span>
983
+ <span class='kw'>end</span>
984
+
985
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'>Unirest</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span>
986
+ <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#MULTIPART_START_URL-constant" title="FilestackConfig::MULTIPART_START_URL (constant)">MULTIPART_START_URL</a></span></span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='id identifier rubyid_params'>params</span><span class='comma'>,</span>
987
+ <span class='label'>headers:</span> <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#HEADERS-constant" title="FilestackConfig::HEADERS (constant)">HEADERS</a></span></span>
988
+ <span class='rparen'>)</span>
989
+ <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>==</span> <span class='int'>200</span>
990
+ <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
991
+ <span class='kw'>else</span>
992
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>RuntimeError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
993
+ <span class='kw'>end</span>
994
+ <span class='kw'>end</span></pre>
995
+ </td>
996
+ </tr>
997
+ </table>
998
+ </div>
999
+
1000
+ <div class="method_details ">
1001
+ <h3 class="signature " id="multipart_upload-instance_method">
1002
+
1003
+ #<strong>multipart_upload</strong>(apikey, filepath, security, options, timeout, intelligent: false) &#x21d2; <tt>Unirest::Response</tt>
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+ </h3><div class="docstring">
1010
+ <div class="discussion">
1011
+
1012
+ <p>Run entire multipart process through with file and options</p>
1013
+
1014
+
1015
+ </div>
1016
+ </div>
1017
+ <div class="tags">
1018
+ <p class="tag_title">Parameters:</p>
1019
+ <ul class="param">
1020
+
1021
+ <li>
1022
+
1023
+ <span class='name'>apikey</span>
1024
+
1025
+
1026
+ <span class='type'>(<tt>String</tt>)</span>
1027
+
1028
+
1029
+
1030
+ &mdash;
1031
+ <div class='inline'>
1032
+ <p>Filestack API key</p>
1033
+ </div>
1034
+
1035
+ </li>
1036
+
1037
+ <li>
1038
+
1039
+ <span class='name'>filename</span>
1040
+
1041
+
1042
+ <span class='type'>(<tt>String</tt>)</span>
1043
+
1044
+
1045
+
1046
+ &mdash;
1047
+ <div class='inline'>
1048
+ <p>Name of incoming file</p>
1049
+ </div>
1050
+
1051
+ </li>
1052
+
1053
+ <li>
1054
+
1055
+ <span class='name'>security</span>
1056
+
1057
+
1058
+ <span class='type'>(<tt><span class='object_link'><a href="FilestackSecurity.html" title="FilestackSecurity (class)">FilestackSecurity</a></span></tt>)</span>
1059
+
1060
+
1061
+
1062
+ &mdash;
1063
+ <div class='inline'>
1064
+ <p>Security object with policy/signature</p>
1065
+ </div>
1066
+
1067
+ </li>
1068
+
1069
+ <li>
1070
+
1071
+ <span class='name'>options</span>
1072
+
1073
+
1074
+ <span class='type'>(<tt>Hash</tt>)</span>
1075
+
1076
+
1077
+
1078
+ &mdash;
1079
+ <div class='inline'>
1080
+ <p>User-defined options for multipart uploads</p>
1081
+ </div>
1082
+
1083
+ </li>
1084
+
1085
+ </ul>
1086
+
1087
+ <p class="tag_title">Returns:</p>
1088
+ <ul class="return">
1089
+
1090
+ <li>
1091
+
1092
+
1093
+ <span class='type'>(<tt>Unirest::Response</tt>)</span>
1094
+
1095
+
1096
+
1097
+ </li>
1098
+
1099
+ </ul>
1100
+
1101
+ </div><table class="source_code">
1102
+ <tr>
1103
+ <td>
1104
+ <pre class="lines">
1105
+
1106
+
1107
+ 239
1108
+ 240
1109
+ 241
1110
+ 242
1111
+ 243
1112
+ 244
1113
+ 245
1114
+ 246
1115
+ 247
1116
+ 248
1117
+ 249
1118
+ 250
1119
+ 251
1120
+ 252
1121
+ 253
1122
+ 254
1123
+ 255
1124
+ 256
1125
+ 257
1126
+ 258
1127
+ 259
1128
+ 260
1129
+ 261
1130
+ 262
1131
+ 263
1132
+ 264
1133
+ 265
1134
+ 266
1135
+ 267
1136
+ 268
1137
+ 269
1138
+ 270
1139
+ 271
1140
+ 272
1141
+ 273
1142
+ 274
1143
+ 275
1144
+ 276
1145
+ 277</pre>
1146
+ </td>
1147
+ <td>
1148
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 239</span>
1149
+
1150
+ <span class='kw'>def</span> <span class='id identifier rubyid_multipart_upload'>multipart_upload</span><span class='lparen'>(</span><span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_timeout'>timeout</span><span class='comma'>,</span> <span class='label'>intelligent:</span> <span class='kw'>false</span><span class='rparen'>)</span>
1151
+ <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span> <span class='op'>=</span> <span class='id identifier rubyid_get_file_info'>get_file_info</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rparen'>)</span>
1152
+ <span class='id identifier rubyid_start_response'>start_response</span> <span class='op'>=</span> <span class='id identifier rubyid_multipart_start'>multipart_start</span><span class='lparen'>(</span>
1153
+ <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
1154
+ <span class='rparen'>)</span>
1155
+ <span class='kw'>unless</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>upload_type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1156
+ <span class='id identifier rubyid_intelligent_enabled'>intelligent_enabled</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_start_response'>start_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>upload_type</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>intelligent_ingestion</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_intelligent'>intelligent</span>
1157
+ <span class='kw'>end</span>
1158
+ <span class='id identifier rubyid_jobs'>jobs</span> <span class='op'>=</span> <span class='id identifier rubyid_create_upload_jobs'>create_upload_jobs</span><span class='lparen'>(</span>
1159
+ <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
1160
+ <span class='rparen'>)</span>
1161
+ <span class='kw'>if</span> <span class='id identifier rubyid_intelligent_enabled'>intelligent_enabled</span>
1162
+ <span class='id identifier rubyid_state'>state</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="IntelligentState.html" title="IntelligentState (class)">IntelligentState</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="IntelligentState.html#initialize-instance_method" title="IntelligentState#initialize (method)">new</a></span></span>
1163
+ <span class='id identifier rubyid_run_intelligent_upload_flow'><span class='object_link'><a href="IntelligentUtils.html#run_intelligent_upload_flow-instance_method" title="IntelligentUtils#run_intelligent_upload_flow (method)">run_intelligent_upload_flow</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_jobs'>jobs</span><span class='comma'>,</span> <span class='id identifier rubyid_state'>state</span><span class='rparen'>)</span>
1164
+ <span class='id identifier rubyid_response_complete'>response_complete</span> <span class='op'>=</span> <span class='id identifier rubyid_multipart_complete'>multipart_complete</span><span class='lparen'>(</span>
1165
+ <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span>
1166
+ <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_intelligent'>intelligent</span>
1167
+ <span class='rparen'>)</span>
1168
+ <span class='kw'>else</span>
1169
+ <span class='id identifier rubyid_parts_and_etags'>parts_and_etags</span> <span class='op'>=</span> <span class='id identifier rubyid_run_uploads'>run_uploads</span><span class='lparen'>(</span><span class='id identifier rubyid_jobs'>jobs</span><span class='comma'>,</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
1170
+ <span class='id identifier rubyid_response_complete'>response_complete</span> <span class='op'>=</span> <span class='id identifier rubyid_multipart_complete'>multipart_complete</span><span class='lparen'>(</span>
1171
+ <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span>
1172
+ <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span> <span class='id identifier rubyid_parts_and_etags'>parts_and_etags</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
1173
+ <span class='rparen'>)</span>
1174
+ <span class='kw'>end</span>
1175
+ <span class='kw'>begin</span>
1176
+ <span class='const'>Timeout</span><span class='op'>::</span><span class='id identifier rubyid_timeout'>timeout</span><span class='lparen'>(</span><span class='id identifier rubyid_timeout'>timeout</span><span class='rparen'>)</span><span class='lbrace'>{</span>
1177
+ <span class='kw'>while</span> <span class='id identifier rubyid_response_complete'>response_complete</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>==</span> <span class='int'>202</span>
1178
+ <span class='id identifier rubyid_response_complete'>response_complete</span> <span class='op'>=</span> <span class='id identifier rubyid_multipart_complete'>multipart_complete</span><span class='lparen'>(</span>
1179
+ <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filename'>filename</span><span class='comma'>,</span> <span class='id identifier rubyid_filesize'>filesize</span><span class='comma'>,</span> <span class='id identifier rubyid_mimetype'>mimetype</span><span class='comma'>,</span>
1180
+ <span class='id identifier rubyid_start_response'>start_response</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_intelligent'>intelligent</span>
1181
+ <span class='rparen'>)</span>
1182
+ <span class='kw'>end</span>
1183
+ <span class='rbrace'>}</span>
1184
+ <span class='kw'>rescue</span>
1185
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Upload timed out upon completion. Please try again later</span><span class='tstring_end'>&quot;</span></span>
1186
+ <span class='kw'>end</span>
1187
+ <span class='id identifier rubyid_response_complete'>response_complete</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
1188
+ <span class='kw'>end</span></pre>
1189
+ </td>
1190
+ </tr>
1191
+ </table>
1192
+ </div>
1193
+
1194
+ <div class="method_details ">
1195
+ <h3 class="signature " id="run_uploads-instance_method">
1196
+
1197
+ #<strong>run_uploads</strong>(jobs, apikey, filepath, options) &#x21d2; <tt>Array</tt>
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+ </h3><div class="docstring">
1204
+ <div class="discussion">
1205
+
1206
+ <p>Runs all jobs in parallel</p>
1207
+
1208
+
1209
+ </div>
1210
+ </div>
1211
+ <div class="tags">
1212
+ <p class="tag_title">Parameters:</p>
1213
+ <ul class="param">
1214
+
1215
+ <li>
1216
+
1217
+ <span class='name'>jobs</span>
1218
+
1219
+
1220
+ <span class='type'>(<tt>Array</tt>)</span>
1221
+
1222
+
1223
+
1224
+ &mdash;
1225
+ <div class='inline'>
1226
+ <p>Array of jobs to be run</p>
1227
+ </div>
1228
+
1229
+ </li>
1230
+
1231
+ <li>
1232
+
1233
+ <span class='name'>apikey</span>
1234
+
1235
+
1236
+ <span class='type'>(<tt>String</tt>)</span>
1237
+
1238
+
1239
+
1240
+ &mdash;
1241
+ <div class='inline'>
1242
+ <p>Filestack API key</p>
1243
+ </div>
1244
+
1245
+ </li>
1246
+
1247
+ <li>
1248
+
1249
+ <span class='name'>filepath</span>
1250
+
1251
+
1252
+ <span class='type'>(<tt>String</tt>)</span>
1253
+
1254
+
1255
+
1256
+ &mdash;
1257
+ <div class='inline'>
1258
+ <p>Local path to file</p>
1259
+ </div>
1260
+
1261
+ </li>
1262
+
1263
+ <li>
1264
+
1265
+ <span class='name'>options</span>
1266
+
1267
+
1268
+ <span class='type'>(<tt>Hash</tt>)</span>
1269
+
1270
+
1271
+
1272
+ &mdash;
1273
+ <div class='inline'>
1274
+ <p>User-defined options for multipart uploads</p>
1275
+ </div>
1276
+
1277
+ </li>
1278
+
1279
+ </ul>
1280
+
1281
+ <p class="tag_title">Returns:</p>
1282
+ <ul class="return">
1283
+
1284
+ <li>
1285
+
1286
+
1287
+ <span class='type'>(<tt>Array</tt>)</span>
1288
+
1289
+
1290
+
1291
+ &mdash;
1292
+ <div class='inline'>
1293
+ <p>Array of parts/etags strings</p>
1294
+ </div>
1295
+
1296
+ </li>
1297
+
1298
+ </ul>
1299
+
1300
+ </div><table class="source_code">
1301
+ <tr>
1302
+ <td>
1303
+ <pre class="lines">
1304
+
1305
+
1306
+ 161
1307
+ 162
1308
+ 163
1309
+ 164
1310
+ 165
1311
+ 166
1312
+ 167
1313
+ 168
1314
+ 169
1315
+ 170
1316
+ 171
1317
+ 172
1318
+ 173
1319
+ 174
1320
+ 175</pre>
1321
+ </td>
1322
+ <td>
1323
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 161</span>
1324
+
1325
+ <span class='kw'>def</span> <span class='id identifier rubyid_run_uploads'>run_uploads</span><span class='lparen'>(</span><span class='id identifier rubyid_jobs'>jobs</span><span class='comma'>,</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
1326
+ <span class='id identifier rubyid_bar'>bar</span> <span class='op'>=</span> <span class='const'>ProgressBar</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_jobs'>jobs</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='rparen'>)</span>
1327
+ <span class='id identifier rubyid_results'>results</span> <span class='op'>=</span> <span class='const'>Parallel</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='id identifier rubyid_jobs'>jobs</span><span class='comma'>,</span> <span class='label'>in_threads:</span> <span class='int'>4</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_job'>job</span><span class='op'>|</span>
1328
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='id identifier rubyid_upload_chunk'>upload_chunk</span><span class='lparen'>(</span>
1329
+ <span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
1330
+ <span class='rparen'>)</span>
1331
+ <span class='kw'>if</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_code'>code</span> <span class='op'>==</span> <span class='int'>200</span>
1332
+ <span class='id identifier rubyid_bar'>bar</span><span class='period'>.</span><span class='id identifier rubyid_increment!'>increment!</span>
1333
+ <span class='id identifier rubyid_part'>part</span> <span class='op'>=</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:part</span><span class='rbracket'>]</span>
1334
+ <span class='id identifier rubyid_etag'>etag</span> <span class='op'>=</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:etag</span><span class='rbracket'>]</span>
1335
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_part'>part</span><span class='embexpr_end'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_etag'>etag</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
1336
+ <span class='kw'>end</span>
1337
+ <span class='kw'>end</span>
1338
+ <span class='id identifier rubyid_results'>results</span>
1339
+ <span class='kw'>end</span></pre>
1340
+ </td>
1341
+ </tr>
1342
+ </table>
1343
+ </div>
1344
+
1345
+ <div class="method_details ">
1346
+ <h3 class="signature " id="upload_chunk-instance_method">
1347
+
1348
+ #<strong>upload_chunk</strong>(job, apikey, filepath, options) &#x21d2; <tt>Unirest::Response</tt>
1349
+
1350
+
1351
+
1352
+
1353
+
1354
+ </h3><div class="docstring">
1355
+ <div class="discussion">
1356
+
1357
+ <p>Uploads one chunk of the file</p>
1358
+
1359
+
1360
+ </div>
1361
+ </div>
1362
+ <div class="tags">
1363
+ <p class="tag_title">Parameters:</p>
1364
+ <ul class="param">
1365
+
1366
+ <li>
1367
+
1368
+ <span class='name'>job</span>
1369
+
1370
+
1371
+ <span class='type'>(<tt>Hash</tt>)</span>
1372
+
1373
+
1374
+
1375
+ &mdash;
1376
+ <div class='inline'>
1377
+ <p>Hash of options needed to upload a chunk</p>
1378
+ </div>
1379
+
1380
+ </li>
1381
+
1382
+ <li>
1383
+
1384
+ <span class='name'>apikey</span>
1385
+
1386
+
1387
+ <span class='type'>(<tt>String</tt>)</span>
1388
+
1389
+
1390
+
1391
+ &mdash;
1392
+ <div class='inline'>
1393
+ <p>Filestack API key</p>
1394
+ </div>
1395
+
1396
+ </li>
1397
+
1398
+ <li>
1399
+
1400
+ <span class='name'>location_url</span>
1401
+
1402
+
1403
+ <span class='type'>(<tt>String</tt>)</span>
1404
+
1405
+
1406
+
1407
+ &mdash;
1408
+ <div class='inline'>
1409
+ <p>Location url given back from endpoint</p>
1410
+ </div>
1411
+
1412
+ </li>
1413
+
1414
+ <li>
1415
+
1416
+ <span class='name'>filepath</span>
1417
+
1418
+
1419
+ <span class='type'>(<tt>String</tt>)</span>
1420
+
1421
+
1422
+
1423
+ &mdash;
1424
+ <div class='inline'>
1425
+ <p>Local path to file</p>
1426
+ </div>
1427
+
1428
+ </li>
1429
+
1430
+ <li>
1431
+
1432
+ <span class='name'>options</span>
1433
+
1434
+
1435
+ <span class='type'>(<tt>Hash</tt>)</span>
1436
+
1437
+
1438
+
1439
+ &mdash;
1440
+ <div class='inline'>
1441
+ <p>User-defined options for multipart uploads</p>
1442
+ </div>
1443
+
1444
+ </li>
1445
+
1446
+ </ul>
1447
+
1448
+ <p class="tag_title">Returns:</p>
1449
+ <ul class="return">
1450
+
1451
+ <li>
1452
+
1453
+
1454
+ <span class='type'>(<tt>Unirest::Response</tt>)</span>
1455
+
1456
+
1457
+
1458
+ </li>
1459
+
1460
+ </ul>
1461
+
1462
+ </div><table class="source_code">
1463
+ <tr>
1464
+ <td>
1465
+ <pre class="lines">
1466
+
1467
+
1468
+ 125
1469
+ 126
1470
+ 127
1471
+ 128
1472
+ 129
1473
+ 130
1474
+ 131
1475
+ 132
1476
+ 133
1477
+ 134
1478
+ 135
1479
+ 136
1480
+ 137
1481
+ 138
1482
+ 139
1483
+ 140
1484
+ 141
1485
+ 142
1486
+ 143
1487
+ 144
1488
+ 145
1489
+ 146
1490
+ 147
1491
+ 148
1492
+ 149
1493
+ 150
1494
+ 151</pre>
1495
+ </td>
1496
+ <td>
1497
+ <pre class="code"><span class="info file"># File 'lib/filestack/utils/multipart_upload_utils.rb', line 125</span>
1498
+
1499
+ <span class='kw'>def</span> <span class='id identifier rubyid_upload_chunk'>upload_chunk</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='comma'>,</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
1500
+ <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rparen'>)</span>
1501
+ <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_seek'>seek</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:seek</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1502
+ <span class='id identifier rubyid_chunk'>chunk</span> <span class='op'>=</span> <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#DEFAULT_CHUNK_SIZE-constant" title="FilestackConfig::DEFAULT_CHUNK_SIZE (constant)">DEFAULT_CHUNK_SIZE</a></span></span><span class='rparen'>)</span>
1503
+
1504
+ <span class='id identifier rubyid_md5'>md5</span> <span class='op'>=</span> <span class='const'>Digest</span><span class='op'>::</span><span class='const'>MD5</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1505
+ <span class='id identifier rubyid_md5'>md5</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_chunk'>chunk</span>
1506
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbrace'>{</span>
1507
+ <span class='label'>apikey:</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span>
1508
+ <span class='label'>part:</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:part</span><span class='rbracket'>]</span><span class='comma'>,</span>
1509
+ <span class='label'>size:</span> <span class='id identifier rubyid_chunk'>chunk</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='comma'>,</span>
1510
+ <span class='label'>md5:</span> <span class='id identifier rubyid_md5'>md5</span><span class='period'>.</span><span class='id identifier rubyid_base64digest'>base64digest</span><span class='comma'>,</span>
1511
+ <span class='label'>uri:</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:uri</span><span class='rbracket'>]</span><span class='comma'>,</span>
1512
+ <span class='label'>region:</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:region</span><span class='rbracket'>]</span><span class='comma'>,</span>
1513
+ <span class='label'>upload_id:</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:upload_id</span><span class='rbracket'>]</span><span class='comma'>,</span>
1514
+ <span class='label'>store_location:</span> <span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:store_location</span><span class='rbracket'>]</span><span class='comma'>,</span>
1515
+ <span class='label'>file:</span> <span class='const'>Tempfile</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_job'>job</span><span class='lbracket'>[</span><span class='symbol'>:filename</span><span class='rbracket'>]</span><span class='rparen'>)</span>
1516
+ <span class='rbrace'>}</span>
1517
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_merge!'>merge!</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span>
1518
+ <span class='id identifier rubyid_fs_response'>fs_response</span> <span class='op'>=</span> <span class='const'>Unirest</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span>
1519
+ <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#MULTIPART_UPLOAD_URL-constant" title="FilestackConfig::MULTIPART_UPLOAD_URL (constant)">MULTIPART_UPLOAD_URL</a></span></span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='id identifier rubyid_data'>data</span><span class='comma'>,</span>
1520
+ <span class='label'>headers:</span> <span class='const'><span class='object_link'><a href="FilestackConfig.html" title="FilestackConfig (class)">FilestackConfig</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FilestackConfig.html#HEADERS-constant" title="FilestackConfig::HEADERS (constant)">HEADERS</a></span></span>
1521
+ <span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
1522
+ <span class='const'>Unirest</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span>
1523
+ <span class='id identifier rubyid_fs_response'>fs_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>url</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_fs_response'>fs_response</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>headers</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='id identifier rubyid_chunk'>chunk</span>
1524
+ <span class='rparen'>)</span>
1525
+ <span class='kw'>end</span></pre>
1526
+ </td>
1527
+ </tr>
1528
+ </table>
1529
+ </div>
1530
+
1531
+ </div>
1532
+
1533
+ </div>
1534
+
1535
+ <div id="footer">
1536
+ Generated on Thu Aug 17 10:04:38 2017 by
1537
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1538
+ 0.9.9 (ruby-2.4.0).
1539
+ </div>
1540
+
1541
+ </div>
1542
+ </body>
1543
+ </html>