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,884 @@
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: FilestackCommon
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 = "FilestackCommon";
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 (F)</a> &raquo;
40
+
41
+
42
+ <span class="title">FilestackCommon</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: FilestackCommon
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+ <dl>
75
+ <dt>Includes:</dt>
76
+ <dd><span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></dd>
77
+ </dl>
78
+
79
+
80
+
81
+
82
+ <dl>
83
+ <dt>Included in:</dt>
84
+ <dd><span class='object_link'><a href="FilestackFilelink.html" title="FilestackFilelink (class)">FilestackFilelink</a></span></dd>
85
+ </dl>
86
+
87
+
88
+
89
+ <dl>
90
+ <dt>Defined in:</dt>
91
+ <dd>lib/filestack/mixins/filestack_common.rb</dd>
92
+ </dl>
93
+
94
+ </div>
95
+
96
+ <h2>Overview</h2><div class="docstring">
97
+ <div class="discussion">
98
+
99
+ <p>Module is mixin for common functionalities that all Filestack objects can
100
+ call.</p>
101
+
102
+
103
+ </div>
104
+ </div>
105
+ <div class="tags">
106
+
107
+
108
+ </div>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ <h2>
117
+ Instance Method Summary
118
+ <small><a href="#" class="summary_toggle">collapse</a></small>
119
+ </h2>
120
+
121
+ <ul class="summary">
122
+
123
+ <li class="public ">
124
+ <span class="summary_signature">
125
+
126
+ <a href="#send_delete-instance_method" title="#send_delete (instance method)">#<strong>send_delete</strong>(handle, apikey, security) &#x21d2; unirest::Response </a>
127
+
128
+
129
+
130
+ </span>
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <span class="summary_desc"><div class='inline'>
141
+ <p>Send the delete api request to delete a filelink.</p>
142
+ </div></span>
143
+
144
+ </li>
145
+
146
+
147
+ <li class="public ">
148
+ <span class="summary_signature">
149
+
150
+ <a href="#send_download-instance_method" title="#send_download (instance method)">#<strong>send_download</strong>(filepath) &#x21d2; Int </a>
151
+
152
+
153
+
154
+ </span>
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+ <span class="summary_desc"><div class='inline'>
165
+ <p>Get the content of a filehandle.</p>
166
+ </div></span>
167
+
168
+ </li>
169
+
170
+
171
+ <li class="public ">
172
+ <span class="summary_signature">
173
+
174
+ <a href="#send_get_content-instance_method" title="#send_get_content (instance method)">#<strong>send_get_content</strong>(url, parameters: nil) &#x21d2; Bytes </a>
175
+
176
+
177
+
178
+ </span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'>
189
+ <p>Get the contents of a Filestack handle.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#send_metadata-instance_method" title="#send_metadata (instance method)">#<strong>send_metadata</strong>(handle, security = nil, params) &#x21d2; Object </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'></div></span>
213
+
214
+ </li>
215
+
216
+
217
+ <li class="public ">
218
+ <span class="summary_signature">
219
+
220
+ <a href="#send_overwrite-instance_method" title="#send_overwrite (instance method)">#<strong>send_overwrite</strong>(filepath, handle, apikey, security) &#x21d2; Typhoeus::Response </a>
221
+
222
+
223
+
224
+ </span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="summary_desc"><div class='inline'>
235
+ <p>Send the overwrite api request to update a filelink.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ <li class="public ">
242
+ <span class="summary_signature">
243
+
244
+ <a href="#send_tags-instance_method" title="#send_tags (instance method)">#<strong>send_tags</strong>(task, handle, security) &#x21d2; Hash </a>
245
+
246
+
247
+
248
+ </span>
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+ <span class="summary_desc"><div class='inline'>
259
+ <p>Get tags or sfw content from a filelink.</p>
260
+ </div></span>
261
+
262
+ </li>
263
+
264
+
265
+ </ul>
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></h3>
278
+ <p class="inherited"><span class='object_link'><a href="UploadUtils.html#get_url-instance_method" title="UploadUtils#get_url (method)">#get_url</a></span>, <span class='object_link'><a href="UploadUtils.html#make_call-instance_method" title="UploadUtils#make_call (method)">#make_call</a></span>, <span class='object_link'><a href="UploadUtils.html#send_upload-instance_method" title="UploadUtils#send_upload (method)">#send_upload</a></span></p>
279
+
280
+
281
+ <div id="instance_method_details" class="method_details_list">
282
+ <h2>Instance Method Details</h2>
283
+
284
+
285
+ <div class="method_details first">
286
+ <h3 class="signature first" id="send_delete-instance_method">
287
+
288
+ #<strong>send_delete</strong>(handle, apikey, security) &#x21d2; <tt>unirest::Response</tt>
289
+
290
+
291
+
292
+
293
+
294
+ </h3><div class="docstring">
295
+ <div class="discussion">
296
+
297
+ <p>Send the delete api request to delete a filelink</p>
298
+
299
+
300
+ </div>
301
+ </div>
302
+ <div class="tags">
303
+ <p class="tag_title">Parameters:</p>
304
+ <ul class="param">
305
+
306
+ <li>
307
+
308
+ <span class='name'>url</span>
309
+
310
+
311
+ <span class='type'>(<tt>String</tt>)</span>
312
+
313
+
314
+
315
+ &mdash;
316
+ <div class='inline'>
317
+ <p>The url of the Filehandle to be deleted (includes security)</p>
318
+ </div>
319
+
320
+ </li>
321
+
322
+ </ul>
323
+
324
+ <p class="tag_title">Returns:</p>
325
+ <ul class="return">
326
+
327
+ <li>
328
+
329
+
330
+ <span class='type'>(<tt>unirest::Response</tt>)</span>
331
+
332
+
333
+
334
+ </li>
335
+
336
+ </ul>
337
+
338
+ </div><table class="source_code">
339
+ <tr>
340
+ <td>
341
+ <pre class="lines">
342
+
343
+
344
+ 37
345
+ 38
346
+ 39
347
+ 40
348
+ 41
349
+ 42
350
+ 43
351
+ 44
352
+ 45
353
+ 46</pre>
354
+ </td>
355
+ <td>
356
+ <pre class="code"><span class="info file"># File 'lib/filestack/mixins/filestack_common.rb', line 37</span>
357
+
358
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_delete'>send_delete</span><span class='lparen'>(</span><span class='id identifier rubyid_handle'>handle</span><span class='comma'>,</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span><span class='rparen'>)</span>
359
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Delete requires security</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_security'>security</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
360
+ <span class='id identifier rubyid_signature'>signature</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>
361
+ <span class='id identifier rubyid_policy'>policy</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>
362
+ <span class='id identifier rubyid_base'>base</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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#API_URL-constant" title="FilestackConfig::API_URL (constant)">API_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/file</span><span class='tstring_end'>&quot;</span></span>
363
+ <span class='const'><span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></span><span class='period'>.</span><span class='id identifier rubyid_make_call'><span class='object_link'><a href="UploadUtils.html#make_call-instance_method" title="UploadUtils#make_call (method)">make_call</a></span></span><span class='lparen'>(</span>
364
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base'>base</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_handle'>handle</span><span class='embexpr_end'>}</span><span class='tstring_content'>?key=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_apikey'>apikey</span><span class='embexpr_end'>}</span><span class='tstring_content'>&amp;signature=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_signature'>signature</span><span class='embexpr_end'>}</span><span class='tstring_content'>&amp;policy=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_policy'>policy</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
365
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>delete</span><span class='tstring_end'>&#39;</span></span>
366
+ <span class='rparen'>)</span>
367
+ <span class='kw'>end</span></pre>
368
+ </td>
369
+ </tr>
370
+ </table>
371
+ </div>
372
+
373
+ <div class="method_details ">
374
+ <h3 class="signature " id="send_download-instance_method">
375
+
376
+ #<strong>send_download</strong>(filepath) &#x21d2; <tt>Int</tt>
377
+
378
+
379
+
380
+
381
+
382
+ </h3><div class="docstring">
383
+ <div class="discussion">
384
+
385
+ <p>Get the content of a filehandle</p>
386
+
387
+
388
+ </div>
389
+ </div>
390
+ <div class="tags">
391
+ <p class="tag_title">Parameters:</p>
392
+ <ul class="param">
393
+
394
+ <li>
395
+
396
+ <span class='name'>filepath</span>
397
+
398
+
399
+ <span class='type'>(<tt>String</tt>)</span>
400
+
401
+
402
+
403
+ &mdash;
404
+ <div class='inline'>
405
+ <p>Local path of file to be written</p>
406
+ </div>
407
+
408
+ </li>
409
+
410
+ </ul>
411
+
412
+ <p class="tag_title">Returns:</p>
413
+ <ul class="return">
414
+
415
+ <li>
416
+
417
+
418
+ <span class='type'>(<tt>Int</tt>)</span>
419
+
420
+
421
+
422
+ &mdash;
423
+ <div class='inline'>
424
+ <p>Size of file written</p>
425
+ </div>
426
+
427
+ </li>
428
+
429
+ </ul>
430
+
431
+ </div><table class="source_code">
432
+ <tr>
433
+ <td>
434
+ <pre class="lines">
435
+
436
+
437
+ 26
438
+ 27
439
+ 28
440
+ 29</pre>
441
+ </td>
442
+ <td>
443
+ <pre class="code"><span class="info file"># File 'lib/filestack/mixins/filestack_common.rb', line 26</span>
444
+
445
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_download'>send_download</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rparen'>)</span>
446
+ <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='id identifier rubyid_send_get_content'>send_get_content</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
447
+ <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='rparen'>)</span>
448
+ <span class='kw'>end</span></pre>
449
+ </td>
450
+ </tr>
451
+ </table>
452
+ </div>
453
+
454
+ <div class="method_details ">
455
+ <h3 class="signature " id="send_get_content-instance_method">
456
+
457
+ #<strong>send_get_content</strong>(url, parameters: nil) &#x21d2; <tt>Bytes</tt>
458
+
459
+
460
+
461
+
462
+
463
+ </h3><div class="docstring">
464
+ <div class="discussion">
465
+
466
+ <p>Get the contents of a Filestack handle</p>
467
+
468
+
469
+ </div>
470
+ </div>
471
+ <div class="tags">
472
+ <p class="tag_title">Parameters:</p>
473
+ <ul class="param">
474
+
475
+ <li>
476
+
477
+ <span class='name'>file_handle</span>
478
+
479
+
480
+ <span class='type'>(<tt>String</tt>)</span>
481
+
482
+
483
+
484
+ &mdash;
485
+ <div class='inline'>
486
+ <p>The Filelink handle</p>
487
+ </div>
488
+
489
+ </li>
490
+
491
+ <li>
492
+
493
+ <span class='name'>security</span>
494
+
495
+
496
+ <span class='type'>(<tt><span class='object_link'><a href="FilestackSecurity.html" title="FilestackSecurity (class)">FilestackSecurity</a></span></tt>)</span>
497
+
498
+
499
+
500
+ &mdash;
501
+ <div class='inline'>
502
+ <p>Optional Filestack security object if security is enabled</p>
503
+ </div>
504
+
505
+ </li>
506
+
507
+ </ul>
508
+
509
+ <p class="tag_title">Returns:</p>
510
+ <ul class="return">
511
+
512
+ <li>
513
+
514
+
515
+ <span class='type'>(<tt>Bytes</tt>)</span>
516
+
517
+
518
+
519
+ </li>
520
+
521
+ </ul>
522
+
523
+ </div><table class="source_code">
524
+ <tr>
525
+ <td>
526
+ <pre class="lines">
527
+
528
+
529
+ 17
530
+ 18
531
+ 19</pre>
532
+ </td>
533
+ <td>
534
+ <pre class="code"><span class="info file"># File 'lib/filestack/mixins/filestack_common.rb', line 17</span>
535
+
536
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_get_content'>send_get_content</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
537
+ <span class='const'><span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></span><span class='period'>.</span><span class='id identifier rubyid_make_call'><span class='object_link'><a href="UploadUtils.html#make_call-instance_method" title="UploadUtils#make_call (method)">make_call</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>get</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='id identifier rubyid_parameters'>parameters</span><span class='rparen'>)</span>
538
+ <span class='kw'>end</span></pre>
539
+ </td>
540
+ </tr>
541
+ </table>
542
+ </div>
543
+
544
+ <div class="method_details ">
545
+ <h3 class="signature " id="send_metadata-instance_method">
546
+
547
+ #<strong>send_metadata</strong>(handle, security = nil, params) &#x21d2; <tt>Object</tt>
548
+
549
+
550
+
551
+
552
+
553
+ </h3><table class="source_code">
554
+ <tr>
555
+ <td>
556
+ <pre class="lines">
557
+
558
+
559
+ 94
560
+ 95
561
+ 96
562
+ 97
563
+ 98
564
+ 99
565
+ 100
566
+ 101
567
+ 102
568
+ 103
569
+ 104
570
+ 105
571
+ 106
572
+ 107
573
+ 108</pre>
574
+ </td>
575
+ <td>
576
+ <pre class="code"><span class="info file"># File 'lib/filestack/mixins/filestack_common.rb', line 94</span>
577
+
578
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_metadata'>send_metadata</span><span class='lparen'>(</span><span class='id identifier rubyid_handle'>handle</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
579
+ <span class='kw'>if</span> <span class='id identifier rubyid_security'>security</span>
580
+ <span class='id identifier rubyid_policy'>policy</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>
581
+ <span class='id identifier rubyid_signature'>signature</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>
582
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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#CDN_URL-constant" title="FilestackConfig::CDN_URL (constant)">CDN_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_handle'>handle</span><span class='embexpr_end'>}</span><span class='tstring_content'>/metadata?signature=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_signature'>signature</span><span class='embexpr_end'>}</span><span class='tstring_content'>&amp;policy=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_policy'>policy</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
583
+ <span class='kw'>else</span>
584
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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#CDN_URL-constant" title="FilestackConfig::CDN_URL (constant)">CDN_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_handle'>handle</span><span class='embexpr_end'>}</span><span class='tstring_content'>/metadata</span><span class='tstring_end'>&quot;</span></span>
585
+ <span class='kw'>end</span>
586
+ <span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></span><span class='period'>.</span><span class='id identifier rubyid_make_call'><span class='object_link'><a href="UploadUtils.html#make_call-instance_method" title="UploadUtils#make_call (method)">make_call</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>get</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>parameters:</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
587
+
588
+ <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>
589
+ <span class='kw'>return</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
590
+ <span class='kw'>end</span>
591
+ <span class='id identifier rubyid_raise'>raise</span> <span class='id identifier rubyid_response'>response</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span>
592
+ <span class='kw'>end</span></pre>
593
+ </td>
594
+ </tr>
595
+ </table>
596
+ </div>
597
+
598
+ <div class="method_details ">
599
+ <h3 class="signature " id="send_overwrite-instance_method">
600
+
601
+ #<strong>send_overwrite</strong>(filepath, handle, apikey, security) &#x21d2; <tt>Typhoeus::Response</tt>
602
+
603
+
604
+
605
+
606
+
607
+ </h3><div class="docstring">
608
+ <div class="discussion">
609
+
610
+ <p>Send the overwrite api request to update a filelink</p>
611
+
612
+
613
+ </div>
614
+ </div>
615
+ <div class="tags">
616
+ <p class="tag_title">Parameters:</p>
617
+ <ul class="param">
618
+
619
+ <li>
620
+
621
+ <span class='name'>filepath</span>
622
+
623
+
624
+ <span class='type'>(<tt>String</tt>)</span>
625
+
626
+
627
+
628
+ &mdash;
629
+ <div class='inline'>
630
+ <p>Filepath of file to upload</p>
631
+ </div>
632
+
633
+ </li>
634
+
635
+ <li>
636
+
637
+ <span class='name'>handle</span>
638
+
639
+
640
+ <span class='type'>(<tt>String</tt>)</span>
641
+
642
+
643
+
644
+ &mdash;
645
+ <div class='inline'>
646
+ <p>The Filelink handle</p>
647
+ </div>
648
+
649
+ </li>
650
+
651
+ <li>
652
+
653
+ <span class='name'>apikey</span>
654
+
655
+
656
+ <span class='type'>(<tt>String</tt>)</span>
657
+
658
+
659
+
660
+ &mdash;
661
+ <div class='inline'>
662
+ <p>Filestack API Key</p>
663
+ </div>
664
+
665
+ </li>
666
+
667
+ <li>
668
+
669
+ <span class='name'>security</span>
670
+
671
+
672
+ <span class='type'>(<tt><span class='object_link'><a href="FilestackSecurity.html" title="FilestackSecurity (class)">FilestackSecurity</a></span></tt>)</span>
673
+
674
+
675
+
676
+ &mdash;
677
+ <div class='inline'>
678
+ <p>Filestack security object</p>
679
+ </div>
680
+
681
+ </li>
682
+
683
+ </ul>
684
+
685
+ <p class="tag_title">Returns:</p>
686
+ <ul class="return">
687
+
688
+ <li>
689
+
690
+
691
+ <span class='type'>(<tt>Typhoeus::Response</tt>)</span>
692
+
693
+
694
+
695
+ </li>
696
+
697
+ </ul>
698
+
699
+ </div><table class="source_code">
700
+ <tr>
701
+ <td>
702
+ <pre class="lines">
703
+
704
+
705
+ 56
706
+ 57
707
+ 58
708
+ 59
709
+ 60
710
+ 61
711
+ 62
712
+ 63
713
+ 64
714
+ 65
715
+ 66
716
+ 67
717
+ 68
718
+ 69
719
+ 70
720
+ 71
721
+ 72
722
+ 73
723
+ 74
724
+ 75</pre>
725
+ </td>
726
+ <td>
727
+ <pre class="code"><span class="info file"># File 'lib/filestack/mixins/filestack_common.rb', line 56</span>
728
+
729
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_overwrite'>send_overwrite</span><span class='lparen'>(</span><span class='id identifier rubyid_filepath'>filepath</span><span class='comma'>,</span> <span class='id identifier rubyid_handle'>handle</span><span class='comma'>,</span> <span class='id identifier rubyid_apikey'>apikey</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span><span class='rparen'>)</span>
730
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Overwrite requires security</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_security'>security</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
731
+
732
+ <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='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>r</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
733
+ <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='id identifier rubyid_file'>file</span><span class='rparen'>)</span>
734
+ <span class='id identifier rubyid_content'>content</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>
735
+
736
+ <span class='id identifier rubyid_signature'>signature</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>
737
+ <span class='id identifier rubyid_policy'>policy</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>
738
+
739
+ <span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Content-Type</span><span class='tstring_end'>&#39;</span></span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_mimetype'>mimetype</span> <span class='rbrace'>}</span>
740
+ <span class='id identifier rubyid_base'>base</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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#API_URL-constant" title="FilestackConfig::API_URL (constant)">API_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/file</span><span class='tstring_end'>&quot;</span></span>
741
+
742
+ <span class='const'><span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></span><span class='period'>.</span><span class='id identifier rubyid_make_call'><span class='object_link'><a href="UploadUtils.html#make_call-instance_method" title="UploadUtils#make_call (method)">make_call</a></span></span><span class='lparen'>(</span>
743
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base'>base</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_handle'>handle</span><span class='embexpr_end'>}</span><span class='tstring_content'>?key=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_apikey'>apikey</span><span class='embexpr_end'>}</span><span class='tstring_content'>&amp;signature=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_signature'>signature</span><span class='embexpr_end'>}</span><span class='tstring_content'>&amp;policy=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_policy'>policy</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
744
+ <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>put</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
745
+ <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='comma'>,</span>
746
+ <span class='label'>parameters:</span> <span class='id identifier rubyid_content'>content</span>
747
+ <span class='rparen'>)</span>
748
+ <span class='kw'>end</span></pre>
749
+ </td>
750
+ </tr>
751
+ </table>
752
+ </div>
753
+
754
+ <div class="method_details ">
755
+ <h3 class="signature " id="send_tags-instance_method">
756
+
757
+ #<strong>send_tags</strong>(task, handle, security) &#x21d2; <tt>Hash</tt>
758
+
759
+
760
+
761
+
762
+
763
+ </h3><div class="docstring">
764
+ <div class="discussion">
765
+
766
+ <p>Get tags or sfw content from a filelink</p>
767
+
768
+
769
+ </div>
770
+ </div>
771
+ <div class="tags">
772
+ <p class="tag_title">Parameters:</p>
773
+ <ul class="param">
774
+
775
+ <li>
776
+
777
+ <span class='name'>task</span>
778
+
779
+
780
+ <span class='type'>(<tt>String</tt>)</span>
781
+
782
+
783
+
784
+ &mdash;
785
+ <div class='inline'>
786
+ <p>&#39;tags&#39; or &#39;sfw&#39;</p>
787
+ </div>
788
+
789
+ </li>
790
+
791
+ <li>
792
+
793
+ <span class='name'>handle</span>
794
+
795
+
796
+ <span class='type'>(<tt>String</tt>)</span>
797
+
798
+
799
+
800
+ &mdash;
801
+ <div class='inline'>
802
+ <p>The filehandle</p>
803
+ </div>
804
+
805
+ </li>
806
+
807
+ <li>
808
+
809
+ <span class='name'>security</span>
810
+
811
+
812
+ <span class='type'>(<tt>Filestack::Security</tt>)</span>
813
+
814
+
815
+
816
+ &mdash;
817
+ <div class='inline'>
818
+ <p>Security object</p>
819
+ </div>
820
+
821
+ </li>
822
+
823
+ </ul>
824
+
825
+ <p class="tag_title">Returns:</p>
826
+ <ul class="return">
827
+
828
+ <li>
829
+
830
+
831
+ <span class='type'>(<tt>Hash</tt>)</span>
832
+
833
+
834
+
835
+ </li>
836
+
837
+ </ul>
838
+
839
+ </div><table class="source_code">
840
+ <tr>
841
+ <td>
842
+ <pre class="lines">
843
+
844
+
845
+ 84
846
+ 85
847
+ 86
848
+ 87
849
+ 88
850
+ 89
851
+ 90
852
+ 91
853
+ 92</pre>
854
+ </td>
855
+ <td>
856
+ <pre class="code"><span class="info file"># File 'lib/filestack/mixins/filestack_common.rb', line 84</span>
857
+
858
+ <span class='kw'>def</span> <span class='id identifier rubyid_send_tags'>send_tags</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='id identifier rubyid_handle'>handle</span><span class='comma'>,</span> <span class='id identifier rubyid_security'>security</span><span class='rparen'>)</span>
859
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>You must use security for tags</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_security'>security</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
860
+
861
+ <span class='id identifier rubyid_policy'>policy</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>
862
+ <span class='id identifier rubyid_signature'>signature</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>
863
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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#CDN_URL-constant" title="FilestackConfig::CDN_URL (constant)">CDN_URL</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_task'>task</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span>\
864
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>security=signature:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_signature'>signature</span><span class='embexpr_end'>}</span><span class='tstring_content'>,policy:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_policy'>policy</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_handle'>handle</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
865
+ <span class='const'><span class='object_link'><a href="UploadUtils.html" title="UploadUtils (module)">UploadUtils</a></span></span><span class='period'>.</span><span class='id identifier rubyid_make_call'><span class='object_link'><a href="UploadUtils.html#make_call-instance_method" title="UploadUtils#make_call (method)">make_call</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>get</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_body'>body</span><span class='lbracket'>[</span><span class='id identifier rubyid_task'>task</span><span class='rbracket'>]</span>
866
+ <span class='kw'>end</span></pre>
867
+ </td>
868
+ </tr>
869
+ </table>
870
+ </div>
871
+
872
+ </div>
873
+
874
+ </div>
875
+
876
+ <div id="footer">
877
+ Generated on Thu Aug 17 10:04:38 2017 by
878
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
879
+ 0.9.9 (ruby-2.4.0).
880
+ </div>
881
+
882
+ </div>
883
+ </body>
884
+ </html>