
                            S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKr S SKJ	s  J
s  Jr  \R                  r\R                  r\R                  r/ S	Qr\R$                  " S
5      r " S S5      rSrSrSrSrSrSrSrSrSrSrSr\\R@                  \\RB                  \\RB                  \\RD                  \\RF                  \\RH                  \\RJ                  \\RL                  0r' " S S5      r( " S S5      r) " S S\*5      r+ " S S\5      r,g! \ a$     " S S\5      r " S S\5      r " S S\5      r Nf = f)     )absolute_importNc                       \ rS rSrSrg)ProtocolBufferDecodeError    N__name__
__module____qualname____firstlineno____static_attributes__r       4lib/googlecloudsdk/appengine/proto/ProtocolBuffer.pyr   r          dr   r   c                       \ rS rSrSrg)ProtocolBufferEncodeError    r   Nr   r   r   r   r   r       r   r   r   c                       \ rS rSrSrg)ProtocolBufferReturnError!   r   Nr   r   r   r   r   r   !   r   r   r   )ProtocolMessageEncoderDecoderExtendableProtocolMessager   r   r   z^(https?)://([^/]+)(/.*)$c                   L   \ rS rSrSrS5S jrS rS5S jrS rS r	S	 r
S
 rS rS rS rS rS rS rS rS r  S6S jr S7S jrS8S jrS rS rSrSrSrS rS rS rS rS r S  r!S! r"S" r#S# r$S$ r%S% r&S& r'S' r(S( r)S) r*S* r+S+ r,S, r-S- r.S. r/S/ r0S0 r1S1 r2S2 r3S3 r4S4r5g)9r   0   a  
The parent class of all protocol buffers.
NOTE: the methods that unconditionally raise NotImplementedError are
reimplemented by the subclasses of this class.
Subclasses are automatically generated by tools/protocol_converter.
Encoding methods can raise ProtocolBufferEncodeError if a value for an
integer or long field is too large, or if any required field is not set.
Decoding methods can raise ProtocolBufferDecodeError if they couldn't
decode correctly, or the decoded message doesn't have all required fields.
Nc                     [         e)zbConstruct a new protocol buffer, with optional starting contents
in binary protocol buffer format.NotImplementedError)selfcontentss     r   __init__ProtocolMessage.__init__@   
     r   c                     [         e)zTErases all fields of protocol buffer (& resets to defaults
if fields have defaults).r   r    s    r   ClearProtocolMessage.ClearE   r$   r   c                     [         e)z3returns true iff all required fields have been set.r   )r    
debug_strss     r   IsInitializedProtocolMessage.IsInitializedJ       
r   c                      U R                  5       $ ! [        [        4 a<    [        5       nU R	                  U5        UR                  5       R                  5       s $ f = f)z9Returns a string representing the protocol buffer object.)_CEncoder   AttributeErrorr   Outputbuffertostringr    es     r   EncodeProtocolMessage.EncodeN   sN    #]]_0 #
)a
kk!nXXZ  ""#    A	AAc                 "    U R                  5       $ )zCSame as Encode(), but has same name as proto2's serialize function.r6   r&   s    r   SerializeToString!ProtocolMessage.SerializeToStringW   s    ;;=r   c                      U R                  5       $ ! [        [        4 a<    [        5       nU R	                  U5        UR                  5       R                  5       s $ f = f)zReturns a string representing the protocol buffer object.
Same as SerializeToString() but does not enforce required fields are set.
)_CEncodePartialr   r0   r   OutputPartialr2   r3   r4   s     r   SerializePartialToString(ProtocolMessage.SerializePartialToString[   sT    #!!##0 #
)a
XXZ  ""#r8   c                     [         e)zCall into C++ encode code.

Generated protocol buffer classes will override this method to
provide C++-based serialization. If a subclass does not
implement this method, Encode() will fall back to
using pure-Python encoding.
r   r&   s    r   r/   ProtocolMessage._CEncodef   s
     r   c                     [         e)zASame as _CEncode, except does not encode missing required fields.r   r&   s    r   r>   ProtocolMessage._CEncodePartialp   r-   r   c                 F    U R                  5         U R                  U5        g)zReads data from the string 's'.
Raises a ProtocolBufferDecodeError if, after successfully reading
in the contents of 's', this protocol message is still not initialized.N)r'   MergeFromStringr    ss     r   ParseFromStringProtocolMessage.ParseFromStringt   s     	JJLr   c                 F    U R                  5         U R                  U5        g)zIReads data from the string 's'.
Does not enforce required fields are set.N)r'   MergePartialFromStringrH   s     r   ParsePartialFromString&ProtocolMessage.ParsePartialFromString{   s     	JJL"r   c                     U R                  U5        / nU R                  U5      (       d  [        SR                  U5      5      eg)zAdds in data from the string 's'.
Raises a ProtocolBufferDecodeError if, after successfully merging
in the contents of 's', this protocol message is still not initialized.
	N)rM   r+   r   join)r    rI   dbgs      r   rG   ProtocolMessage.MergeFromString   sA     	"
Cc""%fkk#&677 #r   c                      U R                  U5        g! [        [        4 aQ    [        R                  " S5      nUR	                  U5        [        US[        U5      5      nU R                  U5         gf = f)zMMerges in data from the string 's'.
Does not enforce required fields are set.Br   N)_CMergeFromStringr   r0   array
fromstringr   lenTryMerge)r    rI   ads       r   rM   &ProtocolMessage.MergePartialFromString   sb    
Q0  ++c
all1o
!QA
a
mmAs    AA54A5c                     [         e)a8  Call into C++ parsing code to merge from a string.

