<?php
declare(strict_types=1);

namespace App\ApiResources\Enum;

use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use App\ApiResources\ApiResourcesInterface;

/**
 * Classe resource qui contient les champs disponibles lors d'un appel à enum.
 */
#[ApiResource(
    collectionOperations: [],
    itemOperations: [
        'get' => [
            'method' => 'GET',
            'path' => '/enum/{name}'
        ]
    ]
)]
class Enum implements ApiResourcesInterface
{
    #[ApiProperty(identifier: true)]
    private string $name;
    private array $items = [];

    public function __construct()
    {
    }
    public function getName(): string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }


    public function setItems(array $items): self
    {
        $this->items = $items;
        return $this;
    }

    public function getItems(): array
    {
        return $this->items;
    }
}