thirdparty/google_appengine/google/appengine/api/urlfetch_service_pb.py
changeset 109 620f9b141567
child 149 f2e327a7c5de
equal deleted inserted replaced
108:261778de26ff 109:620f9b141567
       
     1 #!/usr/bin/env python
       
     2 #
       
     3 # Copyright 2007 Google Inc.
       
     4 #
       
     5 # Licensed under the Apache License, Version 2.0 (the "License");
       
     6 # you may not use this file except in compliance with the License.
       
     7 # You may obtain a copy of the License at
       
     8 #
       
     9 #     http://www.apache.org/licenses/LICENSE-2.0
       
    10 #
       
    11 # Unless required by applicable law or agreed to in writing, software
       
    12 # distributed under the License is distributed on an "AS IS" BASIS,
       
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    14 # See the License for the specific language governing permissions and
       
    15 # limitations under the License.
       
    16 #
       
    17 
       
    18 from google.net.proto import ProtocolBuffer
       
    19 import array
       
    20 import dummy_thread as thread
       
    21 
       
    22 __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
       
    23                    unusednames=printElemNumber,debug_strs no-special"""
       
    24 
       
    25 from google.appengine.api.api_base_pb import StringProto
       
    26 class URLFetchServiceError(ProtocolBuffer.ProtocolMessage):
       
    27 
       
    28   OK           =    0
       
    29   INVALID_URL  =    1
       
    30   FETCH_ERROR  =    2
       
    31   UNSPECIFIED_ERROR =    3
       
    32   RESPONSE_TOO_LARGE =    4
       
    33 
       
    34   _ErrorCode_NAMES = {
       
    35     0: "OK",
       
    36     1: "INVALID_URL",
       
    37     2: "FETCH_ERROR",
       
    38     3: "UNSPECIFIED_ERROR",
       
    39     4: "RESPONSE_TOO_LARGE",
       
    40   }
       
    41 
       
    42   def ErrorCode_Name(cls, x): return cls._ErrorCode_NAMES.get(x, "")
       
    43   ErrorCode_Name = classmethod(ErrorCode_Name)
       
    44 
       
    45   def __init__(self, contents=None):
       
    46     pass
       
    47     if contents is not None: self.MergeFromString(contents)
       
    48 
       
    49 
       
    50   def MergeFrom(self, x):
       
    51     assert x is not self
       
    52 
       
    53   def Equals(self, x):
       
    54     if x is self: return 1
       
    55     return 1
       
    56 
       
    57   def __eq__(self, other):
       
    58     return (other is not None) and (other.__class__ == self.__class__) and self.Equals(other)
       
    59 
       
    60   def __ne__(self, other):
       
    61     return not (self == other)
       
    62 
       
    63   def IsInitialized(self, debug_strs=None):
       
    64     initialized = 1
       
    65     return initialized
       
    66 
       
    67   def ByteSize(self):
       
    68     n = 0
       
    69     return n + 0
       
    70 
       
    71   def Clear(self):
       
    72     pass
       
    73 
       
    74   def OutputUnchecked(self, out):
       
    75     pass
       
    76 
       
    77   def TryMerge(self, d):
       
    78     while d.avail() > 0:
       
    79       tt = d.getVarInt32()
       
    80       if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
       
    81       d.skipData(tt)
       
    82 
       
    83 
       
    84   def __str__(self, prefix="", printElemNumber=0):
       
    85     res=""
       
    86     return res
       
    87 
       
    88 
       
    89   _TEXT = (
       
    90    "ErrorCode",
       
    91   )
       
    92 
       
    93   _TYPES = (
       
    94    ProtocolBuffer.Encoder.NUMERIC,
       
    95   )
       
    96 
       
    97   _STYLE = """"""
       
    98   _STYLE_CONTENT_TYPE = """"""
       
    99 class URLFetchRequest_Header(ProtocolBuffer.ProtocolMessage):
       
   100   def __init__(self, contents=None):
       
   101     self.key_ = ""
       
   102     self.value_ = ""
       
   103     self.has_key_ = 0
       
   104     self.has_value_ = 0
       
   105     if contents is not None: self.MergeFromString(contents)
       
   106 
       
   107   def key(self): return self.key_
       
   108 
       
   109   def set_key(self, x):
       
   110     self.has_key_ = 1
       
   111     self.key_ = x
       
   112 
       
   113   def clear_key(self):
       
   114     self.has_key_ = 0
       
   115     self.key_ = ""
       
   116 
       
   117   def has_key(self): return self.has_key_
       
   118 
       
   119   def value(self): return self.value_
       
   120 
       
   121   def set_value(self, x):
       
   122     self.has_value_ = 1
       
   123     self.value_ = x
       
   124 
       
   125   def clear_value(self):
       
   126     self.has_value_ = 0
       
   127     self.value_ = ""
       
   128 
       
   129   def has_value(self): return self.has_value_
       
   130 
       
   131 
       
   132   def MergeFrom(self, x):
       
   133     assert x is not self
       
   134     if (x.has_key()): self.set_key(x.key())
       
   135     if (x.has_value()): self.set_value(x.value())
       
   136 
       
   137   def Equals(self, x):
       
   138     if x is self: return 1
       
   139     if self.has_key_ != x.has_key_: return 0
       
   140     if self.has_key_ and self.key_ != x.key_: return 0
       
   141     if self.has_value_ != x.has_value_: return 0
       
   142     if self.has_value_ and self.value_ != x.value_: return 0
       
   143     return 1
       
   144 
       
   145   def __eq__(self, other):
       
   146     return (other is not None) and (other.__class__ == self.__class__) and self.Equals(other)
       
   147 
       
   148   def __ne__(self, other):
       
   149     return not (self == other)
       
   150 
       
   151   def IsInitialized(self, debug_strs=None):
       
   152     initialized = 1
       
   153     if (not self.has_key_):
       
   154       initialized = 0
       
   155       if debug_strs is not None:
       
   156         debug_strs.append('Required field: key not set.')
       
   157     if (not self.has_value_):
       
   158       initialized = 0
       
   159       if debug_strs is not None:
       
   160         debug_strs.append('Required field: value not set.')
       
   161     return initialized
       
   162 
       
   163   def ByteSize(self):
       
   164     n = 0
       
   165     n += self.lengthString(len(self.key_))
       
   166     n += self.lengthString(len(self.value_))
       
   167     return n + 2
       
   168 
       
   169   def Clear(self):
       
   170     self.clear_key()
       
   171     self.clear_value()
       
   172 
       
   173   def OutputUnchecked(self, out):
       
   174     out.putVarInt32(34)
       
   175     out.putPrefixedString(self.key_)
       
   176     out.putVarInt32(42)
       
   177     out.putPrefixedString(self.value_)
       
   178 
       
   179   def TryMerge(self, d):
       
   180     while 1:
       
   181       tt = d.getVarInt32()
       
   182       if tt == 28: break
       
   183       if tt == 34:
       
   184         self.set_key(d.getPrefixedString())
       
   185         continue
       
   186       if tt == 42:
       
   187         self.set_value(d.getPrefixedString())
       
   188         continue
       
   189       if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
       
   190       d.skipData(tt)
       
   191 
       
   192 
       
   193   def __str__(self, prefix="", printElemNumber=0):
       
   194     res=""
       
   195     if self.has_key_: res+=prefix+("Key: %s\n" % self.DebugFormatString(self.key_))
       
   196     if self.has_value_: res+=prefix+("Value: %s\n" % self.DebugFormatString(self.value_))
       
   197     return res
       
   198 
       
   199 class URLFetchRequest(ProtocolBuffer.ProtocolMessage):
       
   200 
       
   201   GET          =    1
       
   202   POST         =    2
       
   203   HEAD         =    3
       
   204   PUT          =    4
       
   205   DELETE       =    5
       
   206 
       
   207   _RequestMethod_NAMES = {
       
   208     1: "GET",
       
   209     2: "POST",
       
   210     3: "HEAD",
       
   211     4: "PUT",
       
   212     5: "DELETE",
       
   213   }
       
   214 
       
   215   def RequestMethod_Name(cls, x): return cls._RequestMethod_NAMES.get(x, "")
       
   216   RequestMethod_Name = classmethod(RequestMethod_Name)
       
   217 
       
   218   def __init__(self, contents=None):
       
   219     self.method_ = 0
       
   220     self.url_ = ""
       
   221     self.header_ = []
       
   222     self.payload_ = ""
       
   223     self.has_method_ = 0
       
   224     self.has_url_ = 0
       
   225     self.has_payload_ = 0
       
   226     if contents is not None: self.MergeFromString(contents)
       
   227 
       
   228   def method(self): return self.method_
       
   229 
       
   230   def set_method(self, x):
       
   231     self.has_method_ = 1
       
   232     self.method_ = x
       
   233 
       
   234   def clear_method(self):
       
   235     self.has_method_ = 0
       
   236     self.method_ = 0
       
   237 
       
   238   def has_method(self): return self.has_method_
       
   239 
       
   240   def url(self): return self.url_
       
   241 
       
   242   def set_url(self, x):
       
   243     self.has_url_ = 1
       
   244     self.url_ = x
       
   245 
       
   246   def clear_url(self):
       
   247     self.has_url_ = 0
       
   248     self.url_ = ""
       
   249 
       
   250   def has_url(self): return self.has_url_
       
   251 
       
   252   def header_size(self): return len(self.header_)
       
   253   def header_list(self): return self.header_
       
   254 
       
   255   def header(self, i):
       
   256     return self.header_[i]
       
   257 
       
   258   def mutable_header(self, i):
       
   259     return self.header_[i]
       
   260 
       
   261   def add_header(self):
       
   262     x = URLFetchRequest_Header()
       
   263     self.header_.append(x)
       
   264     return x
       
   265 
       
   266   def clear_header(self):
       
   267     self.header_ = []
       
   268   def payload(self): return self.payload_
       
   269 
       
   270   def set_payload(self, x):
       
   271     self.has_payload_ = 1
       
   272     self.payload_ = x
       
   273 
       
   274   def clear_payload(self):
       
   275     self.has_payload_ = 0
       
   276     self.payload_ = ""
       
   277 
       
   278   def has_payload(self): return self.has_payload_
       
   279 
       
   280 
       
   281   def MergeFrom(self, x):
       
   282     assert x is not self
       
   283     if (x.has_method()): self.set_method(x.method())
       
   284     if (x.has_url()): self.set_url(x.url())
       
   285     for i in xrange(x.header_size()): self.add_header().CopyFrom(x.header(i))
       
   286     if (x.has_payload()): self.set_payload(x.payload())
       
   287 
       
   288   def Equals(self, x):
       
   289     if x is self: return 1
       
   290     if self.has_method_ != x.has_method_: return 0
       
   291     if self.has_method_ and self.method_ != x.method_: return 0
       
   292     if self.has_url_ != x.has_url_: return 0
       
   293     if self.has_url_ and self.url_ != x.url_: return 0
       
   294     if len(self.header_) != len(x.header_): return 0
       
   295     for e1, e2 in zip(self.header_, x.header_):
       
   296       if e1 != e2: return 0
       
   297     if self.has_payload_ != x.has_payload_: return 0
       
   298     if self.has_payload_ and self.payload_ != x.payload_: return 0
       
   299     return 1
       
   300 
       
   301   def __eq__(self, other):
       
   302     return (other is not None) and (other.__class__ == self.__class__) and self.Equals(other)
       
   303 
       
   304   def __ne__(self, other):
       
   305     return not (self == other)
       
   306 
       
   307   def IsInitialized(self, debug_strs=None):
       
   308     initialized = 1
       
   309     if (not self.has_method_):
       
   310       initialized = 0
       
   311       if debug_strs is not None:
       
   312         debug_strs.append('Required field: method not set.')
       
   313     if (not self.has_url_):
       
   314       initialized = 0
       
   315       if debug_strs is not None:
       
   316         debug_strs.append('Required field: url not set.')
       
   317     for i in xrange(len(self.header_)):
       
   318       if (not self.header_[i].IsInitialized(debug_strs)): initialized=0
       
   319     return initialized
       
   320 
       
   321   def ByteSize(self):
       
   322     n = 0
       
   323     n += self.lengthVarInt64(self.method_)
       
   324     n += self.lengthString(len(self.url_))
       
   325     n += 2 * len(self.header_)
       
   326     for i in xrange(len(self.header_)): n += self.header_[i].ByteSize()
       
   327     if (self.has_payload_): n += 1 + self.lengthString(len(self.payload_))
       
   328     return n + 2
       
   329 
       
   330   def Clear(self):
       
   331     self.clear_method()
       
   332     self.clear_url()
       
   333     self.clear_header()
       
   334     self.clear_payload()
       
   335 
       
   336   def OutputUnchecked(self, out):
       
   337     out.putVarInt32(8)
       
   338     out.putVarInt32(self.method_)
       
   339     out.putVarInt32(18)
       
   340     out.putPrefixedString(self.url_)
       
   341     for i in xrange(len(self.header_)):
       
   342       out.putVarInt32(27)
       
   343       self.header_[i].OutputUnchecked(out)
       
   344       out.putVarInt32(28)
       
   345     if (self.has_payload_):
       
   346       out.putVarInt32(50)
       
   347       out.putPrefixedString(self.payload_)
       
   348 
       
   349   def TryMerge(self, d):
       
   350     while d.avail() > 0:
       
   351       tt = d.getVarInt32()
       
   352       if tt == 8:
       
   353         self.set_method(d.getVarInt32())
       
   354         continue
       
   355       if tt == 18:
       
   356         self.set_url(d.getPrefixedString())
       
   357         continue
       
   358       if tt == 27:
       
   359         self.add_header().TryMerge(d)
       
   360         continue
       
   361       if tt == 50:
       
   362         self.set_payload(d.getPrefixedString())
       
   363         continue
       
   364       if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
       
   365       d.skipData(tt)
       
   366 
       
   367 
       
   368   def __str__(self, prefix="", printElemNumber=0):
       
   369     res=""
       
   370     if self.has_method_: res+=prefix+("Method: %s\n" % self.DebugFormatInt32(self.method_))
       
   371     if self.has_url_: res+=prefix+("Url: %s\n" % self.DebugFormatString(self.url_))
       
   372     cnt=0
       
   373     for e in self.header_:
       
   374       elm=""
       
   375       if printElemNumber: elm="(%d)" % cnt
       
   376       res+=prefix+("Header%s {\n" % elm)
       
   377       res+=e.__str__(prefix + "  ", printElemNumber)
       
   378       res+=prefix+"}\n"
       
   379       cnt+=1
       
   380     if self.has_payload_: res+=prefix+("Payload: %s\n" % self.DebugFormatString(self.payload_))
       
   381     return res
       
   382 
       
   383   kMethod = 1
       
   384   kUrl = 2
       
   385   kHeaderGroup = 3
       
   386   kHeaderKey = 4
       
   387   kHeaderValue = 5
       
   388   kPayload = 6
       
   389 
       
   390   _TEXT = (
       
   391    "ErrorCode",
       
   392    "Method",
       
   393    "Url",
       
   394    "Header",
       
   395    "Key",
       
   396    "Value",
       
   397    "Payload",
       
   398   )
       
   399 
       
   400   _TYPES = (
       
   401    ProtocolBuffer.Encoder.NUMERIC,
       
   402    ProtocolBuffer.Encoder.NUMERIC,
       
   403 
       
   404    ProtocolBuffer.Encoder.STRING,
       
   405 
       
   406    ProtocolBuffer.Encoder.STARTGROUP,
       
   407 
       
   408    ProtocolBuffer.Encoder.STRING,
       
   409 
       
   410    ProtocolBuffer.Encoder.STRING,
       
   411 
       
   412    ProtocolBuffer.Encoder.STRING,
       
   413 
       
   414   )
       
   415 
       
   416   _STYLE = """"""
       
   417   _STYLE_CONTENT_TYPE = """"""
       
   418 class URLFetchResponse_Header(ProtocolBuffer.ProtocolMessage):
       
   419   def __init__(self, contents=None):
       
   420     self.key_ = ""
       
   421     self.value_ = ""
       
   422     self.has_key_ = 0
       
   423     self.has_value_ = 0
       
   424     if contents is not None: self.MergeFromString(contents)
       
   425 
       
   426   def key(self): return self.key_
       
   427 
       
   428   def set_key(self, x):
       
   429     self.has_key_ = 1
       
   430     self.key_ = x
       
   431 
       
   432   def clear_key(self):
       
   433     self.has_key_ = 0
       
   434     self.key_ = ""
       
   435 
       
   436   def has_key(self): return self.has_key_
       
   437 
       
   438   def value(self): return self.value_
       
   439 
       
   440   def set_value(self, x):
       
   441     self.has_value_ = 1
       
   442     self.value_ = x
       
   443 
       
   444   def clear_value(self):
       
   445     self.has_value_ = 0
       
   446     self.value_ = ""
       
   447 
       
   448   def has_value(self): return self.has_value_
       
   449 
       
   450 
       
   451   def MergeFrom(self, x):
       
   452     assert x is not self
       
   453     if (x.has_key()): self.set_key(x.key())
       
   454     if (x.has_value()): self.set_value(x.value())
       
   455 
       
   456   def Equals(self, x):
       
   457     if x is self: return 1
       
   458     if self.has_key_ != x.has_key_: return 0
       
   459     if self.has_key_ and self.key_ != x.key_: return 0
       
   460     if self.has_value_ != x.has_value_: return 0
       
   461     if self.has_value_ and self.value_ != x.value_: return 0
       
   462     return 1
       
   463 
       
   464   def __eq__(self, other):
       
   465     return (other is not None) and (other.__class__ == self.__class__) and self.Equals(other)
       
   466 
       
   467   def __ne__(self, other):
       
   468     return not (self == other)
       
   469 
       
   470   def IsInitialized(self, debug_strs=None):
       
   471     initialized = 1
       
   472     if (not self.has_key_):
       
   473       initialized = 0
       
   474       if debug_strs is not None:
       
   475         debug_strs.append('Required field: key not set.')
       
   476     if (not self.has_value_):
       
   477       initialized = 0
       
   478       if debug_strs is not None:
       
   479         debug_strs.append('Required field: value not set.')
       
   480     return initialized
       
   481 
       
   482   def ByteSize(self):
       
   483     n = 0
       
   484     n += self.lengthString(len(self.key_))
       
   485     n += self.lengthString(len(self.value_))
       
   486     return n + 2
       
   487 
       
   488   def Clear(self):
       
   489     self.clear_key()
       
   490     self.clear_value()
       
   491 
       
   492   def OutputUnchecked(self, out):
       
   493     out.putVarInt32(34)
       
   494     out.putPrefixedString(self.key_)
       
   495     out.putVarInt32(42)
       
   496     out.putPrefixedString(self.value_)
       
   497 
       
   498   def TryMerge(self, d):
       
   499     while 1:
       
   500       tt = d.getVarInt32()
       
   501       if tt == 28: break
       
   502       if tt == 34:
       
   503         self.set_key(d.getPrefixedString())
       
   504         continue
       
   505       if tt == 42:
       
   506         self.set_value(d.getPrefixedString())
       
   507         continue
       
   508       if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
       
   509       d.skipData(tt)
       
   510 
       
   511 
       
   512   def __str__(self, prefix="", printElemNumber=0):
       
   513     res=""
       
   514     if self.has_key_: res+=prefix+("Key: %s\n" % self.DebugFormatString(self.key_))
       
   515     if self.has_value_: res+=prefix+("Value: %s\n" % self.DebugFormatString(self.value_))
       
   516     return res
       
   517 
       
   518 class URLFetchResponse(ProtocolBuffer.ProtocolMessage):
       
   519   def __init__(self, contents=None):
       
   520     self.content_ = ""
       
   521     self.statuscode_ = 0
       
   522     self.header_ = []
       
   523     self.contentwastruncated_ = 0
       
   524     self.has_content_ = 0
       
   525     self.has_statuscode_ = 0
       
   526     self.has_contentwastruncated_ = 0
       
   527     if contents is not None: self.MergeFromString(contents)
       
   528 
       
   529   def content(self): return self.content_
       
   530 
       
   531   def set_content(self, x):
       
   532     self.has_content_ = 1
       
   533     self.content_ = x
       
   534 
       
   535   def clear_content(self):
       
   536     self.has_content_ = 0
       
   537     self.content_ = ""
       
   538 
       
   539   def has_content(self): return self.has_content_
       
   540 
       
   541   def statuscode(self): return self.statuscode_
       
   542 
       
   543   def set_statuscode(self, x):
       
   544     self.has_statuscode_ = 1
       
   545     self.statuscode_ = x
       
   546 
       
   547   def clear_statuscode(self):
       
   548     self.has_statuscode_ = 0
       
   549     self.statuscode_ = 0
       
   550 
       
   551   def has_statuscode(self): return self.has_statuscode_
       
   552 
       
   553   def header_size(self): return len(self.header_)
       
   554   def header_list(self): return self.header_
       
   555 
       
   556   def header(self, i):
       
   557     return self.header_[i]
       
   558 
       
   559   def mutable_header(self, i):
       
   560     return self.header_[i]
       
   561 
       
   562   def add_header(self):
       
   563     x = URLFetchResponse_Header()
       
   564     self.header_.append(x)
       
   565     return x
       
   566 
       
   567   def clear_header(self):
       
   568     self.header_ = []
       
   569   def contentwastruncated(self): return self.contentwastruncated_
       
   570 
       
   571   def set_contentwastruncated(self, x):
       
   572     self.has_contentwastruncated_ = 1
       
   573     self.contentwastruncated_ = x
       
   574 
       
   575   def clear_contentwastruncated(self):
       
   576     self.has_contentwastruncated_ = 0
       
   577     self.contentwastruncated_ = 0
       
   578 
       
   579   def has_contentwastruncated(self): return self.has_contentwastruncated_
       
   580 
       
   581 
       
   582   def MergeFrom(self, x):
       
   583     assert x is not self
       
   584     if (x.has_content()): self.set_content(x.content())
       
   585     if (x.has_statuscode()): self.set_statuscode(x.statuscode())
       
   586     for i in xrange(x.header_size()): self.add_header().CopyFrom(x.header(i))
       
   587     if (x.has_contentwastruncated()): self.set_contentwastruncated(x.contentwastruncated())
       
   588 
       
   589   def Equals(self, x):
       
   590     if x is self: return 1
       
   591     if self.has_content_ != x.has_content_: return 0
       
   592     if self.has_content_ and self.content_ != x.content_: return 0
       
   593     if self.has_statuscode_ != x.has_statuscode_: return 0
       
   594     if self.has_statuscode_ and self.statuscode_ != x.statuscode_: return 0
       
   595     if len(self.header_) != len(x.header_): return 0
       
   596     for e1, e2 in zip(self.header_, x.header_):
       
   597       if e1 != e2: return 0
       
   598     if self.has_contentwastruncated_ != x.has_contentwastruncated_: return 0
       
   599     if self.has_contentwastruncated_ and self.contentwastruncated_ != x.contentwastruncated_: return 0
       
   600     return 1
       
   601 
       
   602   def __eq__(self, other):
       
   603     return (other is not None) and (other.__class__ == self.__class__) and self.Equals(other)
       
   604 
       
   605   def __ne__(self, other):
       
   606     return not (self == other)
       
   607 
       
   608   def IsInitialized(self, debug_strs=None):
       
   609     initialized = 1
       
   610     if (not self.has_statuscode_):
       
   611       initialized = 0
       
   612       if debug_strs is not None:
       
   613         debug_strs.append('Required field: statuscode not set.')
       
   614     for i in xrange(len(self.header_)):
       
   615       if (not self.header_[i].IsInitialized(debug_strs)): initialized=0
       
   616     return initialized
       
   617 
       
   618   def ByteSize(self):
       
   619     n = 0
       
   620     if (self.has_content_): n += 1 + self.lengthString(len(self.content_))
       
   621     n += self.lengthVarInt64(self.statuscode_)
       
   622     n += 2 * len(self.header_)
       
   623     for i in xrange(len(self.header_)): n += self.header_[i].ByteSize()
       
   624     if (self.has_contentwastruncated_): n += 2
       
   625     return n + 1
       
   626 
       
   627   def Clear(self):
       
   628     self.clear_content()
       
   629     self.clear_statuscode()
       
   630     self.clear_header()
       
   631     self.clear_contentwastruncated()
       
   632 
       
   633   def OutputUnchecked(self, out):
       
   634     if (self.has_content_):
       
   635       out.putVarInt32(10)
       
   636       out.putPrefixedString(self.content_)
       
   637     out.putVarInt32(16)
       
   638     out.putVarInt32(self.statuscode_)
       
   639     for i in xrange(len(self.header_)):
       
   640       out.putVarInt32(27)
       
   641       self.header_[i].OutputUnchecked(out)
       
   642       out.putVarInt32(28)
       
   643     if (self.has_contentwastruncated_):
       
   644       out.putVarInt32(48)
       
   645       out.putBoolean(self.contentwastruncated_)
       
   646 
       
   647   def TryMerge(self, d):
       
   648     while d.avail() > 0:
       
   649       tt = d.getVarInt32()
       
   650       if tt == 10:
       
   651         self.set_content(d.getPrefixedString())
       
   652         continue
       
   653       if tt == 16:
       
   654         self.set_statuscode(d.getVarInt32())
       
   655         continue
       
   656       if tt == 27:
       
   657         self.add_header().TryMerge(d)
       
   658         continue
       
   659       if tt == 48:
       
   660         self.set_contentwastruncated(d.getBoolean())
       
   661         continue
       
   662       if (tt == 0): raise ProtocolBuffer.ProtocolBufferDecodeError
       
   663       d.skipData(tt)
       
   664 
       
   665 
       
   666   def __str__(self, prefix="", printElemNumber=0):
       
   667     res=""
       
   668     if self.has_content_: res+=prefix+("Content: %s\n" % self.DebugFormatString(self.content_))
       
   669     if self.has_statuscode_: res+=prefix+("StatusCode: %s\n" % self.DebugFormatInt32(self.statuscode_))
       
   670     cnt=0
       
   671     for e in self.header_:
       
   672       elm=""
       
   673       if printElemNumber: elm="(%d)" % cnt
       
   674       res+=prefix+("Header%s {\n" % elm)
       
   675       res+=e.__str__(prefix + "  ", printElemNumber)
       
   676       res+=prefix+"}\n"
       
   677       cnt+=1
       
   678     if self.has_contentwastruncated_: res+=prefix+("ContentWasTruncated: %s\n" % self.DebugFormatBool(self.contentwastruncated_))
       
   679     return res
       
   680 
       
   681   kContent = 1
       
   682   kStatusCode = 2
       
   683   kHeaderGroup = 3
       
   684   kHeaderKey = 4
       
   685   kHeaderValue = 5
       
   686   kContentWasTruncated = 6
       
   687 
       
   688   _TEXT = (
       
   689    "ErrorCode",
       
   690    "Content",
       
   691    "StatusCode",
       
   692    "Header",
       
   693    "Key",
       
   694    "Value",
       
   695    "ContentWasTruncated",
       
   696   )
       
   697 
       
   698   _TYPES = (
       
   699    ProtocolBuffer.Encoder.NUMERIC,
       
   700    ProtocolBuffer.Encoder.STRING,
       
   701 
       
   702    ProtocolBuffer.Encoder.NUMERIC,
       
   703 
       
   704    ProtocolBuffer.Encoder.STARTGROUP,
       
   705 
       
   706    ProtocolBuffer.Encoder.STRING,
       
   707 
       
   708    ProtocolBuffer.Encoder.STRING,
       
   709 
       
   710    ProtocolBuffer.Encoder.NUMERIC,
       
   711 
       
   712   )
       
   713 
       
   714   _STYLE = """"""
       
   715   _STYLE_CONTENT_TYPE = """"""
       
   716 
       
   717 __all__ = ['URLFetchServiceError','URLFetchRequest','URLFetchRequest_Header','URLFetchResponse','URLFetchResponse_Header']