Does *not* check IsInitialized() before returning.

Generated protocol buffer classes will override this method to
provide C++-based deserialization.  If a subclass does not
implement this method, MergeFromString() will fall back to
using pure-Python parsing.
r   rH   s     r   rW   !ProtocolMessage._CMergeFromString   s
     r   c                 "    U R                  5       $ )zReturn the pickled representation of the data inside protocol buffer,
which is the same as its binary-encoded representation (as a string).r:   r&   s    r   __getstate__ProtocolMessage.__getstate__   s     ;;=r   c                 "    U R                  US9  g)zRestore the pickled representation of the data inside protocol buffer.
Note that the mechanism underlying pickle.load() does not call __init__.)r!   N)r"   )r    	contents_s     r   __setstate__ProtocolMessage.__setstate__   s     	MM9M%r      r   c           
      t   U R                  5       nU(       aa  U(       a0  U(       a)  [        R                  R                  R	                  XUS9n	OS[        R                  R                  R	                  U5      n	O)[        R                  R                  R                  U5      n	U	R                  SU5        U	R                  SS[        U5      -  5        U	R                  5         U	R                  U5        U	R                  5       n
US:  ah  U
R                  S:X  aX  [        R                  U
R                  S5      5      nU(       a-  UR!                  5       u  pnU R#                  XUUS-
  US	:H  UUS
9$ U
R                  S:w  a  [%        U
R                  5      eUb  UR'                  U
R)                  5       5        U$ )aG  posts the protocol buffer to the desired url on the server
and puts the return data into the protocol buffer 'response'

NOTE: The underlying socket raises the 'error' exception
for all I/O related errors (can't connect, etc.).

If 'response' is None, the server's PB response will be ignored.

The optional 'follow_redirects' argument indicates the number
of HTTP redirects that are followed before giving up and raising an
exception.  The default is 1.

If 'secure' is true, HTTPS will be used instead of HTTP.  Also,
'keyfile' and 'certfile' may be set for client authentication.
)key_file	cert_filePOSTzContent-Length%dr   i.  Locationrh   httpsfollow_redirectssecurekeyfilecertfile   )r6   sixmoveshttp_clientHTTPSConnectionHTTPConnection
putrequest	putheaderrZ   
endheaderssendgetresponsestatusURL_REmatch	getheadergroupssendCommandr   rJ   read)r    serverurlresponserq   rr   rs   rt   dataconnrespmprotocols                r   r   ProtocolMessage.sendCommand   sd   " ;;=D	Xyy$$44V19 5 ; yy$$44V<YY""11&9dOOFC NN#T3t9_5OOIIdOD!s 2
,,t~~j1
2a	
 !
#X1AA1E(0G(;(/)1	   3 	3
 {{c%dkk22tyy{+Or   c           
      (    U R                  XUUSX#S9$ )a\  posts the protocol buffer via https to the desired url on the server,
using the specified key and certificate files, and puts the return
data int othe protocol buffer 'response'.

See caveats in sendCommand.

You need an SSL-aware build of the Python2 interpreter to use this command.
(Python1 is not supported).  An SSL build of python2.2 is in
/home/build/buildtools/python-ssl-2.2 . An SSL build of python is
standard on all prod machines.

keyfile: Contains our private RSA key
certfile: Contains SSL certificate for remote host
Specify None for keyfile/certfile if you don't want to do client auth.
rh   rp   )r   )r    r   rs   rt   r   r   rq   s          r   sendSecureCommand!ProtocolMessage.sendSecureCommand   s*    " F-=#$g  J Jr   c                     [         e)z:Returns nicely formatted contents of this protocol buffer.r   )r    prefixprintElemNumbers      r   __str__ProtocolMessage.__str__   r-   r   c                 @    U R                  [        R                  5      $ )z7Returns the protocol buffer as a human-readable string.)	_CToASCIIr   _SYMBOLIC_FULL_ASCIIr&   s    r   ToASCIIProtocolMessage.ToASCII   s    >>/>>??r   c                 @    U R                  [        R                  5      $ )zReturns the protocol buffer as an ASCII string.
The output is short, leaving out newlines and some other niceties.
Defers to the C++ ProtocolPrinter class in SYMBOLIC_SHORT mode.
)r   r   _SYMBOLIC_SHORT_ASCIIr&   s    r   ToShortASCIIProtocolMessage.ToShortASCII   s    
 >>/??@@r      c                     [         e)zCalls into C++ ASCII-generating code.

Generated protocol buffer classes will override this method to provide
C++-based ASCII output.
r   )r    output_formats     r   r   ProtocolMessage._CToASCII  s
     r   c                     [         e)zParses a string generated by ToASCII() or by the C++ DebugString()
method, initializing this protocol buffer with its contents. This method
raises a ValueError if it encounters an unknown field.
r   r    ascii_strings     r   
ParseASCIIProtocolMessage.ParseASCII  
    
 r   c                     [         e)zParses a string generated by ToASCII() or by the C++ DebugString()
method, initializing this protocol buffer with its contents.  Ignores
unknown fields.
r   r   s     r   ParseASCIIIgnoreUnknown'ProtocolMessage.ParseASCIIIgnoreUnknown  r   r   c                     [         e)z~Returns whether or not this protocol buffer is equivalent to another.

This assumes that self and other are of the same type.
r   r    others     r   EqualsProtocolMessage.Equals  r   r   c                 b    UR                   U R                   L a  U R                  U5      $ [        $ )zImplementation of operator ==.	__class__r   NotImplementedr   s     r   __eq__ProtocolMessage.__eq__"  s)     $..([[r   c                 l    UR                   U R                   L a  U R                  U5      (       + $ [        $ )zImplementation of operator !=.r   r   s     r   __ne__ProtocolMessage.__ne__-  s,     $..(U###r   c                     / nU R                  U5      (       d  [        SR                  U5      5      eU R                  U5        g)zwrite self to the encoder 'e'.rQ   N)r+   r   rR   OutputUnchecked)r    r5   rS   s      r   r1   ProtocolMessage.Output<  s=    
Cc""%fkk#&677
r   c                     [         e)z>write self to the encoder 'e', don't check for initialization.r   r4   s     r   r   ProtocolMessage.OutputUncheckedD  r-   r   c                     [         e)zewrite self to the encoder 'e', don't check for initialization and
don't assume required fields exist.r   r4   s     r   r?   ProtocolMessage.OutputPartialH  r$   r   c                 F    U R                  5         U R                  U5        g)z reads data from the Decoder 'd'.N)r'   Merger    r]   s     r   ParseProtocolMessage.ParseM  s    JJLJJqM
r   c                     U R                  U5        / nU R                  U5      (       d  [        SR                  U5      5      eg)!merges data from the Decoder 'd'.rQ   N)r[   r+   r   rR   )r    r]   rS   s      r   r   ProtocolMessage.MergeS  s;    MM!
Cc""%fkk#&677
r   c                     [         e)r   r   r   s     r   r[   ProtocolMessage.TryMerge[  r-   r   c                 R    X:X  a  gU R                  5         U R                  U5        g)z&copy data from another protocol bufferN)r'   	MergeFromr    pbs     r   CopyFromProtocolMessage.CopyFrom_  s    

VJJLNN2r   c                     [         e)z'merge data from another protocol bufferr   r   s     r   r   ProtocolMessage.MergeFrome  r-   r   c                 $    U R                  U5      $ N)lengthVarInt64r    ns     r   lengthVarInt32ProtocolMessage.lengthVarInt32m  s    q!!r   c                 @    US:  a  gSn US-  nUS-  nUS:X  a   U$ M  )Nr   
   rh      r   )r    r   results      r   r   ProtocolMessage.lengthVarInt64p  s:    1uF
kfAga	
aM r   c                 *    U R                  U5      U-   $ r   )r   r   s     r   lengthStringProtocolMessage.lengthString{  s    q!A%%r   c                     SU-  $ )Nz%sr   r    values     r   DebugFormatProtocolMessage.DebugFormat~  s    %<r   c                 F    US::  d  US:  a  U R                  U5      $ SU-  $ )Ni lʈi 5wrm   )DebugFormatFixed32r   s     r   DebugFormatInt32 ProtocolMessage.DebugFormatInt32  s,     3$$U++%<r   c                 F    US::  d  US:  a  U R                  U5      $ SU-  $ )Nl @9Hl    @9Hrm   )DebugFormatFixed64r   s     r   DebugFormatInt64 ProtocolMessage.DebugFormatInt64  s,     E^$;$$U++%<r   c                 L   ^ S mSSR                  U4S jU 5       5      -   S-   $ )Nc                 v    [        U 5      nUS:X  a  gUS:X  a  gUS:X  a  gUS:X  a  gUS	:  d  US
:  a  SU-  $ U $ )Nr   z\n'   z\'"   z\"\   z\\   r   z\%03o)ord)cos     r   escape1ProtocolMessage.DebugFormatString.<locals>.escape  sJ    
a&a	
b	
b	
b	
b	
cQVHqL0hr   " c              3   4   >#    U  H  nT" U5      v   M     g 7fr   r   ).0r   r   s     r   	<genexpr>4ProtocolMessage.DebugFormatString.<locals>.<genexpr>  s     2EqEs   )rR   )r    r   r   s     @r   DebugFormatString!ProtocolMessage.DebugFormatString  s)    	 2E222S88r   c                     SU-  $ )Nz%ffr   r   s     r   DebugFormatFloat ProtocolMessage.DebugFormatFloat  s    5=r   c                 "    US:  a  US-  nSU-  $ )Nr           0x%xr   r   s     r   r   "ProtocolMessage.DebugFormatFixed32      	Ee$EE>r   c                 "    US:  a  US-  nSU-  $ )Nr               r	  r   r   s     r   r   "ProtocolMessage.DebugFormatFixed64  r  r   c                     U(       a  gg)Ntruefalser   r   s     r   DebugFormatBoolProtocolMessage.DebugFormatBool  s    r   r   r   )rh   r   NN)rh   )r   r   )6r	   r
   r   r   __doc__r"   r'   r+   r6   r;   r@   r/   r>   rJ   rN   rG   rM   rW   rb   rf   r   r   r   r   r   _NUMERIC_ASCIIr   r   r   r   r   r   r   r   r1   r   r?   r   r   r[   r   r   r   r   r   r   r   r   r  r  r   r   r  r   r   r   r   r   r   0   s   	

