<?php

declare(strict_types=1);

namespace App\ApiResources\Core\File;

use ApiPlatform\Metadata\ApiProperty;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\State\Provider\Core\DownloadProvider;

#[ApiResource(
    operations: [
        new Get(
            uriTemplate: 'file/download/{fileId}',
            requirements: ['fileId' => '\\d+'],
            security: 'is_granted("ROLE_FILE")',
            provider: DownloadProvider::class
        ),
    ]
)]
class Download
{
    #[ApiProperty(identifier: true)]
    private int $fileId;

    public function getFileId(): int
    {
        return $this->fileId;
    }

    public function setFileId(int $fileId): void
    {
        $this->fileId = $fileId;
    }
}
