Ñò ›ˆQc @sdZddkZddkZddkZddklZddklZeiZei de dƒd„Z de fd „ƒYZ d e fd „ƒYZd efd „ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„ZdS(säModel objects for requests and responses. Each API may support one or more serializations, such as JSON, Atom, etc. The model classes are responsible for converting between the wire format and the Python object representation. iÿÿÿÿN(t HttpError(t simplejsontdump_request_responses-Dump all http server requests and responses. cCstdƒ‚dS(Ns"You need to override this function(tNotImplementedError(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyt _abstract)stModelcBs eZdZd„Zd„ZRS(s¼Model base class. All Model classes should implement this interface. The Model serializes and de-serializes between a wire format such as JSON and a Python object representation. cCs tƒdS(sxUpdates outgoing requests with a serialized body. Args: headers: dict, request headers path_params: dict, parameters that appear in the request path query_params: dict, parameters that appear in the query body_value: object, the request body as a Python object, which must be serializable. Returns: A tuple of (headers, path_params, query, body) headers: dict, request headers path_params: dict, parameters that appear in the request path query: string, query part of the request URI body: string, the body serialized in the desired wire format. N(R(tselftheaderst path_paramst query_paramst body_value((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pytrequest5scCs tƒdS(sOConvert the response wire format into a Python object. Args: resp: httplib2.Response, the HTTP response headers and status content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. Raises: apiclient.errors.HttpError if a non 2xx response is received. N(R(Rtresptcontent((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pytresponseHs (t__name__t __module__t__doc__R R(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR-s t BaseModelcBseeZdZdZdZdZdZd„Zd„Z d„Z d„Z d„Z d„Z d„ZRS( sèBase model class. Subclasses should provide implementations for the "serialize" and "deserialize" methods, as well as values for the following class attributes. Attributes: accept: The value to use for the HTTP Accept header. content_type: The value to use for the HTTP Content-type header. no_content_response: The value to return when deserializing a 204 "No Content" response. alt_param: The value to supply as the "alt" query parameter for requests. cCsàtioÒtidƒtidƒx-|iƒD]\}}tid||ƒq1Wtidƒtidƒx-|iƒD]\}}tid||ƒq{Wtidƒtid|ƒtid|ƒtid ƒnd S( s:Logs debugging information about the request if requested.s--request-start--s-headers-start-s%s: %ss -headers-end-s-path-parameters-start-s-path-parameters-end-sbody: %ss query: %ss--request-end--N(tFLAGSRtloggingtinfot iteritems(RRRtquerytbodythtv((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyt _log_requestks        cCs´|i|ƒ}|i|dt|dtƒo#t |iƒo|idƒ}n|i||fƒq>Wdt i |ƒS(s¨Builds a query string. Args: params: dict, the query parameters Returns: The query parameters properly encoded into an HTTP URI query string. taltsutf-8tencodet?N( t alt_paramR tupdateRttypeR$tappendtgetattrtFalsetcallableturllibt urlencode(Rtparamstastuplestkeytvaluetx((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR›s  #cCsttioftidƒx-|iƒD]\}}tid||ƒq$W|oti|ƒntidƒndS(s;Logs debugging information about the response if requested.s--response-start--s%s: %ss--response-end--N(RRRRR(RR R RR((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyt _log_response²s   cCsj|i||ƒ|idjo&|idjo|iS|i|ƒStid|ƒt||ƒ‚dS(sOConvert the response wire format into a Python object. Args: resp: httplib2.Response, the HTTP response headers and status content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. Raises: apiclient.errors.HttpError if a non 2xx response is received. i,iÌs Content from bad request was: %sN(R4tstatustno_content_responset deserializeRtdebugR(RR R ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR¼s cCs tƒdS(s·Perform the actual Python object serialization. Args: body_value: object, the request body as a Python object. Returns: string, the body in serialized form. N(R(RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR"Ös cCs tƒdS(sÑPerform the actual deserialization from response string to Python object. Args: content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. N(R(RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR7ás N(RRRR RR!R6R&RR RR4RR"R7(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyRXs     t JsonModelcBsMeZdZdZdZdZed„Zd„Zd„Z e d„ƒZ RS(s‘Model class for JSON. Serializes and de-serializes between JSON and the Python object representation of HTTP request and response bodies. sapplication/jsontjsoncCs ||_dS(sqConstruct a JsonModel. Args: data_wrapper: boolean, wrap requests and responses in a data wrapper N(t _data_wrapper(Rt data_wrapper((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyt__init__øscCsEt|tƒo(d|jo|ioh|d6}nti|ƒS(Ntdata(t isinstancetdictR;Rtdumps(RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR"s cCs>ti|ƒ}t|tƒod|jo|d}n|S(NR>(RtloadsR?R@(RR R((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR7scCshS(N((R((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR6 s( RRRRR!R&R+R=R"R7tpropertyR6(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR9îs   tRawModelcBs8eZdZdZdZdZd„Zed„ƒZ RS(sÊModel class for requests that don't return JSON. Serializes and de-serializes between JSON and the Python object representation of HTTP request, and returns the raw bytes of the response body. s*/*sapplication/jsoncCs|S(N((RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR7scCsdS(NR((R((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR6sN( RRRRR!R R&R7RCR6(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyRDs  t MediaModelcBs8eZdZdZdZdZd„Zed„ƒZRS(sÅModel class for requests that return Media. Serializes and de-serializes between JSON and the Python object representation of HTTP request, and returns the raw bytes of the response body. s*/*sapplication/jsontmediacCs|S(N((RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR7/scCsdS(NR((R((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR62s( RRRRR!R&R7RCR6(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyRE$s  tProtocolBufferModelcBsJeZdZdZdZdZd„Zd„Zd„Ze d„ƒZ RS(sModel class for protocol buffers. Serializes and de-serializes the binary protocol buffer sent in the HTTP request and response bodies. sapplication/x-protobuftprotocCs ||_dS(sConstructs a ProtocolBufferModel. The serialzed protocol buffer returned in an HTTP response will be de-serialized using the given protocol buffer class. Args: protocol_buffer: The protocol buffer class used to de-serialize a response from the API. N(t_protocol_buffer(Rtprotocol_buffer((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR=As cCs |iƒS(N(tSerializeToString(RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR"MscCs|ii|ƒS(N(RIt FromString(RR ((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR7PscCs |iƒS(N(RI(R((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyR6Ss( RRRRR!R&R=R"R7RCR6(((s`/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/model.pyRG7s  cCsÏh}x’|iƒD]„\}}|i|dƒ}|djod||t|ƒthƒjot||ƒ||s       +–#!