1.9.30 sync.
[gae.git] / python / google / appengine / api / user_service_pb.py
bloba2b60327f711ef32b2bfa0d9e35810daa035356a
1 #!/usr/bin/env python
3 # Copyright 2007 Google Inc.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
20 from google.net.proto import ProtocolBuffer
21 import array
22 import dummy_thread as thread
24 __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
25 unusednames=printElemNumber,debug_strs no-special"""
27 if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
28 _extension_runtime = True
29 _ExtendableProtocolMessage = ProtocolBuffer.ExtendableProtocolMessage
30 else:
31 _extension_runtime = False
32 _ExtendableProtocolMessage = ProtocolBuffer.ProtocolMessage
34 class UserServiceError(ProtocolBuffer.ProtocolMessage):
37 OK = 0
38 REDIRECT_URL_TOO_LONG = 1
39 NOT_ALLOWED = 2
40 OAUTH_INVALID_TOKEN = 3
41 OAUTH_INVALID_REQUEST = 4
42 OAUTH_ERROR = 5
44 _ErrorCode_NAMES = {
45 0: "OK",
46 1: "REDIRECT_URL_TOO_LONG",
47 2: "NOT_ALLOWED",
48 3: "OAUTH_INVALID_TOKEN",
49 4: "OAUTH_INVALID_REQUEST",
50 5: "OAUTH_ERROR",
53 def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "")
54 ErrorCode_Name = classmethod(ErrorCode_Name)
57 def __init__(self, contents=None):
58 pass
59 if contents is not None: self.MergeFromString(contents)
62 def MergeFrom(self, x):
63 assert x is not self
65 def Equals(self, x):
66 if x is self: return 1
67 return 1
69 def IsInitialized(self, debug_strs=None):
70 initialized = 1
71 return initialized
73 def ByteSize(self):
74 n = 0
75 return n
77 def ByteSizePartial(self):
78 n = 0
79 return n
81 def Clear(self):
82 pass
84 def OutputUnchecked(self, out):
85 pass
87 def OutputPartial(self, out):
88 pass
90 def TryMerge(self, d):
91 while d.avail() > 0:
92 tt = d.getVarInt32()
95 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
96 d.skipData(tt)
99 def __str__(self, prefix="", printElemNumber=0):
100 res=""
101 return res
104 def _BuildTagLookupTable(sparse, maxtag, default=None):
105 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
108 _TEXT = _BuildTagLookupTable({
109 0: "ErrorCode",
110 }, 0)
112 _TYPES = _BuildTagLookupTable({
113 0: ProtocolBuffer.Encoder.NUMERIC,
114 }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
117 _STYLE = """"""
118 _STYLE_CONTENT_TYPE = """"""
119 _PROTO_DESCRIPTOR_NAME = 'apphosting.UserServiceError'
120 class CreateLoginURLRequest(ProtocolBuffer.ProtocolMessage):
121 has_destination_url_ = 0
122 destination_url_ = ""
123 has_auth_domain_ = 0
124 auth_domain_ = ""
125 has_federated_identity_ = 0
126 federated_identity_ = ""
128 def __init__(self, contents=None):
129 if contents is not None: self.MergeFromString(contents)
131 def destination_url(self): return self.destination_url_
133 def set_destination_url(self, x):
134 self.has_destination_url_ = 1
135 self.destination_url_ = x
137 def clear_destination_url(self):
138 if self.has_destination_url_:
139 self.has_destination_url_ = 0
140 self.destination_url_ = ""
142 def has_destination_url(self): return self.has_destination_url_
144 def auth_domain(self): return self.auth_domain_
146 def set_auth_domain(self, x):
147 self.has_auth_domain_ = 1
148 self.auth_domain_ = x
150 def clear_auth_domain(self):
151 if self.has_auth_domain_:
152 self.has_auth_domain_ = 0
153 self.auth_domain_ = ""
155 def has_auth_domain(self): return self.has_auth_domain_
157 def federated_identity(self): return self.federated_identity_
159 def set_federated_identity(self, x):
160 self.has_federated_identity_ = 1
161 self.federated_identity_ = x
163 def clear_federated_identity(self):
164 if self.has_federated_identity_:
165 self.has_federated_identity_ = 0
166 self.federated_identity_ = ""
168 def has_federated_identity(self): return self.has_federated_identity_
171 def MergeFrom(self, x):
172 assert x is not self
173 if (x.has_destination_url()): self.set_destination_url(x.destination_url())
174 if (x.has_auth_domain()): self.set_auth_domain(x.auth_domain())
175 if (x.has_federated_identity()): self.set_federated_identity(x.federated_identity())
177 def Equals(self, x):
178 if x is self: return 1
179 if self.has_destination_url_ != x.has_destination_url_: return 0
180 if self.has_destination_url_ and self.destination_url_ != x.destination_url_: return 0
181 if self.has_auth_domain_ != x.has_auth_domain_: return 0
182 if self.has_auth_domain_ and self.auth_domain_ != x.auth_domain_: return 0
183 if self.has_federated_identity_ != x.has_federated_identity_: return 0
184 if self.has_federated_identity_ and self.federated_identity_ != x.federated_identity_: return 0
185 return 1
187 def IsInitialized(self, debug_strs=None):
188 initialized = 1
189 if (not self.has_destination_url_):
190 initialized = 0
191 if debug_strs is not None:
192 debug_strs.append('Required field: destination_url not set.')
193 return initialized
195 def ByteSize(self):
196 n = 0
197 n += self.lengthString(len(self.destination_url_))
198 if (self.has_auth_domain_): n += 1 + self.lengthString(len(self.auth_domain_))
199 if (self.has_federated_identity_): n += 1 + self.lengthString(len(self.federated_identity_))
200 return n + 1
202 def ByteSizePartial(self):
203 n = 0
204 if (self.has_destination_url_):
205 n += 1
206 n += self.lengthString(len(self.destination_url_))
207 if (self.has_auth_domain_): n += 1 + self.lengthString(len(self.auth_domain_))
208 if (self.has_federated_identity_): n += 1 + self.lengthString(len(self.federated_identity_))
209 return n
211 def Clear(self):
212 self.clear_destination_url()
213 self.clear_auth_domain()
214 self.clear_federated_identity()
216 def OutputUnchecked(self, out):
217 out.putVarInt32(10)
218 out.putPrefixedString(self.destination_url_)
219 if (self.has_auth_domain_):
220 out.putVarInt32(18)
221 out.putPrefixedString(self.auth_domain_)
222 if (self.has_federated_identity_):
223 out.putVarInt32(26)
224 out.putPrefixedString(self.federated_identity_)
226 def OutputPartial(self, out):
227 if (self.has_destination_url_):
228 out.putVarInt32(10)
229 out.putPrefixedString(self.destination_url_)
230 if (self.has_auth_domain_):
231 out.putVarInt32(18)
232 out.putPrefixedString(self.auth_domain_)
233 if (self.has_federated_identity_):
234 out.putVarInt32(26)
235 out.putPrefixedString(self.federated_identity_)
237 def TryMerge(self, d):
238 while d.avail() > 0:
239 tt = d.getVarInt32()
240 if tt == 10:
241 self.set_destination_url(d.getPrefixedString())
242 continue
243 if tt == 18:
244 self.set_auth_domain(d.getPrefixedString())
245 continue
246 if tt == 26:
247 self.set_federated_identity(d.getPrefixedString())
248 continue
251 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
252 d.skipData(tt)
255 def __str__(self, prefix="", printElemNumber=0):
256 res=""
257 if self.has_destination_url_: res+=prefix+("destination_url: %s\n" % self.DebugFormatString(self.destination_url_))
258 if self.has_auth_domain_: res+=prefix+("auth_domain: %s\n" % self.DebugFormatString(self.auth_domain_))
259 if self.has_federated_identity_: res+=prefix+("federated_identity: %s\n" % self.DebugFormatString(self.federated_identity_))
260 return res
263 def _BuildTagLookupTable(sparse, maxtag, default=None):
264 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
266 kdestination_url = 1
267 kauth_domain = 2
268 kfederated_identity = 3
270 _TEXT = _BuildTagLookupTable({
271 0: "ErrorCode",
272 1: "destination_url",
273 2: "auth_domain",
274 3: "federated_identity",
275 }, 3)
277 _TYPES = _BuildTagLookupTable({
278 0: ProtocolBuffer.Encoder.NUMERIC,
279 1: ProtocolBuffer.Encoder.STRING,
280 2: ProtocolBuffer.Encoder.STRING,
281 3: ProtocolBuffer.Encoder.STRING,
282 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
285 _STYLE = """"""
286 _STYLE_CONTENT_TYPE = """"""
287 _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateLoginURLRequest'
288 class CreateLoginURLResponse(ProtocolBuffer.ProtocolMessage):
289 has_login_url_ = 0
290 login_url_ = ""
292 def __init__(self, contents=None):
293 if contents is not None: self.MergeFromString(contents)
295 def login_url(self): return self.login_url_
297 def set_login_url(self, x):
298 self.has_login_url_ = 1
299 self.login_url_ = x
301 def clear_login_url(self):
302 if self.has_login_url_:
303 self.has_login_url_ = 0
304 self.login_url_ = ""
306 def has_login_url(self): return self.has_login_url_
309 def MergeFrom(self, x):
310 assert x is not self
311 if (x.has_login_url()): self.set_login_url(x.login_url())
313 def Equals(self, x):
314 if x is self: return 1
315 if self.has_login_url_ != x.has_login_url_: return 0
316 if self.has_login_url_ and self.login_url_ != x.login_url_: return 0
317 return 1
319 def IsInitialized(self, debug_strs=None):
320 initialized = 1
321 if (not self.has_login_url_):
322 initialized = 0
323 if debug_strs is not None:
324 debug_strs.append('Required field: login_url not set.')
325 return initialized
327 def ByteSize(self):
328 n = 0
329 n += self.lengthString(len(self.login_url_))
330 return n + 1
332 def ByteSizePartial(self):
333 n = 0
334 if (self.has_login_url_):
335 n += 1
336 n += self.lengthString(len(self.login_url_))
337 return n
339 def Clear(self):
340 self.clear_login_url()
342 def OutputUnchecked(self, out):
343 out.putVarInt32(10)
344 out.putPrefixedString(self.login_url_)
346 def OutputPartial(self, out):
347 if (self.has_login_url_):
348 out.putVarInt32(10)
349 out.putPrefixedString(self.login_url_)
351 def TryMerge(self, d):
352 while d.avail() > 0:
353 tt = d.getVarInt32()
354 if tt == 10:
355 self.set_login_url(d.getPrefixedString())
356 continue
359 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
360 d.skipData(tt)
363 def __str__(self, prefix="", printElemNumber=0):
364 res=""
365 if self.has_login_url_: res+=prefix+("login_url: %s\n" % self.DebugFormatString(self.login_url_))
366 return res
369 def _BuildTagLookupTable(sparse, maxtag, default=None):
370 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
372 klogin_url = 1
374 _TEXT = _BuildTagLookupTable({
375 0: "ErrorCode",
376 1: "login_url",
377 }, 1)
379 _TYPES = _BuildTagLookupTable({
380 0: ProtocolBuffer.Encoder.NUMERIC,
381 1: ProtocolBuffer.Encoder.STRING,
382 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
385 _STYLE = """"""
386 _STYLE_CONTENT_TYPE = """"""
387 _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateLoginURLResponse'
388 class CreateLogoutURLRequest(ProtocolBuffer.ProtocolMessage):
389 has_destination_url_ = 0
390 destination_url_ = ""
391 has_auth_domain_ = 0
392 auth_domain_ = ""
394 def __init__(self, contents=None):
395 if contents is not None: self.MergeFromString(contents)
397 def destination_url(self): return self.destination_url_
399 def set_destination_url(self, x):
400 self.has_destination_url_ = 1
401 self.destination_url_ = x
403 def clear_destination_url(self):
404 if self.has_destination_url_:
405 self.has_destination_url_ = 0
406 self.destination_url_ = ""
408 def has_destination_url(self): return self.has_destination_url_
410 def auth_domain(self): return self.auth_domain_
412 def set_auth_domain(self, x):
413 self.has_auth_domain_ = 1
414 self.auth_domain_ = x
416 def clear_auth_domain(self):
417 if self.has_auth_domain_:
418 self.has_auth_domain_ = 0
419 self.auth_domain_ = ""
421 def has_auth_domain(self): return self.has_auth_domain_
424 def MergeFrom(self, x):
425 assert x is not self
426 if (x.has_destination_url()): self.set_destination_url(x.destination_url())
427 if (x.has_auth_domain()): self.set_auth_domain(x.auth_domain())
429 def Equals(self, x):
430 if x is self: return 1
431 if self.has_destination_url_ != x.has_destination_url_: return 0
432 if self.has_destination_url_ and self.destination_url_ != x.destination_url_: return 0
433 if self.has_auth_domain_ != x.has_auth_domain_: return 0
434 if self.has_auth_domain_ and self.auth_domain_ != x.auth_domain_: return 0
435 return 1
437 def IsInitialized(self, debug_strs=None):
438 initialized = 1
439 if (not self.has_destination_url_):
440 initialized = 0
441 if debug_strs is not None:
442 debug_strs.append('Required field: destination_url not set.')
443 return initialized
445 def ByteSize(self):
446 n = 0
447 n += self.lengthString(len(self.destination_url_))
448 if (self.has_auth_domain_): n += 1 + self.lengthString(len(self.auth_domain_))
449 return n + 1
451 def ByteSizePartial(self):
452 n = 0
453 if (self.has_destination_url_):
454 n += 1
455 n += self.lengthString(len(self.destination_url_))
456 if (self.has_auth_domain_): n += 1 + self.lengthString(len(self.auth_domain_))
457 return n
459 def Clear(self):
460 self.clear_destination_url()
461 self.clear_auth_domain()
463 def OutputUnchecked(self, out):
464 out.putVarInt32(10)
465 out.putPrefixedString(self.destination_url_)
466 if (self.has_auth_domain_):
467 out.putVarInt32(18)
468 out.putPrefixedString(self.auth_domain_)
470 def OutputPartial(self, out):
471 if (self.has_destination_url_):
472 out.putVarInt32(10)
473 out.putPrefixedString(self.destination_url_)
474 if (self.has_auth_domain_):
475 out.putVarInt32(18)
476 out.putPrefixedString(self.auth_domain_)
478 def TryMerge(self, d):
479 while d.avail() > 0:
480 tt = d.getVarInt32()
481 if tt == 10:
482 self.set_destination_url(d.getPrefixedString())
483 continue
484 if tt == 18:
485 self.set_auth_domain(d.getPrefixedString())
486 continue
489 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
490 d.skipData(tt)
493 def __str__(self, prefix="", printElemNumber=0):
494 res=""
495 if self.has_destination_url_: res+=prefix+("destination_url: %s\n" % self.DebugFormatString(self.destination_url_))
496 if self.has_auth_domain_: res+=prefix+("auth_domain: %s\n" % self.DebugFormatString(self.auth_domain_))
497 return res
500 def _BuildTagLookupTable(sparse, maxtag, default=None):
501 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
503 kdestination_url = 1
504 kauth_domain = 2
506 _TEXT = _BuildTagLookupTable({
507 0: "ErrorCode",
508 1: "destination_url",
509 2: "auth_domain",
510 }, 2)
512 _TYPES = _BuildTagLookupTable({
513 0: ProtocolBuffer.Encoder.NUMERIC,
514 1: ProtocolBuffer.Encoder.STRING,
515 2: ProtocolBuffer.Encoder.STRING,
516 }, 2, ProtocolBuffer.Encoder.MAX_TYPE)
519 _STYLE = """"""
520 _STYLE_CONTENT_TYPE = """"""
521 _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateLogoutURLRequest'
522 class CreateLogoutURLResponse(ProtocolBuffer.ProtocolMessage):
523 has_logout_url_ = 0
524 logout_url_ = ""
526 def __init__(self, contents=None):
527 if contents is not None: self.MergeFromString(contents)
529 def logout_url(self): return self.logout_url_
531 def set_logout_url(self, x):
532 self.has_logout_url_ = 1
533 self.logout_url_ = x
535 def clear_logout_url(self):
536 if self.has_logout_url_:
537 self.has_logout_url_ = 0
538 self.logout_url_ = ""
540 def has_logout_url(self): return self.has_logout_url_
543 def MergeFrom(self, x):
544 assert x is not self
545 if (x.has_logout_url()): self.set_logout_url(x.logout_url())
547 def Equals(self, x):
548 if x is self: return 1
549 if self.has_logout_url_ != x.has_logout_url_: return 0
550 if self.has_logout_url_ and self.logout_url_ != x.logout_url_: return 0
551 return 1
553 def IsInitialized(self, debug_strs=None):
554 initialized = 1
555 if (not self.has_logout_url_):
556 initialized = 0
557 if debug_strs is not None:
558 debug_strs.append('Required field: logout_url not set.')
559 return initialized
561 def ByteSize(self):
562 n = 0
563 n += self.lengthString(len(self.logout_url_))
564 return n + 1
566 def ByteSizePartial(self):
567 n = 0
568 if (self.has_logout_url_):
569 n += 1
570 n += self.lengthString(len(self.logout_url_))
571 return n
573 def Clear(self):
574 self.clear_logout_url()
576 def OutputUnchecked(self, out):
577 out.putVarInt32(10)
578 out.putPrefixedString(self.logout_url_)
580 def OutputPartial(self, out):
581 if (self.has_logout_url_):
582 out.putVarInt32(10)
583 out.putPrefixedString(self.logout_url_)
585 def TryMerge(self, d):
586 while d.avail() > 0:
587 tt = d.getVarInt32()
588 if tt == 10:
589 self.set_logout_url(d.getPrefixedString())
590 continue
593 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
594 d.skipData(tt)
597 def __str__(self, prefix="", printElemNumber=0):
598 res=""
599 if self.has_logout_url_: res+=prefix+("logout_url: %s\n" % self.DebugFormatString(self.logout_url_))
600 return res
603 def _BuildTagLookupTable(sparse, maxtag, default=None):
604 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
606 klogout_url = 1
608 _TEXT = _BuildTagLookupTable({
609 0: "ErrorCode",
610 1: "logout_url",
611 }, 1)
613 _TYPES = _BuildTagLookupTable({
614 0: ProtocolBuffer.Encoder.NUMERIC,
615 1: ProtocolBuffer.Encoder.STRING,
616 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
619 _STYLE = """"""
620 _STYLE_CONTENT_TYPE = """"""
621 _PROTO_DESCRIPTOR_NAME = 'apphosting.CreateLogoutURLResponse'
622 class GetOAuthUserRequest(ProtocolBuffer.ProtocolMessage):
623 has_scope_ = 0
624 scope_ = ""
625 has_request_writer_permission_ = 0
626 request_writer_permission_ = 0
628 def __init__(self, contents=None):
629 self.scopes_ = []
630 if contents is not None: self.MergeFromString(contents)
632 def scope(self): return self.scope_
634 def set_scope(self, x):
635 self.has_scope_ = 1
636 self.scope_ = x
638 def clear_scope(self):
639 if self.has_scope_:
640 self.has_scope_ = 0
641 self.scope_ = ""
643 def has_scope(self): return self.has_scope_
645 def scopes_size(self): return len(self.scopes_)
646 def scopes_list(self): return self.scopes_
648 def scopes(self, i):
649 return self.scopes_[i]
651 def set_scopes(self, i, x):
652 self.scopes_[i] = x
654 def add_scopes(self, x):
655 self.scopes_.append(x)
657 def clear_scopes(self):
658 self.scopes_ = []
660 def request_writer_permission(self): return self.request_writer_permission_
662 def set_request_writer_permission(self, x):
663 self.has_request_writer_permission_ = 1
664 self.request_writer_permission_ = x
666 def clear_request_writer_permission(self):
667 if self.has_request_writer_permission_:
668 self.has_request_writer_permission_ = 0
669 self.request_writer_permission_ = 0
671 def has_request_writer_permission(self): return self.has_request_writer_permission_
674 def MergeFrom(self, x):
675 assert x is not self
676 if (x.has_scope()): self.set_scope(x.scope())
677 for i in xrange(x.scopes_size()): self.add_scopes(x.scopes(i))
678 if (x.has_request_writer_permission()): self.set_request_writer_permission(x.request_writer_permission())
680 def Equals(self, x):
681 if x is self: return 1
682 if self.has_scope_ != x.has_scope_: return 0
683 if self.has_scope_ and self.scope_ != x.scope_: return 0
684 if len(self.scopes_) != len(x.scopes_): return 0
685 for e1, e2 in zip(self.scopes_, x.scopes_):
686 if e1 != e2: return 0
687 if self.has_request_writer_permission_ != x.has_request_writer_permission_: return 0
688 if self.has_request_writer_permission_ and self.request_writer_permission_ != x.request_writer_permission_: return 0
689 return 1
691 def IsInitialized(self, debug_strs=None):
692 initialized = 1
693 return initialized
695 def ByteSize(self):
696 n = 0
697 if (self.has_scope_): n += 1 + self.lengthString(len(self.scope_))
698 n += 1 * len(self.scopes_)
699 for i in xrange(len(self.scopes_)): n += self.lengthString(len(self.scopes_[i]))
700 if (self.has_request_writer_permission_): n += 2
701 return n
703 def ByteSizePartial(self):
704 n = 0
705 if (self.has_scope_): n += 1 + self.lengthString(len(self.scope_))
706 n += 1 * len(self.scopes_)
707 for i in xrange(len(self.scopes_)): n += self.lengthString(len(self.scopes_[i]))
708 if (self.has_request_writer_permission_): n += 2
709 return n
711 def Clear(self):
712 self.clear_scope()
713 self.clear_scopes()
714 self.clear_request_writer_permission()
716 def OutputUnchecked(self, out):
717 if (self.has_scope_):
718 out.putVarInt32(10)
719 out.putPrefixedString(self.scope_)
720 for i in xrange(len(self.scopes_)):
721 out.putVarInt32(18)
722 out.putPrefixedString(self.scopes_[i])
723 if (self.has_request_writer_permission_):
724 out.putVarInt32(24)
725 out.putBoolean(self.request_writer_permission_)
727 def OutputPartial(self, out):
728 if (self.has_scope_):
729 out.putVarInt32(10)
730 out.putPrefixedString(self.scope_)
731 for i in xrange(len(self.scopes_)):
732 out.putVarInt32(18)
733 out.putPrefixedString(self.scopes_[i])
734 if (self.has_request_writer_permission_):
735 out.putVarInt32(24)
736 out.putBoolean(self.request_writer_permission_)
738 def TryMerge(self, d):
739 while d.avail() > 0:
740 tt = d.getVarInt32()
741 if tt == 10:
742 self.set_scope(d.getPrefixedString())
743 continue
744 if tt == 18:
745 self.add_scopes(d.getPrefixedString())
746 continue
747 if tt == 24:
748 self.set_request_writer_permission(d.getBoolean())
749 continue
752 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
753 d.skipData(tt)
756 def __str__(self, prefix="", printElemNumber=0):
757 res=""
758 if self.has_scope_: res+=prefix+("scope: %s\n" % self.DebugFormatString(self.scope_))
759 cnt=0
760 for e in self.scopes_:
761 elm=""
762 if printElemNumber: elm="(%d)" % cnt
763 res+=prefix+("scopes%s: %s\n" % (elm, self.DebugFormatString(e)))
764 cnt+=1
765 if self.has_request_writer_permission_: res+=prefix+("request_writer_permission: %s\n" % self.DebugFormatBool(self.request_writer_permission_))
766 return res
769 def _BuildTagLookupTable(sparse, maxtag, default=None):
770 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
772 kscope = 1
773 kscopes = 2
774 krequest_writer_permission = 3
776 _TEXT = _BuildTagLookupTable({
777 0: "ErrorCode",
778 1: "scope",
779 2: "scopes",
780 3: "request_writer_permission",
781 }, 3)
783 _TYPES = _BuildTagLookupTable({
784 0: ProtocolBuffer.Encoder.NUMERIC,
785 1: ProtocolBuffer.Encoder.STRING,
786 2: ProtocolBuffer.Encoder.STRING,
787 3: ProtocolBuffer.Encoder.NUMERIC,
788 }, 3, ProtocolBuffer.Encoder.MAX_TYPE)
791 _STYLE = """"""
792 _STYLE_CONTENT_TYPE = """"""
793 _PROTO_DESCRIPTOR_NAME = 'apphosting.GetOAuthUserRequest'
794 class GetOAuthUserResponse(ProtocolBuffer.ProtocolMessage):
795 has_email_ = 0
796 email_ = ""
797 has_user_id_ = 0
798 user_id_ = ""
799 has_auth_domain_ = 0
800 auth_domain_ = ""
801 has_user_organization_ = 0
802 user_organization_ = ""
803 has_is_admin_ = 0
804 is_admin_ = 0
805 has_client_id_ = 0
806 client_id_ = ""
807 has_is_project_writer_ = 0
808 is_project_writer_ = 0
810 def __init__(self, contents=None):
811 self.scopes_ = []
812 if contents is not None: self.MergeFromString(contents)
814 def email(self): return self.email_
816 def set_email(self, x):
817 self.has_email_ = 1
818 self.email_ = x
820 def clear_email(self):
821 if self.has_email_:
822 self.has_email_ = 0
823 self.email_ = ""
825 def has_email(self): return self.has_email_
827 def user_id(self): return self.user_id_
829 def set_user_id(self, x):
830 self.has_user_id_ = 1
831 self.user_id_ = x
833 def clear_user_id(self):
834 if self.has_user_id_:
835 self.has_user_id_ = 0
836 self.user_id_ = ""
838 def has_user_id(self): return self.has_user_id_
840 def auth_domain(self): return self.auth_domain_
842 def set_auth_domain(self, x):
843 self.has_auth_domain_ = 1
844 self.auth_domain_ = x
846 def clear_auth_domain(self):
847 if self.has_auth_domain_:
848 self.has_auth_domain_ = 0
849 self.auth_domain_ = ""
851 def has_auth_domain(self): return self.has_auth_domain_
853 def user_organization(self): return self.user_organization_
855 def set_user_organization(self, x):
856 self.has_user_organization_ = 1
857 self.user_organization_ = x
859 def clear_user_organization(self):
860 if self.has_user_organization_:
861 self.has_user_organization_ = 0
862 self.user_organization_ = ""
864 def has_user_organization(self): return self.has_user_organization_
866 def is_admin(self): return self.is_admin_
868 def set_is_admin(self, x):
869 self.has_is_admin_ = 1
870 self.is_admin_ = x
872 def clear_is_admin(self):
873 if self.has_is_admin_:
874 self.has_is_admin_ = 0
875 self.is_admin_ = 0
877 def has_is_admin(self): return self.has_is_admin_
879 def client_id(self): return self.client_id_
881 def set_client_id(self, x):
882 self.has_client_id_ = 1
883 self.client_id_ = x
885 def clear_client_id(self):
886 if self.has_client_id_:
887 self.has_client_id_ = 0
888 self.client_id_ = ""
890 def has_client_id(self): return self.has_client_id_
892 def scopes_size(self): return len(self.scopes_)
893 def scopes_list(self): return self.scopes_
895 def scopes(self, i):
896 return self.scopes_[i]
898 def set_scopes(self, i, x):
899 self.scopes_[i] = x
901 def add_scopes(self, x):
902 self.scopes_.append(x)
904 def clear_scopes(self):
905 self.scopes_ = []
907 def is_project_writer(self): return self.is_project_writer_
909 def set_is_project_writer(self, x):
910 self.has_is_project_writer_ = 1
911 self.is_project_writer_ = x
913 def clear_is_project_writer(self):
914 if self.has_is_project_writer_:
915 self.has_is_project_writer_ = 0
916 self.is_project_writer_ = 0
918 def has_is_project_writer(self): return self.has_is_project_writer_
921 def MergeFrom(self, x):
922 assert x is not self
923 if (x.has_email()): self.set_email(x.email())
924 if (x.has_user_id()): self.set_user_id(x.user_id())
925 if (x.has_auth_domain()): self.set_auth_domain(x.auth_domain())
926 if (x.has_user_organization()): self.set_user_organization(x.user_organization())
927 if (x.has_is_admin()): self.set_is_admin(x.is_admin())
928 if (x.has_client_id()): self.set_client_id(x.client_id())
929 for i in xrange(x.scopes_size()): self.add_scopes(x.scopes(i))
930 if (x.has_is_project_writer()): self.set_is_project_writer(x.is_project_writer())
932 def Equals(self, x):
933 if x is self: return 1
934 if self.has_email_ != x.has_email_: return 0
935 if self.has_email_ and self.email_ != x.email_: return 0
936 if self.has_user_id_ != x.has_user_id_: return 0
937 if self.has_user_id_ and self.user_id_ != x.user_id_: return 0
938 if self.has_auth_domain_ != x.has_auth_domain_: return 0
939 if self.has_auth_domain_ and self.auth_domain_ != x.auth_domain_: return 0
940 if self.has_user_organization_ != x.has_user_organization_: return 0
941 if self.has_user_organization_ and self.user_organization_ != x.user_organization_: return 0
942 if self.has_is_admin_ != x.has_is_admin_: return 0
943 if self.has_is_admin_ and self.is_admin_ != x.is_admin_: return 0
944 if self.has_client_id_ != x.has_client_id_: return 0
945 if self.has_client_id_ and self.client_id_ != x.client_id_: return 0
946 if len(self.scopes_) != len(x.scopes_): return 0
947 for e1, e2 in zip(self.scopes_, x.scopes_):
948 if e1 != e2: return 0
949 if self.has_is_project_writer_ != x.has_is_project_writer_: return 0
950 if self.has_is_project_writer_ and self.is_project_writer_ != x.is_project_writer_: return 0
951 return 1
953 def IsInitialized(self, debug_strs=None):
954 initialized = 1
955 if (not self.has_email_):
956 initialized = 0
957 if debug_strs is not None:
958 debug_strs.append('Required field: email not set.')
959 if (not self.has_user_id_):
960 initialized = 0
961 if debug_strs is not None:
962 debug_strs.append('Required field: user_id not set.')
963 if (not self.has_auth_domain_):
964 initialized = 0
965 if debug_strs is not None:
966 debug_strs.append('Required field: auth_domain not set.')
967 return initialized
969 def ByteSize(self):
970 n = 0
971 n += self.lengthString(len(self.email_))
972 n += self.lengthString(len(self.user_id_))
973 n += self.lengthString(len(self.auth_domain_))
974 if (self.has_user_organization_): n += 1 + self.lengthString(len(self.user_organization_))
975 if (self.has_is_admin_): n += 2
976 if (self.has_client_id_): n += 1 + self.lengthString(len(self.client_id_))
977 n += 1 * len(self.scopes_)
978 for i in xrange(len(self.scopes_)): n += self.lengthString(len(self.scopes_[i]))
979 if (self.has_is_project_writer_): n += 2
980 return n + 3
982 def ByteSizePartial(self):
983 n = 0
984 if (self.has_email_):
985 n += 1
986 n += self.lengthString(len(self.email_))
987 if (self.has_user_id_):
988 n += 1
989 n += self.lengthString(len(self.user_id_))
990 if (self.has_auth_domain_):
991 n += 1
992 n += self.lengthString(len(self.auth_domain_))
993 if (self.has_user_organization_): n += 1 + self.lengthString(len(self.user_organization_))
994 if (self.has_is_admin_): n += 2
995 if (self.has_client_id_): n += 1 + self.lengthString(len(self.client_id_))
996 n += 1 * len(self.scopes_)
997 for i in xrange(len(self.scopes_)): n += self.lengthString(len(self.scopes_[i]))
998 if (self.has_is_project_writer_): n += 2
999 return n
1001 def Clear(self):
1002 self.clear_email()
1003 self.clear_user_id()
1004 self.clear_auth_domain()
1005 self.clear_user_organization()
1006 self.clear_is_admin()
1007 self.clear_client_id()
1008 self.clear_scopes()
1009 self.clear_is_project_writer()
1011 def OutputUnchecked(self, out):
1012 out.putVarInt32(10)
1013 out.putPrefixedString(self.email_)
1014 out.putVarInt32(18)
1015 out.putPrefixedString(self.user_id_)
1016 out.putVarInt32(26)
1017 out.putPrefixedString(self.auth_domain_)
1018 if (self.has_user_organization_):
1019 out.putVarInt32(34)
1020 out.putPrefixedString(self.user_organization_)
1021 if (self.has_is_admin_):
1022 out.putVarInt32(40)
1023 out.putBoolean(self.is_admin_)
1024 if (self.has_client_id_):
1025 out.putVarInt32(50)
1026 out.putPrefixedString(self.client_id_)
1027 for i in xrange(len(self.scopes_)):
1028 out.putVarInt32(58)
1029 out.putPrefixedString(self.scopes_[i])
1030 if (self.has_is_project_writer_):
1031 out.putVarInt32(64)
1032 out.putBoolean(self.is_project_writer_)
1034 def OutputPartial(self, out):
1035 if (self.has_email_):
1036 out.putVarInt32(10)
1037 out.putPrefixedString(self.email_)
1038 if (self.has_user_id_):
1039 out.putVarInt32(18)
1040 out.putPrefixedString(self.user_id_)
1041 if (self.has_auth_domain_):
1042 out.putVarInt32(26)
1043 out.putPrefixedString(self.auth_domain_)
1044 if (self.has_user_organization_):
1045 out.putVarInt32(34)
1046 out.putPrefixedString(self.user_organization_)
1047 if (self.has_is_admin_):
1048 out.putVarInt32(40)
1049 out.putBoolean(self.is_admin_)
1050 if (self.has_client_id_):
1051 out.putVarInt32(50)
1052 out.putPrefixedString(self.client_id_)
1053 for i in xrange(len(self.scopes_)):
1054 out.putVarInt32(58)
1055 out.putPrefixedString(self.scopes_[i])
1056 if (self.has_is_project_writer_):
1057 out.putVarInt32(64)
1058 out.putBoolean(self.is_project_writer_)
1060 def TryMerge(self, d):
1061 while d.avail() > 0:
1062 tt = d.getVarInt32()
1063 if tt == 10:
1064 self.set_email(d.getPrefixedString())
1065 continue
1066 if tt == 18:
1067 self.set_user_id(d.getPrefixedString())
1068 continue
1069 if tt == 26:
1070 self.set_auth_domain(d.getPrefixedString())
1071 continue
1072 if tt == 34:
1073 self.set_user_organization(d.getPrefixedString())
1074 continue
1075 if tt == 40:
1076 self.set_is_admin(d.getBoolean())
1077 continue
1078 if tt == 50:
1079 self.set_client_id(d.getPrefixedString())
1080 continue
1081 if tt == 58:
1082 self.add_scopes(d.getPrefixedString())
1083 continue
1084 if tt == 64:
1085 self.set_is_project_writer(d.getBoolean())
1086 continue
1089 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1090 d.skipData(tt)
1093 def __str__(self, prefix="", printElemNumber=0):
1094 res=""
1095 if self.has_email_: res+=prefix+("email: %s\n" % self.DebugFormatString(self.email_))
1096 if self.has_user_id_: res+=prefix+("user_id: %s\n" % self.DebugFormatString(self.user_id_))
1097 if self.has_auth_domain_: res+=prefix+("auth_domain: %s\n" % self.DebugFormatString(self.auth_domain_))
1098 if self.has_user_organization_: res+=prefix+("user_organization: %s\n" % self.DebugFormatString(self.user_organization_))
1099 if self.has_is_admin_: res+=prefix+("is_admin: %s\n" % self.DebugFormatBool(self.is_admin_))
1100 if self.has_client_id_: res+=prefix+("client_id: %s\n" % self.DebugFormatString(self.client_id_))
1101 cnt=0
1102 for e in self.scopes_:
1103 elm=""
1104 if printElemNumber: elm="(%d)" % cnt
1105 res+=prefix+("scopes%s: %s\n" % (elm, self.DebugFormatString(e)))
1106 cnt+=1
1107 if self.has_is_project_writer_: res+=prefix+("is_project_writer: %s\n" % self.DebugFormatBool(self.is_project_writer_))
1108 return res
1111 def _BuildTagLookupTable(sparse, maxtag, default=None):
1112 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1114 kemail = 1
1115 kuser_id = 2
1116 kauth_domain = 3
1117 kuser_organization = 4
1118 kis_admin = 5
1119 kclient_id = 6
1120 kscopes = 7
1121 kis_project_writer = 8
1123 _TEXT = _BuildTagLookupTable({
1124 0: "ErrorCode",
1125 1: "email",
1126 2: "user_id",
1127 3: "auth_domain",
1128 4: "user_organization",
1129 5: "is_admin",
1130 6: "client_id",
1131 7: "scopes",
1132 8: "is_project_writer",
1133 }, 8)
1135 _TYPES = _BuildTagLookupTable({
1136 0: ProtocolBuffer.Encoder.NUMERIC,
1137 1: ProtocolBuffer.Encoder.STRING,
1138 2: ProtocolBuffer.Encoder.STRING,
1139 3: ProtocolBuffer.Encoder.STRING,
1140 4: ProtocolBuffer.Encoder.STRING,
1141 5: ProtocolBuffer.Encoder.NUMERIC,
1142 6: ProtocolBuffer.Encoder.STRING,
1143 7: ProtocolBuffer.Encoder.STRING,
1144 8: ProtocolBuffer.Encoder.NUMERIC,
1145 }, 8, ProtocolBuffer.Encoder.MAX_TYPE)
1148 _STYLE = """"""
1149 _STYLE_CONTENT_TYPE = """"""
1150 _PROTO_DESCRIPTOR_NAME = 'apphosting.GetOAuthUserResponse'
1151 class CheckOAuthSignatureRequest(ProtocolBuffer.ProtocolMessage):
1153 def __init__(self, contents=None):
1154 pass
1155 if contents is not None: self.MergeFromString(contents)
1158 def MergeFrom(self, x):
1159 assert x is not self
1161 def Equals(self, x):
1162 if x is self: return 1
1163 return 1
1165 def IsInitialized(self, debug_strs=None):
1166 initialized = 1
1167 return initialized
1169 def ByteSize(self):
1170 n = 0
1171 return n
1173 def ByteSizePartial(self):
1174 n = 0
1175 return n
1177 def Clear(self):
1178 pass
1180 def OutputUnchecked(self, out):
1181 pass
1183 def OutputPartial(self, out):
1184 pass
1186 def TryMerge(self, d):
1187 while d.avail() > 0:
1188 tt = d.getVarInt32()
1191 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1192 d.skipData(tt)
1195 def __str__(self, prefix="", printElemNumber=0):
1196 res=""
1197 return res
1200 def _BuildTagLookupTable(sparse, maxtag, default=None):
1201 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1204 _TEXT = _BuildTagLookupTable({
1205 0: "ErrorCode",
1206 }, 0)
1208 _TYPES = _BuildTagLookupTable({
1209 0: ProtocolBuffer.Encoder.NUMERIC,
1210 }, 0, ProtocolBuffer.Encoder.MAX_TYPE)
1213 _STYLE = """"""
1214 _STYLE_CONTENT_TYPE = """"""
1215 _PROTO_DESCRIPTOR_NAME = 'apphosting.CheckOAuthSignatureRequest'
1216 class CheckOAuthSignatureResponse(ProtocolBuffer.ProtocolMessage):
1217 has_oauth_consumer_key_ = 0
1218 oauth_consumer_key_ = ""
1220 def __init__(self, contents=None):
1221 if contents is not None: self.MergeFromString(contents)
1223 def oauth_consumer_key(self): return self.oauth_consumer_key_
1225 def set_oauth_consumer_key(self, x):
1226 self.has_oauth_consumer_key_ = 1
1227 self.oauth_consumer_key_ = x
1229 def clear_oauth_consumer_key(self):
1230 if self.has_oauth_consumer_key_:
1231 self.has_oauth_consumer_key_ = 0
1232 self.oauth_consumer_key_ = ""
1234 def has_oauth_consumer_key(self): return self.has_oauth_consumer_key_
1237 def MergeFrom(self, x):
1238 assert x is not self
1239 if (x.has_oauth_consumer_key()): self.set_oauth_consumer_key(x.oauth_consumer_key())
1241 def Equals(self, x):
1242 if x is self: return 1
1243 if self.has_oauth_consumer_key_ != x.has_oauth_consumer_key_: return 0
1244 if self.has_oauth_consumer_key_ and self.oauth_consumer_key_ != x.oauth_consumer_key_: return 0
1245 return 1
1247 def IsInitialized(self, debug_strs=None):
1248 initialized = 1
1249 if (not self.has_oauth_consumer_key_):
1250 initialized = 0
1251 if debug_strs is not None:
1252 debug_strs.append('Required field: oauth_consumer_key not set.')
1253 return initialized
1255 def ByteSize(self):
1256 n = 0
1257 n += self.lengthString(len(self.oauth_consumer_key_))
1258 return n + 1
1260 def ByteSizePartial(self):
1261 n = 0
1262 if (self.has_oauth_consumer_key_):
1263 n += 1
1264 n += self.lengthString(len(self.oauth_consumer_key_))
1265 return n
1267 def Clear(self):
1268 self.clear_oauth_consumer_key()
1270 def OutputUnchecked(self, out):
1271 out.putVarInt32(10)
1272 out.putPrefixedString(self.oauth_consumer_key_)
1274 def OutputPartial(self, out):
1275 if (self.has_oauth_consumer_key_):
1276 out.putVarInt32(10)
1277 out.putPrefixedString(self.oauth_consumer_key_)
1279 def TryMerge(self, d):
1280 while d.avail() > 0:
1281 tt = d.getVarInt32()
1282 if tt == 10:
1283 self.set_oauth_consumer_key(d.getPrefixedString())
1284 continue
1287 if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
1288 d.skipData(tt)
1291 def __str__(self, prefix="", printElemNumber=0):
1292 res=""
1293 if self.has_oauth_consumer_key_: res+=prefix+("oauth_consumer_key: %s\n" % self.DebugFormatString(self.oauth_consumer_key_))
1294 return res
1297 def _BuildTagLookupTable(sparse, maxtag, default=None):
1298 return tuple([sparse.get(i, default) for i in xrange(0, 1+maxtag)])
1300 koauth_consumer_key = 1
1302 _TEXT = _BuildTagLookupTable({
1303 0: "ErrorCode",
1304 1: "oauth_consumer_key",
1305 }, 1)
1307 _TYPES = _BuildTagLookupTable({
1308 0: ProtocolBuffer.Encoder.NUMERIC,
1309 1: ProtocolBuffer.Encoder.STRING,
1310 }, 1, ProtocolBuffer.Encoder.MAX_TYPE)
1313 _STYLE = """"""
1314 _STYLE_CONTENT_TYPE = """"""
1315 _PROTO_DESCRIPTOR_NAME = 'apphosting.CheckOAuthSignatureResponse'
1316 if _extension_runtime:
1317 pass
1319 __all__ = ['UserServiceError','CreateLoginURLRequest','CreateLoginURLResponse','CreateLogoutURLRequest','CreateLogoutURLResponse','GetOAuthUserRequest','GetOAuthUserResponse','CheckOAuthSignatureRequest','CheckOAuthSignatureResponse']