Skip to content

Commit

Permalink
Merge pull request #32 from mxr576/company_api
Browse files Browse the repository at this point in the history
Add missing organization controller parameter
  • Loading branch information
mxr576 authored Nov 27, 2018
2 parents 3856d58 + 612da60 commit 75f2ac6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
5 changes: 3 additions & 2 deletions src/Api/Management/Controller/CompanyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ class CompanyController extends PaginatedEntityController implements CompanyCont
* @param string $organization
* @param \Apigee\Edge\ClientInterface $client
* @param \Apigee\Edge\Serializer\EntitySerializerInterface|null $entitySerializer
* @param \Apigee\Edge\Api\Management\Controller\OrganizationControllerInterface|null $organizationController
*/
public function __construct(string $organization, ClientInterface $client, ?EntitySerializerInterface $entitySerializer = null)
public function __construct(string $organization, ClientInterface $client, ?EntitySerializerInterface $entitySerializer = null, ?OrganizationControllerInterface $organizationController = null)
{
$entitySerializer = $entitySerializer ?? new CompanySerializer();
parent::__construct($organization, $client, $entitySerializer);
parent::__construct($organization, $client, $entitySerializer, $organizationController);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,17 @@ public function getMembers(): CompanyMembership;
/**
* Set (add/update/remove) members of a company.
*
* Warning! If you pass en empty membership object you remove all developers
* WARNING! If you pass en empty membership object you remove all developers
* from the company.
*
* The return array only contains the changes, it does not contain all
* members. Use getMembers() to retrieve it.
*
* @param \Apigee\Edge\Api\Management\Structure\CompanyMembership $members
* Array of developers with their optional roles in the company.
* Membership object with the changes to be applied.
*
* @return \Apigee\Edge\Api\Management\Structure\CompanyMembership
* Array of developers with their optional roles in the company.
* Membership object with the applied changes, it does not contain all
* members. Use getMembers() to retrieve them.
*/
public function setMembers(CompanyMembership $members): CompanyMembership;
public function setMembers(CompanyMembership $members);

/**
* Removes a developer from a company.
Expand Down
8 changes: 2 additions & 6 deletions src/Api/Management/Controller/DeveloperController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ class DeveloperController extends PaginatedEntityController implements Developer
* @param \Apigee\Edge\Serializer\EntitySerializerInterface|null $entitySerializer
* @param OrganizationControllerInterface|null $organizationController
*/
public function __construct(
string $organization,
ClientInterface $client,
?EntitySerializerInterface $entitySerializer = null,
?OrganizationControllerInterface $organizationController = null
) {
public function __construct(string $organization, ClientInterface $client, ?EntitySerializerInterface $entitySerializer = null, ?OrganizationControllerInterface $organizationController = null)
{
$entitySerializer = $entitySerializer ?? new DeveloperSerializer();
parent::__construct($organization, $client, $entitySerializer, $organizationController);
}
Expand Down
13 changes: 11 additions & 2 deletions src/Controller/StatusAwareEntityControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,23 @@
/**
* Interface StatusAwareEntityControllerInterface.
*
* Entity controller for those entities that has "status" property and the value of that property (and with that the
* status of the entity itself) can be changed only with an additional API call.
* Entity controller for those entities that has "status" property and the value
* of that property (and with that the status of the entity itself) can be
* changed only with an additional API call.
*
* @see https://docs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D
* @see https://docs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/developers/%7Bdeveloper_email_or_id%7D/apps/%7Bapp_name%7D
* @see \Apigee\Edge\Entity\Property\StatusPropertyAwareTrait
*/
interface StatusAwareEntityControllerInterface
{
/**
* Changes the status of an entity in Apigee Edge.
*
* @param string $entityId
* Id of an entity.
* @param string $status
* New status to be set.
*/
public function setStatus(string $entityId, string $status): void;
}

0 comments on commit 75f2ac6

Please sign in to comment.