Skip to content

Commit 0a78c67

Browse files
author
Cari Spruiell
committed
MAGETWO-36760: Add @api annotations to Integration module
- refactored service classes/interfaces - added @api annotations to service interfaces
1 parent e36739d commit 0a78c67

File tree

56 files changed

+177
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+177
-165
lines changed

app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public function execute()
2222
$resultRedirect = $this->resultRedirectFactory->create();
2323
if ($customerId = $this->getRequest()->getParam('customer_id')) {
2424
try {
25-
/** @var \Magento\Integration\Service\V1\CustomerTokenService $tokenService */
26-
$tokenService = $this->_objectManager->get('Magento\Integration\Service\V1\CustomerTokenService');
25+
/** @var \Magento\Integration\Model\CustomerTokenService $tokenService */
26+
$tokenService = $this->_objectManager->get('Magento\Integration\Model\CustomerTokenService');
2727
$tokenService->revokeCustomerAccessToken($customerId);
2828
$this->messageManager->addSuccess(__('You have revoked the customer\'s tokens.'));
2929
$resultRedirect->setPath('customer/index/edit', ['id' => $customerId, '_current' => true]);

app/code/Magento/Customer/Model/Plugin/CustomerAuthorization.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Magento\Customer\Model\Plugin;
88

99
use Magento\Authorization\Model\UserContextInterface;
10-
use Magento\Integration\Service\V1\AuthorizationServiceInterface as AuthorizationService;
10+
use Magento\Integration\Api\AuthorizationServiceInterface as AuthorizationService;
1111

1212
/**
1313
* Plugin around \Magento\Framework\Authorization::isAllowed

app/code/Magento/Integration/Service/V1/AdminTokenServiceInterface.php app/code/Magento/Integration/Api/AdminTokenServiceInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Integration\Service\V1;
7+
namespace Magento\Integration\Api;
88

99
use Magento\Framework\Exception\AuthenticationException;
1010
use Magento\Framework\Exception\InputException;
1111
use Magento\Framework\Exception\LocalizedException;
1212

1313
/**
1414
* Interface providing token generation for Admins
15+
*
16+
* @api
1517
*/
1618
interface AdminTokenServiceInterface
1719
{

app/code/Magento/Integration/Service/V1/AuthorizationServiceInterface.php app/code/Magento/Integration/Api/AuthorizationServiceInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Integration\Service\V1;
7+
namespace Magento\Integration\Api;
88

99
use Magento\Framework\Exception\LocalizedException;
1010

1111
/**
1212
* Interface for integration permissions management.
13+
*
14+
* @api
1315
*/
1416
interface AuthorizationServiceInterface
1517
{

app/code/Magento/Integration/Service/V1/CustomerTokenServiceInterface.php app/code/Magento/Integration/Api/CustomerTokenServiceInterface.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Integration\Service\V1;
7+
namespace Magento\Integration\Api;
88

99
use Magento\Framework\Exception\AuthenticationException;
1010

1111
/**
1212
* Interface providing token generation for Customers
13+
*
14+
* @api
1315
*/
1416
interface CustomerTokenServiceInterface
1517
{

app/code/Magento/Integration/Service/V1/IntegrationInterface.php app/code/Magento/Integration/Api/IntegrationServiceInterface.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Integration\Service\V1;
6+
namespace Magento\Integration\Api;
77

88
use Magento\Integration\Model\Integration as IntegrationModel;
99

1010
/**
1111
* Integration Service Interface
12+
*
13+
* @api
1214
*/
13-
interface IntegrationInterface
15+
interface IntegrationServiceInterface
1416
{
1517
/**
1618
* Create a new Integration

app/code/Magento/Integration/Service/V1/OauthInterface.php app/code/Magento/Integration/Api/OauthServiceInterface.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Integration\Service\V1;
6+
namespace Magento\Integration\Api;
77

88
use Magento\Integration\Model\Oauth\Token as OauthTokenModel;
99

1010
/**
1111
* Integration oAuth Service Interface
12+
*
13+
* @api
1214
*/
13-
interface OauthInterface
15+
interface OauthServiceInterface
1416
{
1517
/**
1618
* Create a new consumer account.

app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Webapi extends \Magento\Backend\Block\Widget\Form\Generic implements
3131
/** @var \Magento\Framework\Json\Encoder */
3232
protected $encoder;
3333

34-
/** @var \Magento\Integration\Service\V1\Integration */
34+
/** @var \Magento\Integration\Model\IntegrationService */
3535
protected $integrationService;
3636

3737
/**
@@ -44,7 +44,7 @@ class Webapi extends \Magento\Backend\Block\Widget\Form\Generic implements
4444
* @param \Magento\Framework\Acl\Resource\ProviderInterface $resourceProvider
4545
* @param \Magento\Integration\Helper\Data $integrationData
4646
* @param \Magento\Framework\Json\Encoder $encoder
47-
* @param \Magento\Integration\Service\V1\Integration $integrationService
47+
* @param \Magento\Integration\Model\IntegrationService $integrationService
4848
* @param array $data
4949
*/
5050
public function __construct(
@@ -55,7 +55,7 @@ public function __construct(
5555
\Magento\Framework\Acl\Resource\ProviderInterface $resourceProvider,
5656
\Magento\Integration\Helper\Data $integrationData,
5757
\Magento\Framework\Json\Encoder $encoder,
58-
\Magento\Integration\Service\V1\Integration $integrationService,
58+
\Magento\Integration\Model\IntegrationService $integrationService,
5959
array $data = []
6060
) {
6161
$this->_rootResource = $rootResource;

app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Webapi.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Webapi extends \Magento\Backend\Block\Widget\Form\Generic implements
4242
* @param \Magento\Framework\Acl\RootResource $rootResource
4343
* @param \Magento\Framework\Acl\Resource\ProviderInterface $aclResourceProvider
4444
* @param \Magento\Integration\Helper\Data $integrationData
45-
* @param \Magento\Integration\Service\V1\Integration $integrationService
45+
* @param \Magento\Integration\Model\IntegrationService $integrationService
4646
* @param array $data
4747
*
4848
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
@@ -54,7 +54,7 @@ public function __construct(
5454
\Magento\Framework\Acl\RootResource $rootResource,
5555
\Magento\Framework\Acl\Resource\ProviderInterface $aclResourceProvider,
5656
\Magento\Integration\Helper\Data $integrationData,
57-
\Magento\Integration\Service\V1\Integration $integrationService,
57+
\Magento\Integration\Model\IntegrationService $integrationService,
5858
array $data = []
5959
) {
6060
$this->_rootResource = $rootResource;

app/code/Magento/Integration/Controller/Adminhtml/Integration.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Integration\Controller\Adminhtml;
77

88
use Magento\Backend\App\Action;
9-
use Magento\Integration\Service\V1\OauthInterface as IntegrationOauthService;
9+
use Magento\Integration\Api\OauthServiceInterface as IntegrationOauthService;
1010

1111
/**
1212
* Controller for integrations management.
@@ -31,7 +31,7 @@ class Integration extends Action
3131
/** @var \Psr\Log\LoggerInterface */
3232
protected $_logger;
3333

34-
/** @var \Magento\Integration\Service\V1\IntegrationInterface */
34+
/** @var \Magento\Integration\Api\IntegrationServiceInterface */
3535
protected $_integrationService;
3636

3737
/** @var IntegrationOauthService */
@@ -55,7 +55,7 @@ class Integration extends Action
5555
* @param \Magento\Backend\App\Action\Context $context
5656
* @param \Magento\Framework\Registry $registry
5757
* @param \Psr\Log\LoggerInterface $logger
58-
* @param \Magento\Integration\Service\V1\IntegrationInterface $integrationService
58+
* @param \Magento\Integration\Api\IntegrationServiceInterface $integrationService
5959
* @param IntegrationOauthService $oauthService
6060
* @param \Magento\Framework\Json\Helper\Data $jsonHelper
6161
* @param \Magento\Integration\Helper\Data $integrationData
@@ -66,7 +66,7 @@ public function __construct(
6666
\Magento\Backend\App\Action\Context $context,
6767
\Magento\Framework\Registry $registry,
6868
\Psr\Log\LoggerInterface $logger,
69-
\Magento\Integration\Service\V1\IntegrationInterface $integrationService,
69+
\Magento\Integration\Api\IntegrationServiceInterface $integrationService,
7070
IntegrationOauthService $oauthService,
7171
\Magento\Framework\Json\Helper\Data $jsonHelper,
7272
\Magento\Integration\Helper\Data $integrationData,

app/code/Magento/Integration/Controller/Token/Access.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
namespace Magento\Integration\Controller\Token;
88

99
use Magento\Integration\Model\Integration as IntegrationModel;
10-
use Magento\Integration\Service\V1\IntegrationInterface as IntegrationService;
11-
use Magento\Integration\Service\V1\OauthInterface as IntegrationOauthService;
10+
use Magento\Integration\Api\IntegrationServiceInterface as IntegrationService;
11+
use Magento\Integration\Api\OauthServiceInterface as IntegrationOauthService;
1212

1313
class Access extends \Magento\Framework\App\Action\Action
1414
{

app/code/Magento/Integration/Service/V1/AdminTokenService.php app/code/Magento/Integration/Model/AdminTokenService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Integration\Service\V1;
7+
namespace Magento\Integration\Model;
88

99
use Magento\Framework\Exception\AuthenticationException;
1010
use Magento\Framework\Exception\LocalizedException;
@@ -18,7 +18,7 @@
1818
* Class to handle token generation for Admins
1919
*
2020
*/
21-
class AdminTokenService implements AdminTokenServiceInterface
21+
class AdminTokenService implements \Magento\Integration\Api\AdminTokenServiceInterface
2222
{
2323
/**
2424
* Token Model

app/code/Magento/Integration/Service/V1/AuthorizationService.php app/code/Magento/Integration/Model/AuthorizationService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Integration\Service\V1;
7+
namespace Magento\Integration\Model;
88

99
use Magento\Authorization\Model\Resource\Role\CollectionFactory as RoleCollectionFactory;
1010
use Magento\Authorization\Model\Resource\Rules\CollectionFactory as RulesCollectionFactory;
@@ -24,7 +24,7 @@
2424
* @SuppressWarnings(PHPMD.LongVariable)
2525
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2626
*/
27-
class AuthorizationService implements AuthorizationServiceInterface
27+
class AuthorizationService implements \Magento\Integration\Api\AuthorizationServiceInterface
2828
{
2929
/**
3030
* @var AclBuilder

app/code/Magento/Integration/Model/Config.php

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function __construct(Cache\Type $configCacheType, Config\Reader $configRe
4747
* Return integrations loaded from cache if enabled or from files merged previously
4848
*
4949
* @return array
50+
* @api
5051
*/
5152
public function getIntegrations()
5253
{

app/code/Magento/Integration/Model/ConfigBasedIntegrationManager.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ConfigBasedIntegrationManager
1616
/**
1717
* Integration service
1818
*
19-
* @var \Magento\Integration\Service\V1\IntegrationInterface
19+
* @var \Magento\Integration\Api\IntegrationServiceInterface
2020
*/
2121
protected $_integrationService;
2222

@@ -29,11 +29,11 @@ class ConfigBasedIntegrationManager
2929

3030
/**
3131
* @param Config $integrationConfig
32-
* @param \Magento\Integration\Service\V1\IntegrationInterface $integrationService
32+
* @param \Magento\Integration\Api\IntegrationServiceInterface $integrationService
3333
*/
3434
public function __construct(
3535
Config $integrationConfig,
36-
\Magento\Integration\Service\V1\IntegrationInterface $integrationService
36+
\Magento\Integration\Api\IntegrationServiceInterface $integrationService
3737
) {
3838
$this->_integrationService = $integrationService;
3939
$this->_integrationConfig = $integrationConfig;

app/code/Magento/Integration/Service/V1/CustomerTokenService.php app/code/Magento/Integration/Model/CustomerTokenService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Integration\Service\V1;
7+
namespace Magento\Integration\Model;
88

99
use Magento\Customer\Api\AccountManagementInterface;
1010
use Magento\Framework\Exception\LocalizedException;
@@ -13,7 +13,7 @@
1313
use Magento\Integration\Model\Oauth\TokenFactory as TokenModelFactory;
1414
use Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory as TokenCollectionFactory;
1515

16-
class CustomerTokenService implements CustomerTokenServiceInterface
16+
class CustomerTokenService implements \Magento\Integration\Api\CustomerTokenServiceInterface
1717
{
1818
/**
1919
* Token Model

app/code/Magento/Integration/Model/Integration.php

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public function loadActiveIntegrationByConsumerId($consumerId)
147147
* Get integration status. Cast to the type of STATUS_* constants in order to make strict comparison valid.
148148
*
149149
* @return int
150+
* @api
150151
*/
151152
public function getStatus()
152153
{

app/code/Magento/Integration/Model/IntegrationConfig.php

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function __construct(TypeIntegration $configCacheType, Reader $configRead
4949
* Return integrations loaded from cache if enabled or from files merged previously
5050
*
5151
* @return array
52+
* @api
5253
*/
5354
public function getIntegrations()
5455
{

app/code/Magento/Integration/Service/V1/Integration.php app/code/Magento/Integration/Model/IntegrationService.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Integration\Service\V1;
6+
namespace Magento\Integration\Model;
77

88
use Magento\Integration\Model\Integration as IntegrationModel;
99
use Magento\Integration\Model\IntegrationFactory;
10-
use Magento\Integration\Service\V1\OauthInterface as IntegrationOauthService;
10+
use Magento\Integration\Api\OauthServiceInterface as IntegrationOauthService;
1111
use Magento\Framework\Exception\IntegrationException;
1212

1313
/**
1414
* Integration Service.
1515
*
1616
* This service is used to interact with integrations.
1717
*/
18-
class Integration implements \Magento\Integration\Service\V1\IntegrationInterface
18+
class IntegrationService implements \Magento\Integration\Api\IntegrationServiceInterface
1919
{
2020
/**
2121
* @var IntegrationFactory

app/code/Magento/Integration/Service/V1/Oauth.php app/code/Magento/Integration/Model/OauthService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Integration\Service\V1;
6+
namespace Magento\Integration\Model;
77

88
use Magento\Framework\Oauth\Helper\Oauth as OauthHelper;
99
use Magento\Integration\Helper\Oauth\Data as IntegrationOauthHelper;
@@ -19,7 +19,7 @@
1919
*
2020
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2121
*/
22-
class Oauth implements OauthInterface
22+
class OauthService implements \Magento\Integration\Api\OauthServiceInterface
2323
{
2424
/**
2525
* @var \Magento\Store\Model\StoreManagerInterface

0 commit comments

Comments
 (0)