# Path: prestans/types/binary_response.py
# class BinaryResponse(object):
#     """
#     Body Response Template to transfer binary files.
#     """
# 
#     def __init__(self, mime_type=None, file_name=None, as_attachment=True, contents=None):
# 
#         self.mime_type = mime_type
#         self.file_name = file_name
# 
#         self._as_attachment = as_attachment
#         self._contents = contents
# 
#     @property
#     def mime_type(self):
#         return self._mime_type
# 
#     @mime_type.setter
#     def mime_type(self, value):
#         self._mime_type = value
# 
#     @property
#     def file_name(self):
#         return self._file_name
# 
#     @file_name.setter
#     def file_name(self, value):
#         self._file_name = value
# 
#     @property
#     def as_attachment(self):
#         return self._as_attachment
# 
#     @as_attachment.setter
#     def as_attachment(self, value):
#         self._as_attachment = value
# 
#     @property
#     def contents(self):
#         return self._contents
# 
#     @contents.setter
#     def contents(self, value):
#         self._contents = value
# 
#     @property
#     def content_length(self):
#         if self._contents is None:
#             return 0
#         return len(self._contents)
# 
#     def validate(self):
#         return self._mime_type is not None and \
#                self._file_name is not None and \
#                self.content_length > 0
# 
# 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


from prestans.types import BinaryResponse
from prestans.types import DataCollection
        from prestans.parser import AttributeFilter
        from prestans.parser import ParameterSet
            raise TypeError("response_template of type %s must be an instance of \
                a prestans.types.DataCollection subclass" % response_template.__class__.__name__)

        if response_template is not None and isinstance(response_template, DataCollection):
            self.response_attribute_filter_template = AttributeFilter.from_model(
                model_instance=response_template,
                default_value=response_attribute_filter_default_value
            )
        else:
            self.response_attribute_filter_template = None

        self._response_template = response_template

        # turn parameter_sets single object into a list
        if parameter_sets is not None and not isinstance(parameter_sets, list):
            parameter_sets = [parameter_sets]

        # check that all parameter sets are of valid type
        if isinstance(parameter_sets, list):
            for parameter_set in parameter_sets:
                if not isinstance(parameter_set, ParameterSet):
                    raise TypeError("parameter_set of type %s must be an instance of \
                    prestans.parser.ParameterSet" % parameter_set.__class__.__name__)

            self._parameter_sets = parameter_sets
        else:
            self._parameter_sets = list()

        # body_template
        if body_template is not None and not \

# Path: prestans/types/binary_response.py
# class BinaryResponse(object):
#     """
#     Body Response Template to transfer binary files.
#     """
# 
#     def __init__(self, mime_type=None, file_name=None, as_attachment=True, contents=None):
# 
#         self.mime_type = mime_type
#         self.file_name = file_name
# 
#         self._as_attachment = as_attachment
#         self._contents = contents
# 
#     @property
#     def mime_type(self):
#         return self._mime_type
# 
#     @mime_type.setter
#     def mime_type(self, value):
#         self._mime_type = value
# 
#     @property
#     def file_name(self):
#         return self._file_name
# 
#     @file_name.setter
#     def file_name(self, value):
#         self._file_name = value
# 
#     @property
#     def as_attachment(self):
#         return self._as_attachment
# 
#     @as_attachment.setter
#     def as_attachment(self, value):
#         self._as_attachment = value
# 
#     @property
#     def contents(self):
#         return self._contents
# 
#     @contents.setter
#     def contents(self, value):
#         self._contents = value
# 
#     @property
#     def content_length(self):
#         if self._contents is None:
#             return 0
#         return len(self._contents)
# 
#     def validate(self):
#         return self._mime_type is not None and \
#                self._file_name is not None and \
#                self.content_length > 0
# 
# 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/parser/verb_config.py
from prestans.types import BinaryResponse
from prestans.types import DataCollection
        from prestans.parser import AttributeFilter
        from prestans.parser import ParameterSet

            raise TypeError("response_template of type %s must be an instance of \
                a prestans.types.DataCollection subclass" % response_template.__class__.__name__)

        if response_template is not None and isinstance(response_template, DataCollection):
            self.response_attribute_filter_template = AttributeFilter.from_model(
                model_instance=response_template,
                default_value=response_attribute_filter_default_value
            )
        else:
            self.response_attribute_filter_template = None

        self._response_template = response_template

        # turn parameter_sets single object into a list
        if parameter_sets is not None and not isinstance(parameter_sets, list):
            parameter_sets = [parameter_sets]

        # check that all parameter sets are of valid type
        if isinstance(parameter_sets, list):
            for parameter_set in parameter_sets:
                if not isinstance(parameter_set, ParameterSet):
                    raise TypeError("parameter_set of type %s must be an instance of \
                    prestans.parser.ParameterSet" % parameter_set.__class__.__name__)

            self._parameter_sets = parameter_sets
        else:
            self._parameter_sets = list()

        # body_template
        if body_template is not None and not \

                isinstance(body_template, DataCollection):