-
Notifications
You must be signed in to change notification settings - Fork 21
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 #100 from Catrobat/create-pull-request/patch-16193…
…68486 Bump autogenerated OpenAPI code
- Loading branch information
Showing
61 changed files
with
705 additions
and
212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -31,6 +31,7 @@ | |
use OpenAPI\Server\Model\LoginRequest; | ||
use OpenAPI\Server\Model\OAuthLoginRequest; | ||
use OpenAPI\Server\Model\RefreshRequest; | ||
use OpenAPI\Server\Model\UpgradeTokenRequest; | ||
|
||
/** | ||
* AuthenticationApiInterface Interface Doc Comment. | ||
|
@@ -100,7 +101,7 @@ public function authenticationPost(LoginRequest $login_request, &$responseCode, | |
/** | ||
* Operation authenticationRefreshPost. | ||
* | ||
* Refresh token | ||
* Refresh token -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param OpenAPI\Server\Model\RefreshRequest $refresh_request (required) | ||
* @param int $responseCode The HTTP response code to return | ||
|
@@ -109,4 +110,17 @@ public function authenticationPost(LoginRequest $login_request, &$responseCode, | |
* @return OpenAPI\Server\Model\JWTResponse | ||
*/ | ||
public function authenticationRefreshPost(RefreshRequest $refresh_request, &$responseCode, array &$responseHeaders); | ||
|
||
/** | ||
* Operation authenticationUpgradePost. | ||
* | ||
* Upgrade a deprecated token -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param OpenAPI\Server\Model\UpgradeTokenRequest $upgrade_token_request (required) | ||
* @param int $responseCode The HTTP response code to return | ||
* @param array $responseHeaders Additional HTTP headers to return with the response () | ||
* | ||
* @return OpenAPI\Server\Model\JWTResponse | ||
*/ | ||
public function authenticationUpgradePost(UpgradeTokenRequest $upgrade_token_request, &$responseCode, array &$responseHeaders); | ||
} |
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -51,7 +51,7 @@ public function setPandaAuth($value); | |
/** | ||
* Operation notificationIdReadPut. | ||
* | ||
* Mark specified notification as read | ||
* Mark specified notification as read - StatusCode: 501 - Not yet implemented | ||
* | ||
* @param int $id (required) | ||
* @param string $accept_language (optional) | ||
|
@@ -63,7 +63,7 @@ public function notificationIdReadPut(int $id, string $accept_language = null, & | |
/** | ||
* Operation notificationsCountGet. | ||
* | ||
* Count the number of unseen notifications | ||
* Count the number of unseen notifications -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param int $responseCode The HTTP response code to return | ||
* @param array $responseHeaders Additional HTTP headers to return with the response () | ||
|
@@ -75,7 +75,7 @@ public function notificationsCountGet(&$responseCode, array &$responseHeaders); | |
/** | ||
* Operation notificationsGet. | ||
* | ||
* Get user notifications | ||
* Get user notifications -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param string $accept_language (optional) | ||
* @param int $limit (optional, default to 20) | ||
|
@@ -91,7 +91,7 @@ public function notificationsGet(string $accept_language = null, int $limit = 20 | |
/** | ||
* Operation notificationsReadPut. | ||
* | ||
* Mark all notifications as read | ||
* Mark all notifications as read -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param int $responseCode The HTTP response code to return | ||
* @param array $responseHeaders Additional HTTP headers to return with the response () | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -49,6 +49,17 @@ interface ProjectsApiInterface | |
*/ | ||
public function setPandaAuth($value); | ||
|
||
/** | ||
* Operation projectIdDelete. | ||
* | ||
* Delete a project -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param string $id (required) | ||
* @param int $responseCode The HTTP response code to return | ||
* @param array $responseHeaders Additional HTTP headers to return with the response () | ||
*/ | ||
public function projectIdDelete(string $id, &$responseCode, array &$responseHeaders); | ||
|
||
/** | ||
* Operation projectIdGet. | ||
* | ||
|
@@ -84,7 +95,7 @@ public function projectIdRecommendationsGet(string $id, string $category, string | |
/** | ||
* Operation projectIdReportPost. | ||
* | ||
* Report a project | ||
* Report a project -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param string $id (required) | ||
* @param OpenAPI\Server\Model\ProjectReportRequest $project_report_request (required) | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -42,7 +42,7 @@ interface SearchApiInterface | |
/** | ||
* Operation searchGet. | ||
* | ||
* Search for projects, users,... The default is to search for all types. | ||
* Search for projects, users,.. -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param string $query (required) | ||
* @param string $type (optional) | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -402,7 +402,7 @@ public function authenticationPostAction(Request $request) | |
/** | ||
* Operation authenticationRefreshPost. | ||
* | ||
* Refresh token | ||
* Refresh token -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param Request $request the Symfony request to handle | ||
* | ||
|
@@ -503,6 +503,104 @@ public function authenticationRefreshPostAction(Request $request) | |
} | ||
} | ||
|
||
/** | ||
* Operation authenticationUpgradePost. | ||
* | ||
* Upgrade a deprecated token -- StatusCode: 501 - Not yet implemented | ||
* | ||
* @param Request $request the Symfony request to handle | ||
* | ||
* @return Response the Symfony response | ||
*/ | ||
public function authenticationUpgradePostAction(Request $request) | ||
{ | ||
// Make sure that the client is providing something that we can consume | ||
$consumes = ['application/json']; | ||
if (!static::isContentTypeAllowed($request, $consumes)) { | ||
// We can't consume the content that the client is sending us | ||
return new Response('', 415); | ||
} | ||
|
||
// Figure out what data format to return to the client | ||
$produces = ['application/json']; | ||
// Figure out what the client accepts | ||
$clientAccepts = $request->headers->has('Accept') ? $request->headers->get('Accept') : '*/*'; | ||
$responseFormat = $this->getOutputFormat($clientAccepts, $produces); | ||
if (null === $responseFormat) { | ||
return new Response('', 406); | ||
} | ||
|
||
// Handle authentication | ||
|
||
// Read out all input parameter values into variables | ||
$upgrade_token_request = $request->getContent(); | ||
|
||
// Use the default value if no value was provided | ||
|
||
// Deserialize the input values that needs it | ||
try { | ||
$inputFormat = $request->getMimeType($request->getContentType()); | ||
$upgrade_token_request = $this->deserialize($upgrade_token_request, 'OpenAPI\Server\Model\UpgradeTokenRequest', $inputFormat); | ||
} catch (SerializerRuntimeException $exception) { | ||
return $this->createBadRequestResponse($exception->getMessage()); | ||
} | ||
|
||
// Validate the input values | ||
$asserts = []; | ||
$asserts[] = new Assert\NotNull(); | ||
$asserts[] = new Assert\Type('OpenAPI\\Server\\Model\\UpgradeTokenRequest'); | ||
$asserts[] = new Assert\Valid(); | ||
$response = $this->validate($upgrade_token_request, $asserts); | ||
if ($response instanceof Response) { | ||
return $response; | ||
} | ||
|
||
try { | ||
$handler = $this->getApiHandler(); | ||
|
||
// Make the call to the business logic | ||
$responseCode = 200; | ||
$responseHeaders = []; | ||
$result = $handler->authenticationUpgradePost($upgrade_token_request, $responseCode, $responseHeaders); | ||
|
||
// Find default response message | ||
$message = ''; | ||
|
||
// Find a more specific message, if available | ||
switch ($responseCode) { | ||
case 200: | ||
$message = 'OK'; | ||
break; | ||
case 400: | ||
$message = 'Bad request (Invalid, or missing parameters)'; | ||
break; | ||
case 401: | ||
$message = 'The provided deprecated upload token is invalid or has expired'; | ||
break; | ||
case 406: | ||
$message = 'Not acceptable - client must accept application/json as content type'; | ||
break; | ||
case 415: | ||
$message = 'Unsupported Media Type - request must use application/json as content type'; | ||
break; | ||
} | ||
|
||
return new Response( | ||
null !== $result ? $this->serialize($result, $responseFormat) : '', | ||
$responseCode, | ||
array_merge( | ||
$responseHeaders, | ||
[ | ||
'Content-Type' => $responseFormat, | ||
'X-OpenAPI-Message' => $message, | ||
] | ||
) | ||
); | ||
} catch (Exception $fallthrough) { | ||
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); | ||
} | ||
} | ||
|
||
/** | ||
* Returns the handler for this API controller. | ||
* | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.0.61 | ||
* The version of the OpenAPI document: v1.0.62 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
Oops, something went wrong.