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