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

# Third-party modules
from flask_restx import Namespace, Resource

# Custom modules
from .data_access_object import SetupObject

tpl = SetupObject("ob")

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

@api.route("/")
class TemplateList(Resource):
    
    def get(self):
        """Show all template files"""
        return tpl.todos

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

    def get(self, name):
        """Show a specific OB"""
        return tpl.show(name)
