-
Notifications
You must be signed in to change notification settings - Fork 16
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 #19 from apidae-tourisme/edit_autorisation
+ v002/autorisation/objet-touristique/modification/
- Loading branch information
Showing
4 changed files
with
77 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
ini_set('display_errors', 1); | ||
error_reporting(E_ALL); | ||
|
||
require __DIR__ . "/requires.inc.php"; | ||
|
||
$client = new \Sitra\ApiClient\Client($config); | ||
|
||
/** | ||
* Fill with some offers ID | ||
* Key is the offer ID | ||
* Value is the expected result | ||
* The exemples below should be edited depending on your project owner (default expected results are meant for member 1157 / Apidae Tourisme) | ||
*/ | ||
$offers = [ | ||
5163353 => 'Offer owned by project manager : Should be allowed', | ||
5023027 => 'Offer masqued, but owned by project manager : Should be allowed', | ||
1 => 'Offer does not exist : 404 / Exception', | ||
]; | ||
|
||
echo '<pre>'; | ||
|
||
foreach ($offers as $offer => $expected) { | ||
echo $offer . ' expected : ' . $expected . "\n"; | ||
try { | ||
$response = $client->getEditAutorisation(['id' => $offer]); | ||
echo $response['response']->getContents(); | ||
} catch (Exception $e) { | ||
echo $e; | ||
} | ||
echo "\n" . '<hr />' . "\n"; | ||
} |
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,32 @@ | ||
<?php | ||
|
||
namespace Sitra\ApiClient\Description; | ||
|
||
use Sitra\ApiClient\Client as ClientApi; | ||
|
||
class Edit | ||
{ | ||
public static $operations = array( | ||
// @see https://dev.apidae-tourisme.com/fr/documentation-technique/v2/api-decriture/v002autorisationobjet-touristiquemodification | ||
'getEditAutorisation' => [ | ||
'httpMethod' => 'GET', | ||
'uri' => '/api/v002/autorisation/objet-touristique/modification/{id}', | ||
'responseModel' => 'getResponseBody', | ||
'parameters' => [ | ||
'id' => [ | ||
'type' => 'integer', | ||
'location' => 'uri', | ||
'required' => true, | ||
], | ||
'tokenSSO' => [ | ||
'type' => 'string', | ||
'location' => 'query', | ||
'required' => false, | ||
] | ||
], | ||
'data' => [ | ||
'scope' => ClientApi::EDIT_SCOPE, | ||
], | ||
], | ||
); | ||
} |