# Path: tincan/base.py
# class Base(object):
#     _props = []
# 
#     def __init__(self, *args, **kwargs):
#         """Initializes an object by checking the provided arguments
#         against lists defined in the individual class. If required
#         properties are defined, this method will set them to None by default.
#         Optional properties will be ignored if they are not provided. The
#         class may provide custom setters for properties, in which case those
#         setters (see __setattr__ below).
# 
#         """
#         if hasattr(self, '_props_req') and self._props_req:
#             list(map(lambda k: setattr(self, k, None), self._props_req))
# 
#         new_kwargs = {}
#         for obj in args:
#             new_kwargs.update(obj if isinstance(obj, dict) else vars(obj))
# 
#         new_kwargs.update(kwargs)
# 
#         for key, value in new_kwargs.items():
#             setattr(self, key, value)
# 
#     def __setattr__(self, attr, value):
#         """Makes sure that only allowed properties are set. This method will
#         call the proper attribute setter as defined in the class to provide
#         additional error checking
# 
#         :param attr: the attribute being set
#         :type attr: str
#         :param value: the value to set
# 
#         """
#         if attr.startswith('_') and attr[1:] in self._props:
#             super(Base, self).__setattr__(attr, value)
#         elif attr not in self._props:
#             raise AttributeError(
#                 f"Property '{attr}' cannot be set on a 'tincan.{self.__class__.__name__}' object."
#                 f"Allowed properties: {', '.join(self._props)}"
#             )
#         else:
#             super(Base, self).__setattr__(attr, value)
# 
#     def __eq__(self, other):
#         return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
# 
# Path: tincan/conversions/iso8601.py
# def make_datetime(value):
#     """Tries to convert the given value to a :class:`datetime.datetime`. If
#     no timezone is given, raises a ValueError.
# 
#     Strings will be parsed as ISO 8601 timestamps.
# 
#     If a number is provided, it will be interpreted as a UNIX
#     timestamp, which by definition is UTC.
# 
#     If a `dict` is provided, does `datetime.datetime(**value)`.
# 
#     If a `tuple` or a `list` is provided, does
#     `datetime.datetime(*value)`. Uses the timezone in the tuple or
#     list if provided.
# 
#     :param value: something to convert
#     :type value: str | unicode | float | int | :class:`datetime.datetime` | dict | list | tuple
#     :return: the value after conversion
#     :rtype: :class:`datetime.datetime`
#     :raises: ValueError | TypeError
# 
#     """
#     result = _make_datetime(value)
#     if not result.tzinfo:
#         raise ValueError(
#             f"value was a timestamp, but no timezone was set! "
#             f"Value was a '{value.__class__.__name__}' object: {repr(value)}"
#             f"\n\n"
#             f"Converted to naive 'datetime.datetime' object: {repr(result)}"
#         )
# 
#     return result


import datetime
from tincan.base import Base
from tincan.conversions.iso8601 import make_datetime
    def timestamp(self):
        """The Document timestamp.

        :setter: Tries to convert to :class:`datetime.datetime`. If
        no timezone is given, makes a naive `datetime.datetime`.

        Strings will be parsed as ISO 8601 timestamps.

        If a number is provided, it will be interpreted as a UNIX
        timestamp, which by definition is UTC.

        If a `dict` is provided, does `datetime.datetime(**value)`.

        If a `tuple` or a `list` is provided, does
        `datetime.datetime(*value)`. Uses the timezone in the tuple or
        list if provided.

        :setter type: :class:`datetime.datetime` | unicode | str | int | float | dict | tuple | None
        :rtype: :class:`datetime.datetime`

        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, value):
        if value is None:
            self._timestamp = value
            return

        try:

# Path: tincan/base.py
# class Base(object):
#     _props = []
# 
#     def __init__(self, *args, **kwargs):
#         """Initializes an object by checking the provided arguments
#         against lists defined in the individual class. If required
#         properties are defined, this method will set them to None by default.
#         Optional properties will be ignored if they are not provided. The
#         class may provide custom setters for properties, in which case those
#         setters (see __setattr__ below).
# 
#         """
#         if hasattr(self, '_props_req') and self._props_req:
#             list(map(lambda k: setattr(self, k, None), self._props_req))
# 
#         new_kwargs = {}
#         for obj in args:
#             new_kwargs.update(obj if isinstance(obj, dict) else vars(obj))
# 
#         new_kwargs.update(kwargs)
# 
#         for key, value in new_kwargs.items():
#             setattr(self, key, value)
# 
#     def __setattr__(self, attr, value):
#         """Makes sure that only allowed properties are set. This method will
#         call the proper attribute setter as defined in the class to provide
#         additional error checking
# 
#         :param attr: the attribute being set
#         :type attr: str
#         :param value: the value to set
# 
#         """
#         if attr.startswith('_') and attr[1:] in self._props:
#             super(Base, self).__setattr__(attr, value)
#         elif attr not in self._props:
#             raise AttributeError(
#                 f"Property '{attr}' cannot be set on a 'tincan.{self.__class__.__name__}' object."
#                 f"Allowed properties: {', '.join(self._props)}"
#             )
#         else:
#             super(Base, self).__setattr__(attr, value)
# 
#     def __eq__(self, other):
#         return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
# 
# Path: tincan/conversions/iso8601.py
# def make_datetime(value):
#     """Tries to convert the given value to a :class:`datetime.datetime`. If
#     no timezone is given, raises a ValueError.
# 
#     Strings will be parsed as ISO 8601 timestamps.
# 
#     If a number is provided, it will be interpreted as a UNIX
#     timestamp, which by definition is UTC.
# 
#     If a `dict` is provided, does `datetime.datetime(**value)`.
# 
#     If a `tuple` or a `list` is provided, does
#     `datetime.datetime(*value)`. Uses the timezone in the tuple or
#     list if provided.
# 
#     :param value: something to convert
#     :type value: str | unicode | float | int | :class:`datetime.datetime` | dict | list | tuple
#     :return: the value after conversion
#     :rtype: :class:`datetime.datetime`
#     :raises: ValueError | TypeError
# 
#     """
#     result = _make_datetime(value)
#     if not result.tzinfo:
#         raise ValueError(
#             f"value was a timestamp, but no timezone was set! "
#             f"Value was a '{value.__class__.__name__}' object: {repr(value)}"
#             f"\n\n"
#             f"Converted to naive 'datetime.datetime' object: {repr(result)}"
#         )
# 
#     return result


# Path: tincan/documents/document.py
import datetime
from tincan.base import Base
from tincan.conversions.iso8601 import make_datetime

    def timestamp(self):
        """The Document timestamp.

        :setter: Tries to convert to :class:`datetime.datetime`. If
        no timezone is given, makes a naive `datetime.datetime`.

        Strings will be parsed as ISO 8601 timestamps.

        If a number is provided, it will be interpreted as a UNIX
        timestamp, which by definition is UTC.

        If a `dict` is provided, does `datetime.datetime(**value)`.

        If a `tuple` or a `list` is provided, does
        `datetime.datetime(*value)`. Uses the timezone in the tuple or
        list if provided.

        :setter type: :class:`datetime.datetime` | unicode | str | int | float | dict | tuple | None
        :rtype: :class:`datetime.datetime`

        """
        return self._timestamp

    @timestamp.setter
    def timestamp(self, value):
        if value is None:
            self._timestamp = value
            return

        try:

            self._timestamp = make_datetime(value)