Skip to content

Commit

Permalink
Merge pull request #138 from Catrobat/create-pull-request/patch-17026…
Browse files Browse the repository at this point in the history
…41736

Bump autogenerated OpenAPI code
  • Loading branch information
dmetzner authored Dec 15, 2023
2 parents 4cce22c + 6dc5448 commit ad3734d
Show file tree
Hide file tree
Showing 103 changed files with 389 additions and 101 deletions.
2 changes: 1 addition & 1 deletion Api/ApiServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/AuthenticationApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/MediaLibraryApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/NotificationsApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/ProjectsApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/SearchApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
15 changes: 14 additions & 1 deletion Api/UserApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down Expand Up @@ -118,6 +118,19 @@ public function userPut(UpdateUserRequest $update_user_request, string $accept_l
*/
public function userResetPasswordPost(ResetPasswordRequest $reset_password_request, string $accept_language, int &$responseCode, array &$responseHeaders): null|array|object;

/**
* Operation usersGet.
*
* Get users
*
* @param string $query (required)
* @param int $limit (optional, default to 20)
* @param int $offset (optional, default to 0)
* @param int &$responseCode The HTTP Response Code
* @param array $responseHeaders Additional HTTP headers to return with the response ()
*/
public function usersGet(string $query, int $limit, int $offset, int &$responseCode, array &$responseHeaders): null|array|object;

/**
* Operation usersSearchGet.
*
Expand Down
2 changes: 1 addition & 1 deletion Api/UtilityApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Controller/AuthenticationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
6 changes: 3 additions & 3 deletions Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down Expand Up @@ -76,7 +76,7 @@ public function setApiServer(ApiServer $server): self

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

/**
* This will return an error response. Usage example:
* return $this->createErrorResponse(new UnauthorizedHttpException());.
* return $this->createErrorResponse(new UnauthorizedHttpException());
*
* @param HttpException $exception An HTTP exception
*/
Expand Down
2 changes: 1 addition & 1 deletion Controller/MediaLibraryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Controller/NotificationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Controller/ProjectsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
104 changes: 103 additions & 1 deletion Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down Expand Up @@ -598,6 +598,108 @@ public function userResetPasswordPostAction(Request $request)
}
}

/**
* Operation usersGet.
*
* Get users
*
* @param Request $request the Symfony request to handle
*
* @return Response the Symfony response
*/
public function usersGetAction(Request $request)
{
// 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
$query = $request->query->get('query');
$limit = $request->query->get('limit', 20);
$offset = $request->query->get('offset', 0);

// Use the default value if no value was provided

// Deserialize the input values that needs it
try {
$query = $this->deserialize($query, 'string', 'string');
$limit = $this->deserialize($limit, 'int', 'string');
$offset = $this->deserialize($offset, 'int', 'string');
} catch (SerializerRuntimeException $exception) {
return $this->createBadRequestResponse($exception->getMessage());
}

// Validate the input values
$asserts = [];
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type('string');
$response = $this->validate($query, $asserts);
if ($response instanceof Response) {
return $response;
}
$asserts = [];
$asserts[] = new Assert\Type('int');
$asserts[] = new Assert\GreaterThanOrEqual(0);
$response = $this->validate($limit, $asserts);
if ($response instanceof Response) {
return $response;
}
$asserts = [];
$asserts[] = new Assert\Type('int');
$asserts[] = new Assert\GreaterThanOrEqual(0);
$response = $this->validate($offset, $asserts);
if ($response instanceof Response) {
return $response;
}

try {
$handler = $this->getApiHandler();

// Make the call to the business logic
$responseCode = 200;
$responseHeaders = [];

$result = $handler->usersGet($query, $limit, $offset, $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 406:
$message = 'Not acceptable - client must accept 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 (\Throwable $fallthrough) {
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
}
}

/**
* Operation usersSearchGet.
*
Expand Down
2 changes: 1 addition & 1 deletion Controller/UtilityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/Compiler/OpenAPIServerApiPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion DependencyInjection/OpenAPIServerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Model/BaseUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
36 changes: 35 additions & 1 deletion Model/BasicUserDataResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down Expand Up @@ -128,6 +128,17 @@ class BasicUserDataResponse
*/
protected ?int $following = null;

/**
* Ranking score of this user.
*
* @SerializedName("ranking_score")
*
* @Assert\Type("int")
*
* @Type("int")
*/
protected ?int $ranking_score = null;

/**
* Constructor.
*
Expand All @@ -143,6 +154,7 @@ public function __construct(array $data = null)
$this->projects = $data['projects'] ?? null;
$this->followers = $data['followers'] ?? null;
$this->following = $data['following'] ?? null;
$this->ranking_score = $data['ranking_score'] ?? null;
}

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

return $this;
}

/**
* Gets ranking_score.
*/
public function getRankingScore(): ?int
{
return $this->ranking_score;
}

/**
* Sets ranking_score.
*
* @param int|null $ranking_score Ranking score of this user
*
* @return $this
*/
public function setRankingScore(int $ranking_score = null): self
{
$this->ranking_score = $ranking_score;

return $this;
}
}
2 changes: 1 addition & 1 deletion Model/DryRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.20
* The version of the OpenAPI document: v1.2.0
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
Loading

0 comments on commit ad3734d

Please sign in to comment.