Submit
Path:
~
/
/
usr
/
lib
/
python2.7
/
site-packages
/
botocore
/
File Content:
serialize.pyc
� ?��Xc @ s� d Z d d l Z d d l Z d d l m Z d d l Z d d l m Z d d l m Z m Z d d l m Z d d l m Z d d l m Z d d l m Z d Z d Z d Z e d � Z d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e e f d � � YZ d e f d � � YZ i e d 6e d 6e d 6e d 6e d 6Z d S(! s� Protocol input serializes. This module contains classes that implement input serialization for the various AWS protocol types. These classes essentially take user input, a model object that represents what the expected input should look like, and it returns a dictionary that contains the various parts of a request. A few high level design decisions: * Each protocol type maps to a separate class, all inherit from ``Serializer``. * The return value for ``serialize_to_request`` (the main entry point) returns a dictionary that represents a request. This will have keys like ``url_path``, ``query_string``, etc. This is done so that it's a) easy to test and b) not tied to a particular HTTP library. See the ``serialize_to_request`` docstring for more details. Unicode ------- The input to the serializers should be text (str/unicode), not bytes, with the exception of blob types. Those are assumed to be binary, and if a str/unicode type is passed in, it will be encoded as utf-8. i����N( t ElementTree( t six( t jsont formatdate( t parse_to_aware_datetime( t percent_encode( t is_json_value_header( t validatet iso8601s %Y-%m-%dT%H:%M:%SZs %Y-%m-%dT%H:%M:%S.%fZc C s8 t | � } | r4 t j � } t j | | � } n | S( N( t SERIALIZERSR t ParamValidatort ParamValidationDecorator( t protocol_namet include_validationt serializert validator( ( s4 /tmp/pip-build-uEGWVr/botocore/botocore/serialize.pyt create_serializer= s t Serializerc B sb e Z d Z e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( t POSTs utf-8c C s t d � � d S( s� Serialize parameters into an HTTP request. This method takes user provided parameters and a shape model and serializes the parameters to an HTTP request. More specifically, this method returns information about parts of the HTTP request, it does not enforce a particular interface or standard for an HTTP request. It instead returns a dictionary of: * 'url_path' * 'query_string' * 'headers' * 'body' * 'method' It is then up to consumers to decide how to map this to a Request object of their HTTP library of choice. Below is an example return value:: {'body': {'Action': 'OperationName', 'Bar': 'val2', 'Foo': 'val1', 'Version': '2014-01-01'}, 'headers': {}, 'method': 'POST', 'query_string': '', 'url_path': '/'} :param parameters: The dictionary input parameters for the operation (i.e the user input). :param operation_model: The OperationModel object that describes the operation. t serialize_to_requestN( t NotImplementedError( t selft parameterst operation_model( ( s4 /tmp/pip-build-uEGWVr/botocore/botocore/serialize.pyR O s "c C s0 i d d 6d d 6| j d 6i d 6d d 6} | S( Nt /t url_patht t query_stringt methodt headerst body( t DEFAULT_METHOD( R t serialized( ( s4 /tmp/pip-build-uEGWVr/botocore/botocore/serialize.pyt _create_default_requests s c C s+ | j d k r t } n t } | j | � S( Ni ( t microsecondt ISO8601_MICROt ISO8601t strftime( R t valuet timestamp_format( ( s4 /tmp/pip-build-uEGWVr/botocore/botocore/serialize.pyt _timestamp_iso8601� s c C s t t j | j � � � S( N( t intt calendart timegmt timetuple( R R&