<?php

declare(strict_types=1);

/** APO-194 Card 7 — GET /api/v1/files/video-assets */
final class MyronListVideoAssetsAction implements MyronAction
{
    public function __construct(private readonly MyronVideoAssetRepository $repo) {}

    public function metadata(): MyronActionMetadata
    {
        return new MyronActionMetadata(
            uri: '/api/v1/files/video-assets', method: 'GET',
            domain: 'content', resource: 'video-asset', verb: 'list',
            inputSchema: ['type' => 'object', 'properties' => []],
            outputSchema: ['type' => 'object', 'properties' => ['items' => ['type' => 'array']]],
            requiredScope: MyronApiScopes::CONTENT_READ,
            summary: 'List video assets with their renditions.',
            audienceClass: 3,
            snapshotInclude: true, snapshotKey: 'content.videoAssets',
            exposeToMcp: true,
        );
    }

    public function execute(array $input, MyronActionCallerContext $caller): MyronActionResult
    {
        return MyronActionResult::ok(['items' => $this->repo->listVideoAssets()]);
    }
}
