# Path: quads/helpers.py
# def param_check(data, params, defaults={}):
#     result = []
#     # set defaults
#     for k, v in defaults.items():
#         data.setdefault(k, v)
# 
#     if data:
#         # check for missing params
#         for param in params:
#             if param not in data:
#                 result.append("Missing required parameter: %s" % param)
#             elif not data[param]:
#                 result.append("Could not parse %s parameter" % param)
#             elif data[param] == "None":
#                 data[param] = None
#             if param == "_id":
#                 data["_id"] = ObjectIdField(data[param])
# 
#     return result, data


import datetime
import ipaddress
import os
from mongoengine import (
    connect,
    Document,
    EmbeddedDocument,
    queryset_manager,
    Q,
    StringField,
    BooleanField,
    ListField,
    ReferenceField,
    DateTimeField,
    SequenceField,
    IntField,
    LongField,
    EmbeddedDocumentField,
)
from quads.helpers import param_check
            fields.remove("vlan")

        result, data = param_check(data, fields)

        return result, data


class Notification(Document):
    cloud = ReferenceField(Cloud)
    ticket = StringField()
    fail = BooleanField(default=False)
    success = BooleanField(default=False)
    initial = BooleanField(default=False)
    pre_initial = BooleanField(default=False)
    pre = BooleanField(default=False)
    one_day = BooleanField(default=False)
    three_days = BooleanField(default=False)
    five_days = BooleanField(default=False)
    seven_days = BooleanField(default=False)


class Disk(EmbeddedDocument):
    disk_type = StringField()
    size_gb = LongField()
    count = IntField()
    meta = {"strict": False}

    @staticmethod
    def prep_data(data):
        _fields = ["disk_type", "size_gb", "count"]

# Path: quads/helpers.py
# def param_check(data, params, defaults={}):
#     result = []
#     # set defaults
#     for k, v in defaults.items():
#         data.setdefault(k, v)
# 
#     if data:
#         # check for missing params
#         for param in params:
#             if param not in data:
#                 result.append("Missing required parameter: %s" % param)
#             elif not data[param]:
#                 result.append("Could not parse %s parameter" % param)
#             elif data[param] == "None":
#                 data[param] = None
#             if param == "_id":
#                 data["_id"] = ObjectIdField(data[param])
# 
#     return result, data


# Path: quads/model.py
import datetime
import ipaddress
import os
from mongoengine import (
    connect,
    Document,
    EmbeddedDocument,
    queryset_manager,
    Q,
    StringField,
    BooleanField,
    ListField,
    ReferenceField,
    DateTimeField,
    SequenceField,
    IntField,
    LongField,
    EmbeddedDocumentField,
)
from quads.helpers import param_check

            fields.remove("vlan")

        result, data = param_check(data, fields)

        return result, data


class Notification(Document):
    cloud = ReferenceField(Cloud)
    ticket = StringField()
    fail = BooleanField(default=False)
    success = BooleanField(default=False)
    initial = BooleanField(default=False)
    pre_initial = BooleanField(default=False)
    pre = BooleanField(default=False)
    one_day = BooleanField(default=False)
    three_days = BooleanField(default=False)
    five_days = BooleanField(default=False)
    seven_days = BooleanField(default=False)


class Disk(EmbeddedDocument):
    disk_type = StringField()
    size_gb = LongField()
    count = IntField()
    meta = {"strict": False}

    @staticmethod
    def prep_data(data):
        _fields = ["disk_type", "size_gb", "count"]

        result, data = param_check(data, _fields)