#!/usr/bin/env python
# -*- coding: utf-8 -*-

from flask import render_template, make_response, request
from flask_restx import Namespace, Resource

from .data_access_object import SetupObject as DAO

dao = DAO("ob")

############################
# REST API
############################

api = Namespace('defaults', description='Default parameters')

@api.route("/")
class DefaultsList(Resource):
    
    def get(self):
        """Show all defaults OB files"""
        return dao.todos

@api.route("/<string:name>")
@api.param("name", "The uniqe name of the default OB")
class DefaultsList(Resource):

    def get(self, name):
        """Show a specific default OB"""
        return dao.read(name)

