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