<?php

namespace NoahVet\Reef\Application\Security\UseCase;

use NoahVet\Reef\Domain\Security\Model\Resource;
use NoahVet\Reef\Domain\Security\Model\ResourceGroupWithMembers;
use NoahVet\Reef\Domain\Security\Port\ResourceRegistryInterface;

/**
 * Registers a resource or resource group in the IAM.
 */
class RegisterResourceUseCase implements RegisterResourceUseCaseInterface
{
    public function __construct(
        private readonly ResourceRegistryInterface $registry,
    ) {
    }

    #[\Override]
    public function register(Resource|ResourceGroupWithMembers $resource): void
    {
        $this->registry->register($resource);
    }
}
