From 74d27b2114404f87238e504b37357cd0b37e8f0c Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 19 Nov 2024 15:20:26 +0100 Subject: [PATCH 1/6] Update generated code with openapi generator 7.8.0 --- lib/Api/APIKeysApi.php | 36 ++++++++-------- lib/Api/PagesApi.php | 28 ++++++------ lib/Api/ProjectsApi.php | 32 +++++++------- lib/Api/VersionsApi.php | 65 +++++++++++----------------- lib/Model/ProjectCompact.php | 46 +++++++++++++++++--- lib/Model/ProjectSettings.php | 6 +-- lib/Model/Tag.php | 65 ++++++++++++++++++++++++++++ test/Model/TagTest.php | 81 +++++++++++++++++++++++++++++++++++ 8 files changed, 262 insertions(+), 97 deletions(-) create mode 100644 lib/Model/Tag.php create mode 100644 test/Model/TagTest.php diff --git a/lib/Api/APIKeysApi.php b/lib/Api/APIKeysApi.php index 6881307..07cd8b4 100644 --- a/lib/Api/APIKeysApi.php +++ b/lib/Api/APIKeysApi.php @@ -225,7 +225,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType $response->getStatusCode(), $response->getHeaders() ]; - case 201: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -252,7 +252,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 201: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -319,7 +319,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType ); $e->setResponseObject($data); break; - case 201: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -327,7 +327,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType ); $e->setResponseObject($data); break; - case 401: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -751,7 +751,7 @@ public function deleteKeyRequest($name, string $contentType = self::contentTypes * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \Aternos\HangarApi\Model\ApiKey|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[] + * @return \Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[] */ public function getKeys(string $contentType = self::contentTypes['getKeys'][0]) { @@ -768,7 +768,7 @@ public function getKeys(string $contentType = self::contentTypes['getKeys'][0]) * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \Aternos\HangarApi\Model\ApiKey|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[], HTTP status code, HTTP response headers (array of strings) */ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['getKeys'][0]) { @@ -810,12 +810,12 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge } switch($statusCode) { - case 200: - if ('\Aternos\HangarApi\Model\ApiKey' === '\SplFileObject') { + case 403: + if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\ApiKey' !== 'string') { + if ('\Aternos\HangarApi\Model\ApiKey[]' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -833,11 +833,11 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\ApiKey', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\ApiKey[]', []), $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -864,7 +864,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 200: if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -893,7 +893,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge ]; } - $returnType = '\Aternos\HangarApi\Model\ApiKey'; + $returnType = '\Aternos\HangarApi\Model\ApiKey[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -923,15 +923,15 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\ApiKey', + '\Aternos\HangarApi\Model\ApiKey[]', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiKey[]', @@ -939,7 +939,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge ); $e->setResponseObject($data); break; - case 401: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiKey[]', @@ -984,7 +984,7 @@ function ($response) { */ public function getKeysAsyncWithHttpInfo(string $contentType = self::contentTypes['getKeys'][0]) { - $returnType = '\Aternos\HangarApi\Model\ApiKey'; + $returnType = '\Aternos\HangarApi\Model\ApiKey[]'; $request = $this->getKeysRequest($contentType); return $this->client diff --git a/lib/Api/PagesApi.php b/lib/Api/PagesApi.php index 6477c5b..42aa46d 100644 --- a/lib/Api/PagesApi.php +++ b/lib/Api/PagesApi.php @@ -705,7 +705,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte } switch($statusCode) { - case 403: + case 200: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -732,7 +732,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -759,7 +759,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte $response->getStatusCode(), $response->getHeaders() ]; - case 200: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -818,7 +818,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte } catch (ApiException $e) { switch ($e->getCode()) { - case 403: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -826,7 +826,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -834,7 +834,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte ); $e->setResponseObject($data); break; - case 200: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -960,7 +960,7 @@ public function getMainPageRequest($slug, string $contentType = self::contentTyp $headers = $this->headerSelector->selectHeaders( - ['application/json', 'text/plain', ], + ['text/plain', 'application/json', ], $contentType, $multipart ); @@ -1084,7 +1084,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co } switch($statusCode) { - case 403: + case 200: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1111,7 +1111,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1138,7 +1138,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co $response->getStatusCode(), $response->getHeaders() ]; - case 200: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1197,7 +1197,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co } catch (ApiException $e) { switch ($e->getCode()) { - case 403: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -1205,7 +1205,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -1213,7 +1213,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co ); $e->setResponseObject($data); break; - case 200: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -1358,7 +1358,7 @@ public function getPageRequest($slug, $path, string $contentType = self::content $headers = $this->headerSelector->selectHeaders( - ['application/json', 'text/plain', ], + ['text/plain', 'application/json', ], $contentType, $multipart ); diff --git a/lib/Api/ProjectsApi.php b/lib/Api/ProjectsApi.php index b4e259f..bad9623 100644 --- a/lib/Api/ProjectsApi.php +++ b/lib/Api/ProjectsApi.php @@ -1738,8 +1738,8 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $query The query to use when searching (optional) * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) + * @param string $query The query to use when searching (optional) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -1750,9 +1750,9 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\PaginatedResultProject|\Aternos\HangarApi\Model\PaginatedResultProject|\Aternos\HangarApi\Model\PaginatedResultProject */ - public function getProjects($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjects($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { - list($response) = $this->getProjectsWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType); + list($response) = $this->getProjectsWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType); return $response; } @@ -1767,8 +1767,8 @@ public function getProjects($pagination, $prioritize_exact_match = true, $sort = * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $query The query to use when searching (optional) * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) + * @param string $query The query to use when searching (optional) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -1781,7 +1781,7 @@ public function getProjects($pagination, $prioritize_exact_match = true, $sort = */ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { - $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType); + $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType); try { $options = $this->createHttpClientOption(); @@ -1972,8 +1972,8 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $query The query to use when searching (optional) * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) + * @param string $query The query to use when searching (optional) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -1983,9 +1983,9 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectsAsync($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjectsAsync($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { - return $this->getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType) + return $this->getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType) ->then( function ($response) { return $response[0]; @@ -2004,8 +2004,8 @@ function ($response) { * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $query The query to use when searching (optional) * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) + * @param string $query The query to use when searching (optional) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -2018,7 +2018,7 @@ function ($response) { public function getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { $returnType = '\Aternos\HangarApi\Model\PaginatedResultProject'; - $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType); + $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2065,8 +2065,8 @@ function ($exception) { * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $query The query to use when searching (optional) * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) + * @param string $query The query to use when searching (optional) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -2076,7 +2076,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProjectsRequest($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjectsRequest($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { // verify the required parameter 'pagination' is set @@ -2161,8 +2161,8 @@ public function getProjectsRequest($pagination, $prioritize_exact_match = true, ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name + $q, + 'q', // param base name 'string', // openApiType 'form', // style true, // explode @@ -2170,8 +2170,8 @@ public function getProjectsRequest($pagination, $prioritize_exact_match = true, ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $q, - 'q', // param base name + $query, + 'query', // param base name 'string', // openApiType 'form', // style true, // explode diff --git a/lib/Api/VersionsApi.php b/lib/Api/VersionsApi.php index a38cd31..a3ec8af 100644 --- a/lib/Api/VersionsApi.php +++ b/lib/Api/VersionsApi.php @@ -2830,7 +2830,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se } switch($statusCode) { - case 403: + case 200: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2857,7 +2857,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2884,7 +2884,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se $response->getStatusCode(), $response->getHeaders() ]; - case 200: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2943,7 +2943,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se } catch (ApiException $e) { switch ($e->getCode()) { - case 403: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -2951,7 +2951,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -2959,7 +2959,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se ); $e->setResponseObject($data); break; - case 200: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -3085,7 +3085,7 @@ public function latestReleaseVersionRequest($slug, string $contentType = self::c $headers = $this->headerSelector->selectHeaders( - ['application/json', 'text/plain', ], + ['text/plain', 'application/json', ], $contentType, $multipart ); @@ -3213,7 +3213,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = } switch($statusCode) { - case 403: + case 200: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3240,7 +3240,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3267,7 +3267,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = $response->getStatusCode(), $response->getHeaders() ]; - case 200: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3326,7 +3326,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = } catch (ApiException $e) { switch ($e->getCode()) { - case 403: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -3334,7 +3334,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -3342,7 +3342,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = ); $e->setResponseObject($data); break; - case 200: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -3487,7 +3487,7 @@ public function latestVersionRequest($slug, $channel, string $contentType = self $headers = $this->headerSelector->selectHeaders( - ['application/json', 'text/plain', ], + ['text/plain', 'application/json', ], $contentType, $multipart ); @@ -3553,16 +3553,15 @@ public function latestVersionRequest($slug, $channel, string $contentType = self * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) - * @param string $platform_version A platform version to filter for (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\PaginatedResultVersion|\Aternos\HangarApi\Model\PaginatedResultVersion|\Aternos\HangarApi\Model\PaginatedResultVersion */ - public function listVersions($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, $platform_version = null, string $contentType = self::contentTypes['listVersions'][0]) + public function listVersions($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - list($response) = $this->listVersionsWithHttpInfo($slug, $pagination, $include_hidden_channels, $channel, $platform, $platform_version, $contentType); + list($response) = $this->listVersionsWithHttpInfo($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType); return $response; } @@ -3576,16 +3575,15 @@ public function listVersions($slug, $pagination, $include_hidden_channels = true * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) - * @param string $platform_version A platform version to filter for (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \Aternos\HangarApi\Model\PaginatedResultVersion|\Aternos\HangarApi\Model\PaginatedResultVersion|\Aternos\HangarApi\Model\PaginatedResultVersion, HTTP status code, HTTP response headers (array of strings) */ - public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, $platform_version = null, string $contentType = self::contentTypes['listVersions'][0]) + public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - $request = $this->listVersionsRequest($slug, $pagination, $include_hidden_channels, $channel, $platform, $platform_version, $contentType); + $request = $this->listVersionsRequest($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType); try { $options = $this->createHttpClientOption(); @@ -3775,15 +3773,14 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) - * @param string $platform_version A platform version to filter for (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listVersionsAsync($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, $platform_version = null, string $contentType = self::contentTypes['listVersions'][0]) + public function listVersionsAsync($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - return $this->listVersionsAsyncWithHttpInfo($slug, $pagination, $include_hidden_channels, $channel, $platform, $platform_version, $contentType) + return $this->listVersionsAsyncWithHttpInfo($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType) ->then( function ($response) { return $response[0]; @@ -3801,16 +3798,15 @@ function ($response) { * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) - * @param string $platform_version A platform version to filter for (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listVersionsAsyncWithHttpInfo($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, $platform_version = null, string $contentType = self::contentTypes['listVersions'][0]) + public function listVersionsAsyncWithHttpInfo($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; - $request = $this->listVersionsRequest($slug, $pagination, $include_hidden_channels, $channel, $platform, $platform_version, $contentType); + $request = $this->listVersionsRequest($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3856,13 +3852,12 @@ function ($exception) { * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) - * @param string $platform_version A platform version to filter for (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function listVersionsRequest($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, $platform_version = null, string $contentType = self::contentTypes['listVersions'][0]) + public function listVersionsRequest($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { // verify the required parameter 'slug' is set @@ -3883,7 +3878,6 @@ public function listVersionsRequest($slug, $pagination, $include_hidden_channels - $resourcePath = '/api/v1/projects/{slug}/versions'; $formParams = []; $queryParams = []; @@ -3927,15 +3921,6 @@ public function listVersionsRequest($slug, $pagination, $include_hidden_channels true, // explode false // required ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $platform_version, - 'platformVersion', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params @@ -4923,7 +4908,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, } switch($statusCode) { - case 201: + case 200: if ('\Aternos\HangarApi\Model\UploadedVersion' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5036,7 +5021,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\UploadedVersion', diff --git a/lib/Model/ProjectCompact.php b/lib/Model/ProjectCompact.php index 662c31c..5e0fdf2 100644 --- a/lib/Model/ProjectCompact.php +++ b/lib/Model/ProjectCompact.php @@ -64,7 +64,8 @@ class ProjectCompact implements ModelInterface, ArrayAccess, \JsonSerializable 'category' => '\Aternos\HangarApi\Model\Category', 'last_updated' => '\DateTime', 'visibility' => '\Aternos\HangarApi\Model\Visibility', - 'avatar_url' => 'string' + 'avatar_url' => 'string', + 'description' => 'string' ]; /** @@ -82,7 +83,8 @@ class ProjectCompact implements ModelInterface, ArrayAccess, \JsonSerializable 'category' => null, 'last_updated' => 'date-time', 'visibility' => null, - 'avatar_url' => null + 'avatar_url' => null, + 'description' => null ]; /** @@ -98,7 +100,8 @@ class ProjectCompact implements ModelInterface, ArrayAccess, \JsonSerializable 'category' => false, 'last_updated' => false, 'visibility' => false, - 'avatar_url' => false + 'avatar_url' => false, + 'description' => false ]; /** @@ -194,7 +197,8 @@ public function isNullableSetToNull(string $property): bool 'category' => 'category', 'last_updated' => 'lastUpdated', 'visibility' => 'visibility', - 'avatar_url' => 'avatarUrl' + 'avatar_url' => 'avatarUrl', + 'description' => 'description' ]; /** @@ -210,7 +214,8 @@ public function isNullableSetToNull(string $property): bool 'category' => 'setCategory', 'last_updated' => 'setLastUpdated', 'visibility' => 'setVisibility', - 'avatar_url' => 'setAvatarUrl' + 'avatar_url' => 'setAvatarUrl', + 'description' => 'setDescription' ]; /** @@ -226,7 +231,8 @@ public function isNullableSetToNull(string $property): bool 'category' => 'getCategory', 'last_updated' => 'getLastUpdated', 'visibility' => 'getVisibility', - 'avatar_url' => 'getAvatarUrl' + 'avatar_url' => 'getAvatarUrl', + 'description' => 'getDescription' ]; /** @@ -294,6 +300,7 @@ public function __construct(array $data = null) $this->setIfExists('last_updated', $data ?? [], null); $this->setIfExists('visibility', $data ?? [], null); $this->setIfExists('avatar_url', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); } /** @@ -553,6 +560,33 @@ public function setAvatarUrl($avatar_url) return $this; } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description The short description of the project + * + * @return self + */ + public function setDescription($description) + { + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); + } + $this->container['description'] = $description; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/ProjectSettings.php b/lib/Model/ProjectSettings.php index 386fbbd..506d1aa 100644 --- a/lib/Model/ProjectSettings.php +++ b/lib/Model/ProjectSettings.php @@ -59,7 +59,7 @@ class ProjectSettings implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'links' => '\Aternos\HangarApi\Model\LinkSection[]', - 'tags' => 'string[]', + 'tags' => '\Aternos\HangarApi\Model\Tag[]', 'license' => '\Aternos\HangarApi\Model\ProjectLicense', 'keywords' => 'string[]', 'sponsors' => 'string', @@ -364,7 +364,7 @@ public function setLinks($links) /** * Gets tags * - * @return string[] + * @return \Aternos\HangarApi\Model\Tag[] */ public function getTags() { @@ -374,7 +374,7 @@ public function getTags() /** * Sets tags * - * @param string[] $tags tags + * @param \Aternos\HangarApi\Model\Tag[] $tags tags * * @return self */ diff --git a/lib/Model/Tag.php b/lib/Model/Tag.php new file mode 100644 index 0000000..9006fe5 --- /dev/null +++ b/lib/Model/Tag.php @@ -0,0 +1,65 @@ + Note that all routes **not** listed here should be considered **internal**, and can change at a moment's notice. **Do not use them**. ## Authentication and Authorization There are two ways to consume the API: Authenticated or anonymous. ### Anonymous When using anonymous authentication, you only have access to public information, but you don't need to worry about creating and storing an API key or handing JWTs. ### Authenticated If you need access to non-public content or actions, you need to create and use API keys. These can be created by going to the API keys page via the profile dropdown or by going to your user page and clicking on the key icon. API keys allow you to impersonate yourself, so they should be handled like passwords. **Do not share them with anyone else!** #### Getting and Using a JWT Once you have an API key, you need to authenticate yourself: Send a `POST` request with your API key identifier to `/api/v1/authenticate?apiKey=yourKey`. The response will contain your JWT as well as an expiration time. Put this JWT into the `Authorization` header of every request and make sure to request a new JWT after the expiration time has passed. Please also set a meaningful `User-Agent` header. This allows us to better identify loads and needs for potentially new endpoints. ## Misc ### Date Formats Standard ISO types. Where possible, we use the [OpenAPI format modifier](https://swagger.io/docs/specification/data-models/data-types/#format). ### Rate Limits and Caching The default rate limit is set at 20 requests every 5 seconds with an initial overdraft for extra leniency. Individual endpoints, such as version creation, may have stricter rate limiting. If applicable, always cache responses. The Hangar API itself is cached by CloudFlare and internally. + * + * The version of the OpenAPI document: 1.0 + * Generated by: https://openapi-generator.tech + * Generator version: 7.8.0 + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +namespace Aternos\HangarApi\Model; +use \Aternos\HangarApi\ObjectSerializer; + +/** + * Tag Class Doc Comment + * + * @category Class + * @package Aternos\HangarApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class Tag +{ + /** + * Possible values of this enum + */ + public const ADDON = 'ADDON'; + + public const LIBRARY = 'LIBRARY'; + + public const SUPPORTS_FOLIA = 'SUPPORTS_FOLIA'; + + /** + * Gets allowable values of the enum + * @return string[] + */ + public static function getAllowableEnumValues() + { + return [ + self::ADDON, + self::LIBRARY, + self::SUPPORTS_FOLIA + ]; + } +} + + diff --git a/test/Model/TagTest.php b/test/Model/TagTest.php new file mode 100644 index 0000000..fd2d4c0 --- /dev/null +++ b/test/Model/TagTest.php @@ -0,0 +1,81 @@ + Note that all routes **not** listed here should be considered **internal**, and can change at a moment's notice. **Do not use them**. ## Authentication and Authorization There are two ways to consume the API: Authenticated or anonymous. ### Anonymous When using anonymous authentication, you only have access to public information, but you don't need to worry about creating and storing an API key or handing JWTs. ### Authenticated If you need access to non-public content or actions, you need to create and use API keys. These can be created by going to the API keys page via the profile dropdown or by going to your user page and clicking on the key icon. API keys allow you to impersonate yourself, so they should be handled like passwords. **Do not share them with anyone else!** #### Getting and Using a JWT Once you have an API key, you need to authenticate yourself: Send a `POST` request with your API key identifier to `/api/v1/authenticate?apiKey=yourKey`. The response will contain your JWT as well as an expiration time. Put this JWT into the `Authorization` header of every request and make sure to request a new JWT after the expiration time has passed. Please also set a meaningful `User-Agent` header. This allows us to better identify loads and needs for potentially new endpoints. ## Misc ### Date Formats Standard ISO types. Where possible, we use the [OpenAPI format modifier](https://swagger.io/docs/specification/data-models/data-types/#format). ### Rate Limits and Caching The default rate limit is set at 20 requests every 5 seconds with an initial overdraft for extra leniency. Individual endpoints, such as version creation, may have stricter rate limiting. If applicable, always cache responses. The Hangar API itself is cached by CloudFlare and internally. + * + * The version of the OpenAPI document: 1.0 + * Generated by: https://openapi-generator.tech + * OpenAPI Generator version: 7.1.0 + */ + +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Please update the test case below to test the model. + */ + +namespace Aternos\HangarApi\Test\Model; + +use PHPUnit\Framework\TestCase; + +/** + * TagTest Class Doc Comment + * + * @category Class + * @description Tag + * @package Aternos\HangarApi + * @author OpenAPI Generator team + * @link https://openapi-generator.tech + */ +class TagTest extends TestCase +{ + + /** + * Setup before running any test case + */ + public static function setUpBeforeClass(): void + { + } + + /** + * Setup before running each test case + */ + public function setUp(): void + { + } + + /** + * Clean up after running each test case + */ + public function tearDown(): void + { + } + + /** + * Clean up after running all test cases + */ + public static function tearDownAfterClass(): void + { + } + + /** + * Test "Tag" + */ + public function testTag() + { + // TODO: implement + $this->markTestIncomplete('Not implemented'); + } +} From 2eaf0bb18d33e3de1eb3b4d18886ed3da1b036bf Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 19 Nov 2024 15:31:19 +0100 Subject: [PATCH 2/6] Update artifact version --- config.yaml | 2 +- lib/Api/APIKeysApi.php | 12 ++++++------ lib/Api/ProjectsApi.php | 36 ++++++++++++++++++------------------ lib/Configuration.php | 4 ++-- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/config.yaml b/config.yaml index cdd4d73..980c815 100644 --- a/config.yaml +++ b/config.yaml @@ -1,5 +1,5 @@ invokerPackage: Aternos\HangarApi -artifactVersion: 3.2.0 +artifactVersion: 4.0.0 generatorName: php outputDir: . sourceFolder: src diff --git a/lib/Api/APIKeysApi.php b/lib/Api/APIKeysApi.php index 07cd8b4..09b8ad7 100644 --- a/lib/Api/APIKeysApi.php +++ b/lib/Api/APIKeysApi.php @@ -810,7 +810,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge } switch($statusCode) { - case 403: + case 200: if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -837,7 +837,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -864,7 +864,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge $response->getStatusCode(), $response->getHeaders() ]; - case 200: + case 401: if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -923,7 +923,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge } catch (ApiException $e) { switch ($e->getCode()) { - case 403: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiKey[]', @@ -931,7 +931,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiKey[]', @@ -939,7 +939,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge ); $e->setResponseObject($data); break; - case 200: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiKey[]', diff --git a/lib/Api/ProjectsApi.php b/lib/Api/ProjectsApi.php index bad9623..c3ead19 100644 --- a/lib/Api/ProjectsApi.php +++ b/lib/Api/ProjectsApi.php @@ -1738,8 +1738,8 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $query The query to use when searching (optional) + * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -1750,9 +1750,9 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\PaginatedResultProject|\Aternos\HangarApi\Model\PaginatedResultProject|\Aternos\HangarApi\Model\PaginatedResultProject */ - public function getProjects($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjects($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { - list($response) = $this->getProjectsWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType); + list($response) = $this->getProjectsWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType); return $response; } @@ -1767,8 +1767,8 @@ public function getProjects($pagination, $prioritize_exact_match = true, $sort = * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $query The query to use when searching (optional) + * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -1779,9 +1779,9 @@ public function getProjects($pagination, $prioritize_exact_match = true, $sort = * @throws \InvalidArgumentException * @return array of \Aternos\HangarApi\Model\PaginatedResultProject|\Aternos\HangarApi\Model\PaginatedResultProject|\Aternos\HangarApi\Model\PaginatedResultProject, HTTP status code, HTTP response headers (array of strings) */ - public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { - $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType); + $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType); try { $options = $this->createHttpClientOption(); @@ -1972,8 +1972,8 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $query The query to use when searching (optional) + * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -1983,9 +1983,9 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectsAsync($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjectsAsync($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { - return $this->getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType) + return $this->getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType) ->then( function ($response) { return $response[0]; @@ -2004,8 +2004,8 @@ function ($response) { * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $query The query to use when searching (optional) + * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -2015,10 +2015,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjectsAsyncWithHttpInfo($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { $returnType = '\Aternos\HangarApi\Model\PaginatedResultProject'; - $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $q, $query, $license, $version, $tag, $member, $contentType); + $request = $this->getProjectsRequest($pagination, $prioritize_exact_match, $sort, $category, $platform, $owner, $query, $q, $license, $version, $tag, $member, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2065,8 +2065,8 @@ function ($exception) { * @param string $category A category to filter for (optional) * @param string $platform A platform to filter for (optional) * @param string $owner The author of the project (optional) - * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $query The query to use when searching (optional) + * @param string $q Deprecated: Use 'query' instead (optional) (deprecated) * @param string $license A license to filter for (optional) * @param string $version A platform version to filter for (optional) * @param string $tag A tag to filter for (optional) @@ -2076,7 +2076,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProjectsRequest($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $q = null, $query = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) + public function getProjectsRequest($pagination, $prioritize_exact_match = true, $sort = null, $category = null, $platform = null, $owner = null, $query = null, $q = null, $license = null, $version = null, $tag = null, $member = null, string $contentType = self::contentTypes['getProjects'][0]) { // verify the required parameter 'pagination' is set @@ -2161,8 +2161,8 @@ public function getProjectsRequest($pagination, $prioritize_exact_match = true, ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $q, - 'q', // param base name + $query, + 'query', // param base name 'string', // openApiType 'form', // style true, // explode @@ -2170,8 +2170,8 @@ public function getProjectsRequest($pagination, $prioritize_exact_match = true, ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $query, - 'query', // param base name + $q, + 'q', // param base name 'string', // openApiType 'form', // style true, // explode diff --git a/lib/Configuration.php b/lib/Configuration.php index 5867ba7..f204830 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/3.2.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/4.0.0/PHP'; /** * Debug switch (default set to false) @@ -433,7 +433,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 1.0' . PHP_EOL; - $report .= ' SDK Package Version: 3.2.0' . PHP_EOL; + $report .= ' SDK Package Version: 4.0.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; From 6e7b92001deb12d2750110bfa934f84734830471 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 19 Nov 2024 15:36:31 +0100 Subject: [PATCH 3/6] Remove platform version from client --- lib/Client/CompactProject.php | 4 +--- lib/Client/HangarAPIClient.php | 3 +-- .../VersionSearch/VersionSearchOptions.php | 20 ------------------- lib/Client/Project.php | 4 +--- 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/lib/Client/CompactProject.php b/lib/Client/CompactProject.php index 9935ff6..c0fb063 100644 --- a/lib/Client/CompactProject.php +++ b/lib/Client/CompactProject.php @@ -58,16 +58,14 @@ public function getProject(): Project * Get all versions of this project (paginated) * @param string|null $channel * @param Platform|null $platform - * @param string|null $platformVersion * @return ProjectVersionList * @throws ApiException */ - public function getVersions(?string $channel = null, ?Platform $platform = null, ?string $platformVersion = null): ProjectVersionList + public function getVersions(?string $channel = null, ?Platform $platform = null): ProjectVersionList { $options = new VersionSearchOptions($this->getSlug()); $options->setChannel($channel); $options->setPlatform($platform); - $options->setPlatformVersion($platformVersion); return $this->client->getProjectVersions($this->getSlug(), $options); } diff --git a/lib/Client/HangarAPIClient.php b/lib/Client/HangarAPIClient.php index dde8af6..ed87c84 100644 --- a/lib/Client/HangarAPIClient.php +++ b/lib/Client/HangarAPIClient.php @@ -338,8 +338,7 @@ public function getProjectVersions( $options->getPagination(), $options->isIncludeHiddenChannels(), $options->getChannel(), - $options->getPlatform()?->value, - $options->getPlatformVersion(), + $options->getPlatform()?->value ); return new ProjectVersionList($this, $result, $options); diff --git a/lib/Client/Options/VersionSearch/VersionSearchOptions.php b/lib/Client/Options/VersionSearch/VersionSearchOptions.php index 2ba117c..06a4953 100644 --- a/lib/Client/Options/VersionSearch/VersionSearchOptions.php +++ b/lib/Client/Options/VersionSearch/VersionSearchOptions.php @@ -24,8 +24,6 @@ class VersionSearchOptions protected ?Platform $platform = null; - protected ?string $platformVersion = null; - protected bool $includeHiddenChannels = true; public function __construct(string $projectSlug) @@ -163,24 +161,6 @@ public function setPlatform(?Platform $platform): static return $this; } - /** - * @return string|null - */ - public function getPlatformVersion(): ?string - { - return $this->platformVersion; - } - - /** - * @param string|null $platformVersion - * @return $this - */ - public function setPlatformVersion(?string $platformVersion): static - { - $this->platformVersion = $platformVersion; - return $this; - } - /** * @return bool */ diff --git a/lib/Client/Project.php b/lib/Client/Project.php index 1c0e5a6..1de9fc5 100644 --- a/lib/Client/Project.php +++ b/lib/Client/Project.php @@ -47,17 +47,15 @@ public function getSlug(): string * Get all versions of this project (paginated) * @param string|null $channel * @param Platform|null $platform - * @param string|null $platformVersion * @return ProjectVersionList * @throws ApiException */ - public function getVersions(?string $channel = null, ?Platform $platform = null, ?string $platformVersion = null): ProjectVersionList + public function getVersions(?string $channel = null, ?Platform $platform = null): ProjectVersionList { $options = new VersionSearchOptions($this->getSlug()); $options->setProject($this); $options->setChannel($channel); $options->setPlatform($platform); - $options->setPlatformVersion($platformVersion); return $this->client->getProjectVersions($this, $options); } From a72bf6d81860ab001e8a429b77afa736f01ac1e5 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Tue, 19 Nov 2024 15:42:27 +0100 Subject: [PATCH 4/6] Update generated code with openapi generator 7.10.0 --- lib/Api/APIKeysApi.php | 66 ++-- lib/Api/AuthenticationApi.php | 29 +- lib/Api/PagesApi.php | 78 ++-- lib/Api/PermissionsApi.php | 79 ++-- lib/Api/ProjectsApi.php | 219 +++++------ lib/Api/UsersApi.php | 229 ++++++------ lib/Api/VersionsApi.php | 394 ++++++++++---------- lib/ApiException.php | 2 +- lib/Configuration.php | 2 +- lib/HeaderSelector.php | 32 +- lib/Model/ApiKey.php | 2 +- lib/Model/ApiSession.php | 2 +- lib/Model/Category.php | 2 +- lib/Model/ChannelFlag.php | 2 +- lib/Model/Color.php | 2 +- lib/Model/CompactRole.php | 2 +- lib/Model/CreateAPIKeyForm.php | 2 +- lib/Model/DayProjectStats.php | 2 +- lib/Model/FileInfo.php | 2 +- lib/Model/Link.php | 2 +- lib/Model/LinkSection.php | 2 +- lib/Model/ModelInterface.php | 2 +- lib/Model/MultipartFileOrUrl.php | 2 +- lib/Model/NamedPermission.php | 2 +- lib/Model/PageEditForm.php | 2 +- lib/Model/PaginatedResultProject.php | 2 +- lib/Model/PaginatedResultProjectCompact.php | 2 +- lib/Model/PaginatedResultProjectMember.php | 2 +- lib/Model/PaginatedResultUser.php | 2 +- lib/Model/PaginatedResultVersion.php | 2 +- lib/Model/Pagination.php | 2 +- lib/Model/PermissionCheck.php | 2 +- lib/Model/PermissionType.php | 2 +- lib/Model/PinnedStatus.php | 2 +- lib/Model/Platform.php | 2 +- lib/Model/PlatformVersionDownload.php | 2 +- lib/Model/PluginDependency.php | 2 +- lib/Model/Project.php | 2 +- lib/Model/ProjectChannel.php | 2 +- lib/Model/ProjectCompact.php | 2 +- lib/Model/ProjectDonationSettings.php | 2 +- lib/Model/ProjectLicense.php | 2 +- lib/Model/ProjectMember.php | 2 +- lib/Model/ProjectNamespace.php | 2 +- lib/Model/ProjectSettings.php | 2 +- lib/Model/ProjectStats.php | 2 +- lib/Model/RequestPagination.php | 2 +- lib/Model/ReviewState.php | 2 +- lib/Model/StringContent.php | 2 +- lib/Model/Tag.php | 2 +- lib/Model/UploadedVersion.php | 2 +- lib/Model/User.php | 2 +- lib/Model/UserActions.php | 2 +- lib/Model/UserNameChange.php | 2 +- lib/Model/UserPermissions.php | 2 +- lib/Model/Version.php | 2 +- lib/Model/VersionStats.php | 2 +- lib/Model/VersionUpload.php | 2 +- lib/Model/Visibility.php | 2 +- lib/ObjectSerializer.php | 6 +- 60 files changed, 633 insertions(+), 601 deletions(-) diff --git a/lib/Api/APIKeysApi.php b/lib/Api/APIKeysApi.php index 09b8ad7..f78c37e 100644 --- a/lib/Api/APIKeysApi.php +++ b/lib/Api/APIKeysApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -95,7 +95,7 @@ public function __construct( $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; } @@ -184,18 +184,6 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType $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 403: @@ -281,6 +269,19 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -563,18 +564,6 @@ public function deleteKeyWithHttpInfo($name, string $contentType = self::content $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() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -796,18 +785,6 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge $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: @@ -893,6 +870,19 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge ]; } + 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\HangarApi\Model\ApiKey[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/lib/Api/AuthenticationApi.php b/lib/Api/AuthenticationApi.php index ea3d94f..dc7f066 100644 --- a/lib/Api/AuthenticationApi.php +++ b/lib/Api/AuthenticationApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -89,7 +89,7 @@ public function __construct( $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; } @@ -178,18 +178,6 @@ public function authenticateWithHttpInfo($api_key, string $contentType = self::c $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: @@ -275,6 +263,19 @@ public function authenticateWithHttpInfo($api_key, string $contentType = self::c ]; } + 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\HangarApi\Model\ApiSession'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/lib/Api/PagesApi.php b/lib/Api/PagesApi.php index 42aa46d..18753c5 100644 --- a/lib/Api/PagesApi.php +++ b/lib/Api/PagesApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -98,7 +98,7 @@ public function __construct( $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; } @@ -188,18 +188,6 @@ public function editMainPageWithHttpInfo($slug, $string_content, string $content $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() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -440,18 +428,6 @@ public function editPageWithHttpInfo($slug, $page_edit_form, string $contentType $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() - ); - } return [null, $statusCode, $response->getHeaders()]; @@ -691,18 +667,6 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte $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: @@ -788,6 +752,19 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1070,18 +1047,6 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co $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: @@ -1167,6 +1132,19 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/lib/Api/PermissionsApi.php b/lib/Api/PermissionsApi.php index fc4a911..c7289a9 100644 --- a/lib/Api/PermissionsApi.php +++ b/lib/Api/PermissionsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -95,7 +95,7 @@ public function __construct( $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; } @@ -188,18 +188,6 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n $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: @@ -285,6 +273,19 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n ]; } + 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\HangarApi\Model\PermissionCheck'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -606,18 +607,6 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n $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: @@ -703,6 +692,19 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n ]; } + 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\HangarApi\Model\PermissionCheck'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1016,18 +1018,6 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, $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: @@ -1113,6 +1103,19 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, ]; } + 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\HangarApi\Model\UserPermissions'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/lib/Api/ProjectsApi.php b/lib/Api/ProjectsApi.php index c3ead19..ec15659 100644 --- a/lib/Api/ProjectsApi.php +++ b/lib/Api/ProjectsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -107,7 +107,7 @@ public function __construct( $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; } @@ -196,18 +196,6 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten $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: @@ -293,6 +281,19 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten ]; } + 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\HangarApi\Model\Project'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -527,7 +528,7 @@ public function getProjectRequest($slug, string $contentType = self::contentType * Returns the members of a project * * @param string $slug The slug of the project to return members for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectMembers'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -546,7 +547,7 @@ public function getProjectMembers($slug, $pagination, string $contentType = self * Returns the members of a project * * @param string $slug The slug of the project to return members for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectMembers'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -579,18 +580,6 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten $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: @@ -676,6 +665,19 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten ]; } + 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\HangarApi\Model\PaginatedResultProjectMember'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -741,7 +743,7 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten * Returns the members of a project * * @param string $slug The slug of the project to return members for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -763,7 +765,7 @@ function ($response) { * Returns the members of a project * * @param string $slug The slug of the project to return members for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -814,7 +816,7 @@ function ($exception) { * Create request for operation 'getProjectMembers' * * @param string $slug The slug of the project to return members for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectMembers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -929,7 +931,7 @@ public function getProjectMembersRequest($slug, $pagination, string $contentType * Returns the stargazers of a project * * @param string $slug The slug of the project to return stargazers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectStargazers'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -948,7 +950,7 @@ public function getProjectStargazers($slug, $pagination, string $contentType = s * Returns the stargazers of a project * * @param string $slug The slug of the project to return stargazers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectStargazers'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -981,18 +983,6 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con $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: @@ -1078,6 +1068,19 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con ]; } + 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\HangarApi\Model\PaginatedResultUser'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1143,7 +1146,7 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con * Returns the stargazers of a project * * @param string $slug The slug of the project to return stargazers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectStargazers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1165,7 +1168,7 @@ function ($response) { * Returns the stargazers of a project * * @param string $slug The slug of the project to return stargazers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectStargazers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1216,7 +1219,7 @@ function ($exception) { * Create request for operation 'getProjectStargazers' * * @param string $slug The slug of the project to return stargazers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectStargazers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1331,7 +1334,7 @@ public function getProjectStargazersRequest($slug, $pagination, string $contentT * Returns the watchers of a project * * @param string $slug The slug of the project to return watchers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectWatchers'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -1350,7 +1353,7 @@ public function getProjectWatchers($slug, $pagination, string $contentType = sel * Returns the watchers of a project * * @param string $slug The slug of the project to return watchers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectWatchers'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -1383,18 +1386,6 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte $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: @@ -1480,6 +1471,19 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte ]; } + 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\HangarApi\Model\PaginatedResultUser'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1545,7 +1549,7 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte * Returns the watchers of a project * * @param string $slug The slug of the project to return watchers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectWatchers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1567,7 +1571,7 @@ function ($response) { * Returns the watchers of a project * * @param string $slug The slug of the project to return watchers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectWatchers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1618,7 +1622,7 @@ function ($exception) { * Create request for operation 'getProjectWatchers' * * @param string $slug The slug of the project to return watchers for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProjectWatchers'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1732,7 +1736,7 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp * * Searches the projects on Hangar * - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $prioritize_exact_match Whether to prioritize the project with an exact name match if present (optional, default to true) * @param string $sort Used to sort the result (optional) * @param string $category A category to filter for (optional) @@ -1761,7 +1765,7 @@ public function getProjects($pagination, $prioritize_exact_match = true, $sort = * * Searches the projects on Hangar * - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $prioritize_exact_match Whether to prioritize the project with an exact name match if present (optional, default to true) * @param string $sort Used to sort the result (optional) * @param string $category A category to filter for (optional) @@ -1805,18 +1809,6 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t $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: @@ -1902,6 +1894,19 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t ]; } + 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\HangarApi\Model\PaginatedResultProject'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1966,7 +1971,7 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t * * Searches the projects on Hangar * - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $prioritize_exact_match Whether to prioritize the project with an exact name match if present (optional, default to true) * @param string $sort Used to sort the result (optional) * @param string $category A category to filter for (optional) @@ -1998,7 +2003,7 @@ function ($response) { * * Searches the projects on Hangar * - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $prioritize_exact_match Whether to prioritize the project with an exact name match if present (optional, default to true) * @param string $sort Used to sort the result (optional) * @param string $category A category to filter for (optional) @@ -2059,7 +2064,7 @@ function ($exception) { /** * Create request for operation 'getProjects' * - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $prioritize_exact_match Whether to prioritize the project with an exact name match if present (optional, default to true) * @param string $sort Used to sort the result (optional) * @param string $category A category to filter for (optional) @@ -2330,18 +2335,6 @@ public function projectByVersionHashWithHttpInfo($hash, string $contentType = se $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: @@ -2427,6 +2420,19 @@ public function projectByVersionHashWithHttpInfo($hash, string $contentType = se ]; } + 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\HangarApi\Model\Project'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2715,18 +2721,6 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string $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: @@ -2812,6 +2806,19 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string ]; } + 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 = 'array'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index 51df160..ef8bda6 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -107,7 +107,7 @@ public function __construct( $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; } @@ -146,7 +146,7 @@ public function getConfig() * Returns all users with at least one public project * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthors'] to see the possible values for this operation * @@ -166,7 +166,7 @@ public function getAuthors($query, $pagination, $sort = null, string $contentTyp * Returns all users with at least one public project * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthors'] to see the possible values for this operation * @@ -200,18 +200,6 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string $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: @@ -297,6 +285,19 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string ]; } + 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\HangarApi\Model\PaginatedResultUser'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -362,7 +363,7 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string * Returns all users with at least one public project * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthors'] to see the possible values for this operation * @@ -385,7 +386,7 @@ function ($response) { * Returns all users with at least one public project * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthors'] to see the possible values for this operation * @@ -437,7 +438,7 @@ function ($exception) { * Create request for operation 'getAuthors' * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAuthors'] to see the possible values for this operation * @@ -564,7 +565,7 @@ public function getAuthorsRequest($query, $pagination, $sort = null, string $con * Returns Hangar staff * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStaff'] to see the possible values for this operation * @@ -584,7 +585,7 @@ public function getStaff($query, $pagination, $sort = null, string $contentType * Returns Hangar staff * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStaff'] to see the possible values for this operation * @@ -618,18 +619,6 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ $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: @@ -715,6 +704,19 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ ]; } + 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\HangarApi\Model\PaginatedResultUser'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -780,7 +782,7 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ * Returns Hangar staff * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStaff'] to see the possible values for this operation * @@ -803,7 +805,7 @@ function ($response) { * Returns Hangar staff * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStaff'] to see the possible values for this operation * @@ -855,7 +857,7 @@ function ($exception) { * Create request for operation 'getStaff' * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStaff'] to see the possible values for this operation * @@ -1032,18 +1034,6 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy $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: @@ -1129,6 +1119,19 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy ]; } + 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\HangarApi\Model\User'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1413,18 +1416,6 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s $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: @@ -1510,6 +1501,19 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s ]; } + 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\HangarApi\Model\ProjectCompact[]'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1744,7 +1748,7 @@ public function getUserPinnedProjectsRequest($user, string $contentType = self:: * Returns the watched projects for a specific user * * @param string $user The user to return watched projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserWatching'] to see the possible values for this operation * @@ -1764,7 +1768,7 @@ public function getUserWatching($user, $pagination, $sort = null, string $conten * Returns the watched projects for a specific user * * @param string $user The user to return watched projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserWatching'] to see the possible values for this operation * @@ -1798,18 +1802,6 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st $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: @@ -1895,6 +1887,19 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st ]; } + 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\HangarApi\Model\PaginatedResultProjectCompact'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1960,7 +1965,7 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st * Returns the watched projects for a specific user * * @param string $user The user to return watched projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserWatching'] to see the possible values for this operation * @@ -1983,7 +1988,7 @@ function ($response) { * Returns the watched projects for a specific user * * @param string $user The user to return watched projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserWatching'] to see the possible values for this operation * @@ -2035,7 +2040,7 @@ function ($exception) { * Create request for operation 'getUserWatching' * * @param string $user The user to return watched projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserWatching'] to see the possible values for this operation * @@ -2161,7 +2166,7 @@ public function getUserWatchingRequest($user, $pagination, $sort = null, string * Returns the starred projects for a specific user * * @param string $user The user to return starred projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showStarred'] to see the possible values for this operation * @@ -2181,7 +2186,7 @@ public function showStarred($user, $pagination, $sort = null, string $contentTyp * Returns the starred projects for a specific user * * @param string $user The user to return starred projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showStarred'] to see the possible values for this operation * @@ -2215,18 +2220,6 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string $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: @@ -2312,6 +2305,19 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string ]; } + 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\HangarApi\Model\PaginatedResultProjectCompact'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2377,7 +2383,7 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string * Returns the starred projects for a specific user * * @param string $user The user to return starred projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showStarred'] to see the possible values for this operation * @@ -2400,7 +2406,7 @@ function ($response) { * Returns the starred projects for a specific user * * @param string $user The user to return starred projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showStarred'] to see the possible values for this operation * @@ -2452,7 +2458,7 @@ function ($exception) { * Create request for operation 'showStarred' * * @param string $user The user to return starred projects for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showStarred'] to see the possible values for this operation * @@ -2578,7 +2584,7 @@ public function showStarredRequest($user, $pagination, $sort = null, string $con * Searches for users * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showUsers'] to see the possible values for this operation * @@ -2598,7 +2604,7 @@ public function showUsers($query, $pagination, $sort = null, string $contentType * Searches for users * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showUsers'] to see the possible values for this operation * @@ -2632,18 +2638,6 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string $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: @@ -2729,6 +2723,19 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string ]; } + 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\HangarApi\Model\PaginatedResultUser'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2794,7 +2801,7 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string * Searches for users * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showUsers'] to see the possible values for this operation * @@ -2817,7 +2824,7 @@ function ($response) { * Searches for users * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showUsers'] to see the possible values for this operation * @@ -2869,7 +2876,7 @@ function ($exception) { * Create request for operation 'showUsers' * * @param string $query The search query (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $sort Used to sort the result (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showUsers'] to see the possible values for this operation * diff --git a/lib/Api/VersionsApi.php b/lib/Api/VersionsApi.php index a3ec8af..ed0fce7 100644 --- a/lib/Api/VersionsApi.php +++ b/lib/Api/VersionsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -128,7 +128,7 @@ public function __construct( $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; } @@ -168,7 +168,7 @@ public function getConfig() * * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -188,7 +188,7 @@ public function downloadVersion($slug, $name, $platform, string $contentType = s * * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -221,18 +221,6 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con $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 303: @@ -372,6 +360,19 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con ]; } + 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 = 'object'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -454,7 +455,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con * * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -477,7 +478,7 @@ function ($response) { * * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -529,7 +530,7 @@ function ($exception) { * * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -658,7 +659,7 @@ public function downloadVersionRequest($slug, $name, $platform, string $contentT * @param string $author The author of the project to download the version from (required) * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion1'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -678,7 +679,7 @@ public function downloadVersion1($author, $slug, $name, $platform, string $conte * @param string $author The author of the project to download the version from (required) * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion1'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -712,18 +713,6 @@ public function downloadVersion1WithHttpInfo($author, $slug, $name, $platform, s $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: @@ -755,6 +744,19 @@ public function downloadVersion1WithHttpInfo($author, $slug, $name, $platform, s ]; } + 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 = 'object'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -804,7 +806,7 @@ public function downloadVersion1WithHttpInfo($author, $slug, $name, $platform, s * @param string $author The author of the project to download the version from (required) * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion1'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -827,7 +829,7 @@ function ($response) { * @param string $author The author of the project to download the version from (required) * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion1'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -881,7 +883,7 @@ function ($exception) { * @param string $author The author of the project to download the version from (required) * @param string $slug The slug of the project to download the version from (required) * @param string $name The name of the version to download (required) - * @param Platform $platform The platform of the version to download (required) + * @param \Aternos\HangarApi\Model\Platform $platform The platform of the version to download (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['downloadVersion1'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1072,18 +1074,6 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont $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: @@ -1115,6 +1105,19 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1398,18 +1401,6 @@ public function getLatestVersionWithHttpInfo($author, $slug, $channel, string $c $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: @@ -1441,6 +1432,19 @@ public function getLatestVersionWithHttpInfo($author, $slug, $channel, string $c ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1743,18 +1747,6 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp $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: @@ -1786,6 +1778,19 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp ]; } + 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\HangarApi\Model\Version'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2091,18 +2096,6 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ $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: @@ -2134,6 +2127,19 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ ]; } + 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 = 'array'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2420,7 +2426,7 @@ public function getVersionStatsRequest($author, $slug, $name, $from_date, $to_da * * @param string $author The author of the project to return versions for (required) * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -2439,7 +2445,7 @@ public function getVersions($author, $slug, $pagination, string $contentType = s * * @param string $author The author of the project to return versions for (required) * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * * @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format @@ -2473,18 +2479,6 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con $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: @@ -2516,6 +2510,19 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con ]; } + 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\HangarApi\Model\PaginatedResultVersion'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -2564,7 +2571,7 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con * * @param string $author The author of the project to return versions for (required) * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2586,7 +2593,7 @@ function ($response) { * * @param string $author The author of the project to return versions for (required) * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2639,7 +2646,7 @@ function ($exception) { * * @param string $author The author of the project to return versions for (required) * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersions'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2816,18 +2823,6 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se $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: @@ -2913,6 +2908,19 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3199,18 +3207,6 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = $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: @@ -3296,6 +3292,19 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = ]; } + 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 = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3549,7 +3558,7 @@ public function latestVersionRequest($slug, $channel, string $contentType = self * Returns all versions of a project * * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) @@ -3571,7 +3580,7 @@ public function listVersions($slug, $pagination, $include_hidden_channels = true * Returns all versions of a project * * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) @@ -3607,18 +3616,6 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha $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: @@ -3704,6 +3701,19 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha ]; } + 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\HangarApi\Model\PaginatedResultVersion'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -3769,7 +3779,7 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha * Returns all versions of a project * * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) @@ -3794,7 +3804,7 @@ function ($response) { * Returns all versions of a project * * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) @@ -3848,7 +3858,7 @@ function ($exception) { * Create request for operation 'listVersions' * * @param string $slug The slug of the project to return versions for (required) - * @param RequestPagination $pagination Pagination information (required) + * @param \Aternos\HangarApi\Model\RequestPagination $pagination Pagination information (required) * @param bool $include_hidden_channels Whether to include hidden-by-default channels in the result, defaults to try (optional, default to true) * @param string $channel A name of a version channel to filter for (optional) * @param string $platform A platform name to filter for (optional) @@ -4048,18 +4058,6 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self $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: @@ -4145,6 +4143,19 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self ]; } + 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\HangarApi\Model\Version'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4453,18 +4464,6 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, $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: @@ -4550,6 +4549,19 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, ]; } + 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 = 'array'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -4894,18 +4906,6 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, $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: @@ -4991,6 +4991,19 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, ]; } + 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\HangarApi\Model\UploadedVersion'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -5309,18 +5322,6 @@ public function uploadVersion1WithHttpInfo($author, $slug, $version_upload, $fil $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: @@ -5352,6 +5353,19 @@ public function uploadVersion1WithHttpInfo($author, $slug, $version_upload, $fil ]; } + 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\HangarApi\Model\UploadedVersion'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer diff --git a/lib/ApiException.php b/lib/ApiException.php index 000bf43..00377fe 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Configuration.php b/lib/Configuration.php index f204830..75dd844 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index fde8232..aff68f7 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -85,7 +85,7 @@ private function selectAcceptHeader(array $accept): ?string } # If none of the available Accept headers is of type "json", then just use all them - $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + $headersWithJson = $this->selectJsonMimeList($accept); if (count($headersWithJson) === 0) { return implode(',', $accept); } @@ -95,6 +95,34 @@ private function selectAcceptHeader(array $accept): ?string return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } + /** + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + /** * Create an Accept header string from the given "Accept" headers array, recalculating all weights * diff --git a/lib/Model/ApiKey.php b/lib/Model/ApiKey.php index 5419e77..0bec6b6 100644 --- a/lib/Model/ApiKey.php +++ b/lib/Model/ApiKey.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ApiSession.php b/lib/Model/ApiSession.php index 665105e..b638ac9 100644 --- a/lib/Model/ApiSession.php +++ b/lib/Model/ApiSession.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Category.php b/lib/Model/Category.php index e413050..70ea5c0 100644 --- a/lib/Model/Category.php +++ b/lib/Model/Category.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ChannelFlag.php b/lib/Model/ChannelFlag.php index dd43921..fb1808d 100644 --- a/lib/Model/ChannelFlag.php +++ b/lib/Model/ChannelFlag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Color.php b/lib/Model/Color.php index 3630114..7a2c47b 100644 --- a/lib/Model/Color.php +++ b/lib/Model/Color.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/CompactRole.php b/lib/Model/CompactRole.php index e65d2dd..36a2e32 100644 --- a/lib/Model/CompactRole.php +++ b/lib/Model/CompactRole.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/CreateAPIKeyForm.php b/lib/Model/CreateAPIKeyForm.php index 756474a..b0f0174 100644 --- a/lib/Model/CreateAPIKeyForm.php +++ b/lib/Model/CreateAPIKeyForm.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/DayProjectStats.php b/lib/Model/DayProjectStats.php index 66fcfb9..5905ecf 100644 --- a/lib/Model/DayProjectStats.php +++ b/lib/Model/DayProjectStats.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/FileInfo.php b/lib/Model/FileInfo.php index 29eed7e..9dbeaed 100644 --- a/lib/Model/FileInfo.php +++ b/lib/Model/FileInfo.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Link.php b/lib/Model/Link.php index ec527c8..1fc4b1b 100644 --- a/lib/Model/Link.php +++ b/lib/Model/Link.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/LinkSection.php b/lib/Model/LinkSection.php index 993f11d..aa1e719 100644 --- a/lib/Model/LinkSection.php +++ b/lib/Model/LinkSection.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ModelInterface.php b/lib/Model/ModelInterface.php index 52bcbd0..b6e85d6 100644 --- a/lib/Model/ModelInterface.php +++ b/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/MultipartFileOrUrl.php b/lib/Model/MultipartFileOrUrl.php index e1a20f1..a1c83a6 100644 --- a/lib/Model/MultipartFileOrUrl.php +++ b/lib/Model/MultipartFileOrUrl.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/NamedPermission.php b/lib/Model/NamedPermission.php index 48b0b88..8c7b822 100644 --- a/lib/Model/NamedPermission.php +++ b/lib/Model/NamedPermission.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PageEditForm.php b/lib/Model/PageEditForm.php index 3d72ad6..05588c3 100644 --- a/lib/Model/PageEditForm.php +++ b/lib/Model/PageEditForm.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PaginatedResultProject.php b/lib/Model/PaginatedResultProject.php index 8c13801..f73c97d 100644 --- a/lib/Model/PaginatedResultProject.php +++ b/lib/Model/PaginatedResultProject.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PaginatedResultProjectCompact.php b/lib/Model/PaginatedResultProjectCompact.php index bcd9a9d..2d06812 100644 --- a/lib/Model/PaginatedResultProjectCompact.php +++ b/lib/Model/PaginatedResultProjectCompact.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PaginatedResultProjectMember.php b/lib/Model/PaginatedResultProjectMember.php index cc25e18..45f3bfe 100644 --- a/lib/Model/PaginatedResultProjectMember.php +++ b/lib/Model/PaginatedResultProjectMember.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PaginatedResultUser.php b/lib/Model/PaginatedResultUser.php index 17f8999..2e48c6b 100644 --- a/lib/Model/PaginatedResultUser.php +++ b/lib/Model/PaginatedResultUser.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PaginatedResultVersion.php b/lib/Model/PaginatedResultVersion.php index e48ef61..e5db9d2 100644 --- a/lib/Model/PaginatedResultVersion.php +++ b/lib/Model/PaginatedResultVersion.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Pagination.php b/lib/Model/Pagination.php index 21d0d68..4b89399 100644 --- a/lib/Model/Pagination.php +++ b/lib/Model/Pagination.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PermissionCheck.php b/lib/Model/PermissionCheck.php index 762aae8..a742cbd 100644 --- a/lib/Model/PermissionCheck.php +++ b/lib/Model/PermissionCheck.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PermissionType.php b/lib/Model/PermissionType.php index 07e25d1..92cabca 100644 --- a/lib/Model/PermissionType.php +++ b/lib/Model/PermissionType.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PinnedStatus.php b/lib/Model/PinnedStatus.php index f46018d..bea5cb8 100644 --- a/lib/Model/PinnedStatus.php +++ b/lib/Model/PinnedStatus.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Platform.php b/lib/Model/Platform.php index d404852..a4aa9d5 100644 --- a/lib/Model/Platform.php +++ b/lib/Model/Platform.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PlatformVersionDownload.php b/lib/Model/PlatformVersionDownload.php index 0c5fef3..bef6ab8 100644 --- a/lib/Model/PlatformVersionDownload.php +++ b/lib/Model/PlatformVersionDownload.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/PluginDependency.php b/lib/Model/PluginDependency.php index 7163c4a..2ada944 100644 --- a/lib/Model/PluginDependency.php +++ b/lib/Model/PluginDependency.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Project.php b/lib/Model/Project.php index 51907bc..a0bb2c2 100644 --- a/lib/Model/Project.php +++ b/lib/Model/Project.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectChannel.php b/lib/Model/ProjectChannel.php index 32fc222..958a6e6 100644 --- a/lib/Model/ProjectChannel.php +++ b/lib/Model/ProjectChannel.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectCompact.php b/lib/Model/ProjectCompact.php index 5e0fdf2..cbd666f 100644 --- a/lib/Model/ProjectCompact.php +++ b/lib/Model/ProjectCompact.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectDonationSettings.php b/lib/Model/ProjectDonationSettings.php index 702c828..bb37084 100644 --- a/lib/Model/ProjectDonationSettings.php +++ b/lib/Model/ProjectDonationSettings.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectLicense.php b/lib/Model/ProjectLicense.php index 75df4cd..6a8ce67 100644 --- a/lib/Model/ProjectLicense.php +++ b/lib/Model/ProjectLicense.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectMember.php b/lib/Model/ProjectMember.php index 04fa7e8..209440f 100644 --- a/lib/Model/ProjectMember.php +++ b/lib/Model/ProjectMember.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectNamespace.php b/lib/Model/ProjectNamespace.php index bce0db1..0f709c6 100644 --- a/lib/Model/ProjectNamespace.php +++ b/lib/Model/ProjectNamespace.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectSettings.php b/lib/Model/ProjectSettings.php index 506d1aa..c50ea50 100644 --- a/lib/Model/ProjectSettings.php +++ b/lib/Model/ProjectSettings.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ProjectStats.php b/lib/Model/ProjectStats.php index 5894a9d..fe3b02e 100644 --- a/lib/Model/ProjectStats.php +++ b/lib/Model/ProjectStats.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/RequestPagination.php b/lib/Model/RequestPagination.php index df375dc..11f2992 100644 --- a/lib/Model/RequestPagination.php +++ b/lib/Model/RequestPagination.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/ReviewState.php b/lib/Model/ReviewState.php index de60e80..097d224 100644 --- a/lib/Model/ReviewState.php +++ b/lib/Model/ReviewState.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/StringContent.php b/lib/Model/StringContent.php index 4e5224c..f5f772e 100644 --- a/lib/Model/StringContent.php +++ b/lib/Model/StringContent.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Tag.php b/lib/Model/Tag.php index 9006fe5..0974c59 100644 --- a/lib/Model/Tag.php +++ b/lib/Model/Tag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/UploadedVersion.php b/lib/Model/UploadedVersion.php index 28a7c54..c30a26a 100644 --- a/lib/Model/UploadedVersion.php +++ b/lib/Model/UploadedVersion.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/User.php b/lib/Model/User.php index 4887ac8..8fca3a8 100644 --- a/lib/Model/User.php +++ b/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/UserActions.php b/lib/Model/UserActions.php index 7d2b6fd..8d8f1f7 100644 --- a/lib/Model/UserActions.php +++ b/lib/Model/UserActions.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/UserNameChange.php b/lib/Model/UserNameChange.php index 9ff3479..773aabc 100644 --- a/lib/Model/UserNameChange.php +++ b/lib/Model/UserNameChange.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/UserPermissions.php b/lib/Model/UserPermissions.php index 59ff752..7d58c33 100644 --- a/lib/Model/UserPermissions.php +++ b/lib/Model/UserPermissions.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Version.php b/lib/Model/Version.php index fc4b744..898581a 100644 --- a/lib/Model/Version.php +++ b/lib/Model/Version.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/VersionStats.php b/lib/Model/VersionStats.php index 8fb7daf..03a116f 100644 --- a/lib/Model/VersionStats.php +++ b/lib/Model/VersionStats.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/VersionUpload.php b/lib/Model/VersionUpload.php index ea6da5b..102b635 100644 --- a/lib/Model/VersionUpload.php +++ b/lib/Model/VersionUpload.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/Model/Visibility.php b/lib/Model/Visibility.php index 16c0119..1e07274 100644 --- a/lib/Model/Visibility.php +++ b/lib/Model/Visibility.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index 35df4e1..735db38 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0 * Generated by: https://openapi-generator.tech - * Generator version: 7.8.0 + * Generator version: 7.10.0 */ /** @@ -194,6 +194,10 @@ private static function isEmptyValue($value, string $openApiType): bool case 'boolean': return !in_array($value, [false, 0], true); + # For string values, '' is considered empty. + case 'string': + return $value === ''; + # For all the other types, any value at this point can be considered empty. default: return true; From 39fd7c5ceb4e672ab8356b1c96aa93a86e7af598 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 4 Dec 2024 13:11:30 +0100 Subject: [PATCH 5/6] Readd trailing comma --- lib/Client/HangarAPIClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Client/HangarAPIClient.php b/lib/Client/HangarAPIClient.php index ed87c84..b129c05 100644 --- a/lib/Client/HangarAPIClient.php +++ b/lib/Client/HangarAPIClient.php @@ -338,7 +338,7 @@ public function getProjectVersions( $options->getPagination(), $options->isIncludeHiddenChannels(), $options->getChannel(), - $options->getPlatform()?->value + $options->getPlatform()?->value, ); return new ProjectVersionList($this, $result, $options); From 914ebccd035cedc9a812dff00b04659f47c48cb6 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Wed, 4 Dec 2024 13:12:22 +0100 Subject: [PATCH 6/6] Introduce and use enum for Tags --- lib/Client/HangarAPIClient.php | 2 +- .../Options/ProjectSearch/ProjectSearchOptions.php | 11 ++++++----- lib/Client/Options/Tag.php | 10 ++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 lib/Client/Options/Tag.php diff --git a/lib/Client/HangarAPIClient.php b/lib/Client/HangarAPIClient.php index b129c05..460a8a8 100644 --- a/lib/Client/HangarAPIClient.php +++ b/lib/Client/HangarAPIClient.php @@ -197,7 +197,7 @@ public function getProjects(ProjectSearchOptions $options = new ProjectSearchOpt null, $options->getLicense(), $options->getVersion(), - $options->getTag(), + $options->getTag()?->value, ); return new ProjectList($this, $result, $options); diff --git a/lib/Client/Options/ProjectSearch/ProjectSearchOptions.php b/lib/Client/Options/ProjectSearch/ProjectSearchOptions.php index 2394f83..73c93b5 100644 --- a/lib/Client/Options/ProjectSearch/ProjectSearchOptions.php +++ b/lib/Client/Options/ProjectSearch/ProjectSearchOptions.php @@ -4,6 +4,7 @@ use Aternos\HangarApi\Client\Options\Platform; use Aternos\HangarApi\Client\Options\ProjectCategory; +use Aternos\HangarApi\Client\Options\Tag; use Aternos\HangarApi\Model\RequestPagination; /** @@ -24,7 +25,7 @@ class ProjectSearchOptions protected ?string $query = null; protected ?string $license = null; protected ?string $version = null; - protected ?string $tag = null; + protected ?Tag $tag = null; public function __construct() { @@ -270,18 +271,18 @@ public function setVersion(?string $version): static } /** - * @return string|null + * @return Tag|null */ - public function getTag(): ?string + public function getTag(): ?Tag { return $this->tag; } /** - * @param string|null $tag + * @param Tag|null $tag * @return $this */ - public function setTag(?string $tag): static + public function setTag(?Tag $tag): static { $this->tag = $tag; return $this; diff --git a/lib/Client/Options/Tag.php b/lib/Client/Options/Tag.php new file mode 100644 index 0000000..a58c4d2 --- /dev/null +++ b/lib/Client/Options/Tag.php @@ -0,0 +1,10 @@ +