RequestProcessorInterface.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Webapi\Controller\Rest;
  8. /**
  9. * Request processor interface
  10. */
  11. interface RequestProcessorInterface
  12. {
  13. /**
  14. * Executes the logic to process the request
  15. *
  16. * @param \Magento\Framework\Webapi\Rest\Request $request
  17. * @return void
  18. * @throws \Magento\Framework\Exception\AuthorizationException
  19. * @throws \Magento\Framework\Exception\InputException
  20. * @throws \Magento\Framework\Webapi\Exception
  21. */
  22. public function process(\Magento\Framework\Webapi\Rest\Request $request);
  23. /**
  24. * Method should return true for all the request current processor can process.
  25. *
  26. * Invoked in the loop for all registered request processors. The first one wins.
  27. *
  28. * @param \Magento\Framework\Webapi\Rest\Request $request
  29. * @return bool
  30. */
  31. public function canProcess(\Magento\Framework\Webapi\Rest\Request $request);
  32. }