TranscriptionFailedEvent.php 800 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\SpeechToText\Events;
  8. use OCP\Files\File;
  9. /**
  10. * This Event is emitted if a transcription of a media file using a Speech-To-Text provider failed
  11. * @since 27.0.0
  12. * @deprecated 30.0.0
  13. */
  14. class TranscriptionFailedEvent extends AbstractTranscriptionEvent {
  15. /**
  16. * @since 27.0.0
  17. */
  18. public function __construct(
  19. int $fileId,
  20. ?File $file,
  21. private string $errorMessage,
  22. ?string $userId,
  23. string $appId,
  24. ) {
  25. parent::__construct($fileId, $file, $userId, $appId);
  26. }
  27. /**
  28. * @since 27.0.0
  29. * @return string The error message
  30. */
  31. public function getErrorMessage(): string {
  32. return $this->errorMessage;
  33. }
  34. }