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
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
31 _extension_runtime
= False
32 _ExtendableProtocolMessage
= ProtocolBuffer
.ProtocolMessage
34 class UserServiceError(ProtocolBuffer
.ProtocolMessage
):
38 REDIRECT_URL_TOO_LONG
= 1
40 OAUTH_INVALID_TOKEN
= 3
41 OAUTH_INVALID_REQUEST
= 4
46 1: "REDIRECT_URL_TOO_LONG",
48 3: "OAUTH_INVALID_TOKEN",
49 4: "OAUTH_INVALID_REQUEST",
53 def ErrorCode_Name(cls
, x
): return cls
._ErrorCode
_NAMES
.get(x
, "")
54 ErrorCode_Name
= classmethod(ErrorCode_Name
)
57 def __init__(self
, contents
=None):
59 if contents
is not None: self
.MergeFromString(contents
)
62 def MergeFrom(self
, x
):
66 if x
is self
: return 1
69 def IsInitialized(self
, debug_strs
=None):
77 def ByteSizePartial(self
):
84 def OutputUnchecked(self
, out
):
87 def OutputPartial(self
, out
):
90 def TryMerge(self
, d
):
95 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
99 def __str__(self
, prefix
="", printElemNumber
=0):
104 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
105 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
108 _TEXT
= _BuildTagLookupTable({
112 _TYPES
= _BuildTagLookupTable({
113 0: ProtocolBuffer
.Encoder
.NUMERIC
,
114 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
118 _STYLE_CONTENT_TYPE
= """"""
119 _PROTO_DESCRIPTOR_NAME
= 'apphosting.UserServiceError'
120 class CreateLoginURLRequest(ProtocolBuffer
.ProtocolMessage
):
121 has_destination_url_
= 0
122 destination_url_
= ""
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
):
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())
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
187 def IsInitialized(self
, debug_strs
=None):
189 if (not self
.has_destination_url_
):
191 if debug_strs
is not None:
192 debug_strs
.append('Required field: destination_url not set.')
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_
))
202 def ByteSizePartial(self
):
204 if (self
.has_destination_url_
):
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_
))
212 self
.clear_destination_url()
213 self
.clear_auth_domain()
214 self
.clear_federated_identity()
216 def OutputUnchecked(self
, out
):
218 out
.putPrefixedString(self
.destination_url_
)
219 if (self
.has_auth_domain_
):
221 out
.putPrefixedString(self
.auth_domain_
)
222 if (self
.has_federated_identity_
):
224 out
.putPrefixedString(self
.federated_identity_
)
226 def OutputPartial(self
, out
):
227 if (self
.has_destination_url_
):
229 out
.putPrefixedString(self
.destination_url_
)
230 if (self
.has_auth_domain_
):
232 out
.putPrefixedString(self
.auth_domain_
)
233 if (self
.has_federated_identity_
):
235 out
.putPrefixedString(self
.federated_identity_
)
237 def TryMerge(self
, d
):
241 self
.set_destination_url(d
.getPrefixedString())
244 self
.set_auth_domain(d
.getPrefixedString())
247 self
.set_federated_identity(d
.getPrefixedString())
251 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
255 def __str__(self
, prefix
="", printElemNumber
=0):
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_
))
263 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
264 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
268 kfederated_identity
= 3
270 _TEXT
= _BuildTagLookupTable({
272 1: "destination_url",
274 3: "federated_identity",
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
)
286 _STYLE_CONTENT_TYPE
= """"""
287 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateLoginURLRequest'
288 class CreateLoginURLResponse(ProtocolBuffer
.ProtocolMessage
):
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
301 def clear_login_url(self
):
302 if self
.has_login_url_
:
303 self
.has_login_url_
= 0
306 def has_login_url(self
): return self
.has_login_url_
309 def MergeFrom(self
, x
):
311 if (x
.has_login_url()): self
.set_login_url(x
.login_url())
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
319 def IsInitialized(self
, debug_strs
=None):
321 if (not self
.has_login_url_
):
323 if debug_strs
is not None:
324 debug_strs
.append('Required field: login_url not set.')
329 n
+= self
.lengthString(len(self
.login_url_
))
332 def ByteSizePartial(self
):
334 if (self
.has_login_url_
):
336 n
+= self
.lengthString(len(self
.login_url_
))
340 self
.clear_login_url()
342 def OutputUnchecked(self
, out
):
344 out
.putPrefixedString(self
.login_url_
)
346 def OutputPartial(self
, out
):
347 if (self
.has_login_url_
):
349 out
.putPrefixedString(self
.login_url_
)
351 def TryMerge(self
, d
):
355 self
.set_login_url(d
.getPrefixedString())
359 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
363 def __str__(self
, prefix
="", printElemNumber
=0):
365 if self
.has_login_url_
: res
+=prefix
+("login_url: %s\n" % self
.DebugFormatString(self
.login_url_
))
369 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
370 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
374 _TEXT
= _BuildTagLookupTable({
379 _TYPES
= _BuildTagLookupTable({
380 0: ProtocolBuffer
.Encoder
.NUMERIC
,
381 1: ProtocolBuffer
.Encoder
.STRING
,
382 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
386 _STYLE_CONTENT_TYPE
= """"""
387 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateLoginURLResponse'
388 class CreateLogoutURLRequest(ProtocolBuffer
.ProtocolMessage
):
389 has_destination_url_
= 0
390 destination_url_
= ""
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
):
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())
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
437 def IsInitialized(self
, debug_strs
=None):
439 if (not self
.has_destination_url_
):
441 if debug_strs
is not None:
442 debug_strs
.append('Required field: destination_url not set.')
447 n
+= self
.lengthString(len(self
.destination_url_
))
448 if (self
.has_auth_domain_
): n
+= 1 + self
.lengthString(len(self
.auth_domain_
))
451 def ByteSizePartial(self
):
453 if (self
.has_destination_url_
):
455 n
+= self
.lengthString(len(self
.destination_url_
))
456 if (self
.has_auth_domain_
): n
+= 1 + self
.lengthString(len(self
.auth_domain_
))
460 self
.clear_destination_url()
461 self
.clear_auth_domain()
463 def OutputUnchecked(self
, out
):
465 out
.putPrefixedString(self
.destination_url_
)
466 if (self
.has_auth_domain_
):
468 out
.putPrefixedString(self
.auth_domain_
)
470 def OutputPartial(self
, out
):
471 if (self
.has_destination_url_
):
473 out
.putPrefixedString(self
.destination_url_
)
474 if (self
.has_auth_domain_
):
476 out
.putPrefixedString(self
.auth_domain_
)
478 def TryMerge(self
, d
):
482 self
.set_destination_url(d
.getPrefixedString())
485 self
.set_auth_domain(d
.getPrefixedString())
489 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
493 def __str__(self
, prefix
="", printElemNumber
=0):
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_
))
500 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
501 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
506 _TEXT
= _BuildTagLookupTable({
508 1: "destination_url",
512 _TYPES
= _BuildTagLookupTable({
513 0: ProtocolBuffer
.Encoder
.NUMERIC
,
514 1: ProtocolBuffer
.Encoder
.STRING
,
515 2: ProtocolBuffer
.Encoder
.STRING
,
516 }, 2, ProtocolBuffer
.Encoder
.MAX_TYPE
)
520 _STYLE_CONTENT_TYPE
= """"""
521 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateLogoutURLRequest'
522 class CreateLogoutURLResponse(ProtocolBuffer
.ProtocolMessage
):
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
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
):
545 if (x
.has_logout_url()): self
.set_logout_url(x
.logout_url())
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
553 def IsInitialized(self
, debug_strs
=None):
555 if (not self
.has_logout_url_
):
557 if debug_strs
is not None:
558 debug_strs
.append('Required field: logout_url not set.')
563 n
+= self
.lengthString(len(self
.logout_url_
))
566 def ByteSizePartial(self
):
568 if (self
.has_logout_url_
):
570 n
+= self
.lengthString(len(self
.logout_url_
))
574 self
.clear_logout_url()
576 def OutputUnchecked(self
, out
):
578 out
.putPrefixedString(self
.logout_url_
)
580 def OutputPartial(self
, out
):
581 if (self
.has_logout_url_
):
583 out
.putPrefixedString(self
.logout_url_
)
585 def TryMerge(self
, d
):
589 self
.set_logout_url(d
.getPrefixedString())
593 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
597 def __str__(self
, prefix
="", printElemNumber
=0):
599 if self
.has_logout_url_
: res
+=prefix
+("logout_url: %s\n" % self
.DebugFormatString(self
.logout_url_
))
603 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
604 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
608 _TEXT
= _BuildTagLookupTable({
613 _TYPES
= _BuildTagLookupTable({
614 0: ProtocolBuffer
.Encoder
.NUMERIC
,
615 1: ProtocolBuffer
.Encoder
.STRING
,
616 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
620 _STYLE_CONTENT_TYPE
= """"""
621 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateLogoutURLResponse'
622 class GetOAuthUserRequest(ProtocolBuffer
.ProtocolMessage
):
626 def __init__(self
, contents
=None):
627 if contents
is not None: self
.MergeFromString(contents
)
629 def scope(self
): return self
.scope_
631 def set_scope(self
, x
):
635 def clear_scope(self
):
640 def has_scope(self
): return self
.has_scope_
643 def MergeFrom(self
, x
):
645 if (x
.has_scope()): self
.set_scope(x
.scope())
648 if x
is self
: return 1
649 if self
.has_scope_
!= x
.has_scope_
: return 0
650 if self
.has_scope_
and self
.scope_
!= x
.scope_
: return 0
653 def IsInitialized(self
, debug_strs
=None):
659 if (self
.has_scope_
): n
+= 1 + self
.lengthString(len(self
.scope_
))
662 def ByteSizePartial(self
):
664 if (self
.has_scope_
): n
+= 1 + self
.lengthString(len(self
.scope_
))
670 def OutputUnchecked(self
, out
):
671 if (self
.has_scope_
):
673 out
.putPrefixedString(self
.scope_
)
675 def OutputPartial(self
, out
):
676 if (self
.has_scope_
):
678 out
.putPrefixedString(self
.scope_
)
680 def TryMerge(self
, d
):
684 self
.set_scope(d
.getPrefixedString())
688 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
692 def __str__(self
, prefix
="", printElemNumber
=0):
694 if self
.has_scope_
: res
+=prefix
+("scope: %s\n" % self
.DebugFormatString(self
.scope_
))
698 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
699 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
703 _TEXT
= _BuildTagLookupTable({
708 _TYPES
= _BuildTagLookupTable({
709 0: ProtocolBuffer
.Encoder
.NUMERIC
,
710 1: ProtocolBuffer
.Encoder
.STRING
,
711 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
715 _STYLE_CONTENT_TYPE
= """"""
716 _PROTO_DESCRIPTOR_NAME
= 'apphosting.GetOAuthUserRequest'
717 class GetOAuthUserResponse(ProtocolBuffer
.ProtocolMessage
):
724 has_user_organization_
= 0
725 user_organization_
= ""
731 def __init__(self
, contents
=None):
732 if contents
is not None: self
.MergeFromString(contents
)
734 def email(self
): return self
.email_
736 def set_email(self
, x
):
740 def clear_email(self
):
745 def has_email(self
): return self
.has_email_
747 def user_id(self
): return self
.user_id_
749 def set_user_id(self
, x
):
750 self
.has_user_id_
= 1
753 def clear_user_id(self
):
754 if self
.has_user_id_
:
755 self
.has_user_id_
= 0
758 def has_user_id(self
): return self
.has_user_id_
760 def auth_domain(self
): return self
.auth_domain_
762 def set_auth_domain(self
, x
):
763 self
.has_auth_domain_
= 1
764 self
.auth_domain_
= x
766 def clear_auth_domain(self
):
767 if self
.has_auth_domain_
:
768 self
.has_auth_domain_
= 0
769 self
.auth_domain_
= ""
771 def has_auth_domain(self
): return self
.has_auth_domain_
773 def user_organization(self
): return self
.user_organization_
775 def set_user_organization(self
, x
):
776 self
.has_user_organization_
= 1
777 self
.user_organization_
= x
779 def clear_user_organization(self
):
780 if self
.has_user_organization_
:
781 self
.has_user_organization_
= 0
782 self
.user_organization_
= ""
784 def has_user_organization(self
): return self
.has_user_organization_
786 def is_admin(self
): return self
.is_admin_
788 def set_is_admin(self
, x
):
789 self
.has_is_admin_
= 1
792 def clear_is_admin(self
):
793 if self
.has_is_admin_
:
794 self
.has_is_admin_
= 0
797 def has_is_admin(self
): return self
.has_is_admin_
799 def client_id(self
): return self
.client_id_
801 def set_client_id(self
, x
):
802 self
.has_client_id_
= 1
805 def clear_client_id(self
):
806 if self
.has_client_id_
:
807 self
.has_client_id_
= 0
810 def has_client_id(self
): return self
.has_client_id_
813 def MergeFrom(self
, x
):
815 if (x
.has_email()): self
.set_email(x
.email())
816 if (x
.has_user_id()): self
.set_user_id(x
.user_id())
817 if (x
.has_auth_domain()): self
.set_auth_domain(x
.auth_domain())
818 if (x
.has_user_organization()): self
.set_user_organization(x
.user_organization())
819 if (x
.has_is_admin()): self
.set_is_admin(x
.is_admin())
820 if (x
.has_client_id()): self
.set_client_id(x
.client_id())
823 if x
is self
: return 1
824 if self
.has_email_
!= x
.has_email_
: return 0
825 if self
.has_email_
and self
.email_
!= x
.email_
: return 0
826 if self
.has_user_id_
!= x
.has_user_id_
: return 0
827 if self
.has_user_id_
and self
.user_id_
!= x
.user_id_
: return 0
828 if self
.has_auth_domain_
!= x
.has_auth_domain_
: return 0
829 if self
.has_auth_domain_
and self
.auth_domain_
!= x
.auth_domain_
: return 0
830 if self
.has_user_organization_
!= x
.has_user_organization_
: return 0
831 if self
.has_user_organization_
and self
.user_organization_
!= x
.user_organization_
: return 0
832 if self
.has_is_admin_
!= x
.has_is_admin_
: return 0
833 if self
.has_is_admin_
and self
.is_admin_
!= x
.is_admin_
: return 0
834 if self
.has_client_id_
!= x
.has_client_id_
: return 0
835 if self
.has_client_id_
and self
.client_id_
!= x
.client_id_
: return 0
838 def IsInitialized(self
, debug_strs
=None):
840 if (not self
.has_email_
):
842 if debug_strs
is not None:
843 debug_strs
.append('Required field: email not set.')
844 if (not self
.has_user_id_
):
846 if debug_strs
is not None:
847 debug_strs
.append('Required field: user_id not set.')
848 if (not self
.has_auth_domain_
):
850 if debug_strs
is not None:
851 debug_strs
.append('Required field: auth_domain not set.')
856 n
+= self
.lengthString(len(self
.email_
))
857 n
+= self
.lengthString(len(self
.user_id_
))
858 n
+= self
.lengthString(len(self
.auth_domain_
))
859 if (self
.has_user_organization_
): n
+= 1 + self
.lengthString(len(self
.user_organization_
))
860 if (self
.has_is_admin_
): n
+= 2
861 if (self
.has_client_id_
): n
+= 1 + self
.lengthString(len(self
.client_id_
))
864 def ByteSizePartial(self
):
866 if (self
.has_email_
):
868 n
+= self
.lengthString(len(self
.email_
))
869 if (self
.has_user_id_
):
871 n
+= self
.lengthString(len(self
.user_id_
))
872 if (self
.has_auth_domain_
):
874 n
+= self
.lengthString(len(self
.auth_domain_
))
875 if (self
.has_user_organization_
): n
+= 1 + self
.lengthString(len(self
.user_organization_
))
876 if (self
.has_is_admin_
): n
+= 2
877 if (self
.has_client_id_
): n
+= 1 + self
.lengthString(len(self
.client_id_
))
883 self
.clear_auth_domain()
884 self
.clear_user_organization()
885 self
.clear_is_admin()
886 self
.clear_client_id()
888 def OutputUnchecked(self
, out
):
890 out
.putPrefixedString(self
.email_
)
892 out
.putPrefixedString(self
.user_id_
)
894 out
.putPrefixedString(self
.auth_domain_
)
895 if (self
.has_user_organization_
):
897 out
.putPrefixedString(self
.user_organization_
)
898 if (self
.has_is_admin_
):
900 out
.putBoolean(self
.is_admin_
)
901 if (self
.has_client_id_
):
903 out
.putPrefixedString(self
.client_id_
)
905 def OutputPartial(self
, out
):
906 if (self
.has_email_
):
908 out
.putPrefixedString(self
.email_
)
909 if (self
.has_user_id_
):
911 out
.putPrefixedString(self
.user_id_
)
912 if (self
.has_auth_domain_
):
914 out
.putPrefixedString(self
.auth_domain_
)
915 if (self
.has_user_organization_
):
917 out
.putPrefixedString(self
.user_organization_
)
918 if (self
.has_is_admin_
):
920 out
.putBoolean(self
.is_admin_
)
921 if (self
.has_client_id_
):
923 out
.putPrefixedString(self
.client_id_
)
925 def TryMerge(self
, d
):
929 self
.set_email(d
.getPrefixedString())
932 self
.set_user_id(d
.getPrefixedString())
935 self
.set_auth_domain(d
.getPrefixedString())
938 self
.set_user_organization(d
.getPrefixedString())
941 self
.set_is_admin(d
.getBoolean())
944 self
.set_client_id(d
.getPrefixedString())
948 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
952 def __str__(self
, prefix
="", printElemNumber
=0):
954 if self
.has_email_
: res
+=prefix
+("email: %s\n" % self
.DebugFormatString(self
.email_
))
955 if self
.has_user_id_
: res
+=prefix
+("user_id: %s\n" % self
.DebugFormatString(self
.user_id_
))
956 if self
.has_auth_domain_
: res
+=prefix
+("auth_domain: %s\n" % self
.DebugFormatString(self
.auth_domain_
))
957 if self
.has_user_organization_
: res
+=prefix
+("user_organization: %s\n" % self
.DebugFormatString(self
.user_organization_
))
958 if self
.has_is_admin_
: res
+=prefix
+("is_admin: %s\n" % self
.DebugFormatBool(self
.is_admin_
))
959 if self
.has_client_id_
: res
+=prefix
+("client_id: %s\n" % self
.DebugFormatString(self
.client_id_
))
963 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
964 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
969 kuser_organization
= 4
973 _TEXT
= _BuildTagLookupTable({
978 4: "user_organization",
983 _TYPES
= _BuildTagLookupTable({
984 0: ProtocolBuffer
.Encoder
.NUMERIC
,
985 1: ProtocolBuffer
.Encoder
.STRING
,
986 2: ProtocolBuffer
.Encoder
.STRING
,
987 3: ProtocolBuffer
.Encoder
.STRING
,
988 4: ProtocolBuffer
.Encoder
.STRING
,
989 5: ProtocolBuffer
.Encoder
.NUMERIC
,
990 6: ProtocolBuffer
.Encoder
.STRING
,
991 }, 6, ProtocolBuffer
.Encoder
.MAX_TYPE
)
995 _STYLE_CONTENT_TYPE
= """"""
996 _PROTO_DESCRIPTOR_NAME
= 'apphosting.GetOAuthUserResponse'
997 class CheckOAuthSignatureRequest(ProtocolBuffer
.ProtocolMessage
):
999 def __init__(self
, contents
=None):
1001 if contents
is not None: self
.MergeFromString(contents
)
1004 def MergeFrom(self
, x
):
1005 assert x
is not self
1007 def Equals(self
, x
):
1008 if x
is self
: return 1
1011 def IsInitialized(self
, debug_strs
=None):
1019 def ByteSizePartial(self
):
1026 def OutputUnchecked(self
, out
):
1029 def OutputPartial(self
, out
):
1032 def TryMerge(self
, d
):
1033 while d
.avail() > 0:
1034 tt
= d
.getVarInt32()
1037 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1041 def __str__(self
, prefix
="", printElemNumber
=0):
1046 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1047 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1050 _TEXT
= _BuildTagLookupTable({
1054 _TYPES
= _BuildTagLookupTable({
1055 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1056 }, 0, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1060 _STYLE_CONTENT_TYPE
= """"""
1061 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CheckOAuthSignatureRequest'
1062 class CheckOAuthSignatureResponse(ProtocolBuffer
.ProtocolMessage
):
1063 has_oauth_consumer_key_
= 0
1064 oauth_consumer_key_
= ""
1066 def __init__(self
, contents
=None):
1067 if contents
is not None: self
.MergeFromString(contents
)
1069 def oauth_consumer_key(self
): return self
.oauth_consumer_key_
1071 def set_oauth_consumer_key(self
, x
):
1072 self
.has_oauth_consumer_key_
= 1
1073 self
.oauth_consumer_key_
= x
1075 def clear_oauth_consumer_key(self
):
1076 if self
.has_oauth_consumer_key_
:
1077 self
.has_oauth_consumer_key_
= 0
1078 self
.oauth_consumer_key_
= ""
1080 def has_oauth_consumer_key(self
): return self
.has_oauth_consumer_key_
1083 def MergeFrom(self
, x
):
1084 assert x
is not self
1085 if (x
.has_oauth_consumer_key()): self
.set_oauth_consumer_key(x
.oauth_consumer_key())
1087 def Equals(self
, x
):
1088 if x
is self
: return 1
1089 if self
.has_oauth_consumer_key_
!= x
.has_oauth_consumer_key_
: return 0
1090 if self
.has_oauth_consumer_key_
and self
.oauth_consumer_key_
!= x
.oauth_consumer_key_
: return 0
1093 def IsInitialized(self
, debug_strs
=None):
1095 if (not self
.has_oauth_consumer_key_
):
1097 if debug_strs
is not None:
1098 debug_strs
.append('Required field: oauth_consumer_key not set.')
1103 n
+= self
.lengthString(len(self
.oauth_consumer_key_
))
1106 def ByteSizePartial(self
):
1108 if (self
.has_oauth_consumer_key_
):
1110 n
+= self
.lengthString(len(self
.oauth_consumer_key_
))
1114 self
.clear_oauth_consumer_key()
1116 def OutputUnchecked(self
, out
):
1118 out
.putPrefixedString(self
.oauth_consumer_key_
)
1120 def OutputPartial(self
, out
):
1121 if (self
.has_oauth_consumer_key_
):
1123 out
.putPrefixedString(self
.oauth_consumer_key_
)
1125 def TryMerge(self
, d
):
1126 while d
.avail() > 0:
1127 tt
= d
.getVarInt32()
1129 self
.set_oauth_consumer_key(d
.getPrefixedString())
1133 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1137 def __str__(self
, prefix
="", printElemNumber
=0):
1139 if self
.has_oauth_consumer_key_
: res
+=prefix
+("oauth_consumer_key: %s\n" % self
.DebugFormatString(self
.oauth_consumer_key_
))
1143 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1144 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1146 koauth_consumer_key
= 1
1148 _TEXT
= _BuildTagLookupTable({
1150 1: "oauth_consumer_key",
1153 _TYPES
= _BuildTagLookupTable({
1154 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1155 1: ProtocolBuffer
.Encoder
.STRING
,
1156 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1160 _STYLE_CONTENT_TYPE
= """"""
1161 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CheckOAuthSignatureResponse'
1162 class CreateFederatedLoginRequest(ProtocolBuffer
.ProtocolMessage
):
1165 has_continue_url_
= 0
1170 def __init__(self
, contents
=None):
1171 if contents
is not None: self
.MergeFromString(contents
)
1173 def claimed_id(self
): return self
.claimed_id_
1175 def set_claimed_id(self
, x
):
1176 self
.has_claimed_id_
= 1
1177 self
.claimed_id_
= x
1179 def clear_claimed_id(self
):
1180 if self
.has_claimed_id_
:
1181 self
.has_claimed_id_
= 0
1182 self
.claimed_id_
= ""
1184 def has_claimed_id(self
): return self
.has_claimed_id_
1186 def continue_url(self
): return self
.continue_url_
1188 def set_continue_url(self
, x
):
1189 self
.has_continue_url_
= 1
1190 self
.continue_url_
= x
1192 def clear_continue_url(self
):
1193 if self
.has_continue_url_
:
1194 self
.has_continue_url_
= 0
1195 self
.continue_url_
= ""
1197 def has_continue_url(self
): return self
.has_continue_url_
1199 def authority(self
): return self
.authority_
1201 def set_authority(self
, x
):
1202 self
.has_authority_
= 1
1205 def clear_authority(self
):
1206 if self
.has_authority_
:
1207 self
.has_authority_
= 0
1208 self
.authority_
= ""
1210 def has_authority(self
): return self
.has_authority_
1213 def MergeFrom(self
, x
):
1214 assert x
is not self
1215 if (x
.has_claimed_id()): self
.set_claimed_id(x
.claimed_id())
1216 if (x
.has_continue_url()): self
.set_continue_url(x
.continue_url())
1217 if (x
.has_authority()): self
.set_authority(x
.authority())
1219 def Equals(self
, x
):
1220 if x
is self
: return 1
1221 if self
.has_claimed_id_
!= x
.has_claimed_id_
: return 0
1222 if self
.has_claimed_id_
and self
.claimed_id_
!= x
.claimed_id_
: return 0
1223 if self
.has_continue_url_
!= x
.has_continue_url_
: return 0
1224 if self
.has_continue_url_
and self
.continue_url_
!= x
.continue_url_
: return 0
1225 if self
.has_authority_
!= x
.has_authority_
: return 0
1226 if self
.has_authority_
and self
.authority_
!= x
.authority_
: return 0
1229 def IsInitialized(self
, debug_strs
=None):
1231 if (not self
.has_claimed_id_
):
1233 if debug_strs
is not None:
1234 debug_strs
.append('Required field: claimed_id not set.')
1235 if (not self
.has_continue_url_
):
1237 if debug_strs
is not None:
1238 debug_strs
.append('Required field: continue_url not set.')
1243 n
+= self
.lengthString(len(self
.claimed_id_
))
1244 n
+= self
.lengthString(len(self
.continue_url_
))
1245 if (self
.has_authority_
): n
+= 1 + self
.lengthString(len(self
.authority_
))
1248 def ByteSizePartial(self
):
1250 if (self
.has_claimed_id_
):
1252 n
+= self
.lengthString(len(self
.claimed_id_
))
1253 if (self
.has_continue_url_
):
1255 n
+= self
.lengthString(len(self
.continue_url_
))
1256 if (self
.has_authority_
): n
+= 1 + self
.lengthString(len(self
.authority_
))
1260 self
.clear_claimed_id()
1261 self
.clear_continue_url()
1262 self
.clear_authority()
1264 def OutputUnchecked(self
, out
):
1266 out
.putPrefixedString(self
.claimed_id_
)
1268 out
.putPrefixedString(self
.continue_url_
)
1269 if (self
.has_authority_
):
1271 out
.putPrefixedString(self
.authority_
)
1273 def OutputPartial(self
, out
):
1274 if (self
.has_claimed_id_
):
1276 out
.putPrefixedString(self
.claimed_id_
)
1277 if (self
.has_continue_url_
):
1279 out
.putPrefixedString(self
.continue_url_
)
1280 if (self
.has_authority_
):
1282 out
.putPrefixedString(self
.authority_
)
1284 def TryMerge(self
, d
):
1285 while d
.avail() > 0:
1286 tt
= d
.getVarInt32()
1288 self
.set_claimed_id(d
.getPrefixedString())
1291 self
.set_continue_url(d
.getPrefixedString())
1294 self
.set_authority(d
.getPrefixedString())
1298 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1302 def __str__(self
, prefix
="", printElemNumber
=0):
1304 if self
.has_claimed_id_
: res
+=prefix
+("claimed_id: %s\n" % self
.DebugFormatString(self
.claimed_id_
))
1305 if self
.has_continue_url_
: res
+=prefix
+("continue_url: %s\n" % self
.DebugFormatString(self
.continue_url_
))
1306 if self
.has_authority_
: res
+=prefix
+("authority: %s\n" % self
.DebugFormatString(self
.authority_
))
1310 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1311 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1317 _TEXT
= _BuildTagLookupTable({
1324 _TYPES
= _BuildTagLookupTable({
1325 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1326 1: ProtocolBuffer
.Encoder
.STRING
,
1327 2: ProtocolBuffer
.Encoder
.STRING
,
1328 3: ProtocolBuffer
.Encoder
.STRING
,
1329 }, 3, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1333 _STYLE_CONTENT_TYPE
= """"""
1334 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateFederatedLoginRequest'
1335 class CreateFederatedLoginResponse(ProtocolBuffer
.ProtocolMessage
):
1336 has_redirected_url_
= 0
1337 redirected_url_
= ""
1339 def __init__(self
, contents
=None):
1340 if contents
is not None: self
.MergeFromString(contents
)
1342 def redirected_url(self
): return self
.redirected_url_
1344 def set_redirected_url(self
, x
):
1345 self
.has_redirected_url_
= 1
1346 self
.redirected_url_
= x
1348 def clear_redirected_url(self
):
1349 if self
.has_redirected_url_
:
1350 self
.has_redirected_url_
= 0
1351 self
.redirected_url_
= ""
1353 def has_redirected_url(self
): return self
.has_redirected_url_
1356 def MergeFrom(self
, x
):
1357 assert x
is not self
1358 if (x
.has_redirected_url()): self
.set_redirected_url(x
.redirected_url())
1360 def Equals(self
, x
):
1361 if x
is self
: return 1
1362 if self
.has_redirected_url_
!= x
.has_redirected_url_
: return 0
1363 if self
.has_redirected_url_
and self
.redirected_url_
!= x
.redirected_url_
: return 0
1366 def IsInitialized(self
, debug_strs
=None):
1368 if (not self
.has_redirected_url_
):
1370 if debug_strs
is not None:
1371 debug_strs
.append('Required field: redirected_url not set.')
1376 n
+= self
.lengthString(len(self
.redirected_url_
))
1379 def ByteSizePartial(self
):
1381 if (self
.has_redirected_url_
):
1383 n
+= self
.lengthString(len(self
.redirected_url_
))
1387 self
.clear_redirected_url()
1389 def OutputUnchecked(self
, out
):
1391 out
.putPrefixedString(self
.redirected_url_
)
1393 def OutputPartial(self
, out
):
1394 if (self
.has_redirected_url_
):
1396 out
.putPrefixedString(self
.redirected_url_
)
1398 def TryMerge(self
, d
):
1399 while d
.avail() > 0:
1400 tt
= d
.getVarInt32()
1402 self
.set_redirected_url(d
.getPrefixedString())
1406 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1410 def __str__(self
, prefix
="", printElemNumber
=0):
1412 if self
.has_redirected_url_
: res
+=prefix
+("redirected_url: %s\n" % self
.DebugFormatString(self
.redirected_url_
))
1416 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1417 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1421 _TEXT
= _BuildTagLookupTable({
1423 1: "redirected_url",
1426 _TYPES
= _BuildTagLookupTable({
1427 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1428 1: ProtocolBuffer
.Encoder
.STRING
,
1429 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1433 _STYLE_CONTENT_TYPE
= """"""
1434 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateFederatedLoginResponse'
1435 class CreateFederatedLogoutRequest(ProtocolBuffer
.ProtocolMessage
):
1436 has_destination_url_
= 0
1437 destination_url_
= ""
1439 def __init__(self
, contents
=None):
1440 if contents
is not None: self
.MergeFromString(contents
)
1442 def destination_url(self
): return self
.destination_url_
1444 def set_destination_url(self
, x
):
1445 self
.has_destination_url_
= 1
1446 self
.destination_url_
= x
1448 def clear_destination_url(self
):
1449 if self
.has_destination_url_
:
1450 self
.has_destination_url_
= 0
1451 self
.destination_url_
= ""
1453 def has_destination_url(self
): return self
.has_destination_url_
1456 def MergeFrom(self
, x
):
1457 assert x
is not self
1458 if (x
.has_destination_url()): self
.set_destination_url(x
.destination_url())
1460 def Equals(self
, x
):
1461 if x
is self
: return 1
1462 if self
.has_destination_url_
!= x
.has_destination_url_
: return 0
1463 if self
.has_destination_url_
and self
.destination_url_
!= x
.destination_url_
: return 0
1466 def IsInitialized(self
, debug_strs
=None):
1468 if (not self
.has_destination_url_
):
1470 if debug_strs
is not None:
1471 debug_strs
.append('Required field: destination_url not set.')
1476 n
+= self
.lengthString(len(self
.destination_url_
))
1479 def ByteSizePartial(self
):
1481 if (self
.has_destination_url_
):
1483 n
+= self
.lengthString(len(self
.destination_url_
))
1487 self
.clear_destination_url()
1489 def OutputUnchecked(self
, out
):
1491 out
.putPrefixedString(self
.destination_url_
)
1493 def OutputPartial(self
, out
):
1494 if (self
.has_destination_url_
):
1496 out
.putPrefixedString(self
.destination_url_
)
1498 def TryMerge(self
, d
):
1499 while d
.avail() > 0:
1500 tt
= d
.getVarInt32()
1502 self
.set_destination_url(d
.getPrefixedString())
1506 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1510 def __str__(self
, prefix
="", printElemNumber
=0):
1512 if self
.has_destination_url_
: res
+=prefix
+("destination_url: %s\n" % self
.DebugFormatString(self
.destination_url_
))
1516 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1517 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1519 kdestination_url
= 1
1521 _TEXT
= _BuildTagLookupTable({
1523 1: "destination_url",
1526 _TYPES
= _BuildTagLookupTable({
1527 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1528 1: ProtocolBuffer
.Encoder
.STRING
,
1529 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1533 _STYLE_CONTENT_TYPE
= """"""
1534 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateFederatedLogoutRequest'
1535 class CreateFederatedLogoutResponse(ProtocolBuffer
.ProtocolMessage
):
1539 def __init__(self
, contents
=None):
1540 if contents
is not None: self
.MergeFromString(contents
)
1542 def logout_url(self
): return self
.logout_url_
1544 def set_logout_url(self
, x
):
1545 self
.has_logout_url_
= 1
1546 self
.logout_url_
= x
1548 def clear_logout_url(self
):
1549 if self
.has_logout_url_
:
1550 self
.has_logout_url_
= 0
1551 self
.logout_url_
= ""
1553 def has_logout_url(self
): return self
.has_logout_url_
1556 def MergeFrom(self
, x
):
1557 assert x
is not self
1558 if (x
.has_logout_url()): self
.set_logout_url(x
.logout_url())
1560 def Equals(self
, x
):
1561 if x
is self
: return 1
1562 if self
.has_logout_url_
!= x
.has_logout_url_
: return 0
1563 if self
.has_logout_url_
and self
.logout_url_
!= x
.logout_url_
: return 0
1566 def IsInitialized(self
, debug_strs
=None):
1568 if (not self
.has_logout_url_
):
1570 if debug_strs
is not None:
1571 debug_strs
.append('Required field: logout_url not set.')
1576 n
+= self
.lengthString(len(self
.logout_url_
))
1579 def ByteSizePartial(self
):
1581 if (self
.has_logout_url_
):
1583 n
+= self
.lengthString(len(self
.logout_url_
))
1587 self
.clear_logout_url()
1589 def OutputUnchecked(self
, out
):
1591 out
.putPrefixedString(self
.logout_url_
)
1593 def OutputPartial(self
, out
):
1594 if (self
.has_logout_url_
):
1596 out
.putPrefixedString(self
.logout_url_
)
1598 def TryMerge(self
, d
):
1599 while d
.avail() > 0:
1600 tt
= d
.getVarInt32()
1602 self
.set_logout_url(d
.getPrefixedString())
1606 if (tt
== 0): raise ProtocolBuffer
.ProtocolBufferDecodeError
1610 def __str__(self
, prefix
="", printElemNumber
=0):
1612 if self
.has_logout_url_
: res
+=prefix
+("logout_url: %s\n" % self
.DebugFormatString(self
.logout_url_
))
1616 def _BuildTagLookupTable(sparse
, maxtag
, default
=None):
1617 return tuple([sparse
.get(i
, default
) for i
in xrange(0, 1+maxtag
)])
1621 _TEXT
= _BuildTagLookupTable({
1626 _TYPES
= _BuildTagLookupTable({
1627 0: ProtocolBuffer
.Encoder
.NUMERIC
,
1628 1: ProtocolBuffer
.Encoder
.STRING
,
1629 }, 1, ProtocolBuffer
.Encoder
.MAX_TYPE
)
1633 _STYLE_CONTENT_TYPE
= """"""
1634 _PROTO_DESCRIPTOR_NAME
= 'apphosting.CreateFederatedLogoutResponse'
1635 if _extension_runtime
:
1638 __all__
= ['UserServiceError','CreateLoginURLRequest','CreateLoginURLResponse','CreateLogoutURLRequest','CreateLogoutURLResponse','GetOAuthUserRequest','GetOAuthUserResponse','CheckOAuthSignatureRequest','CheckOAuthSignatureResponse','CreateFederatedLoginRequest','CreateFederatedLoginResponse','CreateFederatedLogoutRequest','CreateFederatedLogoutResponse']