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.MediaInMemoryUpload</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> <a 19 href="googleapiclient-module.html">Home</a> </th> 20 21 <!-- Tree link --> 22 <th> <a 23 href="module-tree.html">Trees</a> </th> 24 25 <!-- Index link --> 26 <th> <a 27 href="identifier-index.html">Indices</a> </th> 28 29 <!-- Help link --> 30 <th> <a 31 href="help.html">Help</a> </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 googleapiclient</a> :: 41 <a href="googleapiclient.http-module.html">Module http</a> :: 42 Class MediaInMemoryUpload 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 private</a>]</span></td></tr> 50 <tr><td align="right"><span class="options" 51 >[<a href="frames.html" target="_top">frames</a 52 >] | <a href="googleapiclient.http.MediaInMemoryUpload-class.html" 53 target="_top">no frames</a>]</span></td></tr> 54 </table> 55 </td> 56 </tr> 57</table> 58<!-- ==================== CLASS DESCRIPTION ==================== --> 59<h1 class="epydoc">Class MediaInMemoryUpload</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaInMemoryUpload">source code</a></span></p> 60<center> 61<center> <map id="uml_class_diagram_for_googleap_31" name="uml_class_diagram_for_googleap_31"> 62<area shape="rect" id="node1_10" href="googleapiclient.http.MediaInMemoryUpload-class.html#__init__" title="Create a new MediaInMemoryUpload." alt="" coords="18,332,689,352"/> 63<area shape="rect" id="node1" href="googleapiclient.http.MediaInMemoryUpload-class.html" title="MediaUpload for a chunk of bytes." alt="" coords="5,300,700,359"/> 64<area shape="rect" id="node2_11" href="googleapiclient.http.MediaIoBaseUpload-class.html#chunksize" title="Chunk size for resumable uploads." alt="" coords="270,115,437,135"/> 65<area shape="rect" id="node2_12" href="googleapiclient.http.MediaIoBaseUpload-class.html#mimetype" title="Mime type of the body." alt="" coords="270,135,437,155"/> 66<area shape="rect" id="node2_13" href="googleapiclient.http.MediaIoBaseUpload-class.html#size" title="Size of upload." alt="" coords="270,155,437,175"/> 67<area shape="rect" id="node2_14" href="googleapiclient.http.MediaIoBaseUpload-class.html#resumable" title="Whether this upload is resumable." alt="" coords="270,175,437,195"/> 68<area shape="rect" id="node2_15" href="googleapiclient.http.MediaIoBaseUpload-class.html#getbytes" title="Get bytes from the media." alt="" coords="270,195,437,215"/> 69<area shape="rect" id="node2_16" href="googleapiclient.http.MediaIoBaseUpload-class.html#has_stream" title="Does the underlying upload support a streaming interface." alt="" coords="270,215,437,235"/> 70<area shape="rect" id="node2_17" href="googleapiclient.http.MediaIoBaseUpload-class.html#stream" title="A stream interface to the data being uploaded." alt="" coords="270,235,437,255"/> 71<area shape="rect" id="node2_18" href="googleapiclient.http.MediaIoBaseUpload-class.html#to_json" title="This upload type is not serializable." alt="" coords="270,255,437,275"/> 72<area shape="rect" id="node2" href="googleapiclient.http.MediaIoBaseUpload-class.html" title="A MediaUpload for a io.Base objects." alt="" coords="257,83,448,281"/> 73<area shape="rect" id="node3_19" href="googleapiclient.http.MediaUpload-class.html#new_from_json" title="Utility class method to instantiate a MediaUpload subclass from a JSON representation produced by to_json()." alt="" coords="286,37,421,57"/> 74<area shape="rect" id="node3" href="googleapiclient.http.MediaUpload-class.html" title="Describes a media object to upload." alt="" coords="273,5,432,64"/> 75</map> 76 <img src="uml_class_diagram_for_googleap_31.gif" alt='' usemap="#uml_class_diagram_for_googleap_31" ismap="ismap" class="graph-without-title" /> 77</center> 78</center> 79<hr /> 80<pre class="literalblock"> 81MediaUpload for a chunk of bytes. 82 83DEPRECATED: Use MediaIoBaseUpload with either io.TextIOBase or StringIO for 84the stream. 85 86</pre> 87 88<!-- ==================== INSTANCE METHODS ==================== --> 89<a name="section-InstanceMethods"></a> 90<table class="summary" border="1" cellpadding="3" 91 cellspacing="0" width="100%" bgcolor="white"> 92<tr bgcolor="#70b0f0" class="table-header"> 93 <td colspan="2" class="table-header"> 94 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 95 <tr valign="top"> 96 <td align="left"><span class="table-header">Instance Methods</span></td> 97 <td align="right" valign="top" 98 ><span class="options">[<a href="#section-InstanceMethods" 99 class="privatelink" onclick="toggle_private();" 100 >hide private</a>]</span></td> 101 </tr> 102 </table> 103 </td> 104</tr> 105<tr> 106 <td width="15%" align="right" valign="top" class="summary"> 107 <span class="summary-type"> </span> 108 </td><td class="summary"> 109 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 110 <tr> 111 <td><span class="summary-sig"><a href="googleapiclient.http.MediaInMemoryUpload-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, 112 <span class="summary-sig-arg">body</span>, 113 <span class="summary-sig-arg">mimetype</span>=<span class="summary-sig-default">'application/octet-stream'</span>, 114 <span class="summary-sig-arg">chunksize</span>=<span class="summary-sig-default">DEFAULT_CHUNK_SIZE</span>, 115 <span class="summary-sig-arg">resumable</span>=<span class="summary-sig-default">False</span>)</span><br /> 116 Create a new MediaInMemoryUpload.</td> 117 <td align="right" valign="top"> 118 <span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaInMemoryUpload.__init__">source code</a></span> 119 120 </td> 121 </tr> 122 </table> 123 124 </td> 125 </tr> 126 <tr> 127 <td colspan="2" class="summary"> 128 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html">MediaIoBaseUpload</a></code></b>: 129 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#chunksize">chunksize</a></code>, 130 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#getbytes">getbytes</a></code>, 131 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#has_stream">has_stream</a></code>, 132 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#mimetype">mimetype</a></code>, 133 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#resumable">resumable</a></code>, 134 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#size">size</a></code>, 135 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#stream">stream</a></code>, 136 <code><a href="googleapiclient.http.MediaIoBaseUpload-class.html#to_json">to_json</a></code> 137 </p> 138 <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.http.MediaUpload-class.html">MediaUpload</a></code></b> (private): 139 <code><a href="googleapiclient.http.MediaUpload-class.html#_to_json" onclick="show_private();">_to_json</a></code> 140 </p></div> 141 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 142 <code>__delattr__</code>, 143 <code>__format__</code>, 144 <code>__getattribute__</code>, 145 <code>__hash__</code>, 146 <code>__new__</code>, 147 <code>__reduce__</code>, 148 <code>__reduce_ex__</code>, 149 <code>__repr__</code>, 150 <code>__setattr__</code>, 151 <code>__sizeof__</code>, 152 <code>__str__</code>, 153 <code>__subclasshook__</code> 154 </p> 155 </td> 156 </tr> 157</table> 158<!-- ==================== CLASS METHODS ==================== --> 159<a name="section-ClassMethods"></a> 160<table class="summary" border="1" cellpadding="3" 161 cellspacing="0" width="100%" bgcolor="white"> 162<tr bgcolor="#70b0f0" class="table-header"> 163 <td colspan="2" class="table-header"> 164 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 165 <tr valign="top"> 166 <td align="left"><span class="table-header">Class Methods</span></td> 167 <td align="right" valign="top" 168 ><span class="options">[<a href="#section-ClassMethods" 169 class="privatelink" onclick="toggle_private();" 170 >hide private</a>]</span></td> 171 </tr> 172 </table> 173 </td> 174</tr> 175 <tr> 176 <td colspan="2" class="summary"> 177 <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.http.MediaUpload-class.html">MediaUpload</a></code></b>: 178 <code><a href="googleapiclient.http.MediaUpload-class.html#new_from_json">new_from_json</a></code> 179 </p> 180 </td> 181 </tr> 182</table> 183<!-- ==================== PROPERTIES ==================== --> 184<a name="section-Properties"></a> 185<table class="summary" border="1" cellpadding="3" 186 cellspacing="0" width="100%" bgcolor="white"> 187<tr bgcolor="#70b0f0" class="table-header"> 188 <td colspan="2" class="table-header"> 189 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 190 <tr valign="top"> 191 <td align="left"><span class="table-header">Properties</span></td> 192 <td align="right" valign="top" 193 ><span class="options">[<a href="#section-Properties" 194 class="privatelink" onclick="toggle_private();" 195 >hide private</a>]</span></td> 196 </tr> 197 </table> 198 </td> 199</tr> 200 <tr> 201 <td colspan="2" class="summary"> 202 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: 203 <code>__class__</code> 204 </p> 205 </td> 206 </tr> 207</table> 208<!-- ==================== METHOD DETAILS ==================== --> 209<a name="section-MethodDetails"></a> 210<table class="details" border="1" cellpadding="3" 211 cellspacing="0" width="100%" bgcolor="white"> 212<tr bgcolor="#70b0f0" class="table-header"> 213 <td colspan="2" class="table-header"> 214 <table border="0" cellpadding="0" cellspacing="0" width="100%"> 215 <tr valign="top"> 216 <td align="left"><span class="table-header">Method Details</span></td> 217 <td align="right" valign="top" 218 ><span class="options">[<a href="#section-MethodDetails" 219 class="privatelink" onclick="toggle_private();" 220 >hide private</a>]</span></td> 221 </tr> 222 </table> 223 </td> 224</tr> 225</table> 226<a name="__init__"></a> 227<div> 228<table class="details" border="1" cellpadding="3" 229 cellspacing="0" width="100%" bgcolor="white"> 230<tr><td> 231 <table width="100%" cellpadding="0" cellspacing="0" border="0"> 232 <tr valign="top"><td> 233 <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, 234 <span class="sig-arg">body</span>, 235 <span class="sig-arg">mimetype</span>=<span class="sig-default">'application/octet-stream'</span>, 236 <span class="sig-arg">chunksize</span>=<span class="sig-default">DEFAULT_CHUNK_SIZE</span>, 237 <span class="sig-arg">resumable</span>=<span class="sig-default">False</span>)</span> 238 <br /><em class="fname">(Constructor)</em> 239 </h3> 240 </td><td align="right" valign="top" 241 ><span class="codelink"><a href="googleapiclient.http-pysrc.html#MediaInMemoryUpload.__init__">source code</a></span> 242 </td> 243 </tr></table> 244 245 <pre class="literalblock"> 246Create a new MediaInMemoryUpload. 247 248DEPRECATED: Use MediaIoBaseUpload with either io.TextIOBase or StringIO for 249the stream. 250 251Args: 252 body: string, Bytes of body content. 253 mimetype: string, Mime-type of the file or default of 254 'application/octet-stream'. 255 chunksize: int, File will be uploaded in chunks of this many bytes. Only 256 used if resumable=True. 257 resumable: bool, True if this is a resumable upload. False means upload 258 in a single request. 259 260 261</pre> 262 <dl class="fields"> 263 <dt>Decorators:</dt> 264 <dd><ul class="nomargin-top"> 265 <li><code>@util.positional(2)</code></li> 266 </ul></dd> 267 <dt>Overrides: 268 object.__init__ 269 </dt> 270 </dl> 271</td></tr></table> 272</div> 273<br /> 274<!-- ==================== NAVIGATION BAR ==================== --> 275<table class="navbar" border="0" width="100%" cellpadding="0" 276 bgcolor="#a0c0ff" cellspacing="0"> 277 <tr valign="middle"> 278 <!-- Home link --> 279 <th> <a 280 href="googleapiclient-module.html">Home</a> </th> 281 282 <!-- Tree link --> 283 <th> <a 284 href="module-tree.html">Trees</a> </th> 285 286 <!-- Index link --> 287 <th> <a 288 href="identifier-index.html">Indices</a> </th> 289 290 <!-- Help link --> 291 <th> <a 292 href="help.html">Help</a> </th> 293 294 <th class="navbar" width="100%"></th> 295 </tr> 296</table> 297<table border="0" cellpadding="0" cellspacing="0" width="100%%"> 298 <tr> 299 <td align="left" class="footer"> 300 Generated by Epydoc 3.0.1 on Fri Jun 14 15:57:28 2019 301 </td> 302 <td align="right" class="footer"> 303 <a target="mainFrame" href="http://epydoc.sourceforge.net" 304 >http://epydoc.sourceforge.net</a> 305 </td> 306 </tr> 307</table> 308 309<script type="text/javascript"> 310 <!-- 311 // Private objects are initially displayed (because if 312 // javascript is turned off then we want them to be 313 // visible); but by default, we want to hide them. So hide 314 // them unless we have a cookie that says to show them. 315 checkCookie(); 316 // --> 317</script> 318</body> 319</html> 320