Re-add CreateChannel method
This was taken from the 1.4.0 SDK, but it may have been introduced
earlier.
@@ -89,6 +89,28 @@ class ChannelServiceStub(apiproxy_stub.APIProxyStub):
self._update_event = None
+ def _Dynamic_CreateChannel(self, request, response):
+ """Implementation of channel.get_channel.
+
+ Args:
+ request: A ChannelServiceRequest.
+ response: A ChannelServiceResponse
+ """
+ application_key = request.application_key()
+ if not application_key:
+ raise apiproxy_errors.ApplicationError(
+ channel_service_pb.ChannelServiceError.INVALID_CHANNEL_KEY)
+
+ client_id = 'channel-%s-%s' % (random.randint(0, 2 ** 32),
+ application_key)
+ self._log('Creating channel id %s with application key %s',
+ client_id, request.application_key())
+
+ if application_key not in self._channel_messages:
+ self._channel_messages[application_key] = []
+
+ response.set_client_id(client_id)
+
def _Dynamic_SendChannelMessage(self, request, response):
"""Implementation of channel.send_message.
