Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added changes for AppGroup Apps pagination-3x #934

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading