# Path: watcher_dashboard/api/watcher.py
# LOG = logging.getLogger(__name__)
# WATCHER_SERVICE = 'infra-optim'
# def watcherclient(request, password=None):
# def insert_watcher_policy_file():
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, audit_template_uuid, audit_type, name=None,
#                auto_trigger=False, interval=None):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_id):
#     def delete(cls, request, audit_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, name, goal, strategy,
#                description, scope):
#     def patch(cls, request, audit_template_id, parameters):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_template_id):
#     def delete(cls, request, audit_template_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_plan_id):
#     def delete(cls, request, action_plan_id):
#     def start(cls, request, action_plan_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_id):
#     def delete(cls, request, action_id):
#     def start(cls, request, action_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, goal):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, strategy):
#     def id(self):
#     def __init__(self, indicator):
# class Audit(base.APIDictWrapper):
# class AuditTemplate(base.APIDictWrapper):
# class ActionPlan(base.APIDictWrapper):
# class Action(base.APIDictWrapper):
# class Goal(base.APIDictWrapper):
# class Strategy(base.APIDictWrapper):
# class EfficacyIndicatorSpec(base.APIDictWrapper):
# class EfficacyIndicator(base.APIDictWrapper):
# 
# Path: watcher_dashboard/content/audit_templates/forms.py
# LOG = logging.getLogger(__name__)
# class YamlValidator(object):
# class CreateForm(forms.SelfHandlingForm):
#     def __init__(self, message=None):
#     def __call__(self, value):
#     def __init__(self, request, *args, **kwargs):
#     def _get_goal_list(self, request):
#     def _get_strategy_list(self, request, goals):
#     def handle(self, request, data):
# 
# Path: watcher_dashboard/content/audit_templates/tables.py
# class CreateAuditTemplates(horizon.tables.LinkAction):
# class AuditTemplatesFilterAction(horizon.tables.FilterAction):
# class LaunchAudit(horizon.tables.BatchAction):
# class ArchiveAuditTemplates(horizon.tables.DeleteAction):
# class AuditTemplatesTable(horizon.tables.DataTable):
#     class Meta(object):
#     def action_present(count):
#     def action_past(count):
#     def action(self, request, obj_id):
#     def action_present(count):
#     def action_past(count):
#     def delete(self, request, obj_id):
#     def get_object_id(self, datum):
# 
# Path: watcher_dashboard/content/audit_templates/tabs.py
# class OverviewTab(tabs.Tab):
# class AuditTemplateDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):


import json
import logging
import horizon.exceptions
import horizon.tables
import horizon.tabs
import horizon.workflows
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import forms
from watcher_dashboard.api import watcher
from watcher_dashboard.content.audit_templates import forms as wforms
from watcher_dashboard.content.audit_templates import tables
from watcher_dashboard.content.audit_templates import tabs as wtabs
                if filter_field and filter_string:
                    filters[filter_field] = filter_string
        return filters


class CreateView(forms.ModalFormView):
    form_class = wforms.CreateForm
    form_id = "create_audit_templates_form"
    modal_header = _("Create Audit Template")
    template_name = 'infra_optim/audit_templates/create.html'
    success_url = reverse_lazy("horizon:admin:audit_templates:index")
    page_title = _("Create an Audit Template")
    submit_label = _("Create Audit Template")
    submit_url = reverse_lazy("horizon:admin:audit_templates:create")

    def get_object_id(self, obj):
        return obj.uuid


class DetailView(horizon.tabs.TabbedTableView):
    tab_group_class = wtabs.AuditTemplateDetailTabs
    template_name = 'infra_optim/audit_templates/details.html'
    redirect_url = 'horizon:admin:audit_templates:index'
    page_title = _("Audit Template Details: {{ audit_template.name }}")

    def _get_data(self):
        audit_template_uuid = None
        try:
            LOG.info(self.kwargs)
            audit_template_uuid = self.kwargs['audit_template_uuid']

