from netbox.views.generic import ObjectChangeLogView
from . import views
from . import models
from django.urls import include, path
from utilities.urls import get_model_urls

urlpatterns = (
    # Application Profile
    path('applicationprofile/',
         views.ap_view.ApplicationProfileListView.as_view(),
         name='applicationprofile_list'),
    path('applicationprofile/add/',
         views.ap_view.ApplicationProfileEditView.as_view(),
         name='applicationprofile_add'),
    path('applicationprofile/<int:pk>/',
         views.ap_view.ApplicationProfileView.as_view(),
         name='applicationprofile'),
    path('applicationprofile/<int:pk>/edit/',
         views.ap_view.ApplicationProfileEditView.as_view(),
         name='applicationprofile_edit'),
    path('applicationprofile/<int:pk>/delete/',
         views.ap_view.ApplicationProfileDeleteView.as_view(),
         name='applicationprofile_delete'),
    path('applicationprofile/delete/',
        views.ap_view.ApplicationProfileBulkDeleteView.as_view(),
        name="applicationprofile_bulk_delete"),
    path('applicationprofile/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='applicationprofile_changelog',
         kwargs={'model': models.ap_model.ApplicationProfile}),
    path('applicationprofile/<int:pk>/',
         include(get_model_urls('netbox_aci', 'applicationprofile'))),

    # Endpoint Group
    path('endpointgroup/',
         views.epg_view.EndPointGroupListView.as_view(),
         name='endpointgroup_list'),
    path('endpointgroup/add/',
         views.epg_view.EndPointGroupEditView.as_view(),
         name='endpointgroup_add'),
    path('endpointgroup/<int:pk>/',
         views.epg_view.EndPointGroupView.as_view(),
         name='endpointgroup'),
    path('endpointgroup/<int:pk>/edit/',
         views.epg_view.EndPointGroupEditView.as_view(),
         name='endpointgroup_edit'),
    path('endpointgroup/<int:pk>/delete/',
         views.epg_view.EndPointGroupDeleteView.as_view(),
         name='endpointgroup_delete'),
    path('endpointgroup/delete/',
        views.epg_view.EndPointGroupBulkDeleteView.as_view(),
        name="endpointgroup_bulk_delete"),
    path('endpointgroup/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='endpointgroup_changelog',
         kwargs={'model': models.epg_model.EndPointGroup}),
    path('endpointgroup/<int:pk>/',
         include(get_model_urls('netbox_aci', 'endpointgroup'))),

    # Endpoint Security Group
    path('endpointsecuritygroup/',
         views.esg_view.EndPointSecurityGroupListView.as_view(),
         name='endpointsecuritygroup_list'),
    path('endpointsecuritygroup/add/',
         views.esg_view.EndPointSecurityGroupEditView.as_view(),
         name='endpointsecuritygroup_add'),
    path('endpointsecuritygroup/<int:pk>/',
         views.esg_view.EndPointSecurityGroupView.as_view(),
         name='endpointsecuritygroup'),
    path('endpointsecuritygroup/<int:pk>/edit/',
         views.esg_view.EndPointSecurityGroupEditView.as_view(),
         name='endpointsecuritygroup_edit'),
    path('endpointsecuritygroup/<int:pk>/delete/',
         views.esg_view.EndPointSecurityGroupDeleteView.as_view(),
         name='endpointsecuritygroup_delete'),
    path('endpointsecuritygroup/delete/',
        views.esg_view.EndPointSecurityGroupBulkDeleteView.as_view(),
        name="endpointsecuritygroup_bulk_delete"),
    path('endpointsecuritygroup/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='endpointsecuritygroup_changelog',
         kwargs={'model': models.esg_model.EndPointSecurityGroup}),
    path('endpointsecuritygroup/<int:pk>/',
         include(get_model_urls('netbox_aci', 'endpointsecuritygroup'))),

    # Contract
    path('contract/',
         views.contract_view.ContractListView.as_view(),
         name='contract_list'),
    path('contract/add/',
         views.contract_view.ContractEditView.as_view(),
         name='contract_add'),
    path('contract/<int:pk>/',
         views.contract_view.ContractView.as_view(),
         name='contract'),
    path('contract/<int:pk>/edit/',
         views.contract_view.ContractEditView.as_view(),
         name='contract_edit'),
    path('contract/<int:pk>/delete/',
         views.contract_view.ContractDeleteView.as_view(),
         name='contract_delete'),
    path('contract/delete/',
        views.contract_view.ContractBulkDeleteView.as_view(),
        name="contract_bulk_delete"),
    path('contract/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='contract_changelog',
         kwargs={'model': models.contract_model.Contract}),
    path('contract/<int:pk>/',
         include(get_model_urls('netbox_aci', 'contract'))),

    # Contract Subject
    path('contractsubject/',
         views.contract_subject_view.ContractSubjectListView.as_view(),
         name='contractsubject_list'),
    path('contractsubject/add/',
         views.contract_subject_view.ContractSubjectEditView.as_view(),
         name='contractsubject_add'),
    path('contractsubject/<int:pk>/',
         views.contract_subject_view.ContractSubjectView.as_view(),
         name='contractsubject'),
    path('contractsubject/<int:pk>/edit/',
         views.contract_subject_view.ContractSubjectEditView.as_view(),
         name='contractsubject_edit'),
    path('contractsubject/<int:pk>/delete/',
         views.contract_subject_view.ContractSubjectDeleteView.as_view(),
         name='contractsubject_delete'),
    path('contractsubject/delete/',
        views.contract_subject_view.ContractSubjectBulkDeleteView.as_view(),
        name="contractsubject_bulk_delete"),
    path('contractsubject/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='contractsubject_changelog',
         kwargs={'model': models.contract_subject_model.ContractSubject}),
    path('contractsubject/<int:pk>/',
         include(get_model_urls('netbox_aci', 'contractsubject'))),

    # Contract Filter
    path('contractfilter/',
         views.contract_filter_view.ContractFilterListView.as_view(),
         name='contractfilter_list'),
    path('contractfilter/add/',
         views.contract_filter_view.ContractFilterEditView.as_view(),
         name='contractfilter_add'),
    path('contractfilter/<int:pk>/',
         views.contract_filter_view.ContractFilterView.as_view(),
         name='contractfilter'),
    path('contractfilter/<int:pk>/edit/',
         views.contract_filter_view.ContractFilterEditView.as_view(),
         name='contractfilter_edit'),
    path('contractfilter/<int:pk>/delete/',
         views.contract_filter_view.ContractFilterDeleteView.as_view(),
         name='contractfilter_delete'),
    path('contractfilter/delete/',
        views.contract_filter_view.ContractFilterBulkDeleteView.as_view(),
        name="contractfilter_bulk_delete"),
    path('contractfilter/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='contractfilter_changelog',
         kwargs={'model': models.contract_filter_model.ContractFilter}),
    path('contractfilter/<int:pk>/',
         include(get_model_urls('netbox_aci', 'contractfilter'))),

    # Contract Filter Entry
    path('contractfilterentry/',
         views.contract_filter_entry_view.ContractFilterEntryListView.as_view(),
         name='contractfilterentry_list'),
    path('contractfilterentry/add/',
         views.contract_filter_entry_view.ContractFilterEntryEditView.as_view(),
         name='contractfilterentry_add'),
    path('contractfilterentry/<int:pk>/',
         views.contract_filter_entry_view.ContractFilterEntryView.as_view(),
         name='contractfilterentry'),
    path('contractfilterentry/<int:pk>/edit/',
         views.contract_filter_entry_view.ContractFilterEntryEditView.as_view(),
         name='contractfilterentry_edit'),
    path('contractfilterentry/<int:pk>/delete/',
         views.contract_filter_entry_view.ContractFilterEntryDeleteView.as_view(),
         name='contractfilterentry_delete'),
    path('contractfilterentry/delete/',
        views.contract_filter_entry_view.ContractFilterEntryBulkDeleteView.as_view(),
        name="contractfilterentry_bulk_delete"),
    path('contractfilterentry/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='contractfilterentry_changelog',
         kwargs={'model': models.contract_filter_entry_model.ContractFilterEntry}),
    path('contractfilterentry/<int:pk>/',
         include(get_model_urls('netbox_aci', 'contractfilterentry'))),

    # Bridge Domain
    path('bridgedomain/',
         views.bd_view.BridgeDomainListView.as_view(),
         name='bridgedomain_list'),
    path('bridgedomain/add/',
         views.bd_view.BridgeDomainEditView.as_view(),
         name='bridgedomain_add'),
    path('bridgedomain/<int:pk>/',
         views.bd_view.BridgeDomainView.as_view(),
         name='bridgedomain'),
    path('bridgedomain/<int:pk>/edit/',
         views.bd_view.BridgeDomainEditView.as_view(),
         name='bridgedomain_edit'),
    path('bridgedomain/<int:pk>/delete/',
         views.bd_view.BridgeDomainDeleteView.as_view(),
         name='bridgedomain_delete'),
    path('bridgedomain/delete/',
        views.bd_view.BridgeDomainBulkDeleteView.as_view(),
        name="bridgedomain_bulk_delete"),
    path('bridgedomain/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='bridgedomain_changelog',
         kwargs={'model': models.bd_model.BridgeDomain}),
    path('bridgedomain/<int:pk>/',
         include(get_model_urls('netbox_aci', 'bridgedomain'))),

    # L3Out
    path('l3out/',
         views.l3out_view.L3OutListView.as_view(),
         name='l3out_list'),
    path('l3out/add/',
         views.l3out_view.L3OutEditView.as_view(),
         name='l3out_add'),
    path('l3out/<int:pk>/',
         views.l3out_view.L3OutView.as_view(),
         name='l3out'),
    path('l3out/<int:pk>/edit/',
         views.l3out_view.L3OutEditView.as_view(),
         name='l3out_edit'),
    path('l3out/<int:pk>/delete/',
         views.l3out_view.L3OutDeleteView.as_view(),
         name='l3out_delete'),
    path('l3out/delete/',
       views.l3out_view.L3OutBulkDeleteView.as_view(),
        name="l3out_bulk_delete"),
    path('l3out/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='l3out_changelog',
         kwargs={'model': models.l3out_model.L3Out}),
    path('l3out/<int:pk>/',
         include(get_model_urls('netbox_aci', 'l3out'))),

    # Domain
    path('domain/',
         views.domain_view.DomainListView.as_view(),
         name='domain_list'),
    path('domain/add/',
         views.domain_view.DomainEditView.as_view(),
         name='domain_add'),
    path('domain/<int:pk>/',
         views.domain_view.DomainView.as_view(),
         name='domain'),
    path('domain/<int:pk>/edit/',
         views.domain_view.DomainEditView.as_view(),
         name='domain_edit'),
    path('domain/<int:pk>/delete/',
         views.domain_view.DomainDeleteView.as_view(),
         name='domain_delete'),
    path('domain/delete/',
       views.domain_view.DomainBulkDeleteView.as_view(),
        name="domain_bulk_delete"),
    path('domain/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='domain_changelog',
         kwargs={'model': models.domain_model.Domain}),
    path('domain/<int:pk>/',
         include(get_model_urls('netbox_aci', 'domain'))),

    # AAEP
    path('aaep/',
         views.aaep_view.AAEPListView.as_view(),
         name='aaep_list'),
    path('aaep/add/',
         views.aaep_view.AAEPEditView.as_view(),
         name='aaep_add'),
    path('aaep/<int:pk>/',
         views.aaep_view.AAEPView.as_view(),
         name='aaep'),
    path('aaep/<int:pk>/edit/',
         views.aaep_view.AAEPEditView.as_view(),
         name='aaep_edit'),
    path('aaep/<int:pk>/delete/',
         views.aaep_view.AAEPDeleteView.as_view(),
         name='aaep_delete'),
    path('aaep/delete/',
        views.aaep_view.AAEPBulkDeleteView.as_view(),
        name="aaep_bulk_delete"),
    path('aaep/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='aaep_changelog',
         kwargs={'model': models.aaep_model.AAEP}),
    path('aaep/<int:pk>/',
         include(get_model_urls('netbox_aci', 'aaep'))),

    # AAEP STATIC BINDING
    path('aaepstaticbinding/',
         views.aaep_view.AAEPStaticBindingListView.as_view(),
         name='aaepstaticbinding_list'),
    path('aaepstaticbinding/add/',
         views.aaep_view.AAEPStaticBindingEditView.as_view(),
         name='aaepstaticbinding_add'),
    path('aaepstaticbinding/<int:pk>/',
         views.aaep_view.AAEPStaticBindingView.as_view(),
         name='aaepstaticbinding'),
    path('aaepstaticbinding/<int:pk>/edit/',
         views.aaep_view.AAEPStaticBindingEditView.as_view(),
         name='aaepstaticbinding_edit'),
    path('aaepstaticbinding/<int:pk>/delete/',
         views.aaep_view.AAEPStaticBindingDeleteView.as_view(),
         name='aaepstaticbinding_delete'),
    path('aaepstaticbinding/delete/',
        views.aaep_view.AAEPStaticBindingBulkDeleteView.as_view(),
        name="aaepstaticbinding_bulk_delete"),
    path('aaepstaticbinding/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='aaepstaticbinding_changelog',
         kwargs={'model': models.aaep_model.AAEPStaticBinding}),
    path('aaepstaticbinding/<int:pk>/',
         include(get_model_urls('netbox_aci', 'aaepstaticbinding'))),

    # Policy Group IPG
    path('policygroup/',
         views.ipg_view.PolicyGroupListView.as_view(),
         name='policygroup_list'),
    path('policygroup/add/',
         views.ipg_view.PolicyGroupEditView.as_view(),
         name='policygroup_add'),
    path('policygroup/<int:pk>/',
         views.ipg_view.PolicyGroupView.as_view(),
         name='policygroup'),
    path('policygroup/<int:pk>/edit/',
         views.ipg_view.PolicyGroupEditView.as_view(),
         name='policygroup_edit'),
    path('policygroup/<int:pk>/delete/',
         views.ipg_view.PolicyGroupDeleteView.as_view(),
         name='policygroup_delete'),
    path('policygroup/delete/',
        views.ipg_view.PolicyGroupBulkDeleteView.as_view(),
        name="policygroup_bulk_delete"),    
    path('policygroup/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='policygroup_changelog',
         kwargs={'model': models.ipg_model.PolicyGroup}),
    path('policygroup/<int:pk>/',
         include(get_model_urls('netbox_aci', 'policygroup'))),

    # Policy Group Assignement
    path('policygroupassignement/',
         views.ipg_view.PolicyGroupAssignementListView.as_view(),
         name='policygroupassignement_list'),
    path('policygroupassignement/add/',
         views.ipg_view.PolicyGroupAssignementEditView.as_view(),
         name='policygroupassignement_add'),
    path('policygroupassignement/<int:pk>/',
         views.ipg_view.PolicyGroupAssignementView.as_view(),
         name='policygroupassignement'),
    path('policygroupassignement/<int:pk>/edit/',
         views.ipg_view.PolicyGroupAssignementEditView.as_view(),
         name='policygroupassignement_edit'),
    path('policygroupassignement/<int:pk>/delete/',
         views.ipg_view.PolicyGroupAssignementDeleteView.as_view(),
         name='policygroupassignement_delete'),
    path('policygroupassignement/delete/',
        views.ipg_view.PolicyGroupAssignementBulkDeleteView.as_view(),
        name="policygroupassignement_bulk_delete"),
    path('policygroupassignement/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='policygroupassignement_changelog',
         kwargs={'model': models.ipg_model.PolicyGroupAssignement}),
    path('policygroupassignement/<int:pk>/',
         include(get_model_urls('netbox_aci', 'policygroupassignement'))),

    # Policy Link Level
    path('linklevel/',
         views.policy_link_level_view.LinkLevelListView.as_view(),
         name='linklevel_list'),
    path('linklevel/add/',
         views.policy_link_level_view.LinkLevelEditView.as_view(),
         name='linklevel_add'),
    path('linklevel/<int:pk>/',
         views.policy_link_level_view.LinkLevelView.as_view(),
         name='linklevel'),
    path('linklevel/<int:pk>/edit/',
         views.policy_link_level_view.LinkLevelEditView.as_view(),
         name='linklevel_edit'),
    path('linklevel/<int:pk>/delete/',
         views.policy_link_level_view.LinkLevelDeleteView.as_view(),
         name='linklevel_delete'),
    path('linklevel/<int:pk>/changelog/',
         ObjectChangeLogView.as_view(),
         name='linklevel_changelog',
         kwargs={'model': models.policy_link_level_model.LinkLevel}),
    path('linklevel/<int:pk>/',
         include(get_model_urls('netbox_aci', 'linklevel'))),
)