Skip to content

Commit

Permalink
Added changes for AppGroup Apps pagination-3x (apigee#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli authored Sep 15, 2023
1 parent 0d8c2e3 commit cd6ec82
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace Drupal\apigee_edge_teams\Entity\Controller;

use Apigee\Edge\Api\ApigeeX\Controller\AppByOwnerControllerInterface as XAppByOwnerControllerInterface;
use Apigee\Edge\Api\ApigeeX\Controller\AppGroupAppController as EdgeAppGroupAppController;
use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface as EdgeAppByOwnerControllerInterface;
use Apigee\Edge\Api\Management\Controller\CompanyAppController as EdgeCompanyAppController;
Expand All @@ -28,14 +29,14 @@
/**
* Definition of the Team app controller service.
*
* We call company apps as team apps in Drupal.
* We call company/appgroup apps as team apps in Drupal.
*/
final class TeamAppController extends AppByOwnerController implements TeamAppControllerInterface {

/**
* {@inheritdoc}
*/
protected function decorated(): EdgeAppByOwnerControllerInterface {
protected function decorated(): EdgeAppByOwnerControllerInterface|XAppByOwnerControllerInterface {
if (!isset($this->instances[$this->owner])) {
// Checks whether the organization is Edge or ApigeeX organization.
if ($this->organizationController->isOrganizationApigeeX()) {
Expand All @@ -57,4 +58,13 @@ public function getCompanyName(): string {
return $decorated->getCompanyName();
}

/**
* {@inheritdoc}
*/
public function getAppGroup(): string {
/** @var \Apigee\Edge\Api\ApigeeX\Controller\AppGroupAppControllerInterface $decorated */
$decorated = $this->decorated();
return $decorated->getAppGroup();
}

}
15 changes: 8 additions & 7 deletions src/Entity/Controller/AppByOwnerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

namespace Drupal\apigee_edge\Entity\Controller;

use Apigee\Edge\Api\ApigeeX\Controller\AppByOwnerControllerInterface as XAppByOwnerControllerInterface;
use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface;
use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface as EdgeAppByOwnerControllerInterface;
use Apigee\Edge\Entity\EntityInterface;
Expand All @@ -31,7 +32,7 @@
use Drupal\apigee_edge\SDKConnectorInterface;

/**
* Base class for developer- and company app controller services in Drupal.
* Base class for developer- and company/appgroup app controller services in Drupal.
*/
abstract class AppByOwnerController extends AppControllerBase implements AppByOwnerControllerInterface {

Expand All @@ -51,7 +52,7 @@ abstract class AppByOwnerController extends AppControllerBase implements AppByOw
/**
* The owner of an app.
*
* It could be a developer's email address, uuid or a company's company name.
* It could be a developer's email address, uuid or a company's or appgroup's company/appgroup name.
*
* @var string
*/
Expand All @@ -75,7 +76,7 @@ abstract class AppByOwnerController extends AppControllerBase implements AppByOw
* AppByOwnerController constructor.
*
* @param string $owner
* A developer's email address, uuid or a company's company name.
* A developer's email address, uuid or a company's or appgroup's company/appgroup name.
* @param \Drupal\apigee_edge\SDKConnectorInterface $connector
* The SDK connector service.
* @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller
Expand All @@ -95,12 +96,12 @@ public function __construct(string $owner, SDKConnectorInterface $connector, Org
}

/**
* Returns the decorated developer- or company app controller.
* Returns the decorated developer- or company/appgroup app controller.
*
* @return \Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface
* The initialized developer- or company app controller.
* @return \Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface|Apigee\Edge\Api\ApigeeX\Controller\AppByOwnerControllerInterface
* The initialized developer- or company/appgroup app controller.
*/
abstract protected function decorated() : EdgeAppByOwnerControllerInterface;
abstract protected function decorated() : EdgeAppByOwnerControllerInterface|XAppByOwnerControllerInterface;

/**
* {@inheritdoc}
Expand Down

0 comments on commit cd6ec82

Please sign in to comment.