Skip to content

Commit

Permalink
Rerun generator
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Jan 20, 2025
1 parent e583834 commit 3c3f4d0
Show file tree
Hide file tree
Showing 79 changed files with 719 additions and 681 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
invokerPackage: Aternos\CurseForgeApi
artifactVersion: 1.2.2
artifactVersion: 1.3.1
generatorName: php
outputDir: .
sourceFolder: src
Expand Down
57 changes: 29 additions & 28 deletions lib/Api/CategoriesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://openapi-generator.tech
* Generator version: 7.7.0
* Generator version: 7.11.0
*/

/**
Expand Down Expand Up @@ -83,13 +83,13 @@ class CategoriesApi
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
ClientInterface $client = null,
Configuration $config = null,
HeaderSelector $selector = null,
$hostIndex = 0
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: new Configuration();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
Expand Down Expand Up @@ -128,8 +128,8 @@ public function getConfig()
* Get categories
*
* @param int $game_id A game unique id (required)
* @param int $class_id A class unique id (optional)
* @param bool $classes_only A flag used to only return classes (optional)
* @param int|null $class_id A class unique id (optional)
* @param bool|null $classes_only A flag used to only return classes (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
*
* @throws \Aternos\CurseForgeApi\ApiException on non-2xx response or if the response body is not in the expected format
Expand All @@ -148,8 +148,8 @@ public function getCategories($game_id, $class_id = null, $classes_only = null,
* Get categories
*
* @param int $game_id A game unique id (required)
* @param int $class_id A class unique id (optional)
* @param bool $classes_only A flag used to only return classes (optional)
* @param int|null $class_id A class unique id (optional)
* @param bool|null $classes_only A flag used to only return classes (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
*
* @throws \Aternos\CurseForgeApi\ApiException on non-2xx response or if the response body is not in the expected format
Expand Down Expand Up @@ -182,18 +182,6 @@ public function getCategoriesWithHttpInfo($game_id, $class_id = null, $classes_o

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -225,6 +213,19 @@ public function getCategoriesWithHttpInfo($game_id, $class_id = null, $classes_o
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\Aternos\CurseForgeApi\Model\GetCategoriesResponse';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -274,8 +275,8 @@ public function getCategoriesWithHttpInfo($game_id, $class_id = null, $classes_o
* Get categories
*
* @param int $game_id A game unique id (required)
* @param int $class_id A class unique id (optional)
* @param bool $classes_only A flag used to only return classes (optional)
* @param int|null $class_id A class unique id (optional)
* @param bool|null $classes_only A flag used to only return classes (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand All @@ -297,8 +298,8 @@ function ($response) {
* Get categories
*
* @param int $game_id A game unique id (required)
* @param int $class_id A class unique id (optional)
* @param bool $classes_only A flag used to only return classes (optional)
* @param int|null $class_id A class unique id (optional)
* @param bool|null $classes_only A flag used to only return classes (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -349,8 +350,8 @@ function ($exception) {
* Create request for operation 'getCategories'
*
* @param int $game_id A game unique id (required)
* @param int $class_id A class unique id (optional)
* @param bool $classes_only A flag used to only return classes (optional)
* @param int|null $class_id A class unique id (optional)
* @param bool|null $classes_only A flag used to only return classes (optional)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getCategories'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down
Loading

0 comments on commit 3c3f4d0

Please sign in to comment.