#	##8

&
 AB37,^ *+J*@A .		
"	&9r   r   rh   r               r      	   r      c                       \ rS rSrSrSrSrSrSrSr	Sr
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS r\\\\\\\\\\\\\\\ \\!\0	r"\S\S\S\S\ S0r#Sr$g)r   i  r   rh   r   r  r  r  r  c                 :    [         R                   " S5      U l        g )NrV   )rX   bufr&   s    r   r"   Encoder.__init__  s    {{3DH
r   c                     U R                   $ r   r  r&   s    r   r2   Encoder.buffer      88Or   c                 n    US:  d  US:  a  [        S5      eU R                  R                  US-  5        g )Nr      z
u8 too big   r   r  appendr    vs     r   put8Encoder.put8  s1    1ud#<\#JJHHOOAG
r   c                     US:  d  US:  a  [        S5      eU R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        g )Nr   i   zu16 too bigr'  r  r(  r*  s     r   put16Encoder.put16  sM    1ue$=m$LLHHOOQ!VsN#HHOOQ!VsN#
r   c                 :   US:  d  US:  a  [        S5      eU R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        g )Nr   r  zu32 too bigr'  r        r(  r*  s     r   put32Encoder.put32  s}    1ue$=m$LLHHOOQ!VsN#HHOOQ!VsN#HHOOQ"WO$HHOOQ"WO$
r   c                 B   US:  d  US:  a  [        S5      eU R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        U R                  R                  US-	  S-  5        U R                  R                  US	-	  S-  5        U R                  R                  US
-	  S-  5        U R                  R                  US-	  S-  5        g )Nr   r  zu64 too bigr'  r  r2  r3  r   (   r   8   r(  r*  s     r   put64Encoder.put64  s    1ue$=m$LLHHOOQ!VsN#HHOOQ!VsN#HHOOQ"WO$HHOOQ"WO$HHOOQ"WO$HHOOQ"WO$HHOOQ"WO$HHOOQ"WO$
r   c                     U R                   R                  nUS-  U:X  a	  U" U5        g US:  d  US:  a  [        S5      eUS:  a  US-  n US-  nUS-  nU(       a  US-  nU" U5        U(       d   g M)  )	Nr              zint32 too bigr   r  r      r  r)  r   r    r+  
buf_appendbitss       r   putVarInt32Encoder.putVarInt32  s     J3w!|mJ!k/%o661ua
WdAga	

 r   c                     U R                   R                  nUS:  d  US:  a  [        S5      eUS:  a  US-  n US-  nUS-  nU(       a  US-  nU" U5        U(       d   g M)  )	N            l         zint64 too bigr   r  r   r   r>  r?  r@  s       r   putVarInt64Encoder.putVarInt64  st    J!&9"9%o661ua
WdAga	

 r   c                     U R                   R                  nUS:  d  US:  a  [        S5      e US-  nUS-  nU(       a  US-  nU" U5        U(       d   g M)  )Nr   r  zuint64 too bigr   r   r>  r?  r@  s       r   putVarUint64Encoder.putVarUint64  sa    J1u((%&677
WdAga	

 r   c                     [         R                   " S5      nUR                  [        R                  " SU5      5        U R                  R                  U5        g )NrV   <frX   rY   structpackr  extendr    r+  r\   s      r   putFloatEncoder.putFloat)  :    CALLT1%&HHOOA
r   c                     [         R                   " S5      nUR                  [        R                  " SU5      5        U R                  R                  U5        g )NrV   <drN  rR  s      r   	putDoubleEncoder.putDouble/  rU  r   c                     U(       a  U R                   R                  S5        g U R                   R                  S5        g )Nrh   r   )r  r)  r*  s     r   
putBooleanEncoder.putBoolean5  s/    
hhooa  hhooa
r   c                     [        U5      nU R                  [        U5      5        U R                  R	                  U5        g r   )strrC  rZ   r  rY   r*  s     r   putPrefixedStringEncoder.putPrefixedString<  s4     	AASVHH
r   c                 :    U R                   R                  U5        g r   )r  rY   r*  s     r   putRawStringEncoder.putRawStringE  s    HHr   r  r"  N)%r	   r
   r   r   NUMERICDOUBLESTRING
STARTGROUPENDGROUPFLOATMAX_TYPEr"   r2   r,  r/  r4  r9  rC  rG  rJ  rS  rX  r[  r_  rb  TYPE_DOUBLE
TYPE_FLOATTYPE_FIXED64TYPE_FIXED32
TYPE_INT32
TYPE_INT64TYPE_UINT64	TYPE_BOOLTYPE_STRING_TYPE_TO_METHOD_TYPE_TO_BYTE_SIZEr   r   r   r   r   r     s     '&&*(%(

6  YXUU[[\Z&	)/ AAAAAr   r   c                       \ rS rSrS rS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS r\\\\\\\\\\\\\\\\\\0	rSr g)r   iZ  c                 (    Xl         X l        X0l        g r   r  idxlimit)r    r  ry  rz  s       r   r"   Decoder.__init__[  s    HHJ
r   c                 4    U R                   U R                  -
  $ r   )rz  ry  r&   s    r   availDecoder.availa  s    ::  r   c                     U R                   $ r   r"  r&   s    r   r2   Decoder.bufferd  r$  r   c                     U R                   $ r   )ry  r&   s    r   posDecoder.posg  r$  r   c                 ~    U R                   U-   U R                  :  a  [        S5      eU =R                   U-  sl         g N	truncated)ry  rz  r   r   s     r   skipDecoder.skipj  s1    xx!|djj (A+(N"NHHMH
