• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3          "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <title>googleapiclient.http.MediaUpload</title>
7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
8  <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12      alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15       bgcolor="#a0c0ff" cellspacing="0">
16  <tr valign="middle">
17  <!-- Home link -->
18      <th>&nbsp;&nbsp;&nbsp;<a
19        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21  <!-- Tree link -->
22      <th>&nbsp;&nbsp;&nbsp;<a
23        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25  <!-- Index link -->
26      <th>&nbsp;&nbsp;&nbsp;<a
27        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29  <!-- Help link -->
30      <th>&nbsp;&nbsp;&nbsp;<a
31        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33      <th class="navbar" width="100%"></th>
34  </tr>
35</table>
36<table width="100%" cellpadding="0" cellspacing="0">
37  <tr valign="top">
38    <td width="100%">
39      <span class="breadcrumbs">
40        <a href="googleapiclient-module.html">Package&nbsp;googleapiclient</a> ::
41        <a href="googleapiclient.http-module.html">Module&nbsp;http</a> ::
42        Class&nbsp;MediaUpload
43      </span>
44    </td>
45    <td>
46      <table cellpadding="0" cellspacing="0">
47        <!-- hide/show private -->
48        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
49    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
50        <tr><td align="right"><span class="options"
51            >[<a href="frames.html" target="_top">frames</a
52            >]&nbsp;|&nbsp;<a href="googleapiclient.http.MediaUpload-class.html"
53            target="_top">no&nbsp;frames</a>]</span></td></tr>
54      </table>
55    </td>
56  </tr>
57</table>
58<!-- ==================== CLASS DESCRIPTION ==================== -->
59<h1 class="epydoc">Class MediaUpload</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload">source&nbsp;code</a></span></p>
60<center>
61
62</center>
63<hr />
64<pre class="literalblock">
65Describes a media object to upload.
66
67Base class that defines the interface of MediaUpload subclasses.
68
69Note that subclasses of MediaUpload may allow you to control the chunksize
70when uploading a media object. It is important to keep the size of the chunk
71as large as possible to keep the upload efficient. Other factors may influence
72the size of the chunk you use, particularly if you are working in an
73environment where individual HTTP requests may have a hardcoded time limit,
74such as under certain classes of requests under Google App Engine.
75
76Streams are io.Base compatible objects that support seek(). Some MediaUpload
77subclasses support using streams directly to upload data. Support for
78streaming may be indicated by a MediaUpload sub-class and if appropriate for a
79platform that stream will be used for uploading the media object. The support
80for streaming is indicated by has_stream() returning True. The stream() method
81should return an io.Base object that supports seek(). On platforms where the
82underlying httplib module supports streaming, for example Python 2.6 and
83later, the stream will be passed into the http library which will result in
84less memory being used and possibly faster uploads.
85
86If you need to upload media that can't be uploaded using any of the existing
87MediaUpload sub-class then you can sub-class MediaUpload for your particular
88needs.
89
90</pre>
91
92<!-- ==================== INSTANCE METHODS ==================== -->
93<a name="section-InstanceMethods"></a>
94<table class="summary" border="1" cellpadding="3"
95       cellspacing="0" width="100%" bgcolor="white">
96<tr bgcolor="#70b0f0" class="table-header">
97  <td colspan="2" class="table-header">
98    <table border="0" cellpadding="0" cellspacing="0" width="100%">
99      <tr valign="top">
100        <td align="left"><span class="table-header">Instance Methods</span></td>
101        <td align="right" valign="top"
102         ><span class="options">[<a href="#section-InstanceMethods"
103         class="privatelink" onclick="toggle_private();"
104         >hide private</a>]</span></td>
105      </tr>
106    </table>
107  </td>
108</tr>
109<tr>
110    <td width="15%" align="right" valign="top" class="summary">
111      <span class="summary-type">&nbsp;</span>
112    </td><td class="summary">
113      <table width="100%" cellpadding="0" cellspacing="0" border="0">
114        <tr>
115          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#chunksize" class="summary-sig-name">chunksize</a>(<span class="summary-sig-arg">self</span>)</span><br />
116      Chunk size for resumable uploads.</td>
117          <td align="right" valign="top">
118            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.chunksize">source&nbsp;code</a></span>
119
120          </td>
121        </tr>
122      </table>
123
124    </td>
125  </tr>
126<tr>
127    <td width="15%" align="right" valign="top" class="summary">
128      <span class="summary-type">&nbsp;</span>
129    </td><td class="summary">
130      <table width="100%" cellpadding="0" cellspacing="0" border="0">
131        <tr>
132          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#mimetype" class="summary-sig-name">mimetype</a>(<span class="summary-sig-arg">self</span>)</span><br />
133      Mime type of the body.</td>
134          <td align="right" valign="top">
135            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.mimetype">source&nbsp;code</a></span>
136
137          </td>
138        </tr>
139      </table>
140
141    </td>
142  </tr>
143<tr>
144    <td width="15%" align="right" valign="top" class="summary">
145      <span class="summary-type">&nbsp;</span>
146    </td><td class="summary">
147      <table width="100%" cellpadding="0" cellspacing="0" border="0">
148        <tr>
149          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#size" class="summary-sig-name">size</a>(<span class="summary-sig-arg">self</span>)</span><br />
150      Size of upload.</td>
151          <td align="right" valign="top">
152            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.size">source&nbsp;code</a></span>
153
154          </td>
155        </tr>
156      </table>
157
158    </td>
159  </tr>
160<tr>
161    <td width="15%" align="right" valign="top" class="summary">
162      <span class="summary-type">&nbsp;</span>
163    </td><td class="summary">
164      <table width="100%" cellpadding="0" cellspacing="0" border="0">
165        <tr>
166          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#resumable" class="summary-sig-name">resumable</a>(<span class="summary-sig-arg">self</span>)</span><br />
167      Whether this upload is resumable.</td>
168          <td align="right" valign="top">
169            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.resumable">source&nbsp;code</a></span>
170
171          </td>
172        </tr>
173      </table>
174
175    </td>
176  </tr>
177<tr>
178    <td width="15%" align="right" valign="top" class="summary">
179      <span class="summary-type">&nbsp;</span>
180    </td><td class="summary">
181      <table width="100%" cellpadding="0" cellspacing="0" border="0">
182        <tr>
183          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#getbytes" class="summary-sig-name">getbytes</a>(<span class="summary-sig-arg">self</span>,
184        <span class="summary-sig-arg">begin</span>,
185        <span class="summary-sig-arg">end</span>)</span><br />
186      Get bytes from the media.</td>
187          <td align="right" valign="top">
188            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.getbytes">source&nbsp;code</a></span>
189
190          </td>
191        </tr>
192      </table>
193
194    </td>
195  </tr>
196<tr>
197    <td width="15%" align="right" valign="top" class="summary">
198      <span class="summary-type">&nbsp;</span>
199    </td><td class="summary">
200      <table width="100%" cellpadding="0" cellspacing="0" border="0">
201        <tr>
202          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#has_stream" class="summary-sig-name">has_stream</a>(<span class="summary-sig-arg">self</span>)</span><br />
203      Does the underlying upload support a streaming interface.</td>
204          <td align="right" valign="top">
205            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.has_stream">source&nbsp;code</a></span>
206
207          </td>
208        </tr>
209      </table>
210
211    </td>
212  </tr>
213<tr>
214    <td width="15%" align="right" valign="top" class="summary">
215      <span class="summary-type">&nbsp;</span>
216    </td><td class="summary">
217      <table width="100%" cellpadding="0" cellspacing="0" border="0">
218        <tr>
219          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#stream" class="summary-sig-name">stream</a>(<span class="summary-sig-arg">self</span>)</span><br />
220      A stream interface to the data being uploaded.</td>
221          <td align="right" valign="top">
222            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.stream">source&nbsp;code</a></span>
223
224          </td>
225        </tr>
226      </table>
227
228    </td>
229  </tr>
230<tr class="private">
231    <td width="15%" align="right" valign="top" class="summary">
232      <span class="summary-type">&nbsp;</span>
233    </td><td class="summary">
234      <table width="100%" cellpadding="0" cellspacing="0" border="0">
235        <tr>
236          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#_to_json" class="summary-sig-name" onclick="show_private();">_to_json</a>(<span class="summary-sig-arg">self</span>,
237        <span class="summary-sig-arg">strip</span>=<span class="summary-sig-default">None</span>)</span><br />
238      Utility function for creating a JSON representation of a MediaUpload.</td>
239          <td align="right" valign="top">
240            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload._to_json">source&nbsp;code</a></span>
241
242          </td>
243        </tr>
244      </table>
245
246    </td>
247  </tr>
248<tr>
249    <td width="15%" align="right" valign="top" class="summary">
250      <span class="summary-type">&nbsp;</span>
251    </td><td class="summary">
252      <table width="100%" cellpadding="0" cellspacing="0" border="0">
253        <tr>
254          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#to_json" class="summary-sig-name">to_json</a>(<span class="summary-sig-arg">self</span>)</span><br />
255      Create a JSON representation of an instance of MediaUpload.</td>
256          <td align="right" valign="top">
257            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.to_json">source&nbsp;code</a></span>
258
259          </td>
260        </tr>
261      </table>
262
263    </td>
264  </tr>
265  <tr>
266    <td colspan="2" class="summary">
267    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
268      <code>__delattr__</code>,
269      <code>__format__</code>,
270      <code>__getattribute__</code>,
271      <code>__hash__</code>,
272      <code>__init__</code>,
273      <code>__new__</code>,
274      <code>__reduce__</code>,
275      <code>__reduce_ex__</code>,
276      <code>__repr__</code>,
277      <code>__setattr__</code>,
278      <code>__sizeof__</code>,
279      <code>__str__</code>,
280      <code>__subclasshook__</code>
281      </p>
282    </td>
283  </tr>
284</table>
285<!-- ==================== CLASS METHODS ==================== -->
286<a name="section-ClassMethods"></a>
287<table class="summary" border="1" cellpadding="3"
288       cellspacing="0" width="100%" bgcolor="white">
289<tr bgcolor="#70b0f0" class="table-header">
290  <td colspan="2" class="table-header">
291    <table border="0" cellpadding="0" cellspacing="0" width="100%">
292      <tr valign="top">
293        <td align="left"><span class="table-header">Class Methods</span></td>
294        <td align="right" valign="top"
295         ><span class="options">[<a href="#section-ClassMethods"
296         class="privatelink" onclick="toggle_private();"
297         >hide private</a>]</span></td>
298      </tr>
299    </table>
300  </td>
301</tr>
302<tr>
303    <td width="15%" align="right" valign="top" class="summary">
304      <span class="summary-type">&nbsp;</span>
305    </td><td class="summary">
306      <table width="100%" cellpadding="0" cellspacing="0" border="0">
307        <tr>
308          <td><span class="summary-sig"><a href="googleapiclient.http.MediaUpload-class.html#new_from_json" class="summary-sig-name">new_from_json</a>(<span class="summary-sig-arg">cls</span>,
309        <span class="summary-sig-arg">s</span>)</span><br />
310      Utility class method to instantiate a MediaUpload subclass from a JSON
311representation produced by to_json().</td>
312          <td align="right" valign="top">
313            <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.new_from_json">source&nbsp;code</a></span>
314
315          </td>
316        </tr>
317      </table>
318
319    </td>
320  </tr>
321</table>
322<!-- ==================== PROPERTIES ==================== -->
323<a name="section-Properties"></a>
324<table class="summary" border="1" cellpadding="3"
325       cellspacing="0" width="100%" bgcolor="white">
326<tr bgcolor="#70b0f0" class="table-header">
327  <td colspan="2" class="table-header">
328    <table border="0" cellpadding="0" cellspacing="0" width="100%">
329      <tr valign="top">
330        <td align="left"><span class="table-header">Properties</span></td>
331        <td align="right" valign="top"
332         ><span class="options">[<a href="#section-Properties"
333         class="privatelink" onclick="toggle_private();"
334         >hide private</a>]</span></td>
335      </tr>
336    </table>
337  </td>
338</tr>
339  <tr>
340    <td colspan="2" class="summary">
341    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
342      <code>__class__</code>
343      </p>
344    </td>
345  </tr>
346</table>
347<!-- ==================== METHOD DETAILS ==================== -->
348<a name="section-MethodDetails"></a>
349<table class="details" border="1" cellpadding="3"
350       cellspacing="0" width="100%" bgcolor="white">
351<tr bgcolor="#70b0f0" class="table-header">
352  <td colspan="2" class="table-header">
353    <table border="0" cellpadding="0" cellspacing="0" width="100%">
354      <tr valign="top">
355        <td align="left"><span class="table-header">Method Details</span></td>
356        <td align="right" valign="top"
357         ><span class="options">[<a href="#section-MethodDetails"
358         class="privatelink" onclick="toggle_private();"
359         >hide private</a>]</span></td>
360      </tr>
361    </table>
362  </td>
363</tr>
364</table>
365<a name="chunksize"></a>
366<div>
367<table class="details" border="1" cellpadding="3"
368       cellspacing="0" width="100%" bgcolor="white">
369<tr><td>
370  <table width="100%" cellpadding="0" cellspacing="0" border="0">
371  <tr valign="top"><td>
372  <h3 class="epydoc"><span class="sig"><span class="sig-name">chunksize</span>(<span class="sig-arg">self</span>)</span>
373  </h3>
374  </td><td align="right" valign="top"
375    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.chunksize">source&nbsp;code</a></span>&nbsp;
376    </td>
377  </tr></table>
378
379  <pre class="literalblock">
380Chunk size for resumable uploads.
381
382Returns:
383  Chunk size in bytes.
384
385</pre>
386  <dl class="fields">
387  </dl>
388</td></tr></table>
389</div>
390<a name="mimetype"></a>
391<div>
392<table class="details" border="1" cellpadding="3"
393       cellspacing="0" width="100%" bgcolor="white">
394<tr><td>
395  <table width="100%" cellpadding="0" cellspacing="0" border="0">
396  <tr valign="top"><td>
397  <h3 class="epydoc"><span class="sig"><span class="sig-name">mimetype</span>(<span class="sig-arg">self</span>)</span>
398  </h3>
399  </td><td align="right" valign="top"
400    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.mimetype">source&nbsp;code</a></span>&nbsp;
401    </td>
402  </tr></table>
403
404  <pre class="literalblock">
405Mime type of the body.
406
407Returns:
408  Mime type.
409
410</pre>
411  <dl class="fields">
412  </dl>
413</td></tr></table>
414</div>
415<a name="size"></a>
416<div>
417<table class="details" border="1" cellpadding="3"
418       cellspacing="0" width="100%" bgcolor="white">
419<tr><td>
420  <table width="100%" cellpadding="0" cellspacing="0" border="0">
421  <tr valign="top"><td>
422  <h3 class="epydoc"><span class="sig"><span class="sig-name">size</span>(<span class="sig-arg">self</span>)</span>
423  </h3>
424  </td><td align="right" valign="top"
425    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.size">source&nbsp;code</a></span>&nbsp;
426    </td>
427  </tr></table>
428
429  <pre class="literalblock">
430Size of upload.
431
432Returns:
433  Size of the body, or None of the size is unknown.
434
435</pre>
436  <dl class="fields">
437  </dl>
438</td></tr></table>
439</div>
440<a name="resumable"></a>
441<div>
442<table class="details" border="1" cellpadding="3"
443       cellspacing="0" width="100%" bgcolor="white">
444<tr><td>
445  <table width="100%" cellpadding="0" cellspacing="0" border="0">
446  <tr valign="top"><td>
447  <h3 class="epydoc"><span class="sig"><span class="sig-name">resumable</span>(<span class="sig-arg">self</span>)</span>
448  </h3>
449  </td><td align="right" valign="top"
450    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.resumable">source&nbsp;code</a></span>&nbsp;
451    </td>
452  </tr></table>
453
454  <pre class="literalblock">
455Whether this upload is resumable.
456
457Returns:
458  True if resumable upload or False.
459
460</pre>
461  <dl class="fields">
462  </dl>
463</td></tr></table>
464</div>
465<a name="getbytes"></a>
466<div>
467<table class="details" border="1" cellpadding="3"
468       cellspacing="0" width="100%" bgcolor="white">
469<tr><td>
470  <table width="100%" cellpadding="0" cellspacing="0" border="0">
471  <tr valign="top"><td>
472  <h3 class="epydoc"><span class="sig"><span class="sig-name">getbytes</span>(<span class="sig-arg">self</span>,
473        <span class="sig-arg">begin</span>,
474        <span class="sig-arg">end</span>)</span>
475  </h3>
476  </td><td align="right" valign="top"
477    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.getbytes">source&nbsp;code</a></span>&nbsp;
478    </td>
479  </tr></table>
480
481  <pre class="literalblock">
482Get bytes from the media.
483
484Args:
485  begin: int, offset from beginning of file.
486  length: int, number of bytes to read, starting at begin.
487
488Returns:
489  A string of bytes read. May be shorter than length if EOF was reached
490  first.
491
492</pre>
493  <dl class="fields">
494  </dl>
495</td></tr></table>
496</div>
497<a name="has_stream"></a>
498<div>
499<table class="details" border="1" cellpadding="3"
500       cellspacing="0" width="100%" bgcolor="white">
501<tr><td>
502  <table width="100%" cellpadding="0" cellspacing="0" border="0">
503  <tr valign="top"><td>
504  <h3 class="epydoc"><span class="sig"><span class="sig-name">has_stream</span>(<span class="sig-arg">self</span>)</span>
505  </h3>
506  </td><td align="right" valign="top"
507    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.has_stream">source&nbsp;code</a></span>&nbsp;
508    </td>
509  </tr></table>
510
511  <pre class="literalblock">
512Does the underlying upload support a streaming interface.
513
514Streaming means it is an io.IOBase subclass that supports seek, i.e.
515seekable() returns True.
516
517Returns:
518  True if the call to stream() will return an instance of a seekable io.Base
519  subclass.
520
521</pre>
522  <dl class="fields">
523  </dl>
524</td></tr></table>
525</div>
526<a name="stream"></a>
527<div>
528<table class="details" border="1" cellpadding="3"
529       cellspacing="0" width="100%" bgcolor="white">
530<tr><td>
531  <table width="100%" cellpadding="0" cellspacing="0" border="0">
532  <tr valign="top"><td>
533  <h3 class="epydoc"><span class="sig"><span class="sig-name">stream</span>(<span class="sig-arg">self</span>)</span>
534  </h3>
535  </td><td align="right" valign="top"
536    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.stream">source&nbsp;code</a></span>&nbsp;
537    </td>
538  </tr></table>
539
540  <pre class="literalblock">
541A stream interface to the data being uploaded.
542
543Returns:
544  The returned value is an io.IOBase subclass that supports seek, i.e.
545  seekable() returns True.
546
547</pre>
548  <dl class="fields">
549  </dl>
550</td></tr></table>
551</div>
552<a name="_to_json"></a>
553<div class="private">
554<table class="details" border="1" cellpadding="3"
555       cellspacing="0" width="100%" bgcolor="white">
556<tr><td>
557  <table width="100%" cellpadding="0" cellspacing="0" border="0">
558  <tr valign="top"><td>
559  <h3 class="epydoc"><span class="sig"><span class="sig-name">_to_json</span>(<span class="sig-arg">self</span>,
560        <span class="sig-arg">strip</span>=<span class="sig-default">None</span>)</span>
561  </h3>
562  </td><td align="right" valign="top"
563    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload._to_json">source&nbsp;code</a></span>&nbsp;
564    </td>
565  </tr></table>
566
567  <pre class="literalblock">
568Utility function for creating a JSON representation of a MediaUpload.
569
570Args:
571  strip: array, An array of names of members to not include in the JSON.
572
573Returns:
574   string, a JSON representation of this instance, suitable to pass to
575   from_json().
576
577</pre>
578  <dl class="fields">
579    <dt>Decorators:</dt>
580    <dd><ul class="nomargin-top">
581        <li><code>@util.positional(1)</code></li>
582    </ul></dd>
583  </dl>
584</td></tr></table>
585</div>
586<a name="to_json"></a>
587<div>
588<table class="details" border="1" cellpadding="3"
589       cellspacing="0" width="100%" bgcolor="white">
590<tr><td>
591  <table width="100%" cellpadding="0" cellspacing="0" border="0">
592  <tr valign="top"><td>
593  <h3 class="epydoc"><span class="sig"><span class="sig-name">to_json</span>(<span class="sig-arg">self</span>)</span>
594  </h3>
595  </td><td align="right" valign="top"
596    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.to_json">source&nbsp;code</a></span>&nbsp;
597    </td>
598  </tr></table>
599
600  <pre class="literalblock">
601Create a JSON representation of an instance of MediaUpload.
602
603Returns:
604   string, a JSON representation of this instance, suitable to pass to
605   from_json().
606
607</pre>
608  <dl class="fields">
609  </dl>
610</td></tr></table>
611</div>
612<a name="new_from_json"></a>
613<div>
614<table class="details" border="1" cellpadding="3"
615       cellspacing="0" width="100%" bgcolor="white">
616<tr><td>
617  <table width="100%" cellpadding="0" cellspacing="0" border="0">
618  <tr valign="top"><td>
619  <h3 class="epydoc"><span class="sig"><span class="sig-name">new_from_json</span>(<span class="sig-arg">cls</span>,
620        <span class="sig-arg">s</span>)</span>
621    <br /><em class="fname">Class Method</em>
622  </h3>
623  </td><td align="right" valign="top"
624    ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaUpload.new_from_json">source&nbsp;code</a></span>&nbsp;
625    </td>
626  </tr></table>
627
628  <pre class="literalblock">
629Utility class method to instantiate a MediaUpload subclass from a JSON
630representation produced by to_json().
631
632Args:
633  s: string, JSON from to_json().
634
635Returns:
636  An instance of the subclass of MediaUpload that was serialized with
637  to_json().
638
639</pre>
640  <dl class="fields">
641  </dl>
642</td></tr></table>
643</div>
644<br />
645<!-- ==================== NAVIGATION BAR ==================== -->
646<table class="navbar" border="0" width="100%" cellpadding="0"
647       bgcolor="#a0c0ff" cellspacing="0">
648  <tr valign="middle">
649  <!-- Home link -->
650      <th>&nbsp;&nbsp;&nbsp;<a
651        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
652
653  <!-- Tree link -->
654      <th>&nbsp;&nbsp;&nbsp;<a
655        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
656
657  <!-- Index link -->
658      <th>&nbsp;&nbsp;&nbsp;<a
659        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
660
661  <!-- Help link -->
662      <th>&nbsp;&nbsp;&nbsp;<a
663        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
664
665      <th class="navbar" width="100%"></th>
666  </tr>
667</table>
668<table border="0" cellpadding="0" cellspacing="0" width="100%%">
669  <tr>
670    <td align="left" class="footer">
671    Generated by Epydoc 3.0.1 on Mon Jun  5 13:38:40 2017
672    </td>
673    <td align="right" class="footer">
674      <a target="mainFrame" href="http://epydoc.sourceforge.net"
675        >http://epydoc.sourceforge.net</a>
676    </td>
677  </tr>
678</table>
679
680<script type="text/javascript">
681  <!--
682  // Private objects are initially displayed (because if
683  // javascript is turned off then we want them to be
684  // visible); but by default, we want to hide them.  So hide
685  // them unless we have a cookie that says to show them.
686  checkCookie();
687  // -->
688</script>
689</body>
690</html>
691