Lines Matching full:channel
0 """Channel notifications support.
3 Classes and functions to support channel subscriptions and notifications
10 - Storing the Channel between calls is up to the caller.
13 Example setting up a channel:
15 # Create a new channel that gets notifications via webhook.
16 channel = new_webhook_channel("https://example.com/my_web_hook")
18 # Store the channel, keyed by 'channel.id'. Store it before calling the
24 bucket="some_bucket_id", body=channel.body()).execute()
25 channel.update(resp)
27 # Store the channel, keyed by 'channel.id'. Store it after being updated
39 # Retrieve the channel by id.
40 channel = ...
43 n = notification_from_headers(channel, self.request.headers)
56 service.channels().stop(channel.body())
71 # Map the names of the parameters in the JSON channel description to
72 # the parameter names we use in the Channel class.
84 X_GOOG_CHANNEL_ID = 'X-GOOG-CHANNEL-ID'
99 """A Notification from a Channel.
128 class Channel(object):
129 """A Channel for notifications.
135 type: str, The type of delivery mechanism used by this channel. For
137 id: str, A UUID for the channel.
138 token: str, An arbitrary string associated with the channel that
140 over this channel.
142 delivered. Specific to the channel type.
144 channel will expire.
146 controlling delivery channel behavior.
155 """Create a new Channel.
157 In user code, this Channel constructor will not typically be called
162 type: str, The type of delivery mechanism used by this channel. For
164 id: str, A UUID for the channel.
165 token: str, An arbitrary string associated with the channel that
167 over this channel.
169 delivered. Specific to the channel type.
171 channel will expire.
173 controlling delivery channel behavior.
188 """Build a body from the Channel.
194 A dictionary representation of the channel.
214 """Update a channel with information from the response of watch().
217 from the watch() request is a dictionary with updated channel information,
229 def notification_from_headers(channel, headers):
234 channel: Channel, The channel that the notification is associated with.
247 if channel.id != channel_id:
249 'Channel id mismatch: %s != %s' % (channel.id, channel_id))
260 """Create a new webhook Channel.
264 token: str, An arbitrary string associated with the channel that
266 over this channel.
267 expiration: datetime.datetime, A time in the future when the channel
273 params: dict, Extra parameters to pass on channel creation. Currently
284 return Channel('web_hook', str(uuid.uuid4()),