ShortUrlServiceInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core\Service;
  4. use Laminas\Paginator\Paginator;
  5. use Shlinkio\Shlink\Core\Entity\ShortUrl;
  6. use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
  7. use Shlinkio\Shlink\Core\Exception\ShortUrlNotFoundException;
  8. use Shlinkio\Shlink\Core\Model\ShortUrlEdit;
  9. use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
  10. use Shlinkio\Shlink\Core\Model\ShortUrlsParams;
  11. use Shlinkio\Shlink\Rest\Entity\ApiKey;
  12. interface ShortUrlServiceInterface
  13. {
  14. /**
  15. * @return ShortUrl[]|Paginator
  16. */
  17. public function listShortUrls(ShortUrlsParams $params, ?ApiKey $apiKey = null): Paginator;
  18. /**
  19. * @param string[] $tags
  20. * @throws ShortUrlNotFoundException
  21. */
  22. public function setTagsByShortCode(ShortUrlIdentifier $identifier, array $tags = []): ShortUrl;
  23. /**
  24. * @throws ShortUrlNotFoundException
  25. * @throws InvalidUrlException
  26. */
  27. public function updateMetadataByShortCode(
  28. ShortUrlIdentifier $identifier,
  29. ShortUrlEdit $shortUrlEdit,
  30. ?ApiKey $apiKey = null
  31. ): ShortUrl;
  32. }