# Path: quads/config.py
# DEFAULT_CONF_PATH = os.path.join(os.path.dirname(__file__), "../conf/quads.yml")
#     LOGFMT = "%(asctime)-12s : %(levelname)-8s - %(message)s"
#     STDFMT = "- %(levelname)-8s - %(message)s"
#     API = "v2"
#     FPING_TIMEOUT = 10000
#     QUADSVERSION = "1.1.6"
#     QUADSCODENAME = "gaúcho"
#     SUPPORTED = [
#         "fc640",
#         "r620",
#         "r630",
#         "r640",
#         "640",
#         "r650",
#         "650",
#         "r720",
#         "r730xd",
#         "r930",
#         "r730",
#         "r740xd",
#         "740xd",
#         "r750xd",
#         "r750",
#         "750",
#         "r720xd",
#         "7425",
#         "7525",
#     ]
#     OFFSETS = {"em1": 0, "em2": 1, "em3": 2, "em4": 3, "em5": 4}
#     TEMPLATES_PATH = os.path.join(os.path.dirname(__file__), "templates")
#     INTERFACES = {
#         "em1": ["172.16", "172.21"],
#         "em2": ["172.17", "172.22"],
#         "em3": ["172.18", "172.23"],
#         "em4": ["172.19", "172.24"],
#         "em5": ["172.20", "172.25"],
#     }
# class _ConfigBase:
# class _Config(_ConfigBase):
#     def __init__(self):
#     def load_from_yaml(self, filepath: str = DEFAULT_CONF_PATH):
#     def __getitem__(self, item: str):
#     def API_URL(self):
# 
# 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 os
import mongoengine
import requests
from quads.config import Config
from quads.helpers import param_check




class Quads:
    """
    A python interface into the Quads API

    NOTE: Eventually the relationship of this class and API should be reversed.
        Considering both logic of API and the rest of quads is already written here in code
        there shouldn't be a need to have a http proxy for a part of it.
    TODO: Separate heavy-lifting logic of API endpoints into it's own functions (or methods on this class)
        and have CLI and API depend on that
    """


# Path: quads/config.py
# DEFAULT_CONF_PATH = os.path.join(os.path.dirname(__file__), "../conf/quads.yml")
#     LOGFMT = "%(asctime)-12s : %(levelname)-8s - %(message)s"
#     STDFMT = "- %(levelname)-8s - %(message)s"
#     API = "v2"
#     FPING_TIMEOUT = 10000
#     QUADSVERSION = "1.1.6"
#     QUADSCODENAME = "gaúcho"
#     SUPPORTED = [
#         "fc640",
#         "r620",
#         "r630",
#         "r640",
#         "640",
#         "r650",
#         "650",
#         "r720",
#         "r730xd",
#         "r930",
#         "r730",
#         "r740xd",
#         "740xd",
#         "r750xd",
#         "r750",
#         "750",
#         "r720xd",
#         "7425",
#         "7525",
#     ]
#     OFFSETS = {"em1": 0, "em2": 1, "em3": 2, "em4": 3, "em5": 4}
#     TEMPLATES_PATH = os.path.join(os.path.dirname(__file__), "templates")
#     INTERFACES = {
#         "em1": ["172.16", "172.21"],
#         "em2": ["172.17", "172.22"],
#         "em3": ["172.18", "172.23"],
#         "em4": ["172.19", "172.24"],
#         "em5": ["172.20", "172.25"],
#     }
# class _ConfigBase:
# class _Config(_ConfigBase):
#     def __init__(self):
#     def load_from_yaml(self, filepath: str = DEFAULT_CONF_PATH):
#     def __getitem__(self, item: str):
#     def API_URL(self):
# 
# 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/quads.py
import os
import mongoengine
import requests
from quads.config import Config
from quads.helpers import param_check





class Quads:
    """
    A python interface into the Quads API

    NOTE: Eventually the relationship of this class and API should be reversed.
        Considering both logic of API and the rest of quads is already written here in code
        there shouldn't be a need to have a http proxy for a part of it.
    TODO: Separate heavy-lifting logic of API endpoints into it's own functions (or methods on this class)
        and have CLI and API depend on that
    """


    def __init__(self, config: Config):