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