def __init__(self, doc):
    '\n        Initialize from a database document.\n\n        :param dict doc: A database document.\n        '
    self._max_cost = doc.get('max_cost')
    self._max_duration = doc.get('max_duration')
    self._max_items = doc.get('max_items')
    if ((self._max_duration is not None) and (self._max_duration < 0)):
        _invalid('Max duration must be ≥0')
    if ((self._max_items is not None) and (self._max_items < 0)):
        _invalid('Max items must be ≥0')
Initialize from a database document.

:param dict doc: A database document.
def __init__(self, doc):
    '\n        Initialize from a database document.\n\n        :param dict doc: A database document.\n        '
    self._max_cost = doc.get('max_cost')
    self._max_duration = doc.get('max_duration')
    self._max_items = doc.get('max_items')
    if ((self._max_duration is not None) and (self._max_duration < 0)):
        _invalid('Max duration must be ≥0')
    if ((self._max_items is not None) and (self._max_items < 0)):
        _invalid('Max items must be ≥0')