# Path: watcher_dashboard/api/watcher.py
# LOG = logging.getLogger(__name__)
# WATCHER_SERVICE = 'infra-optim'
# def watcherclient(request, password=None):
# def insert_watcher_policy_file():
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, audit_template_uuid, audit_type, name=None,
#                auto_trigger=False, interval=None):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_id):
#     def delete(cls, request, audit_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def create(cls, request, name, goal, strategy,
#                description, scope):
#     def patch(cls, request, audit_template_id, parameters):
#     def list(cls, request, **filters):
#     def get(cls, request, audit_template_id):
#     def delete(cls, request, audit_template_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_plan_id):
#     def delete(cls, request, action_plan_id):
#     def start(cls, request, action_plan_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, action_id):
#     def delete(cls, request, action_id):
#     def start(cls, request, action_id):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, goal):
#     def id(self):
#     def __init__(self, apiresource, request=None):
#     def list(cls, request, **filters):
#     def get(cls, request, strategy):
#     def id(self):
#     def __init__(self, indicator):
# class Audit(base.APIDictWrapper):
# class AuditTemplate(base.APIDictWrapper):
# class ActionPlan(base.APIDictWrapper):
# class Action(base.APIDictWrapper):
# class Goal(base.APIDictWrapper):
# class Strategy(base.APIDictWrapper):
# class EfficacyIndicatorSpec(base.APIDictWrapper):
# class EfficacyIndicator(base.APIDictWrapper):
# 
# Path: watcher_dashboard/content/audit_templates/forms.py
# LOG = logging.getLogger(__name__)
# class YamlValidator(object):
# class CreateForm(forms.SelfHandlingForm):
#     def __init__(self, message=None):
#     def __call__(self, value):
#     def __init__(self, request, *args, **kwargs):
#     def _get_goal_list(self, request):
#     def _get_strategy_list(self, request, goals):
#     def handle(self, request, data):
# 
# Path: watcher_dashboard/content/audit_templates/tables.py
# class CreateAuditTemplates(horizon.tables.LinkAction):
# class AuditTemplatesFilterAction(horizon.tables.FilterAction):
# class LaunchAudit(horizon.tables.BatchAction):
# class ArchiveAuditTemplates(horizon.tables.DeleteAction):
# class AuditTemplatesTable(horizon.tables.DataTable):
#     class Meta(object):
#     def action_present(count):
#     def action_past(count):
#     def action(self, request, obj_id):
#     def action_present(count):
#     def action_past(count):
#     def delete(self, request, obj_id):
#     def get_object_id(self, datum):
# 
# Path: watcher_dashboard/content/audit_templates/tabs.py
# class OverviewTab(tabs.Tab):
# class AuditTemplateDetailTabs(tabs.TabGroup):
#     def get_context_data(self, request):


# Path: watcher_dashboard/content/audit_templates/views.py
import json
import logging
import horizon.exceptions
import horizon.tables
import horizon.tabs
import horizon.workflows
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import forms
from watcher_dashboard.api import watcher
from watcher_dashboard.content.audit_templates import forms as wforms
from watcher_dashboard.content.audit_templates import tables
from watcher_dashboard.content.audit_templates import tabs as wtabs

                if filter_field and filter_string:
                    filters[filter_field] = filter_string
        return filters


class CreateView(forms.ModalFormView):
    form_class = wforms.CreateForm
    form_id = "create_audit_templates_form"
    modal_header = _("Create Audit Template")
    template_name = 'infra_optim/audit_templates/create.html'
    success_url = reverse_lazy("horizon:admin:audit_templates:index")
    page_title = _("Create an Audit Template")
    submit_label = _("Create Audit Template")
    submit_url = reverse_lazy("horizon:admin:audit_templates:create")

    def get_object_id(self, obj):
        return obj.uuid


class DetailView(horizon.tabs.TabbedTableView):
    tab_group_class = wtabs.AuditTemplateDetailTabs
    template_name = 'infra_optim/audit_templates/details.html'
    redirect_url = 'horizon:admin:audit_templates:index'
    page_title = _("Audit Template Details: {{ audit_template.name }}")

    def _get_data(self):
        audit_template_uuid = None
        try:
            LOG.info(self.kwargs)
            audit_template_uuid = self.kwargs['audit_template_uuid']

            audit_template = watcher.AuditTemplate.get(