diff --git a/src/Api/ApigeeX/Controller/AppByOwnerController.php b/src/Api/ApigeeX/Controller/AppByOwnerController.php new file mode 100644 index 00000000..55a2f7fc --- /dev/null +++ b/src/Api/ApigeeX/Controller/AppByOwnerController.php @@ -0,0 +1,53 @@ +appGroup = $appGroup; $entitySerializer = $entitySerializer ?? new AppGroupEntitySerializer(); @@ -62,26 +61,6 @@ public function __construct( parent::__construct($organization, $client, $entitySerializer); } - /** - * Override the getEntities() method, for AppGroup compatibility. - * - * AppGroup does not support the "expand=false" query parameter. - * - * {@inheritdoc} - * - * @return \Apigee\Edge\Entity\EntityInterface[] - */ - public function getEntities(): array - { - $uri = $this->getBaseEndpointUri(); - $response = $this->getClient()->get($uri); - $responseArray = $this->responseToArray($response); - // Ignore entity type key from response, ex.: apiProduct. - $responseArray = reset($responseArray); - - return $this->responseArrayToArrayOfEntities($responseArray); - } - /** * Override the getEntityIds() method, for AppGroup compatibility. * diff --git a/src/Api/ApigeeX/Controller/AppGroupAppControllerInterface.php b/src/Api/ApigeeX/Controller/AppGroupAppControllerInterface.php index 20a12164..20d2bac0 100644 --- a/src/Api/ApigeeX/Controller/AppGroupAppControllerInterface.php +++ b/src/Api/ApigeeX/Controller/AppGroupAppControllerInterface.php @@ -18,12 +18,10 @@ namespace Apigee\Edge\Api\ApigeeX\Controller; -use Apigee\Edge\Api\Management\Controller\AppByOwnerControllerInterface; - /** * Interface AppGroupAppControllerInterface. * - * @see https://apidocs.apigee.com/api/apps-appgroup + * @see https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.appgroups.apps */ interface AppGroupAppControllerInterface extends AppByOwnerControllerInterface, AppGroupAwareControllerInterface { diff --git a/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/apps/GET_pageToken=4phpunit_test_app.json b/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/apps/GET_pageToken=4phpunit_test_app.json new file mode 100644 index 00000000..b29c7b36 --- /dev/null +++ b/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/apps/GET_pageToken=4phpunit_test_app.json @@ -0,0 +1,84 @@ +{ + "app": [ + { + "appFamily": "default", + "appId": "b3e71cbb-7eb5-4444-b384-ac82bca1d9dc", + "attributes": [ + { + "name": "DisplayName", + "value": "PHP Unit: Test app" + }, + { + "name": "Notes", + "value": "This is a test app created by PHP Unit." + }, + { + "name": "foo", + "value": "foo" + }, + { + "name": "bar", + "value": "baz" + } + ], + "callbackUrl": "http://example.com", + "createdAt": 648345600000, + "createdBy": "phpunit@example.com", + "credentials": [ + { + "apiProducts": [], + "attributes": [], + "consumerKey": "wAXAIiOr2oJOVGqFltnm3Jwr2LE0GEuY", + "consumerSecret": "S8YjnsjmdBqDAegR", + "issuedAt": 648345600000, + "scopes": [], + "status": "approved" + } + ], + "appGroup": "phpunit", + "lastModifiedAt": 648345600000, + "lastModifiedBy": "phpunit@example.com", + "name": "4phpunit_test_app", + "scopes": [], + "status": "approved" + }, + { + "appFamily": "default", + "appId": "b3e71cbb-7eb5-3333-b384-ac82bca1d9dc", + "attributes": [ + { + "name": "DisplayName", + "value": "PHP Unit: Test app" + }, + { + "name": "Notes", + "value": "This is a test app created by PHP Unit." + }, + { + "name": "foo", + "value": "bar" + } + ], + "callbackUrl": "http://example.com", + "createdAt": 648345600000, + "createdBy": "phpunit@example.com", + "credentials": [ + { + "apiProducts": [], + "attributes": [], + "consumerKey": "wAXAIiOr2oJOVGqFltnm3Jwr2LE0GEuY", + "consumerSecret": "S8YjnsjmdBqDAegR", + "issuedAt": 648345600000, + "scopes": [], + "status": "approved" + } + ], + "appGroup": "phpunit", + "lastModifiedAt": 648345600000, + "lastModifiedBy": "phpunit@example.com", + "name": "5phpunit_test_app", + "scopes": [], + "status": "approved" + } + ] +} diff --git a/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/apps/GET_pageToken=5phpunit_test_app.json b/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/apps/GET_pageToken=5phpunit_test_app.json new file mode 100644 index 00000000..2b6031ce --- /dev/null +++ b/tests/offline-test-data/v1/organizations/phpunit/appgroups/phpunit/apps/GET_pageToken=5phpunit_test_app.json @@ -0,0 +1,42 @@ +{ + "app": [ + { + "appFamily": "default", + "appId": "b3e71cbb-7eb5-3333-b384-ac82bca1d9dc", + "attributes": [ + { + "name": "DisplayName", + "value": "PHP Unit: Test app" + }, + { + "name": "Notes", + "value": "This is a test app created by PHP Unit." + }, + { + "name": "foo", + "value": "bar" + } + ], + "callbackUrl": "http://example.com", + "createdAt": 648345600000, + "createdBy": "phpunit@example.com", + "credentials": [ + { + "apiProducts": [], + "attributes": [], + "consumerKey": "wAXAIiOr2oJOVGqFltnm3Jwr2LE0GEuY", + "consumerSecret": "S8YjnsjmdBqDAegR", + "issuedAt": 648345600000, + "scopes": [], + "status": "approved" + } + ], + "appGroup": "phpunit", + "lastModifiedAt": 648345600000, + "lastModifiedBy": "phpunit@example.com", + "name": "5phpunit_test_app", + "scopes": [], + "status": "approved" + } + ] +}