*/ class GetMediaInfoFromLibraryInput implements InputInterface { public function __construct( #[SourceRequest('imdbId', nullify: true)] public ?string $imdbId = null, #[SourceRequest('title', nullify: true)] public ?string $title = null, #[SourceRequest('season', nullify: true)] public ?string $season = null, #[SourceRequest('episode', nullify: true)] public ?string $episode = null, ) {} public function toCommand(): C { if (null === $this->imdbId && null === $this->title) { throw new \InvalidArgumentException('Either imdbId or title must be set', 400); } return new GetMediaFromLibraryCommand( imdbId: $this->imdbId, title: $this->title, season: $this->season, episode: $this->episode, ); } }