-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from magento-performance/cabpi-346
CABPI-346, CABPI-348
- Loading branch information
Showing
30 changed files
with
1,725 additions
and
332 deletions.
There are no files selected for viewing
147 changes: 147 additions & 0 deletions
147
app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\AdminAdobeIms\Api\Data; | ||
|
||
use Magento\Framework\Api\ExtensibleDataInterface; | ||
|
||
/** | ||
* Declare the ims token data service object | ||
* @api | ||
*/ | ||
interface ImsWebapiInterface extends ExtensibleDataInterface | ||
{ | ||
/** | ||
* Get ID | ||
* | ||
* @return int|null | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* Get admin user ID | ||
* | ||
* @return int|null | ||
*/ | ||
public function getAdminUserId(): ?int; | ||
|
||
/** | ||
* Set admin user ID | ||
* | ||
* @param int $value | ||
* @return $this | ||
*/ | ||
public function setAdminUserId(int $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Get access token hash | ||
* | ||
* @return string|null | ||
*/ | ||
public function getAccessTokenHash(): ?string; | ||
|
||
/** | ||
* Set access token hash | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setAccessTokenHash(string $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Get access token | ||
* | ||
* @return string|null | ||
*/ | ||
public function getAccessToken(): ?string; | ||
|
||
/** | ||
* Set access token | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setAccessToken(string $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Get creation time | ||
* | ||
* @return string|null | ||
*/ | ||
public function getCreatedAt(): ?string; | ||
|
||
/** | ||
* Set creation time | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setCreatedAt(string $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Get update time | ||
* | ||
* @return string|null | ||
*/ | ||
public function getUpdatedAt(): ?string; | ||
|
||
/** | ||
* Set update time | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setUpdatedAt(string $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Get last check time | ||
* | ||
* @return string|null | ||
*/ | ||
public function getLastCheckTime(): ?string; | ||
|
||
/** | ||
* Set last check time | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setLastCheckTime(string $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Get expires time of token | ||
* | ||
* @return string|null | ||
*/ | ||
public function getAccessTokenExpiresAt(): ?string; | ||
|
||
/** | ||
* Set expires time of token | ||
* | ||
* @param string $value | ||
* @return $this | ||
*/ | ||
public function setAccessTokenExpiresAt(string $value): ImsWebapiInterface; | ||
|
||
/** | ||
* Retrieve existing extension attributes object or create a new one. | ||
* | ||
* @return \Magento\AdminAdobeIms\Api\Data\ImsWebapiExtensionInterface | ||
*/ | ||
public function getExtensionAttributes(): ImsWebapiExtensionInterface; | ||
|
||
/** | ||
* Set extension attributes | ||
* | ||
* @param \Magento\AdminAdobeIms\Api\Data\ImsWebapiExtensionInterface $extensionAttributes | ||
* @return $this | ||
*/ | ||
public function setExtensionAttributes( | ||
ImsWebapiExtensionInterface $extensionAttributes | ||
): ImsWebapiInterface; | ||
} |
35 changes: 35 additions & 0 deletions
35
app/code/Magento/AdminAdobeIms/Api/Data/ImsWebapiSearchResultsInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\AdminAdobeIms\Api\Data; | ||
|
||
use Magento\AdminAdobeIms\Api\Data\ImsWebapiInterface; | ||
use Magento\Framework\Api\SearchResultsInterface; | ||
|
||
/** | ||
* Interface ImsWebapiSearchResultsInterface | ||
* | ||
* @api | ||
*/ | ||
interface ImsWebapiSearchResultsInterface extends SearchResultsInterface | ||
{ | ||
/** | ||
* Get ims token list. | ||
* | ||
* @return ImsWebapiInterface[] | ||
*/ | ||
public function getItems(); | ||
|
||
/** | ||
* Set ims token list. | ||
* | ||
* @param ImsWebapiInterface[] $items | ||
* @return $this | ||
*/ | ||
public function setItems(array $items); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
app/code/Magento/AdminAdobeIms/Api/ImsWebapiRepositoryInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\AdminAdobeIms\Api; | ||
|
||
use Magento\AdminAdobeIms\Api\Data\ImsWebapiInterface; | ||
|
||
use Magento\AdminAdobeIms\Api\Data\ImsWebapiSearchResultsInterface; | ||
use Magento\Framework\Api\SearchCriteriaInterface; | ||
use Magento\Framework\Exception\CouldNotSaveException; | ||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
|
||
/** | ||
* Declare ims web api repository | ||
* @api | ||
*/ | ||
interface ImsWebapiRepositoryInterface | ||
{ | ||
/** | ||
* Save ims token | ||
* | ||
* @param ImsWebapiInterface $entity | ||
* @return void | ||
* @throws CouldNotSaveException | ||
*/ | ||
public function save(ImsWebapiInterface $entity): void; | ||
|
||
/** | ||
* Get ims token | ||
* | ||
* @param int $entityId | ||
* @return ImsWebapiInterface | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function get(int $entityId): ImsWebapiInterface; | ||
|
||
/** | ||
* Get ims token(s) by admin user id | ||
* | ||
* @param int $adminUserId | ||
* @return ImsWebapiInterface[] | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getByAdminUserId(int $adminUserId): array; | ||
|
||
/** | ||
* Get entity by access token hash | ||
* | ||
* @param string $tokenHash | ||
* @return ImsWebapiInterface | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getByAccessTokenHash(string $tokenHash): ImsWebapiInterface; | ||
|
||
/** | ||
* Get ims token by search criteria | ||
* | ||
* @param SearchCriteriaInterface $searchCriteria | ||
* @return ImsWebapiSearchResultsInterface | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function getList(SearchCriteriaInterface $searchCriteria): ImsWebapiSearchResultsInterface; | ||
|
||
/** | ||
* Delete ims tokens for admin user id. | ||
* | ||
* @param int $adminUserId | ||
* @return bool | ||
* @throws NoSuchEntityException | ||
* @throws LocalizedException | ||
*/ | ||
public function deleteByAdminUserId(int $adminUserId): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.