generated from CommonGateway/PetStoreBundle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from OpenCatalogi/feature/OP/mapping
Added async action for updating description
- Loading branch information
Showing
19 changed files
with
366 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"title": "Enrich Organization Action", | ||
"$id": "https://opencatalogi.nl/action/oc.enrichOrganization.action.json", | ||
"$schema": "https://docs.commongateway.nl/schemas/Action.schema.json", | ||
"version": "0.0.1", | ||
"async": true, | ||
"priority": 2, | ||
"listens": ["opencatalogi.enrich.organization"], | ||
"class": "OpenCatalogi\\OpenCatalogiBundle\\ActionHandler\\EnrichOrganizationHandler", | ||
"conditions": { | ||
"==": [ | ||
1, | ||
1 | ||
] | ||
}, | ||
"configuration": { | ||
"githubSource": "https://opencatalogi.nl/source/oc.GitHubAPI.source.json", | ||
"organizationSchema": "https://opencatalogi.nl/oc.organisation.schema.json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
namespace OpenCatalogi\OpenCatalogiBundle\ActionHandler; | ||
|
||
use CommonGateway\CoreBundle\ActionHandler\ActionHandlerInterface; | ||
use OpenCatalogi\OpenCatalogiBundle\Service\EnrichOrganizationService; | ||
use OpenCatalogi\OpenCatalogiBundle\Service\FindGithubRepositoryThroughOrganizationService; | ||
use OpenCatalogi\OpenCatalogiBundle\Service\GithubApiService; | ||
|
||
/** | ||
* Executes a the EnrichOrganizationHandler and gets an organization from the response of the githubEventAction and formInputAction | ||
* and enriches the organization. | ||
*/ | ||
class EnrichOrganizationHandler implements ActionHandlerInterface | ||
{ | ||
|
||
/** | ||
* @var EnrichOrganizationService | ||
*/ | ||
private EnrichOrganizationService $service; | ||
|
||
|
||
/** | ||
* @param EnrichOrganizationService $service The EnrichOrganizationService | ||
*/ | ||
public function __construct(EnrichOrganizationService $service) | ||
{ | ||
$this->service = $service; | ||
|
||
}//end __construct() | ||
|
||
|
||
/** | ||
* This function returns the required configuration as a [json-schema](https://json-schema.org/) array. | ||
* | ||
* @return array a [json-schema](https://json-schema.org/) that this action should comply to | ||
*/ | ||
public function getConfiguration() | ||
{ | ||
return [ | ||
'$id' => 'https://opencatalogi.nl/ActionHandler/EnrichOrganizationHandler.ActionHandler.json', | ||
'$schema' => 'https://docs.commongateway.nl/schemas/ActionHandler.schema.json', | ||
'title' => 'EnrichOrganizationHandler', | ||
'description' => 'This handler enriches the organizations', | ||
'required' => [ | ||
'githubSource', | ||
'organizationSchema', | ||
], | ||
'properties' => [ | ||
'githubSource' => [ | ||
'type' => 'string', | ||
'description' => 'The source of the github api.', | ||
'example' => 'https://opencatalogi.nl/source/oc.GitHubAPI.source.json', | ||
'reference' => 'https://opencatalogi.nl/source/oc.GitHubAPI.source.json', | ||
'required' => true, | ||
], | ||
'organizationSchema' => [ | ||
'type' => 'string', | ||
'description' => 'The organisation schema.', | ||
'example' => 'https://opencatalogi.nl/oc.organisation.schema.json', | ||
'reference' => 'https://opencatalogi.nl/oc.organisation.schema.json', | ||
'required' => true, | ||
], | ||
], | ||
]; | ||
|
||
}//end getConfiguration() | ||
|
||
|
||
/** | ||
* This function runs the enrich organization service plugin. | ||
* | ||
* @param array $data The data from the call | ||
* @param array $configuration The configuration of the action | ||
* | ||
* @return array | ||
*/ | ||
public function run(array $data, array $configuration): array | ||
{ | ||
return $this->service->enrichOrganizationHandler($data, $configuration); | ||
|
||
}//end run() | ||
|
||
|
||
}//end class |
Oops, something went wrong.