r   c                    US-  nU[         R                  :X  a  U R                  5         g U[         R                  :X  a  U R	                  S5        g U[         R
                  :X  a"  U R                  5       nU R	                  U5        g U[         R                  :X  ap   U R                  5       nUS-  [         R                  :X  a  OU R                  U5        M;  U[         R                  -
  U[         R                  -
  :w  a  [        S5      eg U[         R                  :X  a  [        S5      eU[         R                  :X  a  U R	                  S5        g [        S5      e)Nr   r  	corruptedr  )r   rd  getVarInt64re  r  rf  getVarInt32rg  rh  skipDatar   ri  )r    tagtr   s       r   r  Decoder.skipDatao  s   aAGOO
	
gnn	
iil	
gnn	



a
iil	
g  	 Eg&&&

--
  g
C'*<*<$<	='44 
>	
g	%k22	
gmm	
iil%k22r   c                     U R                   U R                  :  a  [        S5      eU R                  U R                      nU =R                   S-  sl         U$ )Nr  rh   ry  rz  r   r  )r    r   s     r   get8Decoder.get8  sA    xx4::%>{%KKAHHMHHr   c                     U R                   S-   U R                  :  a  [        S5      eU R                  U R                      nU R                  U R                   S-      nU =R                   S-  sl         US-  U-  $ )Nr   r  rh   r  r  )r    r   r]   s      r   get16Decoder.get16  sd    xx!|djj (A+(N"NAAAHHMHFa<r   c                    U R                   S-   U R                  :  a  [        S5      eU R                  U R                      nU R                  U R                   S-      nU R                  U R                   S-      n[	        U R                  U R                   S-      5      nU =R                   S-  sl         US-  US-  -  US-  -  U-  $ )	Nr  r  rh   r   r  r3  r2  r  ry  rz  r   r  int)r    r   r]   r5   fs        r   get32Decoder.get32  s    xx!|djj (A+(N"NAAAAADHHTXX\"#AHHMHGR AF+a//r   c                    U R                   S-   U R                  :  a  [        S5      eU R                  U R                      nU R                  U R                   S-      nU R                  U R                   S-      n[	        U R                  U R                   S-      5      n[	        U R                  U R                   S-      5      n[	        U R                  U R                   S-      5      n[	        U R                  U R                   S-      5      n[	        U R                  U R                   S	-      5      nU =R                   S-  sl         US
-  US-  -  US-  -  US-  -  US-  -  US-  -  US-  -  U-  $ )Nr  r  rh   r   r  r  r  r  r   r8  r   r7  r   r3  r2  r  )	r    r   r]   r5   r  ghijs	            r   get64Decoder.get64  sC   xx!|djj (A+(N"NAAAAADHHTXX\"#ADHHTXX\"#ADHHTXX\"#ADHHTXX\"#ADHHTXX\"#AHHMH"Wb!Q"W-b9Q"WEBw6#%&' (r   c                 N   U R                  5       nUS-  (       d  U$ [        S5      nSn U[        US-  5      U-  -  nUS-  nUS-  (       d  US:  a  [        S5      eO#US:  a  [        S5      eU R                  5       nMX  US:  a  US-  nUS	:  d  US
:  a  [        S5      eU$ )Nr>  r   r   r   r  r  @   rF  r<  r=  )r  r  r   )r    br   shifts       r   r  Decoder.getVarInt32  s     			AGhVFE
QW&'fqje#g(()+6
6	"5kBB
))+a  ####fv3%k22Mr   c                 <    U R                  5       nUS:  a  US-  nU$ )NrF  r  )getVarUint64)r    r   s     r   r  Decoder.getVarInt64  s'     F'fMr   c                     [        S5      nSn US:  a  [        S5      eU R                  5       nU[        US-  5      U-  -  nUS-  nUS-  (       d  US:  a  [        S5      eU$ MY  )Nr   r  r  r   r   r>  r  )r  r   r  )r    r   r  r  s       r   r  Decoder.getVarUint64  st    VFE
	"5kBB
))+aQW&'fqje#gg&?&L L r   c                     U R                   S-   U R                  :  a  [        S5      eU R                  U R                   U R                   S-    nU =R                   S-  sl         [        R
                  " SU5      S   $ )Nr  r  rM  r   ry  rz  r   r  rO  unpackr    r\   s     r   getFloatDecoder.getFloat  `    xx!|djj (A+(N"N$((1*%AHHMH==q!!$$r   c                     U R                   S-   U R                  :  a  [        S5      eU R                  U R                   U R                   S-    nU =R                   S-  sl         [        R
                  " SU5      S   $ )Nr  r  rW  r   r  r  s     r   	getDoubleDecoder.getDouble  r  r   c                 T    U R                  5       nUS:w  a  US:w  a  [        S5      eU$ )Nr   rh   r  )r  r   )r    r  s     r   
getBooleanDecoder.getBoolean  s*    		AAv!q& 9+ FFHr   c                    U R                  5       nU R                  U-   U R                  :  a  [        S5      eU R                  U R                  U R                  U-    nU =R                  U-  sl        UR                  5       $ r  )r  ry  rz  r   r  r3   )r    lengthrs      r   getPrefixedStringDecoder.getPrefixedString  sg    Fxx&4::%%k22DHHv-.AHHH::<r   c                     U R                   U R                  U R                   nU R                  U l        UR                  5       $ r   )r  ry  rz  r3   )r    r  s     r   getRawStringDecoder.getRawString  s1    $**%AzzDH::<r   rx  N)!r	   r
   r   r   r"   r}  r2   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  r   r   r   r   r   r   Z  s    !
