23 lines
638 B
PHP
23 lines
638 B
PHP
<?php
|
|
|
|
namespace App\Dto;
|
|
|
|
use ApiPlatform\Metadata\ApiProperty;
|
|
use ApiPlatform\Metadata\ApiResource;
|
|
use ApiPlatform\Metadata\Post;
|
|
use App\State\BookImporter;
|
|
use Symfony\Component\Serializer\Attribute\Groups;
|
|
|
|
#[ApiResource(operations: [new Post(uriTemplate: '/book_imports', processor: BookImporter::class)])]
|
|
final class BookInput
|
|
{
|
|
public function __construct(
|
|
#[Groups(['import', 'isbn'])]
|
|
public string $isbn = '',
|
|
#[Groups(['import', 'contact'])]
|
|
#[ApiProperty(description: 'Who to write to')]
|
|
public string $contactEmail = '',
|
|
public bool $overwrite = false,
|
|
) {
|
|
}
|
|
}
|