# Path: cdrouter/cdr_datetime.py
# class DateTime(fields.DateTime):
#     def __init__(self, format=None, **kwargs):
#         super(DateTime, self).__init__(format=format, **kwargs)
#         
#     def _serialize(self, value, attr, obj):
#         try:
#             return super(DateTime, self)._serialize(value, attr, obj)
#         except ValidationError:
#             return datetime.min
# 
#     def _deserialize(self, value, attr, data):
#         try:
#             return super(DateTime, self)._deserialize(value, attr, data)
#         except ValidationError:
#             return datetime.min


import collections
from functools import partial
from marshmallow import Schema, fields, post_load
from .cdr_datetime import DateTime
    :param description: (optional) Test description as string.
    :param skip_name: (optional) Skip name for TestResult as string.
    :param skip_reason: (optional) Skip reason for TestResult as string.
    :param log: (optional) Logfile path for TestResult as string.
    :param note: (optional) Note for TestResult as string.
    """
    def __init__(self, **kwargs):
        self.id = kwargs.get('id', None)
        self.seq = kwargs.get('seq', None)
        self.loop = kwargs.get('loop', None)
        self.result = kwargs.get('result', None)
        self.alerts = kwargs.get('alerts', None)
        self.retries = kwargs.get('retries', None)
        self.started = kwargs.get('started', None)
        self.duration = kwargs.get('duration', None)
        self.flagged = kwargs.get('flagged', None)
        self.name = kwargs.get('name', None)
        self.description = kwargs.get('description', None)
        self.skip_name = kwargs.get('skip_name', None)
        self.skip_reason = kwargs.get('skip_reason', None)
        self.log = kwargs.get('log', None)
        self.note = kwargs.get('note', None)

class TestResultSchema(Schema):
    id = fields.Int(as_string=True)
    seq = fields.Int(as_string=True)
    loop = fields.Int(as_string=True)
    result = fields.Str()
    alerts = fields.Int()
    retries = fields.Int()

# Path: cdrouter/cdr_datetime.py
# class DateTime(fields.DateTime):
#     def __init__(self, format=None, **kwargs):
#         super(DateTime, self).__init__(format=format, **kwargs)
#         
#     def _serialize(self, value, attr, obj):
#         try:
#             return super(DateTime, self)._serialize(value, attr, obj)
#         except ValidationError:
#             return datetime.min
# 
#     def _deserialize(self, value, attr, data):
#         try:
#             return super(DateTime, self)._deserialize(value, attr, data)
#         except ValidationError:
#             return datetime.min


# Path: cdrouter/testresults.py
import collections
from functools import partial
from marshmallow import Schema, fields, post_load
from .cdr_datetime import DateTime

    :param description: (optional) Test description as string.
    :param skip_name: (optional) Skip name for TestResult as string.
    :param skip_reason: (optional) Skip reason for TestResult as string.
    :param log: (optional) Logfile path for TestResult as string.
    :param note: (optional) Note for TestResult as string.
    """
    def __init__(self, **kwargs):
        self.id = kwargs.get('id', None)
        self.seq = kwargs.get('seq', None)
        self.loop = kwargs.get('loop', None)
        self.result = kwargs.get('result', None)
        self.alerts = kwargs.get('alerts', None)
        self.retries = kwargs.get('retries', None)
        self.started = kwargs.get('started', None)
        self.duration = kwargs.get('duration', None)
        self.flagged = kwargs.get('flagged', None)
        self.name = kwargs.get('name', None)
        self.description = kwargs.get('description', None)
        self.skip_name = kwargs.get('skip_name', None)
        self.skip_reason = kwargs.get('skip_reason', None)
        self.log = kwargs.get('log', None)
        self.note = kwargs.get('note', None)

class TestResultSchema(Schema):
    id = fields.Int(as_string=True)
    seq = fields.Int(as_string=True)
    loop = fields.Int(as_string=True)
    result = fields.Str()
    alerts = fields.Int()
    retries = fields.Int()

    started = DateTime()