340(6%%
 YXUU[[\Z&	)/r   r   c                       \ rS rSrSrS rSrg)ExtensionIdentifieri  )		full_namenumber
field_typewire_tagis_repeateddefaultcontaining_clscomposite_clsmessage_namec                 L    Xl         X l        X0l        X@l        XPl        X`l        g r   )r  r  r  r  r  r  )r    r  r  r  r  r  r  s          r   r"   ExtensionIdentifier.__init__  s!    NK OM"Lr   )r  r  r  r  r  r  N)r	   r
   r   r   	__slots__r"   r   r   r   r   r  r    s    M)r   r  c                       \ rS rSrS rS rSS jrS rSS jrS r	S	 r
SS
 jrS rS rS rS rS rS rS rS rS r\SS j5       rSrg)r   i  c                 @    U R                  U5        XR                  ;   $ )z@Checks if the message contains a certain non-repeated extension._VerifyExtensionIdentifier_extension_fieldsr    	extensions     r   HasExtension&ExtendableProtocolMessage.HasExtension  s    ##I.....r   c                 `    U R                  U5        XR                  ;   a  U R                  U	 gg)zaClears the value of extension, so that HasExtension() returns false or
ExtensionSize() returns 0.Nr  r  s     r   ClearExtension(ExtendableProtocolMessage.ClearExtension  s1     	##I.***

 
 
+ +r   Nc                    U R                  U5        XR                  ;   a  U R                  U   nOBUR                  (       a  / nO.UR                  (       a  UR                  5       nOUR                  nUR                  (       a  X2   nU$ )aN  Gets the extension value for a certain extension.

Args:
  extension: The ExtensionIdentifier for the extension.
  index: The index of element to get in a repeated field. Only needed if
      the extension is repeated.

Returns:
  The value of the extension if exists, otherwise the default value of the
  extension will be returned.
)r  r  r  r  r  r    r  indexr   s       r   GetExtension&ExtendableProtocolMessage.GetExtension!  ss     	##I.***%%i0f			""((*""}fMr   c                    U R                  U5        UR                  (       a  [        SUR                  -  5      eUR                  (       a   Uu  p4X@R                  U   U'   g Uu  nX@R                  U'   g! [
         a    [        S[        U5      S-   -  5      ef = f! [
         a    [        S[        U5      S-   -  5      ef = f)a  Sets the extension value for a certain scalar type extension.

Arg varies according to extension type:
- Singular:
  message.SetExtension(extension, value)
- Repeated:
  message.SetExtension(extension, index, value)
where
  extension: The ExtensionIdentifier for the extension.
  index: The index of element to set in a repeated field. Only needed if
      the extension is repeated.
  value: The value to set.

Raises:
  TypeError if a message type extension is given.
z?Cannot assign to extension "%s" because it is a composite type.zbSetExtension(extension, index, value) for repeated extension takes exactly 4 arguments: (%d given)r   z[SetExtension(extension, value) for singular extension takes exactly 3 arguments: (%d given)N)r  r  	TypeErrorr  r  
ValueErrorrZ   r  )r    r  argsr  r   s        r   SetExtension&ExtendableProtocolMessage.SetExtension;  s    " 	##I.
K


  G
 27Y'.G
 +0Y'  G47:4y1}FG 	GG  G47:4y1}FG 	GGs   A7 $B 7%B%Cc                 J   U R                  U5        UR                  c  [        SUR                  -  5      eUR                  (       a  Uc  [        S5      eU R                  X5      $ XR                  ;   a  U R                  U   $ UR                  5       nX0R                  U'   U$ )a  Gets a mutable reference of a message type extension.

For repeated extension, index must be specified, and only one element will
be returned. For optional extension, if the extension does not exist, a new
message will be created and set in parent message.

Args:
  extension: The ExtensionIdentifier for the extension.
  index: The index of element to mutate in a repeated field. Only needed if
      the extension is repeated.

Returns:
  The mutable message reference.

Raises:
  TypeError if non-message type extension is given.
zQMutableExtension() cannot be applied to "%s", because it is not a composite type.z^MutableExtension(extension, index) for repeated extension takes exactly 2 arguments: (1 given))r  r  r  r  r  r  r  r  s       r   MutableExtension*ExtendableProtocolMessage.MutableExtensionb  s    $ 	##I.&'1123 3 	34 	4 y00***##I..&&(f*0Y'mr   c                     U R                  U5        UR                  (       d  [        SUR                  -  5      eXR                  ;   a  U R                  U   $ / nX R                  U'   U$ )z]Returns a mutable list of extensions.

Raises:
  TypeError if the extension is not repeated.
zRExtensionList() cannot be applied to "%s", because it is not a repeated extension.)r  r  r  r  r  )r    r  r   s      r   ExtensionList'ExtendableProtocolMessage.ExtensionList  sr     	##I.   "+"5"567 7 ***##I..F(.9%Mr   c                     U R                  U5        UR                  (       d  [        SUR                  -  5      eXR                  ;   a  [        U R                  U   5      $ g)zaReturns the size of a repeated extension.

Raises:
  TypeError if the extension is not repeated.
zRExtensionSize() cannot be applied to "%s", because it is not a repeated extension.r   )r  r  r  r  r  rZ   r  s     r   ExtensionSize'ExtendableProtocolMessage.ExtensionSize  sb     	##I.   "+"5"567 7 ***''	233r   c                    U R                  U5        UR                  (       d  [        SUR                  -  5      eXR                  ;   a  U R                  U   nO/ nX0R                  U'   UR
                  (       a>  Ub  [        SUR                  -  5      eUR                  5       nUR                  U5        U$ UR                  U5        g)a  Appends a new element into a repeated extension.

Arg varies according to the extension field type:
- Scalar/String:
  message.AddExtension(extension, value)
- Message:
  mutable_message = AddExtension(extension)

Args:
  extension: The ExtensionIdentifier for the extension.
  value: The value of the extension if the extension is scalar/string type.
      The value must NOT be set for message type extensions; set values on
      the returned message object instead.

Returns:
  A mutable new message if it's a message type extension, or None otherwise.

Raises:
  TypeError if the extension is not repeated, or value is given for message
  type extensions.
zQAddExtension() cannot be applied to "%s", because it is not a repeated extension.Nzvalue must not be set in AddExtension() for "%s", because it is a message type extension. Set values on the returned message instead.)r  r  r  r  r  r  r)  )r    r  r   fieldmsgs        r   AddExtension&ExtendableProtocolMessage.AddExtension  s    , 	##I.   "+"5"567 7 ***$$Y/ee*/Y'		",,-. 	. ##%cll3j	LLr   c           	          UR                   U R                  :w  aJ  [        SUR                  < SUR                   R                  < SU R                  R                  < S35      eg )NzContaining type of z is z
, but not .)r  r   r  r  r	   r  s     r   r  4ExtendableProtocolMessage._VerifyExtensionIdentifier  sP    4>>1",,"11::002 3 3 2r   c                    UR                   R                  5        H  u  p#UR                  (       aK  U HC  nUR                  c  U R	                  X$5        M#  U R	                  U5      R                  U5        ME     Ma  UR                  c  U R                  X#5        M  U R                  U5      R                  U5        M     g r   )r  itemsr  r  r  r   r  r  )r    xextval
single_vals        r   _MergeExtensionFields/ExtendableProtocolMessage._MergeExtensionFields  s    ''--/	J&c.c",,Z8	  $


