• Home
  • Raw
  • Download

Lines Matching full:channel

15 """Channel notifications support.
17 Classes and functions to support channel subscriptions and notifications
24 - Storing the Channel between calls is up to the caller.
27 Example setting up a channel:
29 # Create a new channel that gets notifications via webhook.
30 channel = new_webhook_channel("https://example.com/my_web_hook")
32 # Store the channel, keyed by 'channel.id'. Store it before calling the
38 bucket="some_bucket_id", body=channel.body()).execute()
39 channel.update(resp)
41 # Store the channel, keyed by 'channel.id'. Store it after being updated
53 # Retrieve the channel by id.
54 channel = ...
57 n = notification_from_headers(channel, self.request.headers)
70 service.channels().stop(channel.body()).execute()
84 # Map the names of the parameters in the JSON channel description to
85 # the parameter names we use in the Channel class.
97 X_GOOG_CHANNEL_ID = "X-GOOG-CHANNEL-ID"
112 """A Notification from a Channel.
142 class Channel(object): class
143 """A Channel for notifications.
149 type: str, The type of delivery mechanism used by this channel. For
151 id: str, A UUID for the channel.
152 token: str, An arbitrary string associated with the channel that
154 over this channel.
156 delivered. Specific to the channel type.
158 channel will expire.
160 controlling delivery channel behavior.
178 """Create a new Channel.
180 In user code, this Channel constructor will not typically be called
185 type: str, The type of delivery mechanism used by this channel. For
187 id: str, A UUID for the channel.
188 token: str, An arbitrary string associated with the channel that
190 over this channel.
192 delivered. Specific to the channel type.
194 channel will expire.
196 controlling delivery channel behavior.
211 """Build a body from the Channel.
217 A dictionary representation of the channel.
237 """Update a channel with information from the response of watch().
240 from the watch() request is a dictionary with updated channel information,
252 def notification_from_headers(channel, headers): argument
257 channel: Channel, The channel that the notification is associated with.
270 if channel.id != channel_id:
272 "Channel id mismatch: %s != %s" % (channel.id, channel_id)
284 """Create a new webhook Channel.
288 token: str, An arbitrary string associated with the channel that
290 over this channel.
291 expiration: datetime.datetime, A time in the future when the channel
297 params: dict, Extra parameters to pass on channel creation. Currently
309 return Channel(