# 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 marshmallow import Schema, fields, post_load
from .cdr_datetime import DateTime
    """
    def __init__(self, **kwargs):
        self.id = kwargs.get('id', None)
        self.status = kwargs.get('status', None)
        self.options = kwargs.get('options', None)
        self.package_id = kwargs.get('package_id', None)
        self.package_name = kwargs.get('package_name', None)
        self.config_id = kwargs.get('config_id', None)
        self.config_name = kwargs.get('config_name', None)
        self.device_id = kwargs.get('device_id', None)
        self.device_name = kwargs.get('device_name', None)
        self.result_id = kwargs.get('result_id', None)
        self.user_id = kwargs.get('user_id', None)
        self.created = kwargs.get('created', None)
        self.updated = kwargs.get('updated', None)
        self.automatic = kwargs.get('automatic', None)
        self.run_at = kwargs.get('run_at', None)

class JobSchema(Schema):
    id = fields.Int(as_string=True)
    status = fields.Str()
    options = fields.Nested(OptionsSchema)
    package_id = fields.Int(as_string=True)
    package_name = fields.Str()
    config_id = fields.Int(as_string=True)
    config_name = fields.Str()
    device_id = fields.Int(as_string=True)
    device_name = fields.Str()
    result_id = fields.Int(as_string=True, missing=None)
    user_id = fields.Int(as_string=True)

# 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/jobs.py
import collections
from marshmallow import Schema, fields, post_load
from .cdr_datetime import DateTime

    """
    def __init__(self, **kwargs):
        self.id = kwargs.get('id', None)
        self.status = kwargs.get('status', None)
        self.options = kwargs.get('options', None)
        self.package_id = kwargs.get('package_id', None)
        self.package_name = kwargs.get('package_name', None)
        self.config_id = kwargs.get('config_id', None)
        self.config_name = kwargs.get('config_name', None)
        self.device_id = kwargs.get('device_id', None)
        self.device_name = kwargs.get('device_name', None)
        self.result_id = kwargs.get('result_id', None)
        self.user_id = kwargs.get('user_id', None)
        self.created = kwargs.get('created', None)
        self.updated = kwargs.get('updated', None)
        self.automatic = kwargs.get('automatic', None)
        self.run_at = kwargs.get('run_at', None)

class JobSchema(Schema):
    id = fields.Int(as_string=True)
    status = fields.Str()
    options = fields.Nested(OptionsSchema)
    package_id = fields.Int(as_string=True)
    package_name = fields.Str()
    config_id = fields.Int(as_string=True)
    config_name = fields.Str()
    device_id = fields.Int(as_string=True)
    device_name = fields.Str()
    result_id = fields.Int(as_string=True, missing=None)
    user_id = fields.Int(as_string=True)

    created = DateTime()