C
%



$
.
.s
3 0r   c                 B   ^  [        U 4S jT R                   5       S S9$ )Nc              3   x   >#    U  H/  nUR                   (       a  TR                  U5      S :  d  M+  Uv   M1     g7f)r   N)r  r  )r   r  r    s     r   r   <ExtendableProtocolMessage._ListExtensions.<locals>.<genexpr>  s4      	B.T%7%7%<q%@ 
.s   *:	:c                     U R                   $ r   )r  )items    r   <lambda>;ExtendableProtocolMessage._ListExtensions.<locals>.<lambda>  s    r   )key)sortedr  r&   s   `r   _ListExtensions)ExtendableProtocolMessage._ListExtensions  s'    	B.. 	B$& &r   c                    U R                  5       nX!R                  5       :w  a  gU H  nUR                  (       ac  U R                  U5      UR                  U5      :w  a    g[        U R	                  U5      UR	                  U5      5       H  u  pEXE:w  d  M      g   Mw  U R                  U5      UR                  U5      :w  d  M    g   g)NFT)r  r  r  zipr  r  )r    r  
extensionsr  e1e2s         r   _ExtensionEquals*ExtendableProtocolMessage._ExtensionEquals  s    %%'J&&((	c"aooc&::5$,,S1%&__S%9;FBXe; S!Q^^C%88  r   c                 .  ^^ UU4S jn[        [        R                  " X4S5      US9 H_  u  pxUR                  U:  a  Us  $ UR                  (       a   U R
                  U    H  n	U" X5        M     MJ  U" XR
                  U   5        Ma     [        U5      $ )a   Serialize a range of extensions.

To generate canonical output when encoding, we interleave fields and
extensions to preserve tag order.

Generated code will prepare a list of ExtensionIdentifier sorted in field
number order and call this method to serialize a specific range of
extensions. The range is specified by the two arguments, start_index and
end_field_number.

The method will serialize all extensions[i] with i >= start_index and
extensions[i].number < end_field_number. Since extensions argument is sorted
by field_number, this is a contiguous range; the first index j not included
in that range is returned. The return value can be used as the start_index
in the next call to serialize the next range of extensions.

Args:
  extensions: A list of ExtensionIdentifier sorted in field number order.
  start_index: The start index in the extensions list.
  end_field_number: The end field number of the extension range.

Returns:
  The first index that is not in the range. Or the size of extensions if all
  the extensions are within the range.
c                 8  > TR                  U R                  5        U R                  [        :X  aI  T(       a  UR	                  T5        OUR                  T5        TR                  U R                  S-   5        g U R                  [        :X  ai  T(       a1  TR                  UR                  5       5        UR	                  T5        g TR                  UR                  5       5        UR                  T5        g [        R                  U R                     " TU5        g )Nrh   )rC  r  r  
TYPE_GROUPr?   r   TYPE_FOREIGNByteSizePartialByteSizer   rt  )r  r   outpartials     r   OutputSingleFieldKExtendableProtocolMessage._OutputExtensionFields.<locals>.OutputSingleField  s    	oocll#	:	%


c
"



$q()>>\)
//%//1
2


c
"
//%..*
+



$/U;r   N)start)	enumerate	itertoolsislicer  r  r  rZ   )
r    r  r  r  start_indexend_field_numberr  	ext_indexr  r  s
    ``       r   _OutputExtensionFields0ExtendableProtocolMessage._OutputExtensionFields  s    6<$ $$7{L		'	'	++C0E
C
' 1 	#55c:;L z?r   c                    US-	  nX0R                   ;   Ga  U R                   U   nXR                  :w  a  g UR                  [        :X  a  UR	                  5       n[        UR                  5       UR                  5       UR                  5       U-   5      nUR                  (       a!  U R                  U5      R                  U5        O U R                  U5      R                  U5        UR                  U5        g UR                  [        :X  aS  UR                  (       a!  U R                  U5      R                  U5        g U R                  U5      R                  U5        g [
        R                  UR                     " U5      nUR                  (       a  U R                  XG5        g U R                  XG5        g UR!                  U5        g )Nr  )_extensions_by_field_numberr  r  r  r  r   r2   r  r  r  r[   r  r  r  rt  r  r  )r    r  r]   r  r  r  tmpr   s           r   _ParseOneExtensionField1ExtendableProtocolMessage._ParseOneExtensionField5  sC   ]F111,,V4c	\\	!	<	'ahhj!%%'1557V+;<??


C
 
)
)#
.



$
-
-c
2	v>>Z'??


C
 
)
)!
,



$
-
-a
0''7:??


C
'


C
' jjr   c                 v   Sn[         R                  " U R                  5       H  u  p4UR                  nU R	                  UR
                  5      nU[        :X  a  US-  nUR                  (       a/  X&[        U5      -  -  nU H  nX R                  XWU5      -  nM     M{  X&U R                  XTU5      -   -  nM     U$ )Nr   r   )
rv   	iteritemsr  r  r   r  r  r  rZ   _FieldByteSize)r    r  sizer  r   ftypetag_sizesingle_values           r   _ExtensionByteSize,ExtendableProtocolMessage._ExtensionByteSizeS  s    DMM$*@*@A	""e$$Y%7%78h	*	A			3u:%%!L
%%e7C
C$ " 	4..uWEEE B Kr   c                    SnU[         :X  a  U R                  [        U5      5      nU$ U[        :X  d
  U[        :X  aJ  U(       a!  U R                  UR                  5       5      nU$ U R                  UR                  5       5      n U$ U[        :X  d  U[        :X  d
  U[        :X  a  U R                  U5      nU$ U[        R                  ;   a  [        R                  U   nU$ [        SU-  5      e)Nr   z$Extension type %d is not recognized.)rs  r   rZ   r  r  r  r  rp  rq  ro  r   r   ru  AssertionError)r    r0  r   r  r/  s        r   r.  (ExtendableProtocolMessage._FieldByteSizeb  s    Ds5z*d  K 
,	%:"5	  !6!6!89 K   !12 K 
*		+		*	  'd K 
',,	,))%0 K 2U:< 	<r   c                 v   SnU R                  5       nU GH  nU R                  U   nUR                  (       aa  SnU HW  nSn	U(       a  SU-  n	UR                  c  M   X1SUR                  < U	< S3-   -  nX8R                  US-   U5      -  nX1S-   -  nMY     M  UR                  b4  X1SUR                  -  -   -  nX6R                  US-   U5      -  nX1S-   -  nM  UR                  [        ;   a  [        UR                     " X5      n
OU R                  U5      n
X1SUR                  < S	U
< S
3-   -  nGM"     U$ )Nr   r   z(%d)[z] {
z  z}
z[%s] {
z]: 
)	r  r  r  r  r  r   r  _TYPE_TO_DEBUG_STRINGr   )r    r   r   resr  r  r   cntr5   elm
text_values              r   _ExtensionDebugString/ExtendableProtocolMessage._ExtensionDebugStringw  sR   
C%%'J	$$Y/e			A#FSLc$$06$$c+ + +C99Vd]O<<CE>!C  "".
*y':':::
:#
tm_. .#
%
#!!%::.$$&&*3J ))%0J
)*=*=zJJ
J#1  2 Jr   c                    Xl         X!l        Ub  UR                  Ul        U R                  R                  UR                  U5      nX1La:  [        SUR                  UR                  U R                  UR                  4-  5      eg )NzSExtensions "%s" and "%s" both try to extend message type "%s" with field number %d.)
r  r  _PROTO_DESCRIPTOR_NAMEr  r(  
setdefaultr  r6  r  r	   )clsr  r  actual_handles       r   _RegisterExtension,ExtendableProtocolMessage._RegisterExtension  s    "+ ,CCi33>>)%M% 7 7<<))++, , &r   r   r   )r	   r
   r   r   r  r  r  r  r  r  r  r  r  r   r  r  r%  r*  r3  r.  r@  staticmethodrG  r   r   r   r   r   r     so    /
,4%0N"H"+Z34&7r<*< , ,r   r   )-
__future__r   rX   r   rerO  rv   six.moves.http_client%googlecloudsdk.appengine.proto.proto1	appengineprotoproto1r   r   r   ImportError	Exception__all__compiler   r   rk  rl  rp  rq  ro  rm  rn  rr  rs  r  r  r   r   r  r  r   r   r  r;  r   r   objectr  r   r   r   r   <module>rV     sm  " '   	  
 ? 98 %>>$>>$>>( 
/	0s sl 


	
 /22/22/22/22/33/44/44/114 Y Yvh) h)\
& 
N, N,o  32)22)22)2	3s   D 'D=<D=