Skip to content

Developer Service

The Developer Service exposes methods to create, update, delete, get, list developers, also some other operations related to developers.

Usage

php
use \Lordjoo\Apigee\Facades\Apigee;
$developerService = Apigee::edge()->developer();
use \Lordjoo\Apigee\Facades\Apigee;
$developerService = Apigee::edge()->developer();

List all developers

Using the get() method, you can get a collection of all developers in the organization.

php
$developers = $developerService->get();
$developers = $developerService->get();

$developers is a Laravel Collection of Developer objects.

Get a developer by email

Using the find() method, you can get a developer by email.

php
$developer = $developerService->find($email);
$developer = $developerService->find($email);

$developer is an instance of Developer object.

Create a developer

Using the create() method, you can create a developer, the create() method accepts one parameter $data where $data is an array of the developer properties DeveloperRequest

php
$developer = $developerService->create($data);
$developer = $developerService->create($data);

Update a developer

Using the update() method, you can update a developer, the update() method accepts two parameters $email and $data where $email is the email of the developer you want to update and $data is an array of the developer properties DeveloperRequest

php
$developer = $developerService->update($email, $data);
$developer = $developerService->update($email, $data);

Note

The create and update method will do a validation check on the data you passed, so if you passed an invalid data, the method will throw a validation exception.

Delete a developer

Using the delete() method, you can delete a developer by it's email.

php
$developerService->delete($email);
$developerService->delete($email);

Change a developer's status

Using the updateStatus() method, you can change a developer's status by it's email. the updateStatus() method accepts two parameters $email and $status where $email is the email of the developer you want to change the status of and $status is the new status of the developer, either active or inactive

php
$developerService->updateStatus($email, $status);
$developerService->updateStatus($email, $status);

Entity

Properties

PropertyTypeDescription
firstNamestringFirst name of the developer
lastNamestringLast name of the developer
userNamestringUser name of the developer
emailstringEmail of the developer
statusstringStatus of the developer, either active or inactive
companiesstring[]Array of companies the developer is associated with
organizationNamestringName of the organization the developer is associated with
lastModifiedAtCarbonDate and time the developer was last modified
createdAtCarbonDate and time the developer was created
createdBystringEmail of the user who created the developer
lastModifiedBystringEmail of the user who last modified the developer

Methods

We also provide some helper methods to make it easier to work with the developer entity

getApps()

return a collection of DeveloperApp entities associated with the developer

activate()

Update the developer status to active

php
$developer->activate();
$developer->activate();

deactivate()

Update the developer status to inactive

php
$developer->deactivate();
$developer->deactivate();

update(array $data)

Update the developer properties, the $data parameter is an array of the developer properties DeveloperRequest

php
$developer->update($data);
$developer->update($data);

delete()

Delete the developer

php
$developer->delete();
$developer->delete();

Released under the MIT License.