IProvider.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\TaskProcessing;
  8. /**
  9. * This is the interface that is implemented by apps that
  10. * implement a task processing provider
  11. * @since 30.0.0
  12. */
  13. interface IProvider {
  14. /**
  15. * The unique id of this provider
  16. * @since 30.0.0
  17. */
  18. public function getId(): string;
  19. /**
  20. * The localized name of this provider
  21. * @since 30.0.0
  22. */
  23. public function getName(): string;
  24. /**
  25. * Returns the task type id of the task type, that this
  26. * provider handles
  27. *
  28. * @since 30.0.0
  29. * @return string
  30. */
  31. public function getTaskTypeId(): string;
  32. /**
  33. * @return int The expected average runtime of a task in seconds
  34. * @since 30.0.0
  35. */
  36. public function getExpectedRuntime(): int;
  37. /**
  38. * Returns the shape of optional input parameters
  39. *
  40. * @since 30.0.0
  41. * @psalm-return ShapeDescriptor[]
  42. */
  43. public function getOptionalInputShape(): array;
  44. /**
  45. * Returns the shape of optional output parameters
  46. *
  47. * @since 30.0.0
  48. * @psalm-return ShapeDescriptor[]
  49. */
  50. public function getOptionalOutputShape(): array;
  51. }