Skip to content

Commit 6dc5448

Browse files
dmetznerCatrobot
authored and
Catrobot
committed
Automated Code Generation
1 parent 4cce22c commit 6dc5448

File tree

103 files changed

+389
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+389
-101
lines changed

Api/ApiServer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/AuthenticationApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/MediaLibraryApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/NotificationsApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/ProjectsApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/SearchApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/UserApiInterface.php

+14-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/
@@ -118,6 +118,19 @@ public function userPut(UpdateUserRequest $update_user_request, string $accept_l
118118
*/
119119
public function userResetPasswordPost(ResetPasswordRequest $reset_password_request, string $accept_language, int &$responseCode, array &$responseHeaders): null|array|object;
120120

121+
/**
122+
* Operation usersGet.
123+
*
124+
* Get users
125+
*
126+
* @param string $query (required)
127+
* @param int $limit (optional, default to 20)
128+
* @param int $offset (optional, default to 0)
129+
* @param int &$responseCode The HTTP Response Code
130+
* @param array $responseHeaders Additional HTTP headers to return with the response ()
131+
*/
132+
public function usersGet(string $query, int $limit, int $offset, int &$responseCode, array &$responseHeaders): null|array|object;
133+
121134
/**
122135
* Operation usersSearchGet.
123136
*

Api/UtilityApiInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/AuthenticationController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/Controller.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/
@@ -76,7 +76,7 @@ public function setApiServer(ApiServer $server): self
7676

7777
/**
7878
* This will return a response with code 400. Usage example:
79-
* return $this->createBadRequestResponse('Unable to access this page!');.
79+
* return $this->createBadRequestResponse('Unable to access this page!');
8080
*
8181
* @param string $message A message
8282
*/
@@ -87,7 +87,7 @@ public function createBadRequestResponse(string $message = 'Bad Request.'): Resp
8787

8888
/**
8989
* This will return an error response. Usage example:
90-
* return $this->createErrorResponse(new UnauthorizedHttpException());.
90+
* return $this->createErrorResponse(new UnauthorizedHttpException());
9191
*
9292
* @param HttpException $exception An HTTP exception
9393
*/

Controller/MediaLibraryController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/NotificationsController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/ProjectsController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/SearchController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/UserController.php

+103-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/
@@ -598,6 +598,108 @@ public function userResetPasswordPostAction(Request $request)
598598
}
599599
}
600600

601+
/**
602+
* Operation usersGet.
603+
*
604+
* Get users
605+
*
606+
* @param Request $request the Symfony request to handle
607+
*
608+
* @return Response the Symfony response
609+
*/
610+
public function usersGetAction(Request $request)
611+
{
612+
// Figure out what data format to return to the client
613+
$produces = ['application/json'];
614+
// Figure out what the client accepts
615+
$clientAccepts = $request->headers->has('Accept') ? $request->headers->get('Accept') : '*/*';
616+
$responseFormat = $this->getOutputFormat($clientAccepts, $produces);
617+
if (null === $responseFormat) {
618+
return new Response('', 406);
619+
}
620+
621+
// Handle authentication
622+
623+
// Read out all input parameter values into variables
624+
$query = $request->query->get('query');
625+
$limit = $request->query->get('limit', 20);
626+
$offset = $request->query->get('offset', 0);
627+
628+
// Use the default value if no value was provided
629+
630+
// Deserialize the input values that needs it
631+
try {
632+
$query = $this->deserialize($query, 'string', 'string');
633+
$limit = $this->deserialize($limit, 'int', 'string');
634+
$offset = $this->deserialize($offset, 'int', 'string');
635+
} catch (SerializerRuntimeException $exception) {
636+
return $this->createBadRequestResponse($exception->getMessage());
637+
}
638+
639+
// Validate the input values
640+
$asserts = [];
641+
$asserts[] = new Assert\NotNull();
642+
$asserts[] = new Assert\Type('string');
643+
$response = $this->validate($query, $asserts);
644+
if ($response instanceof Response) {
645+
return $response;
646+
}
647+
$asserts = [];
648+
$asserts[] = new Assert\Type('int');
649+
$asserts[] = new Assert\GreaterThanOrEqual(0);
650+
$response = $this->validate($limit, $asserts);
651+
if ($response instanceof Response) {
652+
return $response;
653+
}
654+
$asserts = [];
655+
$asserts[] = new Assert\Type('int');
656+
$asserts[] = new Assert\GreaterThanOrEqual(0);
657+
$response = $this->validate($offset, $asserts);
658+
if ($response instanceof Response) {
659+
return $response;
660+
}
661+
662+
try {
663+
$handler = $this->getApiHandler();
664+
665+
// Make the call to the business logic
666+
$responseCode = 200;
667+
$responseHeaders = [];
668+
669+
$result = $handler->usersGet($query, $limit, $offset, $responseCode, $responseHeaders);
670+
671+
// Find default response message
672+
$message = '';
673+
674+
// Find a more specific message, if available
675+
switch ($responseCode) {
676+
case 200:
677+
$message = 'OK';
678+
break;
679+
case 400:
680+
$message = 'Bad request (Invalid, or missing parameters)';
681+
break;
682+
case 406:
683+
$message = 'Not acceptable - client must accept application/json as content type';
684+
break;
685+
}
686+
687+
return new Response(
688+
null !== $result ? $this->serialize($result, $responseFormat) : '',
689+
$responseCode,
690+
array_merge(
691+
$responseHeaders,
692+
[
693+
'Content-Type' => $responseFormat,
694+
'X-OpenAPI-Message' => $message,
695+
]
696+
)
697+
);
698+
} catch (\Throwable $fallthrough) {
699+
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
700+
}
701+
}
702+
601703
/**
602704
* Operation usersSearchGet.
603705
*

Controller/UtilityController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

DependencyInjection/Compiler/OpenAPIServerApiPass.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

DependencyInjection/OpenAPIServerExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Model/BaseUser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Model/BasicUserDataResponse.php

+35-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/
@@ -128,6 +128,17 @@ class BasicUserDataResponse
128128
*/
129129
protected ?int $following = null;
130130

131+
/**
132+
* Ranking score of this user.
133+
*
134+
* @SerializedName("ranking_score")
135+
*
136+
* @Assert\Type("int")
137+
*
138+
* @Type("int")
139+
*/
140+
protected ?int $ranking_score = null;
141+
131142
/**
132143
* Constructor.
133144
*
@@ -143,6 +154,7 @@ public function __construct(array $data = null)
143154
$this->projects = $data['projects'] ?? null;
144155
$this->followers = $data['followers'] ?? null;
145156
$this->following = $data['following'] ?? null;
157+
$this->ranking_score = $data['ranking_score'] ?? null;
146158
}
147159

148160
/**
@@ -320,4 +332,26 @@ public function setFollowing(int $following = null): self
320332

321333
return $this;
322334
}
335+
336+
/**
337+
* Gets ranking_score.
338+
*/
339+
public function getRankingScore(): ?int
340+
{
341+
return $this->ranking_score;
342+
}
343+
344+
/**
345+
* Sets ranking_score.
346+
*
347+
* @param int|null $ranking_score Ranking score of this user
348+
*
349+
* @return $this
350+
*/
351+
public function setRankingScore(int $ranking_score = null): self
352+
{
353+
$this->ranking_score = $ranking_score;
354+
355+
return $this;
356+
}
323357
}

Model/DryRun.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.1.20
19+
* The version of the OpenAPI document: v1.2.0
2020
* Contact: [email protected]
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

0 commit comments

Comments
 (0)