IProvider.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. /**
  52. * Returns the option list for each input shape ENUM slot
  53. *
  54. * @since 30.0.0
  55. * @psalm-return ShapeEnumValue[][]
  56. */
  57. public function getInputShapeEnumValues(): array;
  58. /**
  59. * Returns the default values for input shape slots
  60. *
  61. * @since 30.0.0
  62. * @psalm-return array<array-key, string|numeric>
  63. */
  64. public function getInputShapeDefaults(): array;
  65. /**
  66. * Returns the option list for each optional input shape ENUM slot
  67. *
  68. * @since 30.0.0
  69. * @psalm-return ShapeEnumValue[][]
  70. */
  71. public function getOptionalInputShapeEnumValues(): array;
  72. /**
  73. * Returns the default values for optional input shape slots
  74. *
  75. * @since 30.0.0
  76. * @psalm-return array<array-key, string|numeric>
  77. */
  78. public function getOptionalInputShapeDefaults(): array;
  79. /**
  80. * Returns the option list for each output shape ENUM slot
  81. *
  82. * @since 30.0.0
  83. * @psalm-return ShapeEnumValue[][]
  84. */
  85. public function getOutputShapeEnumValues(): array;
  86. /**
  87. * Returns the option list for each optional output shape ENUM slot
  88. *
  89. * @since 30.0.0
  90. * @psalm-return ShapeEnumValue[][]
  91. */
  92. public function getOptionalOutputShapeEnumValues(): array;
  93. }