from django.urls import path
from . import views



# URL Config
urlpatterns = [

      path('api/device/key=<str:device_auth_key>', views.DroneBasePingApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/is_autonomous', views.DroneBaseCheckIfAutomatedApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/flight_id=<int:flight_id>', views.FlightInfosApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/flight_id=<int:flight_id>/status=InProgress', views.FlightInProgressApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/flight_id=<int:flight_id>/status=Completed', views.FlightCompletedApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/flight_id=<int:flight_id>/status=Failed', views.FlightFailedApiView.as_view()),

      # manual info calls
      path('api/device/key=<str:device_auth_key>/active_missions', views.ActiveMissionsApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/mission_id=<int:mission_id>', views.MissionFlightPlanApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/plan_id=<int:plan_id>/create_flight', views.FlightCreateApiView.as_view()),

      path('api/device/key=<str:device_auth_key>/generate_mission', views.DroneBaseGeneratePlanApiView.as_view()),

      path('api/device/key=<str:device_auth_key>/flight_plan=<int:plan_id>/view', views.MissionFlightPlanViewerApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/flight_plan=<int:plan_id>/kml', views.MissionFlightPlanViewerApiKMLFormatView.as_view()),
      path('api/device/key=<str:device_auth_key>/flight_plan=<int:plan_id>/ardupilot', views.MissionFlightPlanViewerApiArduPilotFormatView.as_view()),

      path('api/device/key=<str:device_auth_key>/trees', views.BlockTreesApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/drone_station', views.DroneBaseLocationApiView.as_view()),

      path('api/device/key=<str:device_auth_key>/tree_breeds', views.EntepriseTreeBreedsApiView.as_view()),

      path('api/data/flight_id=<int:flight_id>/diagnostics', views.DroneLocationPingApiView.as_view()),
      path('api/data/mission_id=<int:mission_id>/diagnostics', views.DroneLocationMissionPingApiView.as_view()),

      path('api/data/mission_id=<int:mission_id>/photos', views.MissionPhotosSendApiView.as_view()),
      path('api/data/photo_id=<int:photo_id>', views.MissionPhotoSendApiView.as_view()),

      # Machine Learning calls
      path('api/ML/mission_id=<int:mission_id>/scab_detection', views.MissionsScabDetectionView.as_view()),
      path('api/ML/mission_id=<int:mission_id>/pear_detection', views.MissionsPearDetectionView.as_view()),

      # post request calls
      path('api/device/key=<str:device_auth_key>/request/plan', views.DroneBasePlanReceiverApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/request/tree', views.DroneBaseTreeReceiverApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/request/mission_id=<int:mission_id>/photos', views.MissionPhotosRecieveApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/request/tree_breeds', views.EnterpriseRecieveTreeBreedApiView.as_view()),
      path('api/device/key=<str:device_auth_key>/request/tree_row', views.EnterpriseRecieveTreeRowApiView.as_view()),
      
      path('api/ML/object_detection', views.ProcessImagesAPIView.as_view(), name='process_images'),


      # recommendation calls
      path('api/recommendation/garden/<int:garden_id>', views.reccomendationsGarden),

      # fake mission completion
      path('api/complete_mission/<int:mission_id>', views.FakeCompleteMission.as_view(), name='complete_mission'),

      # check ml file validity
      path('api/check_ml_file', views.CheckMLFile.as_view(), name='check_ml_file'),
      path('api/current_ml_models', views.CurrentMLModels.as_view(), name='get_current_ml_models'),
      path('api/save_ml_model', views.SaveMLModel.as_view(), name='save_ml_model'),
      path('api/active_classes', views.ActiveClasses.as_view(), name='active_classes'),
      path('api/delete_ml_model', views.DeleteMLModel.as_view(), name='delete_ml_model'),
      path('api/upload_photos', views.UploadPhotos.as_view(), name='upload_photos'),
      # map
      path('api/blocks/<int:block_id>/scab', views.ScabInfoMapView.as_view()),
      path('api/blocks/<int:block_id>/yield', views.YieldInfoMapView.as_view()),
      # monitoring page
      path('api/monitoring_page/yields/<int:enterprise_id>', views.YieldDataMonitoring.as_view(), name='monitoring_page'),
]

