<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteIndexController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteStoreController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteShowController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteUpdateController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteRotateSecretsController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteConnectivityTestController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteExportController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteSecretsController;
use App\Http\Controllers\Api\V1\Admin\Integration\AdminIntegrationSiteDestroyController;

Route::middleware('admin.api-resource')
    ->group(function (): void {
        Route::get('integration-sites', AdminIntegrationSiteIndexController::class)
            ->name('api.v1.admin.integration-sites.index');
        Route::post('integration-sites', AdminIntegrationSiteStoreController::class)
            ->name('api.v1.admin.integration-sites.store');
        Route::get('integration-sites/{admin_site}', AdminIntegrationSiteShowController::class)
            ->name('api.v1.admin.integration-sites.show');
        Route::put('integration-sites/{admin_site}', AdminIntegrationSiteUpdateController::class)
            ->name('api.v1.admin.integration-sites.update');
        Route::delete('integration-sites/{admin_site}', AdminIntegrationSiteDestroyController::class)
            ->name('api.v1.admin.integration-sites.destroy');
        Route::post('integration-sites/{admin_site}/rotate-secrets', AdminIntegrationSiteRotateSecretsController::class)
            ->name('api.v1.admin.integration-sites.rotate-secrets');
        Route::post('integration-sites/{admin_site}/connectivity-test', AdminIntegrationSiteConnectivityTestController::class)
            ->name('api.v1.admin.integration-sites.connectivity-test');
        Route::get('integration-sites/{admin_site}/export', AdminIntegrationSiteExportController::class)
            ->name('api.v1.admin.integration-sites.export');
        Route::get('integration-sites/{admin_site}/secrets', AdminIntegrationSiteSecretsController::class)
            ->name('api.v1.admin.integration-sites.secrets');
    });
