John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame^] | 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.channel.Channel</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.channel-module.html">Module channel</a> :: |
| 42 | Class Channel |
| 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.channel.Channel-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 Channel</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel">source code</a></span></p> |
| 60 | <center> |
| 61 | <center> <map id="uml_class_diagram_for_googleap" name="uml_class_diagram_for_googleap"> |
| 62 | <area shape="rect" id="node0" href="googleapiclient.channel.Channel-class.html#__init__" title="Create a new Channel." alt="" coords="17,39,627,57"/> |
| 63 | <area shape="rect" id="node0" href="googleapiclient.channel.Channel-class.html#body" title="Build a body from the Channel." alt="" coords="17,57,627,76"/> |
| 64 | <area shape="rect" id="node0" href="googleapiclient.channel.Channel-class.html#update" title="Update a channel with information from the response of watch()." alt="" coords="17,76,627,95"/> |
| 65 | <area shape="rect" id="node1" href="googleapiclient.channel.Channel-class.html" title="A Channel for notifications." alt="" coords="5,6,637,101"/> |
| 66 | </map> |
| 67 | <img src="uml_class_diagram_for_googleap.gif" alt='' usemap="#uml_class_diagram_for_googleap" ismap="ismap" class="graph-without-title" /> |
| 68 | </center> |
| 69 | </center> |
| 70 | <hr /> |
| 71 | <pre class="literalblock"> |
| 72 | A Channel for notifications. |
| 73 | |
| 74 | Usually not constructed directly, instead it is returned from helper |
| 75 | functions like new_webhook_channel(). |
| 76 | |
| 77 | Attributes: |
| 78 | type: str, The type of delivery mechanism used by this channel. For |
| 79 | example, 'web_hook'. |
| 80 | id: str, A UUID for the channel. |
| 81 | token: str, An arbitrary string associated with the channel that |
| 82 | is delivered to the target address with each event delivered |
| 83 | over this channel. |
| 84 | address: str, The address of the receiving entity where events are |
| 85 | delivered. Specific to the channel type. |
| 86 | expiration: int, The time, in milliseconds from the epoch, when this |
| 87 | channel will expire. |
| 88 | params: dict, A dictionary of string to string, with additional parameters |
| 89 | controlling delivery channel behavior. |
| 90 | resource_id: str, An opaque id that identifies the resource that is |
| 91 | being watched. Stable across different API versions. |
| 92 | resource_uri: str, The canonicalized ID of the watched resource. |
| 93 | |
| 94 | </pre> |
| 95 | |
| 96 | <!-- ==================== INSTANCE METHODS ==================== --> |
| 97 | <a name="section-InstanceMethods"></a> |
| 98 | <table class="summary" border="1" cellpadding="3" |
| 99 | cellspacing="0" width="100%" bgcolor="white"> |
| 100 | <tr bgcolor="#70b0f0" class="table-header"> |
| 101 | <td colspan="2" class="table-header"> |
| 102 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 103 | <tr valign="top"> |
| 104 | <td align="left"><span class="table-header">Instance Methods</span></td> |
| 105 | <td align="right" valign="top" |
| 106 | ><span class="options">[<a href="#section-InstanceMethods" |
| 107 | class="privatelink" onclick="toggle_private();" |
| 108 | >hide private</a>]</span></td> |
| 109 | </tr> |
| 110 | </table> |
| 111 | </td> |
| 112 | </tr> |
| 113 | <tr> |
| 114 | <td width="15%" align="right" valign="top" class="summary"> |
| 115 | <span class="summary-type"> </span> |
| 116 | </td><td class="summary"> |
| 117 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 118 | <tr> |
| 119 | <td><span class="summary-sig"><a href="googleapiclient.channel.Channel-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, |
| 120 | <span class="summary-sig-arg">type</span>, |
| 121 | <span class="summary-sig-arg">id</span>, |
| 122 | <span class="summary-sig-arg">token</span>, |
| 123 | <span class="summary-sig-arg">address</span>, |
| 124 | <span class="summary-sig-arg">expiration</span>=<span class="summary-sig-default">None</span>, |
| 125 | <span class="summary-sig-arg">params</span>=<span class="summary-sig-default">None</span>, |
| 126 | <span class="summary-sig-arg">resource_id</span>=<span class="summary-sig-default">""</span>, |
| 127 | <span class="summary-sig-arg">resource_uri</span>=<span class="summary-sig-default">""</span>)</span><br /> |
| 128 | Create a new Channel.</td> |
| 129 | <td align="right" valign="top"> |
| 130 | <span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel.__init__">source code</a></span> |
| 131 | |
| 132 | </td> |
| 133 | </tr> |
| 134 | </table> |
| 135 | |
| 136 | </td> |
| 137 | </tr> |
| 138 | <tr> |
| 139 | <td width="15%" align="right" valign="top" class="summary"> |
| 140 | <span class="summary-type"> </span> |
| 141 | </td><td class="summary"> |
| 142 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 143 | <tr> |
| 144 | <td><span class="summary-sig"><a href="googleapiclient.channel.Channel-class.html#body" class="summary-sig-name">body</a>(<span class="summary-sig-arg">self</span>)</span><br /> |
| 145 | Build a body from the Channel.</td> |
| 146 | <td align="right" valign="top"> |
| 147 | <span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel.body">source code</a></span> |
| 148 | |
| 149 | </td> |
| 150 | </tr> |
| 151 | </table> |
| 152 | |
| 153 | </td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td width="15%" align="right" valign="top" class="summary"> |
| 157 | <span class="summary-type"> </span> |
| 158 | </td><td class="summary"> |
| 159 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 160 | <tr> |
| 161 | <td><span class="summary-sig"><a href="googleapiclient.channel.Channel-class.html#update" class="summary-sig-name">update</a>(<span class="summary-sig-arg">self</span>, |
| 162 | <span class="summary-sig-arg">resp</span>)</span><br /> |
| 163 | Update a channel with information from the response of watch().</td> |
| 164 | <td align="right" valign="top"> |
| 165 | <span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel.update">source code</a></span> |
| 166 | |
| 167 | </td> |
| 168 | </tr> |
| 169 | </table> |
| 170 | |
| 171 | </td> |
| 172 | </tr> |
| 173 | <tr> |
| 174 | <td colspan="2" class="summary"> |
| 175 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 176 | <code>__delattr__</code>, |
| 177 | <code>__format__</code>, |
| 178 | <code>__getattribute__</code>, |
| 179 | <code>__hash__</code>, |
| 180 | <code>__new__</code>, |
| 181 | <code>__reduce__</code>, |
| 182 | <code>__reduce_ex__</code>, |
| 183 | <code>__repr__</code>, |
| 184 | <code>__setattr__</code>, |
| 185 | <code>__sizeof__</code>, |
| 186 | <code>__str__</code>, |
| 187 | <code>__subclasshook__</code> |
| 188 | </p> |
| 189 | </td> |
| 190 | </tr> |
| 191 | </table> |
| 192 | <!-- ==================== PROPERTIES ==================== --> |
| 193 | <a name="section-Properties"></a> |
| 194 | <table class="summary" border="1" cellpadding="3" |
| 195 | cellspacing="0" width="100%" bgcolor="white"> |
| 196 | <tr bgcolor="#70b0f0" class="table-header"> |
| 197 | <td colspan="2" class="table-header"> |
| 198 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 199 | <tr valign="top"> |
| 200 | <td align="left"><span class="table-header">Properties</span></td> |
| 201 | <td align="right" valign="top" |
| 202 | ><span class="options">[<a href="#section-Properties" |
| 203 | class="privatelink" onclick="toggle_private();" |
| 204 | >hide private</a>]</span></td> |
| 205 | </tr> |
| 206 | </table> |
| 207 | </td> |
| 208 | </tr> |
| 209 | <tr> |
| 210 | <td colspan="2" class="summary"> |
| 211 | <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: |
| 212 | <code>__class__</code> |
| 213 | </p> |
| 214 | </td> |
| 215 | </tr> |
| 216 | </table> |
| 217 | <!-- ==================== METHOD DETAILS ==================== --> |
| 218 | <a name="section-MethodDetails"></a> |
| 219 | <table class="details" border="1" cellpadding="3" |
| 220 | cellspacing="0" width="100%" bgcolor="white"> |
| 221 | <tr bgcolor="#70b0f0" class="table-header"> |
| 222 | <td colspan="2" class="table-header"> |
| 223 | <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| 224 | <tr valign="top"> |
| 225 | <td align="left"><span class="table-header">Method Details</span></td> |
| 226 | <td align="right" valign="top" |
| 227 | ><span class="options">[<a href="#section-MethodDetails" |
| 228 | class="privatelink" onclick="toggle_private();" |
| 229 | >hide private</a>]</span></td> |
| 230 | </tr> |
| 231 | </table> |
| 232 | </td> |
| 233 | </tr> |
| 234 | </table> |
| 235 | <a name="__init__"></a> |
| 236 | <div> |
| 237 | <table class="details" border="1" cellpadding="3" |
| 238 | cellspacing="0" width="100%" bgcolor="white"> |
| 239 | <tr><td> |
| 240 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 241 | <tr valign="top"><td> |
| 242 | <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, |
| 243 | <span class="sig-arg">type</span>, |
| 244 | <span class="sig-arg">id</span>, |
| 245 | <span class="sig-arg">token</span>, |
| 246 | <span class="sig-arg">address</span>, |
| 247 | <span class="sig-arg">expiration</span>=<span class="sig-default">None</span>, |
| 248 | <span class="sig-arg">params</span>=<span class="sig-default">None</span>, |
| 249 | <span class="sig-arg">resource_id</span>=<span class="sig-default">""</span>, |
| 250 | <span class="sig-arg">resource_uri</span>=<span class="sig-default">""</span>)</span> |
| 251 | <br /><em class="fname">(Constructor)</em> |
| 252 | </h3> |
| 253 | </td><td align="right" valign="top" |
| 254 | ><span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel.__init__">source code</a></span> |
| 255 | </td> |
| 256 | </tr></table> |
| 257 | |
| 258 | <pre class="literalblock"> |
| 259 | Create a new Channel. |
| 260 | |
| 261 | In user code, this Channel constructor will not typically be called |
| 262 | manually since there are functions for creating channels for each specific |
| 263 | type with a more customized set of arguments to pass. |
| 264 | |
| 265 | Args: |
| 266 | type: str, The type of delivery mechanism used by this channel. For |
| 267 | example, 'web_hook'. |
| 268 | id: str, A UUID for the channel. |
| 269 | token: str, An arbitrary string associated with the channel that |
| 270 | is delivered to the target address with each event delivered |
| 271 | over this channel. |
| 272 | address: str, The address of the receiving entity where events are |
| 273 | delivered. Specific to the channel type. |
| 274 | expiration: int, The time, in milliseconds from the epoch, when this |
| 275 | channel will expire. |
| 276 | params: dict, A dictionary of string to string, with additional parameters |
| 277 | controlling delivery channel behavior. |
| 278 | resource_id: str, An opaque id that identifies the resource that is |
| 279 | being watched. Stable across different API versions. |
| 280 | resource_uri: str, The canonicalized ID of the watched resource. |
| 281 | |
| 282 | </pre> |
| 283 | <dl class="fields"> |
| 284 | <dt>Decorators:</dt> |
| 285 | <dd><ul class="nomargin-top"> |
| 286 | <li><code>@util.positional(5)</code></li> |
| 287 | </ul></dd> |
| 288 | <dt>Overrides: |
| 289 | object.__init__ |
| 290 | </dt> |
| 291 | </dl> |
| 292 | </td></tr></table> |
| 293 | </div> |
| 294 | <a name="body"></a> |
| 295 | <div> |
| 296 | <table class="details" border="1" cellpadding="3" |
| 297 | cellspacing="0" width="100%" bgcolor="white"> |
| 298 | <tr><td> |
| 299 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 300 | <tr valign="top"><td> |
| 301 | <h3 class="epydoc"><span class="sig"><span class="sig-name">body</span>(<span class="sig-arg">self</span>)</span> |
| 302 | </h3> |
| 303 | </td><td align="right" valign="top" |
| 304 | ><span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel.body">source code</a></span> |
| 305 | </td> |
| 306 | </tr></table> |
| 307 | |
| 308 | <pre class="literalblock"> |
| 309 | Build a body from the Channel. |
| 310 | |
| 311 | Constructs a dictionary that's appropriate for passing into watch() |
| 312 | methods as the value of body argument. |
| 313 | |
| 314 | Returns: |
| 315 | A dictionary representation of the channel. |
| 316 | |
| 317 | </pre> |
| 318 | <dl class="fields"> |
| 319 | </dl> |
| 320 | </td></tr></table> |
| 321 | </div> |
| 322 | <a name="update"></a> |
| 323 | <div> |
| 324 | <table class="details" border="1" cellpadding="3" |
| 325 | cellspacing="0" width="100%" bgcolor="white"> |
| 326 | <tr><td> |
| 327 | <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
| 328 | <tr valign="top"><td> |
| 329 | <h3 class="epydoc"><span class="sig"><span class="sig-name">update</span>(<span class="sig-arg">self</span>, |
| 330 | <span class="sig-arg">resp</span>)</span> |
| 331 | </h3> |
| 332 | </td><td align="right" valign="top" |
| 333 | ><span class="codelink"><a href="googleapiclient.channel-pysrc.html#Channel.update">source code</a></span> |
| 334 | </td> |
| 335 | </tr></table> |
| 336 | |
| 337 | <pre class="literalblock"> |
| 338 | Update a channel with information from the response of watch(). |
| 339 | |
| 340 | When a request is sent to watch() a resource, the response returned |
| 341 | from the watch() request is a dictionary with updated channel information, |
| 342 | such as the resource_id, which is needed when stopping a subscription. |
| 343 | |
| 344 | Args: |
| 345 | resp: dict, The response from a watch() method. |
| 346 | |
| 347 | </pre> |
| 348 | <dl class="fields"> |
| 349 | </dl> |
| 350 | </td></tr></table> |
| 351 | </div> |
| 352 | <br /> |
| 353 | <!-- ==================== NAVIGATION BAR ==================== --> |
| 354 | <table class="navbar" border="0" width="100%" cellpadding="0" |
| 355 | bgcolor="#a0c0ff" cellspacing="0"> |
| 356 | <tr valign="middle"> |
| 357 | <!-- Home link --> |
| 358 | <th> <a |
| 359 | href="googleapiclient-module.html">Home</a> </th> |
| 360 | |
| 361 | <!-- Tree link --> |
| 362 | <th> <a |
| 363 | href="module-tree.html">Trees</a> </th> |
| 364 | |
| 365 | <!-- Index link --> |
| 366 | <th> <a |
| 367 | href="identifier-index.html">Indices</a> </th> |
| 368 | |
| 369 | <!-- Help link --> |
| 370 | <th> <a |
| 371 | href="help.html">Help</a> </th> |
| 372 | |
| 373 | <th class="navbar" width="100%"></th> |
| 374 | </tr> |
| 375 | </table> |
| 376 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
| 377 | <tr> |
| 378 | <td align="left" class="footer"> |
| 379 | Generated by Epydoc 3.0.1 on Thu Apr 24 15:46:09 2014 |
| 380 | </td> |
| 381 | <td align="right" class="footer"> |
| 382 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
| 383 | >http://epydoc.sourceforge.net</a> |
| 384 | </td> |
| 385 | </tr> |
| 386 | </table> |
| 387 | |
| 388 | <script type="text/javascript"> |
| 389 | <!-- |
| 390 | // Private objects are initially displayed (because if |
| 391 | // javascript is turned off then we want them to be |
| 392 | // visible); but by default, we want to hide them. So hide |
| 393 | // them unless we have a cookie that says to show them. |
| 394 | checkCookie(); |
| 395 | // --> |
| 396 | </script> |
| 397 | </body> |
| 398 | </html> |