# Path: prestans/exception.py
# class Base(Exception):
# class UnsupportedVocabularyError(Base):
# class UnsupportedContentTypeError(Base):
# class ValidationError(Base):
# class HandlerException(Base):
# class RequestException(HandlerException):
# class ResponseException(HandlerException):
# class UnimplementedVerbError(RequestException):
# class NoEndpointError(RequestException):
# class AuthenticationError(RequestException):
# class AuthorizationError(RequestException):
# class SerializationFailedError(RequestException):
# class DeSerializationFailedError(RequestException):
# class AttributeFilterDiffers(RequestException):
# class InconsistentPersistentDataError(Base):
# class DataValidationException(Base):
# class RequiredAttributeError(DataValidationException):
# class ParseFailedError(DataValidationException):
# class LessThanMinimumError(DataValidationException):
# class MoreThanMaximumError(DataValidationException):
# class InvalidChoiceError(DataValidationException):
# class MinimumLengthError(DataValidationException):
# class MaximumLengthError(DataValidationException):
# class InvalidTypeError(DataValidationException):
# class MissingParameterError(DataValidationException):
# class InvalidFormatError(DataValidationException):
# class InvalidMetaValueError(DataValidationException):
# class UnregisteredAdapterError(DataValidationException):
# class ServiceUnavailable(ResponseException):
# class BadRequest(ResponseException):
# class Conflict(ResponseException):
# class NotFound(ResponseException):
# class Unauthorized(ResponseException):
# class MovedPermanently(ResponseException):
# class Redirect(ResponseException):
# class TemporaryRedirect(Redirect):
# class PermanentRedirect(Redirect):
# class PaymentRequired(ResponseException):
# class Forbidden(ResponseException):
# class InternalServerError(ResponseException):
#     def __init__(self, http_status, message):
#     def http_status(self):
#     def http_status(self, value):
#     def stack_trace(self):
#     def push_trace(self, trace_object):
#     def message(self):
#     def __str__(self):
#     def __init__(self, accept_header, supported_types):
#     def __init__(self, requested_mime_type, content_type):
#     def __init__(self, message, attribute_name, value, blueprint):
#     def append_validation_trace(self, blueprint):
#     def __str__(self):
#     def __init__(self, code, message):
#     def request(self):
#     def request(self, value):
#     def log_message(self):
#     def __str__(self):
#     def __init__(self, code, message):
#     def __init__(self, code, message, response_model=None):
#     def response_model(self):
#     def __init__(self, verb_name):
#     def __init__(self):
#     def __init__(self, message=None):
#     def __init__(self, role_name):
#     def __init__(self, format):
#     def __init__(self, format):
#     def __init__(self, attribute_list):
#     def __init__(self, attribute_name, exception_message):
#     def __str__(self):
#     def __init__(self, message):
#     def __init__(self):
#     def __init__(self, message="Parser Failed"):
#     def __init__(self, value, allowed_min):
#     def __init__(self, value, allowed_max):
#     def __init__(self, value, allowed_choices):
#     def __init__(self, value, minimum):
#     def __init__(self, value, maximum):
#     def __init__(self, value, type_name):
#     def __init__(self):
#     def __init__(self, value):
#     def __init__(self):
#     def __init__(self, model_name):
#     def __init__(self, message="Service Unavailable", response_model=None):
#     def __init__(self, message="Bad Request", response_model=None):
#     def __init__(self, message="Conflict", response_model=None):
#     def __init__(self, message="Not Found", response_model=None):
#     def __init__(self, message="Unauthorized", response_model=None):
#     def __init__(self, message="Moved Permanently", response_model=None):
#     def __init__(self, code, url):
#     def url(self):
#     def __init__(self, url):
#     def __init__(self, url):
#     def __init__(self, message="Payment Required", response_model=None):
#     def __init__(self, message="Forbidden", response_model=None):
#     def __init__(self, message="Internal Server Error", response_model=None):
# 
# Path: prestans/types/base.py
# class DataCollection(DataType):
# 
#     def blueprint(self):
#         raise NotImplementedError
# 
#     def validate(self, value, attribute_filter=None, minified=False):
#         raise NotImplementedError
# 
#     def as_serializable(self, attribute_filter=None):
#         raise NotImplementedError
# 
#     def attribute_rewrite_map(self):
#         raise NotImplementedError
# 
#     def attribute_rewrite_reverse_map(self):
#         raise NotImplementedError
# 
#     def get_attribute_filter(self, default_value=False):
#         raise NotImplementedError


import sys
        import json
        import plistlib
from prestans import exception
from prestans.types import DataCollection
    def handler_body_type(self):
        return DataCollection

    def content_type(self):
        return 'application/json'


class XMLPlist(Base):
    """
    Uses Apple's Property List format to serialize collections to XML.

    Refer to:
     - https://docs.python.org/2/library/plistlib.html
     - https://docs.python.org/3/library/plistlib.html
    """

    def dumps(self, serializable_object):


        try:
            if sys.version_info < (3,):
                plist_str = plistlib.writePlistToString(serializable_object)
            else:
                plist_str = plistlib.dumps(serializable_object)
        except Exception as exp:
            raise exception.SerializationFailedError("XMLPlist: %s" % exp)

        return plist_str

    def handler_body_type(self):

