Developer Service
The Developer Service exposes methods to create, update, delete, get, list developers, also some other operations related to developers.
Usage
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.
$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.
$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
$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
$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.
$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
$developerService->updateStatus($email, $status);$developerService->updateStatus($email, $status);Entity
Properties
| Property | Type | Description |
|---|---|---|
| firstName | string | First name of the developer |
| lastName | string | Last name of the developer |
| userName | string | User name of the developer |
| string | Email of the developer | |
| status | string | Status of the developer, either active or inactive |
| companies | string[] | Array of companies the developer is associated with |
| organizationName | string | Name of the organization the developer is associated with |
| lastModifiedAt | Carbon | Date and time the developer was last modified |
| createdAt | Carbon | Date and time the developer was created |
| createdBy | string | Email of the user who created the developer |
| lastModifiedBy | string | Email 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
$developer->activate();$developer->activate();deactivate()
Update the developer status to inactive
$developer->deactivate();$developer->deactivate();update(array $data)
Update the developer properties, the $data parameter is an array of the developer properties DeveloperRequest
$developer->update($data);$developer->update($data);delete()
Delete the developer
$developer->delete();$developer->delete();