CustomerLinkRepositoryInterface.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. /**
  3. * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License").
  6. * You may not use this file except in compliance with the License.
  7. * A copy of the License is located at
  8. *
  9. * http://aws.amazon.com/apache2.0
  10. *
  11. * or in the "license" file accompanying this file. This file is distributed
  12. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  13. * express or implied. See the License for the specific language governing
  14. * permissions and limitations under the License.
  15. */
  16. namespace Amazon\Login\Api;
  17. use Magento\Framework\Exception\CouldNotSaveException;
  18. use Magento\Framework\Exception\CouldNotDeleteException;
  19. use Magento\Framework\Exception\NoSuchEntityException;
  20. /**
  21. * CustomerLink (Amazon Customer <=> Magento Customer) CRUD interface.
  22. *
  23. * @api
  24. */
  25. interface CustomerLinkRepositoryInterface
  26. {
  27. /**
  28. * Lists payment tokens that match specified search criteria.
  29. *
  30. * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria The search criteria.
  31. * @return \Amazon\Login\Api\Data\CustomerLinkSearchResultsInterface search result interface.
  32. */
  33. public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria);
  34. /**
  35. * Loads by Customer ID.
  36. *
  37. * @param int $customerId The customer ID.
  38. * @return \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface.
  39. */
  40. public function get($customerId);
  41. /**
  42. * Loads by Entity ID.
  43. *
  44. * @param int $entityId The customer link entity ID.
  45. * @return \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface.
  46. */
  47. public function getById($entityId);
  48. /**
  49. * Delete customer link.
  50. *
  51. * @param \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface.
  52. * @return bool
  53. * @throws CouldNotDeleteException
  54. */
  55. public function delete(Data\CustomerLinkInterface $customerLink);
  56. /**
  57. * Delete customer link by entity id
  58. *
  59. * @param string $entityId
  60. * @return bool
  61. * @throws CouldNotDeleteException
  62. * @throws NoSuchEntityException
  63. */
  64. public function deleteById($entityId);
  65. /**
  66. * Save customer link
  67. *
  68. * @param \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface.
  69. * @return \Amazon\Login\Api\Data\CustomerLinkInterface
  70. * @throws CouldNotSaveException
  71. */
  72. public function save(Data\CustomerLinkInterface $customerLink);
  73. }