IntegrationServiceInterface.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Integration\Api;
  7. use Magento\Integration\Model\Integration as IntegrationModel;
  8. /**
  9. * Integration Service Interface
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface IntegrationServiceInterface
  15. {
  16. /**
  17. * Create a new Integration
  18. *
  19. * @param array $integrationData
  20. * @return IntegrationModel
  21. * @throws \Magento\Framework\Exception\IntegrationException
  22. */
  23. public function create(array $integrationData);
  24. /**
  25. * Get the details of a specific Integration.
  26. *
  27. * @param int $integrationId
  28. * @return IntegrationModel
  29. * @throws \Magento\Framework\Exception\IntegrationException
  30. */
  31. public function get($integrationId);
  32. /**
  33. * Find Integration by name.
  34. *
  35. * @param string $integrationName
  36. * @return IntegrationModel
  37. */
  38. public function findByName($integrationName);
  39. /**
  40. * Get the details of an Integration by consumer_id.
  41. *
  42. * @param int $consumerId
  43. * @return IntegrationModel
  44. */
  45. public function findByConsumerId($consumerId);
  46. /**
  47. * Get the details of an active Integration by consumer_id.
  48. *
  49. * @param int $consumerId
  50. * @return IntegrationModel
  51. */
  52. public function findActiveIntegrationByConsumerId($consumerId);
  53. /**
  54. * Update an Integration.
  55. *
  56. * @param array $integrationData
  57. * @return IntegrationModel
  58. * @throws \Magento\Framework\Exception\IntegrationException
  59. */
  60. public function update(array $integrationData);
  61. /**
  62. * Delete an Integration.
  63. *
  64. * @param int $integrationId
  65. * @return array Integration data
  66. * @throws \Magento\Framework\Exception\IntegrationException
  67. */
  68. public function delete($integrationId);
  69. /**
  70. * Return an array of selected resources for an integration.
  71. *
  72. * @param int $integrationId
  73. * @return array
  74. */
  75. public function getSelectedResources($integrationId);
  76. }