# Path: prestans/exception.py
# class Base(Exception):
# class UnsupportedVocabularyError(Base):
# class UnsupportedContentTypeError(Base):
# class ValidationError(Base):
# class HandlerException(Base):
# class RequestException(HandlerException):
# class ResponseException(HandlerException):
# class UnimplementedVerbError(RequestException):
# class NoEndpointError(RequestException):
# class AuthenticationError(RequestException):
# class AuthorizationError(RequestException):
# class SerializationFailedError(RequestException):
# class DeSerializationFailedError(RequestException):
# class AttributeFilterDiffers(RequestException):
# class InconsistentPersistentDataError(Base):
# class DataValidationException(Base):
# class RequiredAttributeError(DataValidationException):
# class ParseFailedError(DataValidationException):
# class LessThanMinimumError(DataValidationException):
# class MoreThanMaximumError(DataValidationException):
# class InvalidChoiceError(DataValidationException):
# class MinimumLengthError(DataValidationException):
# class MaximumLengthError(DataValidationException):
# class InvalidTypeError(DataValidationException):
# class MissingParameterError(DataValidationException):
# class InvalidFormatError(DataValidationException):
# class InvalidMetaValueError(DataValidationException):
# class UnregisteredAdapterError(DataValidationException):
# class ServiceUnavailable(ResponseException):
# class BadRequest(ResponseException):
# class Conflict(ResponseException):
# class NotFound(ResponseException):
# class Unauthorized(ResponseException):
# class MovedPermanently(ResponseException):
# class Redirect(ResponseException):
# class TemporaryRedirect(Redirect):
# class PermanentRedirect(Redirect):
# class PaymentRequired(ResponseException):
# class Forbidden(ResponseException):
# class InternalServerError(ResponseException):
#     def __init__(self, http_status, message):
#     def http_status(self):
#     def http_status(self, value):
#     def stack_trace(self):
#     def push_trace(self, trace_object):
#     def message(self):
#     def __str__(self):
#     def __init__(self, accept_header, supported_types):
#     def __init__(self, requested_mime_type, content_type):
#     def __init__(self, message, attribute_name, value, blueprint):
#     def append_validation_trace(self, blueprint):
#     def __str__(self):
#     def __init__(self, code, message):
#     def request(self):
#     def request(self, value):
#     def log_message(self):
#     def __str__(self):
#     def __init__(self, code, message):
#     def __init__(self, code, message, response_model=None):
#     def response_model(self):
#     def __init__(self, verb_name):
#     def __init__(self):
#     def __init__(self, message=None):
#     def __init__(self, role_name):
#     def __init__(self, format):
#     def __init__(self, format):
#     def __init__(self, attribute_list):
#     def __init__(self, attribute_name, exception_message):
#     def __str__(self):
#     def __init__(self, message):
#     def __init__(self):
#     def __init__(self, message="Parser Failed"):
#     def __init__(self, value, allowed_min):
#     def __init__(self, value, allowed_max):
#     def __init__(self, value, allowed_choices):
#     def __init__(self, value, minimum):
#     def __init__(self, value, maximum):
#     def __init__(self, value, type_name):
#     def __init__(self):
#     def __init__(self, value):
#     def __init__(self):
#     def __init__(self, model_name):
#     def __init__(self, message="Service Unavailable", response_model=None):
#     def __init__(self, message="Bad Request", response_model=None):
#     def __init__(self, message="Conflict", response_model=None):
#     def __init__(self, message="Not Found", response_model=None):
#     def __init__(self, message="Unauthorized", response_model=None):
#     def __init__(self, message="Moved Permanently", response_model=None):
#     def __init__(self, code, url):
#     def url(self):
#     def __init__(self, url):
#     def __init__(self, url):
#     def __init__(self, message="Payment Required", response_model=None):
#     def __init__(self, message="Forbidden", response_model=None):
#     def __init__(self, message="Internal Server Error", response_model=None):
# 
# Path: prestans/types/base.py
# class DataCollection(DataType):
# 
#     def blueprint(self):
#         raise NotImplementedError
# 
#     def validate(self, value, attribute_filter=None, minified=False):
#         raise NotImplementedError
# 
#     def as_serializable(self, attribute_filter=None):
#         raise NotImplementedError
# 
#     def attribute_rewrite_map(self):
#         raise NotImplementedError
# 
#     def attribute_rewrite_reverse_map(self):
#         raise NotImplementedError
# 
#     def get_attribute_filter(self, default_value=False):
#         raise NotImplementedError


# Path: prestans/serializer.py
import sys
        import json
        import plistlib
from prestans import exception
from prestans.types import DataCollection

    def handler_body_type(self):
        return DataCollection

    def content_type(self):
        return 'application/json'


class XMLPlist(Base):
    """
    Uses Apple's Property List format to serialize collections to XML.

    Refer to:
     - https://docs.python.org/2/library/plistlib.html
     - https://docs.python.org/3/library/plistlib.html
    """

    def dumps(self, serializable_object):


        try:
            if sys.version_info < (3,):
                plist_str = plistlib.writePlistToString(serializable_object)
            else:
                plist_str = plistlib.dumps(serializable_object)
        except Exception as exp:
            raise exception.SerializationFailedError("XMLPlist: %s" % exp)

        return plist_str

    def handler_body_type(self):

        return DataCollection