/google/appengine/api/channel/channel_service_pb.py

https://github.com/ChicagoAtNight/flightpin · Python · 444 lines · 396 code · 32 blank · 16 comment · 5 complexity · b694d8d142eafd262b7b512e87b8de89 MD5 · raw file

  1. #!/usr/bin/env python
  2. #
  3. # Copyright 2007 Google Inc.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. from google.net.proto import ProtocolBuffer
  18. import array
  19. import dummy_thread as thread
  20. __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
  21. unusednames=printElemNumber,debug_strs no-special"""
  22. class ChannelServiceError(ProtocolBuffer.ProtocolMessage):
  23. OK = 0
  24. INTERNAL_ERROR = 1
  25. INVALID_CHANNEL_KEY = 2
  26. BAD_MESSAGE = 3
  27. _ErrorCode_NAMES = {
  28. 0: "OK",
  29. 1: "INTERNAL_ERROR",
  30. 2: "INVALID_CHANNEL_KEY",
  31. 3: "BAD_MESSAGE",
  32. }
  33. def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "")
  34. ErrorCode_Name = classmethod(ErrorCode_Name)
  35. def __init__(self, contents=None):
  36. pass
  37. if contents is not None: self.MergeFromString(contents)
  38. def MergeFrom(self, x):
  39. assert x is not self
  40. def Equals(self, x):
  41. if x is self: return 1
  42. return 1
  43. def IsInitialized(self, debug_strs=None):
  44. initialized = 1
  45. return initialized
  46. def ByteSize(self):
  47. n = 0
  48. return n
  49. def ByteSizePartial(self):
  50. n = 0
  51. return n
  52. def Clear(self):
  53. pass
  54. def OutputUnchecked(self, out):
  55. pass
  56. def OutputPartial(self, out):
  57. pass
  58. def TryMerge(self, d):
  59. while d.avail() > 0:
  60. tt = d.getVarInt32()
  61. if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
  62. d.skipData(tt)
  63. def __str__(self, prefix="", printElemNumber=0):
  64. res=""
  65. return res
  66. def _BuildTagLookupTable(sparse, maxtag, default=None):
  67. return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
  68. _TEXT = _BuildTagLookupTable({
  69. 0: "ErrorCode",
  70. }, 0)
  71. _TYPES = _BuildTagLookupTable({
  72. 0: ProtocolBuffer.Encoder.NUMERIC,
  73. }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
  74. _STYLE = """"""
  75. _STYLE_CONTENT_TYPE = """"""
  76. _PROTO_DESCRIPTOR_NAME = 'apphosting.ChannelServiceError'
  77. class CreateChannelRequest(ProtocolBuffer.ProtocolMessage):
  78. has_application_key_ = 0
  79. application_key_ = ""
  80. def __init__(self, contents=None):
  81. if contents is not None: self.MergeFromString(contents)
  82. def application_key(self): return self.application_key_
  83. def set_application_key(self, x):
  84. self.has_application_key_ = 1
  85. self.application_key_ = x
  86. def clear_application_key(self):
  87. if self.has_application_key_:
  88. self.has_application_key_ = 0
  89. self.application_key_ = ""
  90. def has_application_key(self): return self.has_application_key_
  91. def MergeFrom(self, x):
  92. assert x is not self
  93. if (x.has_application_key()): self.set_application_key(x.application_key())
  94. def Equals(self, x):
  95. if x is self: return 1
  96. if self.has_application_key_ != x.has_application_key_: return 0
  97. if self.has_application_key_ and self.application_key_ != x.application_key_: return 0
  98. return 1
  99. def IsInitialized(self, debug_strs=None):
  100. initialized = 1
  101. if (not self.has_application_key_):
  102. initialized = 0
  103. if debug_strs is not None:
  104. debug_strs.append('Required field: application_key not set.')
  105. return initialized
  106. def ByteSize(self):
  107. n = 0
  108. n += self.lengthString(len(self.application_key_))
  109. return n + 1
  110. def ByteSizePartial(self):
  111. n = 0
  112. if (self.has_application_key_):
  113. n += 1
  114. n += self.lengthString(len(self.application_key_))
  115. return n
  116. def Clear(self):
  117. self.clear_application_key()
  118. def OutputUnchecked(self, out):
  119. out.putVarInt32(10)
  120. out.putPrefixedString(self.application_key_)
  121. def OutputPartial(self, out):
  122. if (self.has_application_key_):
  123. out.putVarInt32(10)
  124. out.putPrefixedString(self.application_key_)
  125. def TryMerge(self, d):
  126. while d.avail() > 0:
  127. tt = d.getVarInt32()
  128. if tt == 10:
  129. self.set_application_key(d.getPrefixedString())
  130. continue
  131. if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
  132. d.skipData(tt)
  133. def __str__(self, prefix="", printElemNumber=0):
  134. res=""
  135. if self.has_application_key_: res+=prefix+("application_key: %s\n" % self.DebugFormatString(self.application_key_))
  136. return res
  137. def _BuildTagLookupTable(sparse, maxtag, default=None):
  138. return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
  139. kapplication_key = 1
  140. _TEXT = _BuildTagLookupTable({
  141. 0: "ErrorCode",
  142. 1: "application_key",
  143. }, 1)
  144. _TYPES = _BuildTagLookupTable({
  145. 0: ProtocolBuffer.Encoder.NUMERIC,
  146. 1: ProtocolBuffer.Encoder.STRING,
  147. }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
  148. _STYLE = """"""
  149. _STYLE_CONTENT_TYPE = """"""
  150. _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateChannelRequest'
  151. class CreateChannelResponse(ProtocolBuffer.ProtocolMessage):
  152. has_client_id_ = 0
  153. client_id_ = ""
  154. def __init__(self, contents=None):
  155. if contents is not None: self.MergeFromString(contents)
  156. def client_id(self): return self.client_id_
  157. def set_client_id(self, x):
  158. self.has_client_id_ = 1
  159. self.client_id_ = x
  160. def clear_client_id(self):
  161. if self.has_client_id_:
  162. self.has_client_id_ = 0
  163. self.client_id_ = ""
  164. def has_client_id(self): return self.has_client_id_
  165. def MergeFrom(self, x):
  166. assert x is not self
  167. if (x.has_client_id()): self.set_client_id(x.client_id())
  168. def Equals(self, x):
  169. if x is self: return 1
  170. if self.has_client_id_ != x.has_client_id_: return 0
  171. if self.has_client_id_ and self.client_id_ != x.client_id_: return 0
  172. return 1
  173. def IsInitialized(self, debug_strs=None):
  174. initialized = 1
  175. return initialized
  176. def ByteSize(self):
  177. n = 0
  178. if (self.has_client_id_): n += 1 + self.lengthString(len(self.client_id_))
  179. return n
  180. def ByteSizePartial(self):
  181. n = 0
  182. if (self.has_client_id_): n += 1 + self.lengthString(len(self.client_id_))
  183. return n
  184. def Clear(self):
  185. self.clear_client_id()
  186. def OutputUnchecked(self, out):
  187. if (self.has_client_id_):
  188. out.putVarInt32(18)
  189. out.putPrefixedString(self.client_id_)
  190. def OutputPartial(self, out):
  191. if (self.has_client_id_):
  192. out.putVarInt32(18)
  193. out.putPrefixedString(self.client_id_)
  194. def TryMerge(self, d):
  195. while d.avail() > 0:
  196. tt = d.getVarInt32()
  197. if tt == 18:
  198. self.set_client_id(d.getPrefixedString())
  199. continue
  200. if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
  201. d.skipData(tt)
  202. def __str__(self, prefix="", printElemNumber=0):
  203. res=""
  204. if self.has_client_id_: res+=prefix+("client_id: %s\n" % self.DebugFormatString(self.client_id_))
  205. return res
  206. def _BuildTagLookupTable(sparse, maxtag, default=None):
  207. return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
  208. kclient_id = 2
  209. _TEXT = _BuildTagLookupTable({
  210. 0: "ErrorCode",
  211. 2: "client_id",
  212. }, 2)
  213. _TYPES = _BuildTagLookupTable({
  214. 0: ProtocolBuffer.Encoder.NUMERIC,
  215. 2: ProtocolBuffer.Encoder.STRING,
  216. }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
  217. _STYLE = """"""
  218. _STYLE_CONTENT_TYPE = """"""
  219. _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateChannelResponse'
  220. class SendMessageRequest(ProtocolBuffer.ProtocolMessage):
  221. has_application_key_ = 0
  222. application_key_ = ""
  223. has_message_ = 0
  224. message_ = ""
  225. def __init__(self, contents=None):
  226. if contents is not None: self.MergeFromString(contents)
  227. def application_key(self): return self.application_key_
  228. def set_application_key(self, x):
  229. self.has_application_key_ = 1
  230. self.application_key_ = x
  231. def clear_application_key(self):
  232. if self.has_application_key_:
  233. self.has_application_key_ = 0
  234. self.application_key_ = ""
  235. def has_application_key(self): return self.has_application_key_
  236. def message(self): return self.message_
  237. def set_message(self, x):
  238. self.has_message_ = 1
  239. self.message_ = x
  240. def clear_message(self):
  241. if self.has_message_:
  242. self.has_message_ = 0
  243. self.message_ = ""
  244. def has_message(self): return self.has_message_
  245. def MergeFrom(self, x):
  246. assert x is not self
  247. if (x.has_application_key()): self.set_application_key(x.application_key())
  248. if (x.has_message()): self.set_message(x.message())
  249. def Equals(self, x):
  250. if x is self: return 1
  251. if self.has_application_key_ != x.has_application_key_: return 0
  252. if self.has_application_key_ and self.application_key_ != x.application_key_: return 0
  253. if self.has_message_ != x.has_message_: return 0
  254. if self.has_message_ and self.message_ != x.message_: return 0
  255. return 1
  256. def IsInitialized(self, debug_strs=None):
  257. initialized = 1
  258. if (not self.has_application_key_):
  259. initialized = 0
  260. if debug_strs is not None:
  261. debug_strs.append('Required field: application_key not set.')
  262. if (not self.has_message_):
  263. initialized = 0
  264. if debug_strs is not None:
  265. debug_strs.append('Required field: message not set.')
  266. return initialized
  267. def ByteSize(self):
  268. n = 0
  269. n += self.lengthString(len(self.application_key_))
  270. n += self.lengthString(len(self.message_))
  271. return n + 2
  272. def ByteSizePartial(self):
  273. n = 0
  274. if (self.has_application_key_):
  275. n += 1
  276. n += self.lengthString(len(self.application_key_))
  277. if (self.has_message_):
  278. n += 1
  279. n += self.lengthString(len(self.message_))
  280. return n
  281. def Clear(self):
  282. self.clear_application_key()
  283. self.clear_message()
  284. def OutputUnchecked(self, out):
  285. out.putVarInt32(10)
  286. out.putPrefixedString(self.application_key_)
  287. out.putVarInt32(18)
  288. out.putPrefixedString(self.message_)
  289. def OutputPartial(self, out):
  290. if (self.has_application_key_):
  291. out.putVarInt32(10)
  292. out.putPrefixedString(self.application_key_)
  293. if (self.has_message_):
  294. out.putVarInt32(18)
  295. out.putPrefixedString(self.message_)
  296. def TryMerge(self, d):
  297. while d.avail() > 0:
  298. tt = d.getVarInt32()
  299. if tt == 10:
  300. self.set_application_key(d.getPrefixedString())
  301. continue
  302. if tt == 18:
  303. self.set_message(d.getPrefixedString())
  304. continue
  305. if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
  306. d.skipData(tt)
  307. def __str__(self, prefix="", printElemNumber=0):
  308. res=""
  309. if self.has_application_key_: res+=prefix+("application_key: %s\n" % self.DebugFormatString(self.application_key_))
  310. if self.has_message_: res+=prefix+("message: %s\n" % self.DebugFormatString(self.message_))
  311. return res
  312. def _BuildTagLookupTable(sparse, maxtag, default=None):
  313. return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
  314. kapplication_key = 1
  315. kmessage = 2
  316. _TEXT = _BuildTagLookupTable({
  317. 0: "ErrorCode",
  318. 1: "application_key",
  319. 2: "message",
  320. }, 2)
  321. _TYPES = _BuildTagLookupTable({
  322. 0: ProtocolBuffer.Encoder.NUMERIC,
  323. 1: ProtocolBuffer.Encoder.STRING,
  324. 2: ProtocolBuffer.Encoder.STRING,
  325. }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
  326. _STYLE = """"""
  327. _STYLE_CONTENT_TYPE = """"""
  328. _PROTO_DESCRIPTOR_NAME = 'apphosting.SendMessageRequest'
  329. __all__ = ['ChannelServiceError','CreateChannelRequest','CreateChannelResponse','SendMessageRequest']