diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 9e80872..25e8f9b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - php-version: [ '8.1', '8.2' ] + php-version: [ '8.1', '8.2', '8.3', '8.4' ] name: Run tests on PHP v${{ matrix.php-version }} @@ -43,4 +43,4 @@ jobs: - name: Run phpunit tests run: vendor/bin/phpunit --colors=always --testdox env: - HANGAR_API_KEY: ${{ secrets.HANGAR_API_KEY }} \ No newline at end of file + HANGAR_API_KEY: ${{ secrets.HANGAR_API_KEY }} diff --git a/README.md b/README.md index 8411b14..6ecfed2 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ $versions = $hangarClient->getProjectVersions("mclogs"); $versions = $project->getVersions(); // get a specific version of a project by name -$version = $hangarClient->getProjectVersion("mclogs", "2.6.2"); +$version = $hangarClient->getVersion("mclogs", "2.6.2"); // get a specific version of a project $version = $project->getVersion("2.6.2"); @@ -148,4 +148,4 @@ $page->save(); The generated code can be updated by installing the [openapi generator](https://openapi-generator.tech/docs/installation) running the following command: ```bash openapi-generator-cli generate -c config.yaml -``` \ No newline at end of file +``` diff --git a/config.yaml b/config.yaml index 980c815..76f4d08 100644 --- a/config.yaml +++ b/config.yaml @@ -3,4 +3,4 @@ artifactVersion: 4.0.0 generatorName: php outputDir: . sourceFolder: src -inputSpec: https://hangar.papermc.io/v3/api-docs/public \ No newline at end of file +inputSpec: https://hangar.papermc.io/v3/api-docs/public diff --git a/lib/Api/APIKeysApi.php b/lib/Api/APIKeysApi.php index f78c37e..66d04b2 100644 --- a/lib/Api/APIKeysApi.php +++ b/lib/Api/APIKeysApi.php @@ -186,7 +186,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType switch($statusCode) { - case 403: + case 201: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -240,7 +240,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType $response->getStatusCode(), $response->getHeaders() ]; - case 201: + case 403: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -312,7 +312,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType } catch (ApiException $e) { switch ($e->getCode()) { - case 403: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -328,7 +328,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType ); $e->setResponseObject($data); break; - case 201: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -814,7 +814,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -841,7 +841,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 { @@ -921,7 +921,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiKey[]', @@ -929,7 +929,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[]', diff --git a/lib/Api/AuthenticationApi.php b/lib/Api/AuthenticationApi.php index dc7f066..879c3c5 100644 --- a/lib/Api/AuthenticationApi.php +++ b/lib/Api/AuthenticationApi.php @@ -207,7 +207,7 @@ public function authenticateWithHttpInfo($api_key, string $contentType = self::c $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Aternos\HangarApi\Model\ApiSession' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -234,7 +234,7 @@ public function authenticateWithHttpInfo($api_key, string $contentType = self::c $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Aternos\HangarApi\Model\ApiSession' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -314,7 +314,7 @@ public function authenticateWithHttpInfo($api_key, string $contentType = self::c ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiSession', @@ -322,7 +322,7 @@ public function authenticateWithHttpInfo($api_key, string $contentType = self::c ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ApiSession', diff --git a/lib/Api/PagesApi.php b/lib/Api/PagesApi.php index 18753c5..7dfb522 100644 --- a/lib/Api/PagesApi.php +++ b/lib/Api/PagesApi.php @@ -136,7 +136,7 @@ public function getConfig() * * Edits the main page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\StringContent $string_content string_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editMainPage'] to see the possible values for this operation * @@ -144,9 +144,9 @@ public function getConfig() * @throws \InvalidArgumentException * @return void */ - public function editMainPage($slug, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) + public function editMainPage($project, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) { - $this->editMainPageWithHttpInfo($slug, $string_content, $contentType); + $this->editMainPageWithHttpInfo($project, $string_content, $contentType); } /** @@ -154,7 +154,7 @@ public function editMainPage($slug, $string_content, string $contentType = self: * * Edits the main page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\StringContent $string_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editMainPage'] to see the possible values for this operation * @@ -162,9 +162,9 @@ public function editMainPage($slug, $string_content, string $contentType = self: * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function editMainPageWithHttpInfo($slug, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) + public function editMainPageWithHttpInfo($project, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) { - $request = $this->editMainPageRequest($slug, $string_content, $contentType); + $request = $this->editMainPageRequest($project, $string_content, $contentType); try { $options = $this->createHttpClientOption(); @@ -203,16 +203,16 @@ public function editMainPageWithHttpInfo($slug, $string_content, string $content * * Edits the main page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\StringContent $string_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editMainPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editMainPageAsync($slug, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) + public function editMainPageAsync($project, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) { - return $this->editMainPageAsyncWithHttpInfo($slug, $string_content, $contentType) + return $this->editMainPageAsyncWithHttpInfo($project, $string_content, $contentType) ->then( function ($response) { return $response[0]; @@ -225,17 +225,17 @@ function ($response) { * * Edits the main page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\StringContent $string_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editMainPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editMainPageAsyncWithHttpInfo($slug, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) + public function editMainPageAsyncWithHttpInfo($project, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) { $returnType = ''; - $request = $this->editMainPageRequest($slug, $string_content, $contentType); + $request = $this->editMainPageRequest($project, $string_content, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -263,20 +263,20 @@ function ($exception) { /** * Create request for operation 'editMainPage' * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\StringContent $string_content (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editMainPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function editMainPageRequest($slug, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) + public function editMainPageRequest($project, $string_content, string $contentType = self::contentTypes['editMainPage'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling editMainPage' + 'Missing the required parameter $project when calling editMainPage' ); } @@ -288,7 +288,7 @@ public function editMainPageRequest($slug, $string_content, string $contentType } - $resourcePath = '/api/v1/pages/editmain/{slug}'; + $resourcePath = '/api/v1/pages/editmain/{project}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -298,10 +298,10 @@ public function editMainPageRequest($slug, $string_content, string $contentType // path params - if ($slug !== null) { + if ($project !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), $resourcePath ); } @@ -376,7 +376,7 @@ public function editMainPageRequest($slug, $string_content, string $contentType * * Edits a page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\PageEditForm $page_edit_form page_edit_form (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editPage'] to see the possible values for this operation * @@ -384,9 +384,9 @@ public function editMainPageRequest($slug, $string_content, string $contentType * @throws \InvalidArgumentException * @return void */ - public function editPage($slug, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) + public function editPage($project, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) { - $this->editPageWithHttpInfo($slug, $page_edit_form, $contentType); + $this->editPageWithHttpInfo($project, $page_edit_form, $contentType); } /** @@ -394,7 +394,7 @@ public function editPage($slug, $page_edit_form, string $contentType = self::con * * Edits a page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\PageEditForm $page_edit_form (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editPage'] to see the possible values for this operation * @@ -402,9 +402,9 @@ public function editPage($slug, $page_edit_form, string $contentType = self::con * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function editPageWithHttpInfo($slug, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) + public function editPageWithHttpInfo($project, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) { - $request = $this->editPageRequest($slug, $page_edit_form, $contentType); + $request = $this->editPageRequest($project, $page_edit_form, $contentType); try { $options = $this->createHttpClientOption(); @@ -443,16 +443,16 @@ public function editPageWithHttpInfo($slug, $page_edit_form, string $contentType * * Edits a page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\PageEditForm $page_edit_form (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editPageAsync($slug, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) + public function editPageAsync($project, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) { - return $this->editPageAsyncWithHttpInfo($slug, $page_edit_form, $contentType) + return $this->editPageAsyncWithHttpInfo($project, $page_edit_form, $contentType) ->then( function ($response) { return $response[0]; @@ -465,17 +465,17 @@ function ($response) { * * Edits a page of a project * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\PageEditForm $page_edit_form (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function editPageAsyncWithHttpInfo($slug, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) + public function editPageAsyncWithHttpInfo($project, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) { $returnType = ''; - $request = $this->editPageRequest($slug, $page_edit_form, $contentType); + $request = $this->editPageRequest($project, $page_edit_form, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -503,20 +503,20 @@ function ($exception) { /** * Create request for operation 'editPage' * - * @param string $slug The slug of the project to change the page for (required) + * @param string $project The slug or id of the project to change the page for (required) * @param \Aternos\HangarApi\Model\PageEditForm $page_edit_form (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['editPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function editPageRequest($slug, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) + public function editPageRequest($project, $page_edit_form, string $contentType = self::contentTypes['editPage'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling editPage' + 'Missing the required parameter $project when calling editPage' ); } @@ -528,7 +528,7 @@ public function editPageRequest($slug, $page_edit_form, string $contentType = se } - $resourcePath = '/api/v1/pages/edit/{slug}'; + $resourcePath = '/api/v1/pages/edit/{project}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -538,10 +538,10 @@ public function editPageRequest($slug, $page_edit_form, string $contentType = se // path params - if ($slug !== null) { + if ($project !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), $resourcePath ); } @@ -616,16 +616,16 @@ public function editPageRequest($slug, $page_edit_form, string $contentType = se * * Returns the main page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMainPage'] 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 string|string|string */ - public function getMainPage($slug, string $contentType = self::contentTypes['getMainPage'][0]) + public function getMainPage($project, string $contentType = self::contentTypes['getMainPage'][0]) { - list($response) = $this->getMainPageWithHttpInfo($slug, $contentType); + list($response) = $this->getMainPageWithHttpInfo($project, $contentType); return $response; } @@ -634,16 +634,16 @@ public function getMainPage($slug, string $contentType = self::contentTypes['get * * Returns the main page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMainPage'] 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 string|string|string, HTTP status code, HTTP response headers (array of strings) */ - public function getMainPageWithHttpInfo($slug, string $contentType = self::contentTypes['getMainPage'][0]) + public function getMainPageWithHttpInfo($project, string $contentType = self::contentTypes['getMainPage'][0]) { - $request = $this->getMainPageRequest($slug, $contentType); + $request = $this->getMainPageRequest($project, $contentType); try { $options = $this->createHttpClientOption(); @@ -696,7 +696,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -723,7 +723,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 { @@ -803,7 +803,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -811,7 +811,7 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -829,15 +829,15 @@ public function getMainPageWithHttpInfo($slug, string $contentType = self::conte * * Returns the main page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMainPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMainPageAsync($slug, string $contentType = self::contentTypes['getMainPage'][0]) + public function getMainPageAsync($project, string $contentType = self::contentTypes['getMainPage'][0]) { - return $this->getMainPageAsyncWithHttpInfo($slug, $contentType) + return $this->getMainPageAsyncWithHttpInfo($project, $contentType) ->then( function ($response) { return $response[0]; @@ -850,16 +850,16 @@ function ($response) { * * Returns the main page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMainPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getMainPageAsyncWithHttpInfo($slug, string $contentType = self::contentTypes['getMainPage'][0]) + public function getMainPageAsyncWithHttpInfo($project, string $contentType = self::contentTypes['getMainPage'][0]) { $returnType = 'string'; - $request = $this->getMainPageRequest($slug, $contentType); + $request = $this->getMainPageRequest($project, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -900,24 +900,24 @@ function ($exception) { /** * Create request for operation 'getMainPage' * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getMainPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getMainPageRequest($slug, string $contentType = self::contentTypes['getMainPage'][0]) + public function getMainPageRequest($project, string $contentType = self::contentTypes['getMainPage'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getMainPage' + 'Missing the required parameter $project when calling getMainPage' ); } - $resourcePath = '/api/v1/pages/main/{slug}'; + $resourcePath = '/api/v1/pages/main/{project}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -927,10 +927,10 @@ public function getMainPageRequest($slug, string $contentType = self::contentTyp // path params - if ($slug !== null) { + if ($project !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), $resourcePath ); } @@ -994,7 +994,7 @@ public function getMainPageRequest($slug, string $contentType = self::contentTyp * * Returns a page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $path The path of the page (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * @@ -1002,9 +1002,9 @@ public function getMainPageRequest($slug, string $contentType = self::contentTyp * @throws \InvalidArgumentException * @return string|string|string */ - public function getPage($slug, $path, string $contentType = self::contentTypes['getPage'][0]) + public function getPage($project, $path, string $contentType = self::contentTypes['getPage'][0]) { - list($response) = $this->getPageWithHttpInfo($slug, $path, $contentType); + list($response) = $this->getPageWithHttpInfo($project, $path, $contentType); return $response; } @@ -1013,7 +1013,7 @@ public function getPage($slug, $path, string $contentType = self::contentTypes[' * * Returns a page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $path The path of the page (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * @@ -1021,9 +1021,9 @@ public function getPage($slug, $path, string $contentType = self::contentTypes[' * @throws \InvalidArgumentException * @return array of string|string|string, HTTP status code, HTTP response headers (array of strings) */ - public function getPageWithHttpInfo($slug, $path, string $contentType = self::contentTypes['getPage'][0]) + public function getPageWithHttpInfo($project, $path, string $contentType = self::contentTypes['getPage'][0]) { - $request = $this->getPageRequest($slug, $path, $contentType); + $request = $this->getPageRequest($project, $path, $contentType); try { $options = $this->createHttpClientOption(); @@ -1076,7 +1076,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1103,7 +1103,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 { @@ -1183,7 +1183,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -1191,7 +1191,7 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'string', @@ -1209,16 +1209,16 @@ public function getPageWithHttpInfo($slug, $path, string $contentType = self::co * * Returns a page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $path The path of the page (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPageAsync($slug, $path, string $contentType = self::contentTypes['getPage'][0]) + public function getPageAsync($project, $path, string $contentType = self::contentTypes['getPage'][0]) { - return $this->getPageAsyncWithHttpInfo($slug, $path, $contentType) + return $this->getPageAsyncWithHttpInfo($project, $path, $contentType) ->then( function ($response) { return $response[0]; @@ -1231,17 +1231,17 @@ function ($response) { * * Returns a page of a project * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $path The path of the page (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getPageAsyncWithHttpInfo($slug, $path, string $contentType = self::contentTypes['getPage'][0]) + public function getPageAsyncWithHttpInfo($project, $path, string $contentType = self::contentTypes['getPage'][0]) { $returnType = 'string'; - $request = $this->getPageRequest($slug, $path, $contentType); + $request = $this->getPageRequest($project, $path, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1282,20 +1282,20 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param string $slug The slug of the project to return the page for (required) + * @param string $project The slug or id of the project to return the page for (required) * @param string $path The path of the page (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getPageRequest($slug, $path, string $contentType = self::contentTypes['getPage'][0]) + public function getPageRequest($project, $path, string $contentType = self::contentTypes['getPage'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'project' is set + if ($project === null || (is_array($project) && count($project) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getPage' + 'Missing the required parameter $project when calling getPage' ); } @@ -1307,7 +1307,7 @@ public function getPageRequest($slug, $path, string $contentType = self::content } - $resourcePath = '/api/v1/pages/page/{slug}'; + $resourcePath = '/api/v1/pages/page/{project}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1326,10 +1326,10 @@ public function getPageRequest($slug, $path, string $contentType = self::content // path params - if ($slug !== null) { + if ($project !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'project' . '}', + ObjectSerializer::toPathValue($project), $resourcePath ); } diff --git a/lib/Api/PermissionsApi.php b/lib/Api/PermissionsApi.php index c7289a9..b6c0ede 100644 --- a/lib/Api/PermissionsApi.php +++ b/lib/Api/PermissionsApi.php @@ -134,17 +134,18 @@ public function getConfig() * Checks whether you have all the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The project slug of the project to check permissions in. Must not be used together with `organizationName` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `projectOwner` and `projectSlug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAll'] 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\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck */ - public function hasAll($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAll'][0]) + public function hasAll($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAll'][0]) { - list($response) = $this->hasAllWithHttpInfo($permissions, $slug, $organization, $contentType); + list($response) = $this->hasAllWithHttpInfo($permissions, $slug, $organization, $project, $contentType); return $response; } @@ -154,17 +155,18 @@ public function hasAll($permissions, $slug = null, $organization = null, string * Checks whether you have all the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The project slug of the project to check permissions in. Must not be used together with `organizationName` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `projectOwner` and `projectSlug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAll'] 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\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck, HTTP status code, HTTP response headers (array of strings) */ - public function hasAllWithHttpInfo($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAll'][0]) + public function hasAllWithHttpInfo($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAll'][0]) { - $request = $this->hasAllRequest($permissions, $slug, $organization, $contentType); + $request = $this->hasAllRequest($permissions, $slug, $organization, $project, $contentType); try { $options = $this->createHttpClientOption(); @@ -217,7 +219,7 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Aternos\HangarApi\Model\PermissionCheck' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -244,7 +246,7 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Aternos\HangarApi\Model\PermissionCheck' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -324,7 +326,7 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PermissionCheck', @@ -332,7 +334,7 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PermissionCheck', @@ -351,16 +353,17 @@ public function hasAllWithHttpInfo($permissions, $slug = null, $organization = n * Checks whether you have all the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The project slug of the project to check permissions in. Must not be used together with `organizationName` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `projectOwner` and `projectSlug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAll'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function hasAllAsync($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAll'][0]) + public function hasAllAsync($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAll'][0]) { - return $this->hasAllAsyncWithHttpInfo($permissions, $slug, $organization, $contentType) + return $this->hasAllAsyncWithHttpInfo($permissions, $slug, $organization, $project, $contentType) ->then( function ($response) { return $response[0]; @@ -374,17 +377,18 @@ function ($response) { * Checks whether you have all the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The project slug of the project to check permissions in. Must not be used together with `organizationName` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `projectOwner` and `projectSlug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAll'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function hasAllAsyncWithHttpInfo($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAll'][0]) + public function hasAllAsyncWithHttpInfo($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAll'][0]) { $returnType = '\Aternos\HangarApi\Model\PermissionCheck'; - $request = $this->hasAllRequest($permissions, $slug, $organization, $contentType); + $request = $this->hasAllRequest($permissions, $slug, $organization, $project, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -426,14 +430,15 @@ function ($exception) { * Create request for operation 'hasAll' * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The project slug of the project to check permissions in. Must not be used together with `organizationName` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `projectOwner` and `projectSlug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAll'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function hasAllRequest($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAll'][0]) + public function hasAllRequest($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAll'][0]) { // verify the required parameter 'permissions' is set @@ -452,6 +457,7 @@ public function hasAllRequest($permissions, $slug = null, $organization = null, + $resourcePath = '/api/v1/permissions/hasAll'; $formParams = []; $queryParams = []; @@ -486,6 +492,15 @@ public function hasAllRequest($permissions, $slug = null, $organization = null, true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $project, + 'project', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -553,17 +568,18 @@ public function hasAllRequest($permissions, $slug = null, $organization = null, * Checks whether you have at least one of the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The slug of the project to check permissions in. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAny'] 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\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck */ - public function hasAny($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAny'][0]) + public function hasAny($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAny'][0]) { - list($response) = $this->hasAnyWithHttpInfo($permissions, $slug, $organization, $contentType); + list($response) = $this->hasAnyWithHttpInfo($permissions, $slug, $organization, $project, $contentType); return $response; } @@ -573,17 +589,18 @@ public function hasAny($permissions, $slug = null, $organization = null, string * Checks whether you have at least one of the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The slug of the project to check permissions in. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAny'] 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\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck|\Aternos\HangarApi\Model\PermissionCheck, HTTP status code, HTTP response headers (array of strings) */ - public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAny'][0]) + public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAny'][0]) { - $request = $this->hasAnyRequest($permissions, $slug, $organization, $contentType); + $request = $this->hasAnyRequest($permissions, $slug, $organization, $project, $contentType); try { $options = $this->createHttpClientOption(); @@ -636,7 +653,7 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Aternos\HangarApi\Model\PermissionCheck' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -663,7 +680,7 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Aternos\HangarApi\Model\PermissionCheck' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -743,7 +760,7 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PermissionCheck', @@ -751,7 +768,7 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PermissionCheck', @@ -770,16 +787,17 @@ public function hasAnyWithHttpInfo($permissions, $slug = null, $organization = n * Checks whether you have at least one of the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The slug of the project to check permissions in. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAny'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function hasAnyAsync($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAny'][0]) + public function hasAnyAsync($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAny'][0]) { - return $this->hasAnyAsyncWithHttpInfo($permissions, $slug, $organization, $contentType) + return $this->hasAnyAsyncWithHttpInfo($permissions, $slug, $organization, $project, $contentType) ->then( function ($response) { return $response[0]; @@ -793,17 +811,18 @@ function ($response) { * Checks whether you have at least one of the provided permissions * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The slug of the project to check permissions in. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAny'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function hasAnyAsyncWithHttpInfo($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAny'][0]) + public function hasAnyAsyncWithHttpInfo($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAny'][0]) { $returnType = '\Aternos\HangarApi\Model\PermissionCheck'; - $request = $this->hasAnyRequest($permissions, $slug, $organization, $contentType); + $request = $this->hasAnyRequest($permissions, $slug, $organization, $project, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -845,14 +864,15 @@ function ($exception) { * Create request for operation 'hasAny' * * @param \Aternos\HangarApi\Model\NamedPermission[] $permissions The permissions to check (required) - * @param string $slug The slug of the project to check permissions in. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['hasAny'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function hasAnyRequest($permissions, $slug = null, $organization = null, string $contentType = self::contentTypes['hasAny'][0]) + public function hasAnyRequest($permissions, $slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['hasAny'][0]) { // verify the required parameter 'permissions' is set @@ -865,6 +885,7 @@ public function hasAnyRequest($permissions, $slug = null, $organization = null, + $resourcePath = '/api/v1/permissions/hasAny'; $formParams = []; $queryParams = []; @@ -899,6 +920,15 @@ public function hasAnyRequest($permissions, $slug = null, $organization = null, true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $project, + 'project', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -965,17 +995,18 @@ public function hasAnyRequest($permissions, $slug = null, $organization = null, * * Returns your permissions * - * @param string $slug The slug of the project get the permissions for. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showPermissions'] 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\UserPermissions|\Aternos\HangarApi\Model\UserPermissions|\Aternos\HangarApi\Model\UserPermissions */ - public function showPermissions($slug = null, $organization = null, string $contentType = self::contentTypes['showPermissions'][0]) + public function showPermissions($slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['showPermissions'][0]) { - list($response) = $this->showPermissionsWithHttpInfo($slug, $organization, $contentType); + list($response) = $this->showPermissionsWithHttpInfo($slug, $organization, $project, $contentType); return $response; } @@ -984,17 +1015,18 @@ public function showPermissions($slug = null, $organization = null, string $cont * * Returns your permissions * - * @param string $slug The slug of the project get the permissions for. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showPermissions'] 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\UserPermissions|\Aternos\HangarApi\Model\UserPermissions|\Aternos\HangarApi\Model\UserPermissions, HTTP status code, HTTP response headers (array of strings) */ - public function showPermissionsWithHttpInfo($slug = null, $organization = null, string $contentType = self::contentTypes['showPermissions'][0]) + public function showPermissionsWithHttpInfo($slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['showPermissions'][0]) { - $request = $this->showPermissionsRequest($slug, $organization, $contentType); + $request = $this->showPermissionsRequest($slug, $organization, $project, $contentType); try { $options = $this->createHttpClientOption(); @@ -1047,7 +1079,7 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Aternos\HangarApi\Model\UserPermissions' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1074,7 +1106,7 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Aternos\HangarApi\Model\UserPermissions' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1154,7 +1186,7 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\UserPermissions', @@ -1162,7 +1194,7 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\UserPermissions', @@ -1180,16 +1212,17 @@ public function showPermissionsWithHttpInfo($slug = null, $organization = null, * * Returns your permissions * - * @param string $slug The slug of the project get the permissions for. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showPermissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showPermissionsAsync($slug = null, $organization = null, string $contentType = self::contentTypes['showPermissions'][0]) + public function showPermissionsAsync($slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['showPermissions'][0]) { - return $this->showPermissionsAsyncWithHttpInfo($slug, $organization, $contentType) + return $this->showPermissionsAsyncWithHttpInfo($slug, $organization, $project, $contentType) ->then( function ($response) { return $response[0]; @@ -1202,17 +1235,18 @@ function ($response) { * * Returns your permissions * - * @param string $slug The slug of the project get the permissions for. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showPermissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showPermissionsAsyncWithHttpInfo($slug = null, $organization = null, string $contentType = self::contentTypes['showPermissions'][0]) + public function showPermissionsAsyncWithHttpInfo($slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['showPermissions'][0]) { $returnType = '\Aternos\HangarApi\Model\UserPermissions'; - $request = $this->showPermissionsRequest($slug, $organization, $contentType); + $request = $this->showPermissionsRequest($slug, $organization, $project, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1253,19 +1287,21 @@ function ($exception) { /** * Create request for operation 'showPermissions' * - * @param string $slug The slug of the project get the permissions for. Must not be used together with `organization` (optional) - * @param string $organization The organization to check permissions in. Must not be used together with `slug` (optional) + * @param string $slug Deprecated alias for `project` (optional) (deprecated) + * @param string $organization The id or name of the organization to check permissions in. Must not be used together with `project` (optional) + * @param string $project The id or slug of the project to check permissions in. Must not be used together with `organization` (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showPermissions'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function showPermissionsRequest($slug = null, $organization = null, string $contentType = self::contentTypes['showPermissions'][0]) + public function showPermissionsRequest($slug = null, $organization = null, $project = null, string $contentType = self::contentTypes['showPermissions'][0]) { + $resourcePath = '/api/v1/permissions'; $formParams = []; $queryParams = []; @@ -1291,6 +1327,15 @@ public function showPermissionsRequest($slug = null, $organization = null, strin true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $project, + 'project', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); diff --git a/lib/Api/ProjectsApi.php b/lib/Api/ProjectsApi.php index ec15659..bd1cc86 100644 --- a/lib/Api/ProjectsApi.php +++ b/lib/Api/ProjectsApi.php @@ -145,16 +145,16 @@ public function getConfig() * * Returns info on a specific project * - * @param string $slug The slug of the project to return (required) + * @param string $slug_or_id The slug or id or id of the project to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] 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\Project|\Aternos\HangarApi\Model\Project|\Aternos\HangarApi\Model\Project */ - public function getProject($slug, string $contentType = self::contentTypes['getProject'][0]) + public function getProject($slug_or_id, string $contentType = self::contentTypes['getProject'][0]) { - list($response) = $this->getProjectWithHttpInfo($slug, $contentType); + list($response) = $this->getProjectWithHttpInfo($slug_or_id, $contentType); return $response; } @@ -163,16 +163,16 @@ public function getProject($slug, string $contentType = self::contentTypes['getP * * Returns info on a specific project * - * @param string $slug The slug of the project to return (required) + * @param string $slug_or_id The slug or id or id of the project to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] 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\Project|\Aternos\HangarApi\Model\Project|\Aternos\HangarApi\Model\Project, HTTP status code, HTTP response headers (array of strings) */ - public function getProjectWithHttpInfo($slug, string $contentType = self::contentTypes['getProject'][0]) + public function getProjectWithHttpInfo($slug_or_id, string $contentType = self::contentTypes['getProject'][0]) { - $request = $this->getProjectRequest($slug, $contentType); + $request = $this->getProjectRequest($slug_or_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -225,7 +225,7 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\Project' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -252,7 +252,7 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\Project' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -332,7 +332,7 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\Project', @@ -340,7 +340,7 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\Project', @@ -358,15 +358,15 @@ public function getProjectWithHttpInfo($slug, string $contentType = self::conten * * Returns info on a specific project * - * @param string $slug The slug of the project to return (required) + * @param string $slug_or_id The slug or id or id of the project to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectAsync($slug, string $contentType = self::contentTypes['getProject'][0]) + public function getProjectAsync($slug_or_id, string $contentType = self::contentTypes['getProject'][0]) { - return $this->getProjectAsyncWithHttpInfo($slug, $contentType) + return $this->getProjectAsyncWithHttpInfo($slug_or_id, $contentType) ->then( function ($response) { return $response[0]; @@ -379,16 +379,16 @@ function ($response) { * * Returns info on a specific project * - * @param string $slug The slug of the project to return (required) + * @param string $slug_or_id The slug or id or id of the project to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectAsyncWithHttpInfo($slug, string $contentType = self::contentTypes['getProject'][0]) + public function getProjectAsyncWithHttpInfo($slug_or_id, string $contentType = self::contentTypes['getProject'][0]) { $returnType = '\Aternos\HangarApi\Model\Project'; - $request = $this->getProjectRequest($slug, $contentType); + $request = $this->getProjectRequest($slug_or_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -429,24 +429,24 @@ function ($exception) { /** * Create request for operation 'getProject' * - * @param string $slug The slug of the project to return (required) + * @param string $slug_or_id The slug or id or id of the project to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getProject'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getProjectRequest($slug, string $contentType = self::contentTypes['getProject'][0]) + public function getProjectRequest($slug_or_id, string $contentType = self::contentTypes['getProject'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getProject' + 'Missing the required parameter $slug_or_id when calling getProject' ); } - $resourcePath = '/api/v1/projects/{slug}'; + $resourcePath = '/api/v1/projects/{slugOrId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -456,10 +456,10 @@ public function getProjectRequest($slug, string $contentType = self::contentType // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } @@ -527,7 +527,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 string $slug_or_id The slug or id of the project to return members for (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 * @@ -535,9 +535,9 @@ public function getProjectRequest($slug, string $contentType = self::contentType * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\PaginatedResultProjectMember|\Aternos\HangarApi\Model\PaginatedResultProjectMember|\Aternos\HangarApi\Model\PaginatedResultProjectMember */ - public function getProjectMembers($slug, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) + public function getProjectMembers($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) { - list($response) = $this->getProjectMembersWithHttpInfo($slug, $pagination, $contentType); + list($response) = $this->getProjectMembersWithHttpInfo($slug_or_id, $pagination, $contentType); return $response; } @@ -546,7 +546,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 string $slug_or_id The slug or id of the project to return members for (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 * @@ -554,9 +554,9 @@ public function getProjectMembers($slug, $pagination, string $contentType = self * @throws \InvalidArgumentException * @return array of \Aternos\HangarApi\Model\PaginatedResultProjectMember|\Aternos\HangarApi\Model\PaginatedResultProjectMember|\Aternos\HangarApi\Model\PaginatedResultProjectMember, HTTP status code, HTTP response headers (array of strings) */ - public function getProjectMembersWithHttpInfo($slug, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) + public function getProjectMembersWithHttpInfo($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) { - $request = $this->getProjectMembersRequest($slug, $pagination, $contentType); + $request = $this->getProjectMembersRequest($slug_or_id, $pagination, $contentType); try { $options = $this->createHttpClientOption(); @@ -609,7 +609,7 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultProjectMember' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -636,7 +636,7 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultProjectMember' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -716,7 +716,7 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProjectMember', @@ -724,7 +724,7 @@ public function getProjectMembersWithHttpInfo($slug, $pagination, string $conten ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProjectMember', @@ -742,16 +742,16 @@ 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 string $slug_or_id The slug or id of the project to return members for (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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectMembersAsync($slug, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) + public function getProjectMembersAsync($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) { - return $this->getProjectMembersAsyncWithHttpInfo($slug, $pagination, $contentType) + return $this->getProjectMembersAsyncWithHttpInfo($slug_or_id, $pagination, $contentType) ->then( function ($response) { return $response[0]; @@ -764,17 +764,17 @@ function ($response) { * * Returns the members of a project * - * @param string $slug The slug of the project to return members for (required) + * @param string $slug_or_id The slug or id of the project to return members for (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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectMembersAsyncWithHttpInfo($slug, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) + public function getProjectMembersAsyncWithHttpInfo($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) { $returnType = '\Aternos\HangarApi\Model\PaginatedResultProjectMember'; - $request = $this->getProjectMembersRequest($slug, $pagination, $contentType); + $request = $this->getProjectMembersRequest($slug_or_id, $pagination, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -815,20 +815,20 @@ function ($exception) { /** * Create request for operation 'getProjectMembers' * - * @param string $slug The slug of the project to return members for (required) + * @param string $slug_or_id The slug or id of the project to return members for (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 * @return \GuzzleHttp\Psr7\Request */ - public function getProjectMembersRequest($slug, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) + public function getProjectMembersRequest($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectMembers'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getProjectMembers' + 'Missing the required parameter $slug_or_id when calling getProjectMembers' ); } @@ -840,7 +840,7 @@ public function getProjectMembersRequest($slug, $pagination, string $contentType } - $resourcePath = '/api/v1/projects/{slug}/members'; + $resourcePath = '/api/v1/projects/{slugOrId}/members'; $formParams = []; $queryParams = []; $headerParams = []; @@ -859,10 +859,10 @@ public function getProjectMembersRequest($slug, $pagination, string $contentType // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } @@ -930,7 +930,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 string $slug_or_id The slug or id of the project to return stargazers for (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 * @@ -938,9 +938,9 @@ public function getProjectMembersRequest($slug, $pagination, string $contentType * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser */ - public function getProjectStargazers($slug, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) + public function getProjectStargazers($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) { - list($response) = $this->getProjectStargazersWithHttpInfo($slug, $pagination, $contentType); + list($response) = $this->getProjectStargazersWithHttpInfo($slug_or_id, $pagination, $contentType); return $response; } @@ -949,7 +949,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 string $slug_or_id The slug or id of the project to return stargazers for (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 * @@ -957,9 +957,9 @@ public function getProjectStargazers($slug, $pagination, string $contentType = s * @throws \InvalidArgumentException * @return array of \Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser, HTTP status code, HTTP response headers (array of strings) */ - public function getProjectStargazersWithHttpInfo($slug, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) + public function getProjectStargazersWithHttpInfo($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) { - $request = $this->getProjectStargazersRequest($slug, $pagination, $contentType); + $request = $this->getProjectStargazersRequest($slug_or_id, $pagination, $contentType); try { $options = $this->createHttpClientOption(); @@ -1012,7 +1012,7 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1039,7 +1039,7 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1119,7 +1119,7 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -1127,7 +1127,7 @@ public function getProjectStargazersWithHttpInfo($slug, $pagination, string $con ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -1145,16 +1145,16 @@ 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 string $slug_or_id The slug or id of the project to return stargazers for (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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectStargazersAsync($slug, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) + public function getProjectStargazersAsync($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) { - return $this->getProjectStargazersAsyncWithHttpInfo($slug, $pagination, $contentType) + return $this->getProjectStargazersAsyncWithHttpInfo($slug_or_id, $pagination, $contentType) ->then( function ($response) { return $response[0]; @@ -1167,17 +1167,17 @@ function ($response) { * * Returns the stargazers of a project * - * @param string $slug The slug of the project to return stargazers for (required) + * @param string $slug_or_id The slug or id of the project to return stargazers for (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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectStargazersAsyncWithHttpInfo($slug, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) + public function getProjectStargazersAsyncWithHttpInfo($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) { $returnType = '\Aternos\HangarApi\Model\PaginatedResultUser'; - $request = $this->getProjectStargazersRequest($slug, $pagination, $contentType); + $request = $this->getProjectStargazersRequest($slug_or_id, $pagination, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1218,20 +1218,20 @@ function ($exception) { /** * Create request for operation 'getProjectStargazers' * - * @param string $slug The slug of the project to return stargazers for (required) + * @param string $slug_or_id The slug or id of the project to return stargazers for (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 * @return \GuzzleHttp\Psr7\Request */ - public function getProjectStargazersRequest($slug, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) + public function getProjectStargazersRequest($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectStargazers'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getProjectStargazers' + 'Missing the required parameter $slug_or_id when calling getProjectStargazers' ); } @@ -1243,7 +1243,7 @@ public function getProjectStargazersRequest($slug, $pagination, string $contentT } - $resourcePath = '/api/v1/projects/{slug}/stargazers'; + $resourcePath = '/api/v1/projects/{slugOrId}/stargazers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1262,10 +1262,10 @@ public function getProjectStargazersRequest($slug, $pagination, string $contentT // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } @@ -1333,7 +1333,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 string $slug_or_id The slug or id of the project to return watchers for (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 * @@ -1341,9 +1341,9 @@ public function getProjectStargazersRequest($slug, $pagination, string $contentT * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser */ - public function getProjectWatchers($slug, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) + public function getProjectWatchers($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) { - list($response) = $this->getProjectWatchersWithHttpInfo($slug, $pagination, $contentType); + list($response) = $this->getProjectWatchersWithHttpInfo($slug_or_id, $pagination, $contentType); return $response; } @@ -1352,7 +1352,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 string $slug_or_id The slug or id of the project to return watchers for (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 * @@ -1360,9 +1360,9 @@ public function getProjectWatchers($slug, $pagination, string $contentType = sel * @throws \InvalidArgumentException * @return array of \Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser|\Aternos\HangarApi\Model\PaginatedResultUser, HTTP status code, HTTP response headers (array of strings) */ - public function getProjectWatchersWithHttpInfo($slug, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) + public function getProjectWatchersWithHttpInfo($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) { - $request = $this->getProjectWatchersRequest($slug, $pagination, $contentType); + $request = $this->getProjectWatchersRequest($slug_or_id, $pagination, $contentType); try { $options = $this->createHttpClientOption(); @@ -1415,7 +1415,7 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1442,7 +1442,7 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1522,7 +1522,7 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -1530,7 +1530,7 @@ public function getProjectWatchersWithHttpInfo($slug, $pagination, string $conte ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -1548,16 +1548,16 @@ 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 string $slug_or_id The slug or id of the project to return watchers for (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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectWatchersAsync($slug, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) + public function getProjectWatchersAsync($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) { - return $this->getProjectWatchersAsyncWithHttpInfo($slug, $pagination, $contentType) + return $this->getProjectWatchersAsyncWithHttpInfo($slug_or_id, $pagination, $contentType) ->then( function ($response) { return $response[0]; @@ -1570,17 +1570,17 @@ function ($response) { * * Returns the watchers of a project * - * @param string $slug The slug of the project to return watchers for (required) + * @param string $slug_or_id The slug or id of the project to return watchers for (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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getProjectWatchersAsyncWithHttpInfo($slug, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) + public function getProjectWatchersAsyncWithHttpInfo($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) { $returnType = '\Aternos\HangarApi\Model\PaginatedResultUser'; - $request = $this->getProjectWatchersRequest($slug, $pagination, $contentType); + $request = $this->getProjectWatchersRequest($slug_or_id, $pagination, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1621,20 +1621,20 @@ function ($exception) { /** * Create request for operation 'getProjectWatchers' * - * @param string $slug The slug of the project to return watchers for (required) + * @param string $slug_or_id The slug or id of the project to return watchers for (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 * @return \GuzzleHttp\Psr7\Request */ - public function getProjectWatchersRequest($slug, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) + public function getProjectWatchersRequest($slug_or_id, $pagination, string $contentType = self::contentTypes['getProjectWatchers'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getProjectWatchers' + 'Missing the required parameter $slug_or_id when calling getProjectWatchers' ); } @@ -1646,7 +1646,7 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp } - $resourcePath = '/api/v1/projects/{slug}/watchers'; + $resourcePath = '/api/v1/projects/{slugOrId}/watchers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1665,10 +1665,10 @@ public function getProjectWatchersRequest($slug, $pagination, string $contentTyp // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } @@ -1742,8 +1742,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) @@ -1754,9 +1754,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; } @@ -1771,8 +1771,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) @@ -1783,9 +1783,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, $query = null, $q = 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, $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(); @@ -1838,7 +1838,7 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultProject' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1865,7 +1865,7 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultProject' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1945,7 +1945,7 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProject', @@ -1953,7 +1953,7 @@ public function getProjectsWithHttpInfo($pagination, $prioritize_exact_match = t ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProject', @@ -1977,8 +1977,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) @@ -1988,9 +1988,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]; @@ -2009,8 +2009,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) @@ -2020,10 +2020,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, $query = null, $q = 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, $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()) @@ -2070,8 +2070,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) @@ -2081,7 +2081,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 @@ -2166,8 +2166,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 @@ -2175,8 +2175,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 @@ -2364,7 +2364,7 @@ public function projectByVersionHashWithHttpInfo($hash, string $contentType = se $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\Project' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2391,7 +2391,7 @@ public function projectByVersionHashWithHttpInfo($hash, string $contentType = se $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\Project' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2471,7 +2471,7 @@ public function projectByVersionHashWithHttpInfo($hash, string $contentType = se ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\Project', @@ -2479,7 +2479,7 @@ public function projectByVersionHashWithHttpInfo($hash, string $contentType = se ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\Project', @@ -2666,7 +2666,7 @@ public function projectByVersionHashRequest($hash, string $contentType = self::c * * Returns the stats for a project * - * @param string $slug The slug of the project to return stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showProjectStats'] to see the possible values for this operation @@ -2675,9 +2675,9 @@ public function projectByVersionHashRequest($hash, string $contentType = self::c * @throws \InvalidArgumentException * @return array|array|array */ - public function showProjectStats($slug, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) + public function showProjectStats($slug_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) { - list($response) = $this->showProjectStatsWithHttpInfo($slug, $from_date, $to_date, $contentType); + list($response) = $this->showProjectStatsWithHttpInfo($slug_or_id, $from_date, $to_date, $contentType); return $response; } @@ -2686,7 +2686,7 @@ public function showProjectStats($slug, $from_date, $to_date, string $contentTyp * * Returns the stats for a project * - * @param string $slug The slug of the project to return stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showProjectStats'] to see the possible values for this operation @@ -2695,9 +2695,9 @@ public function showProjectStats($slug, $from_date, $to_date, string $contentTyp * @throws \InvalidArgumentException * @return array of array|array|array, HTTP status code, HTTP response headers (array of strings) */ - public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) + public function showProjectStatsWithHttpInfo($slug_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) { - $request = $this->showProjectStatsRequest($slug, $from_date, $to_date, $contentType); + $request = $this->showProjectStatsRequest($slug_or_id, $from_date, $to_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -2750,7 +2750,7 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2777,7 +2777,7 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2857,7 +2857,7 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -2865,7 +2865,7 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -2883,7 +2883,7 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string * * Returns the stats for a project * - * @param string $slug The slug of the project to return stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showProjectStats'] to see the possible values for this operation @@ -2891,9 +2891,9 @@ public function showProjectStatsWithHttpInfo($slug, $from_date, $to_date, string * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showProjectStatsAsync($slug, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) + public function showProjectStatsAsync($slug_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) { - return $this->showProjectStatsAsyncWithHttpInfo($slug, $from_date, $to_date, $contentType) + return $this->showProjectStatsAsyncWithHttpInfo($slug_or_id, $from_date, $to_date, $contentType) ->then( function ($response) { return $response[0]; @@ -2906,7 +2906,7 @@ function ($response) { * * Returns the stats for a project * - * @param string $slug The slug of the project to return stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showProjectStats'] to see the possible values for this operation @@ -2914,10 +2914,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showProjectStatsAsyncWithHttpInfo($slug, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) + public function showProjectStatsAsyncWithHttpInfo($slug_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) { $returnType = 'array'; - $request = $this->showProjectStatsRequest($slug, $from_date, $to_date, $contentType); + $request = $this->showProjectStatsRequest($slug_or_id, $from_date, $to_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2958,7 +2958,7 @@ function ($exception) { /** * Create request for operation 'showProjectStats' * - * @param string $slug The slug of the project to return stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showProjectStats'] to see the possible values for this operation @@ -2966,13 +2966,13 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function showProjectStatsRequest($slug, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) + public function showProjectStatsRequest($slug_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showProjectStats'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling showProjectStats' + 'Missing the required parameter $slug_or_id when calling showProjectStats' ); } @@ -2991,7 +2991,7 @@ public function showProjectStatsRequest($slug, $from_date, $to_date, string $con } - $resourcePath = '/api/v1/projects/{slug}/stats'; + $resourcePath = '/api/v1/projects/{slugOrId}/stats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3019,10 +3019,10 @@ public function showProjectStatsRequest($slug, $from_date, $to_date, string $con // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index ef8bda6..378c984 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -229,7 +229,7 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -256,7 +256,7 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -336,7 +336,7 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -344,7 +344,7 @@ public function getAuthorsWithHttpInfo($query, $pagination, $sort = null, string ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -648,7 +648,7 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -675,7 +675,7 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -755,7 +755,7 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -763,7 +763,7 @@ public function getStaffWithHttpInfo($query, $pagination, $sort = null, string $ ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -983,7 +983,7 @@ public function getStaffRequest($query, $pagination, $sort = null, string $conte * * Returns a specific user * - * @param string $user The name of the user to return (required) + * @param string $user The name or id of the user to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] 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 @@ -1001,7 +1001,7 @@ public function getUser($user, string $contentType = self::contentTypes['getUser * * Returns a specific user * - * @param string $user The name of the user to return (required) + * @param string $user The name or id of the user to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] 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 @@ -1063,7 +1063,7 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\User' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1090,7 +1090,7 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\User' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1170,7 +1170,7 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\User', @@ -1178,7 +1178,7 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\User', @@ -1196,7 +1196,7 @@ public function getUserWithHttpInfo($user, string $contentType = self::contentTy * * Returns a specific user * - * @param string $user The name of the user to return (required) + * @param string $user The name or id of the user to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1217,7 +1217,7 @@ function ($response) { * * Returns a specific user * - * @param string $user The name of the user to return (required) + * @param string $user The name or id of the user to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1267,7 +1267,7 @@ function ($exception) { /** * Create request for operation 'getUser' * - * @param string $user The name of the user to return (required) + * @param string $user The name or id of the user to return (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUser'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1365,7 +1365,7 @@ public function getUserRequest($user, string $contentType = self::contentTypes[' * * Returns the pinned projects for a specific user * - * @param string $user The user to return pinned projects for (required) + * @param string $user The name or id of the user to return pinned projects for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPinnedProjects'] 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,7 +1383,7 @@ public function getUserPinnedProjects($user, string $contentType = self::content * * Returns the pinned projects for a specific user * - * @param string $user The user to return pinned projects for (required) + * @param string $user The name or id of the user to return pinned projects for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPinnedProjects'] 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 @@ -1445,7 +1445,7 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\ProjectCompact[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1472,7 +1472,7 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\ProjectCompact[]' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1552,7 +1552,7 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ProjectCompact[]', @@ -1560,7 +1560,7 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\ProjectCompact[]', @@ -1578,7 +1578,7 @@ public function getUserPinnedProjectsWithHttpInfo($user, string $contentType = s * * Returns the pinned projects for a specific user * - * @param string $user The user to return pinned projects for (required) + * @param string $user The name or id of the user to return pinned projects for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPinnedProjects'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1599,7 +1599,7 @@ function ($response) { * * Returns the pinned projects for a specific user * - * @param string $user The user to return pinned projects for (required) + * @param string $user The name or id of the user to return pinned projects for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPinnedProjects'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1649,7 +1649,7 @@ function ($exception) { /** * Create request for operation 'getUserPinnedProjects' * - * @param string $user The user to return pinned projects for (required) + * @param string $user The name or id of the user to return pinned projects for (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getUserPinnedProjects'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1747,7 +1747,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 string $user The name or id of the user to return watched projects for (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 @@ -1767,7 +1767,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 string $user The name or id of the user to return watched projects for (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 @@ -1831,7 +1831,7 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultProjectCompact' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1858,7 +1858,7 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultProjectCompact' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1938,7 +1938,7 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProjectCompact', @@ -1946,7 +1946,7 @@ public function getUserWatchingWithHttpInfo($user, $pagination, $sort = null, st ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProjectCompact', @@ -1964,7 +1964,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 string $user The name or id of the user to return watched projects for (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 @@ -1987,7 +1987,7 @@ function ($response) { * * Returns the watched projects for a specific user * - * @param string $user The user to return watched projects for (required) + * @param string $user The name or id of the user to return watched projects for (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 @@ -2039,7 +2039,7 @@ function ($exception) { /** * Create request for operation 'getUserWatching' * - * @param string $user The user to return watched projects for (required) + * @param string $user The name or id of the user to return watched projects for (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 @@ -2165,7 +2165,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 string $user The name or id of the user to return starred projects for (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 @@ -2185,7 +2185,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 string $user The name or id of the user to return starred projects for (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 @@ -2249,7 +2249,7 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultProjectCompact' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2276,7 +2276,7 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultProjectCompact' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2356,7 +2356,7 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProjectCompact', @@ -2364,7 +2364,7 @@ public function showStarredWithHttpInfo($user, $pagination, $sort = null, string ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultProjectCompact', @@ -2382,7 +2382,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 string $user The name or id of the user to return starred projects for (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 @@ -2405,7 +2405,7 @@ function ($response) { * * Returns the starred projects for a specific user * - * @param string $user The user to return starred projects for (required) + * @param string $user The name or id of the user to return starred projects for (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 @@ -2457,7 +2457,7 @@ function ($exception) { /** * Create request for operation 'showStarred' * - * @param string $user The user to return starred projects for (required) + * @param string $user The name or id of the user to return starred projects for (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 @@ -2667,7 +2667,7 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2694,7 +2694,7 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\PaginatedResultUser' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2774,7 +2774,7 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', @@ -2782,7 +2782,7 @@ public function showUsersWithHttpInfo($query, $pagination, $sort = null, string ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\PaginatedResultUser', diff --git a/lib/Api/VersionsApi.php b/lib/Api/VersionsApi.php index ed0fce7..01a7ea9 100644 --- a/lib/Api/VersionsApi.php +++ b/lib/Api/VersionsApi.php @@ -77,6 +77,9 @@ class VersionsApi 'downloadVersion1' => [ 'application/json', ], + 'downloadVersionById' => [ + 'application/json', + ], 'getLatestReleaseVersion' => [ 'application/json', ], @@ -104,9 +107,15 @@ class VersionsApi 'showVersion' => [ 'application/json', ], + 'showVersionById' => [ + 'application/json', + ], 'showVersionStats' => [ 'application/json', ], + 'showVersionStatsById' => [ + 'application/json', + ], 'uploadVersion' => [ 'multipart/form-data', ], @@ -166,8 +175,8 @@ public function getConfig() * * Downloads a version * - * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -175,9 +184,9 @@ public function getConfig() * @throws \InvalidArgumentException * @return object|object|object|object|object */ - public function downloadVersion($slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) + public function downloadVersion($slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) { - list($response) = $this->downloadVersionWithHttpInfo($slug, $name, $platform, $contentType); + list($response) = $this->downloadVersionWithHttpInfo($slug_or_id, $name_or_id, $platform, $contentType); return $response; } @@ -186,8 +195,8 @@ public function downloadVersion($slug, $name, $platform, string $contentType = s * * Downloads a version * - * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -195,9 +204,9 @@ public function downloadVersion($slug, $name, $platform, string $contentType = s * @throws \InvalidArgumentException * @return array of object|object|object|object|object, HTTP status code, HTTP response headers (array of strings) */ - public function downloadVersionWithHttpInfo($slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) + public function downloadVersionWithHttpInfo($slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) { - $request = $this->downloadVersionRequest($slug, $name, $platform, $contentType); + $request = $this->downloadVersionRequest($slug_or_id, $name_or_id, $platform, $contentType); try { $options = $this->createHttpClientOption(); @@ -223,7 +232,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con switch($statusCode) { - case 303: + case 200: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -250,7 +259,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con $response->getStatusCode(), $response->getHeaders() ]; - case 200: + case 303: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -304,7 +313,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -331,7 +340,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -403,7 +412,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con } catch (ApiException $e) { switch ($e->getCode()) { - case 303: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -411,7 +420,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con ); $e->setResponseObject($data); break; - case 200: + case 303: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -427,7 +436,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -435,7 +444,7 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'object', @@ -453,17 +462,17 @@ public function downloadVersionWithHttpInfo($slug, $name, $platform, string $con * * Downloads a version * - * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadVersionAsync($slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) + public function downloadVersionAsync($slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) { - return $this->downloadVersionAsyncWithHttpInfo($slug, $name, $platform, $contentType) + return $this->downloadVersionAsyncWithHttpInfo($slug_or_id, $name_or_id, $platform, $contentType) ->then( function ($response) { return $response[0]; @@ -476,18 +485,18 @@ function ($response) { * * Downloads a version * - * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @return \GuzzleHttp\Promise\PromiseInterface */ - public function downloadVersionAsyncWithHttpInfo($slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) + public function downloadVersionAsyncWithHttpInfo($slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) { $returnType = 'object'; - $request = $this->downloadVersionRequest($slug, $name, $platform, $contentType); + $request = $this->downloadVersionRequest($slug_or_id, $name_or_id, $platform, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -528,28 +537,28 @@ function ($exception) { /** * Create request for operation 'downloadVersion' * - * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @return \GuzzleHttp\Psr7\Request */ - public function downloadVersionRequest($slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) + public function downloadVersionRequest($slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling downloadVersion' + 'Missing the required parameter $slug_or_id when calling downloadVersion' ); } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'name_or_id' is set + if ($name_or_id === null || (is_array($name_or_id) && count($name_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling downloadVersion' + 'Missing the required parameter $name_or_id when calling downloadVersion' ); } @@ -561,7 +570,7 @@ public function downloadVersionRequest($slug, $name, $platform, string $contentT } - $resourcePath = '/api/v1/projects/{slug}/versions/{name}/{platform}/download'; + $resourcePath = '/api/v1/projects/{slugOrId}/versions/{nameOrId}/{platform}/download'; $formParams = []; $queryParams = []; $headerParams = []; @@ -571,18 +580,18 @@ public function downloadVersionRequest($slug, $name, $platform, string $contentT // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } // path params - if ($name !== null) { + if ($name_or_id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'nameOrId' . '}', + ObjectSerializer::toPathValue($name_or_id), $resourcePath ); } @@ -597,7 +606,7 @@ public function downloadVersionRequest($slug, $name, $platform, string $contentT $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream', 'application/json', ], + ['application/json', 'application/octet-stream', ], $contentType, $multipart ); @@ -657,8 +666,8 @@ public function downloadVersionRequest($slug, $name, $platform, string $contentT * Operation downloadVersion1 * * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -667,9 +676,9 @@ public function downloadVersionRequest($slug, $name, $platform, string $contentT * @return object * @deprecated */ - public function downloadVersion1($author, $slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) + public function downloadVersion1($author, $slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) { - list($response) = $this->downloadVersion1WithHttpInfo($author, $slug, $name, $platform, $contentType); + list($response) = $this->downloadVersion1WithHttpInfo($author, $slug_or_id, $name_or_id, $platform, $contentType); return $response; } @@ -677,8 +686,8 @@ public function downloadVersion1($author, $slug, $name, $platform, string $conte * Operation downloadVersion1WithHttpInfo * * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -687,9 +696,9 @@ public function downloadVersion1($author, $slug, $name, $platform, string $conte * @return array of object, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function downloadVersion1WithHttpInfo($author, $slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) + public function downloadVersion1WithHttpInfo($author, $slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) { - $request = $this->downloadVersion1Request($author, $slug, $name, $platform, $contentType); + $request = $this->downloadVersion1Request($author, $slug_or_id, $name_or_id, $platform, $contentType); try { $options = $this->createHttpClientOption(); @@ -804,8 +813,8 @@ public function downloadVersion1WithHttpInfo($author, $slug, $name, $platform, s * Operation downloadVersion1Async * * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -813,9 +822,9 @@ public function downloadVersion1WithHttpInfo($author, $slug, $name, $platform, s * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function downloadVersion1Async($author, $slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) + public function downloadVersion1Async($author, $slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) { - return $this->downloadVersion1AsyncWithHttpInfo($author, $slug, $name, $platform, $contentType) + return $this->downloadVersion1AsyncWithHttpInfo($author, $slug_or_id, $name_or_id, $platform, $contentType) ->then( function ($response) { return $response[0]; @@ -827,8 +836,8 @@ function ($response) { * Operation downloadVersion1AsyncWithHttpInfo * * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -836,10 +845,10 @@ function ($response) { * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function downloadVersion1AsyncWithHttpInfo($author, $slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) + public function downloadVersion1AsyncWithHttpInfo($author, $slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) { $returnType = 'object'; - $request = $this->downloadVersion1Request($author, $slug, $name, $platform, $contentType); + $request = $this->downloadVersion1Request($author, $slug_or_id, $name_or_id, $platform, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -881,8 +890,8 @@ function ($exception) { * Create request for operation 'downloadVersion1' * * @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 string $slug_or_id The slug or id of the project to download the version from (required) + * @param string $name_or_id The name 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 * @@ -890,7 +899,7 @@ function ($exception) { * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function downloadVersion1Request($author, $slug, $name, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) + public function downloadVersion1Request($author, $slug_or_id, $name_or_id, $platform, string $contentType = self::contentTypes['downloadVersion1'][0]) { // verify the required parameter 'author' is set @@ -900,17 +909,17 @@ public function downloadVersion1Request($author, $slug, $name, $platform, string ); } - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling downloadVersion1' + 'Missing the required parameter $slug_or_id when calling downloadVersion1' ); } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'name_or_id' is set + if ($name_or_id === null || (is_array($name_or_id) && count($name_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling downloadVersion1' + 'Missing the required parameter $name_or_id when calling downloadVersion1' ); } @@ -922,7 +931,7 @@ public function downloadVersion1Request($author, $slug, $name, $platform, string } - $resourcePath = '/api/v1/projects/{author}/{slug}/versions/{name}/{platform}/download'; + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/versions/{nameOrId}/{platform}/download'; $formParams = []; $queryParams = []; $headerParams = []; @@ -940,18 +949,18 @@ public function downloadVersion1Request($author, $slug, $name, $platform, string ); } // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } // path params - if ($name !== null) { + if ($name_or_id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'nameOrId' . '}', + ObjectSerializer::toPathValue($name_or_id), $resourcePath ); } @@ -966,7 +975,7 @@ public function downloadVersion1Request($author, $slug, $name, $platform, string $headers = $this->headerSelector->selectHeaders( - ['application/octet-stream', 'application/json', ], + ['application/json', 'application/octet-stream', ], $contentType, $multipart ); @@ -1019,38 +1028,40 @@ public function downloadVersion1Request($author, $slug, $name, $platform, string } /** - * Operation getLatestReleaseVersion + * Operation downloadVersionById * - * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation + * Downloads a version by its ID + * + * @param string $id The id 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['downloadVersionById'] 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 string - * @deprecated + * @return object|object|object|object|object */ - public function getLatestReleaseVersion($author, $slug, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) + public function downloadVersionById($id, $platform, string $contentType = self::contentTypes['downloadVersionById'][0]) { - list($response) = $this->getLatestReleaseVersionWithHttpInfo($author, $slug, $contentType); + list($response) = $this->downloadVersionByIdWithHttpInfo($id, $platform, $contentType); return $response; } /** - * Operation getLatestReleaseVersionWithHttpInfo + * Operation downloadVersionByIdWithHttpInfo * - * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation + * Downloads a version by its ID + * + * @param string $id The id 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['downloadVersionById'] 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 string, HTTP status code, HTTP response headers (array of strings) - * @deprecated + * @return array of object|object|object|object|object, HTTP status code, HTTP response headers (array of strings) */ - public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) + public function downloadVersionByIdWithHttpInfo($id, $platform, string $contentType = self::contentTypes['downloadVersionById'][0]) { - $request = $this->getLatestReleaseVersionRequest($author, $slug, $contentType); + $request = $this->downloadVersionByIdRequest($id, $platform, $contentType); try { $options = $this->createHttpClientOption(); @@ -1077,11 +1088,11 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('object' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1099,7 +1110,115 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 303: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('object' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('object' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1118,7 +1237,7 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont ); } - $returnType = 'string'; + $returnType = 'object'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1151,7 +1270,39 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 303: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1162,19 +1313,20 @@ public function getLatestReleaseVersionWithHttpInfo($author, $slug, string $cont } /** - * Operation getLatestReleaseVersionAsync + * Operation downloadVersionByIdAsync * - * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation + * Downloads a version by its ID + * + * @param string $id The id 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['downloadVersionById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getLatestReleaseVersionAsync($author, $slug, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) + public function downloadVersionByIdAsync($id, $platform, string $contentType = self::contentTypes['downloadVersionById'][0]) { - return $this->getLatestReleaseVersionAsyncWithHttpInfo($author, $slug, $contentType) + return $this->downloadVersionByIdAsyncWithHttpInfo($id, $platform, $contentType) ->then( function ($response) { return $response[0]; @@ -1183,20 +1335,21 @@ function ($response) { } /** - * Operation getLatestReleaseVersionAsyncWithHttpInfo + * Operation downloadVersionByIdAsyncWithHttpInfo * - * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation + * Downloads a version by its ID + * + * @param string $id The id 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['downloadVersionById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface - * @deprecated */ - public function getLatestReleaseVersionAsyncWithHttpInfo($author, $slug, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) + public function downloadVersionByIdAsyncWithHttpInfo($id, $platform, string $contentType = self::contentTypes['downloadVersionById'][0]) { - $returnType = 'string'; - $request = $this->getLatestReleaseVersionRequest($author, $slug, $contentType); + $returnType = 'object'; + $request = $this->downloadVersionByIdRequest($id, $platform, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1235,35 +1388,34 @@ function ($exception) { } /** - * Create request for operation 'getLatestReleaseVersion' + * Create request for operation 'downloadVersionById' * - * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation + * @param string $id The id 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['downloadVersionById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request - * @deprecated */ - public function getLatestReleaseVersionRequest($author, $slug, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) + public function downloadVersionByIdRequest($id, $platform, string $contentType = self::contentTypes['downloadVersionById'][0]) { - // verify the required parameter 'author' is set - if ($author === null || (is_array($author) && count($author) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $author when calling getLatestReleaseVersion' + 'Missing the required parameter $id when calling downloadVersionById' ); } - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'platform' is set + if ($platform === null || (is_array($platform) && count($platform) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getLatestReleaseVersion' + 'Missing the required parameter $platform when calling downloadVersionById' ); } - $resourcePath = '/api/v1/projects/{author}/{slug}/latestrelease'; + $resourcePath = '/api/v1/versions/{id}/{platform}/download'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1273,25 +1425,25 @@ public function getLatestReleaseVersionRequest($author, $slug, string $contentTy // path params - if ($author !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'author' . '}', - ObjectSerializer::toPathValue($author), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } // path params - if ($slug !== null) { + if ($platform !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'platform' . '}', + ObjectSerializer::toPathValue($platform), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['application/json', 'text/plain', ], + ['application/json', 'application/octet-stream', ], $contentType, $multipart ); @@ -1321,6 +1473,10 @@ public function getLatestReleaseVersionRequest($author, $slug, string $contentTy } } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1344,40 +1500,38 @@ public function getLatestReleaseVersionRequest($author, $slug, string $contentTy } /** - * Operation getLatestVersion + * Operation getLatestReleaseVersion * * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] 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 string * @deprecated */ - public function getLatestVersion($author, $slug, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) + public function getLatestReleaseVersion($author, $slug_or_id, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) { - list($response) = $this->getLatestVersionWithHttpInfo($author, $slug, $channel, $contentType); + list($response) = $this->getLatestReleaseVersionWithHttpInfo($author, $slug_or_id, $contentType); return $response; } /** - * Operation getLatestVersionWithHttpInfo + * Operation getLatestReleaseVersionWithHttpInfo * * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] 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 string, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getLatestVersionWithHttpInfo($author, $slug, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) + public function getLatestReleaseVersionWithHttpInfo($author, $slug_or_id, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) { - $request = $this->getLatestVersionRequest($author, $slug, $channel, $contentType); + $request = $this->getLatestReleaseVersionRequest($author, $slug_or_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1489,20 +1643,19 @@ public function getLatestVersionWithHttpInfo($author, $slug, $channel, string $c } /** - * Operation getLatestVersionAsync + * Operation getLatestReleaseVersionAsync * * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getLatestVersionAsync($author, $slug, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) + public function getLatestReleaseVersionAsync($author, $slug_or_id, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) { - return $this->getLatestVersionAsyncWithHttpInfo($author, $slug, $channel, $contentType) + return $this->getLatestReleaseVersionAsyncWithHttpInfo($author, $slug_or_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1511,21 +1664,20 @@ function ($response) { } /** - * Operation getLatestVersionAsyncWithHttpInfo + * Operation getLatestReleaseVersionAsyncWithHttpInfo * * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getLatestVersionAsyncWithHttpInfo($author, $slug, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) + public function getLatestReleaseVersionAsyncWithHttpInfo($author, $slug_or_id, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) { $returnType = 'string'; - $request = $this->getLatestVersionRequest($author, $slug, $channel, $contentType); + $request = $this->getLatestReleaseVersionRequest($author, $slug_or_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1564,58 +1716,41 @@ function ($exception) { } /** - * Create request for operation 'getLatestVersion' + * Create request for operation 'getLatestReleaseVersion' * * @param string $author The author of the project to return the latest version for (required) - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestReleaseVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getLatestVersionRequest($author, $slug, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) + public function getLatestReleaseVersionRequest($author, $slug_or_id, string $contentType = self::contentTypes['getLatestReleaseVersion'][0]) { // verify the required parameter 'author' is set if ($author === null || (is_array($author) && count($author) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $author when calling getLatestVersion' + 'Missing the required parameter $author when calling getLatestReleaseVersion' ); } - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getLatestVersion' + 'Missing the required parameter $slug_or_id when calling getLatestReleaseVersion' ); } - // verify the required parameter 'channel' is set - if ($channel === null || (is_array($channel) && count($channel) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $channel when calling getLatestVersion' - ); - } - - $resourcePath = '/api/v1/projects/{author}/{slug}/latest'; + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/latestrelease'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $channel, - 'channel', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params @@ -1627,10 +1762,10 @@ public function getLatestVersionRequest($author, $slug, $channel, string $conten ); } // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } @@ -1690,40 +1825,40 @@ public function getLatestVersionRequest($author, $slug, $channel, string $conten } /** - * Operation getVersion + * Operation getLatestVersion * - * @param string $author The author of the project to return the version for (required) - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation + * @param string $author The author of the project to return the latest version for (required) + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] 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\Version + * @return string * @deprecated */ - public function getVersion($author, $slug, $name, string $contentType = self::contentTypes['getVersion'][0]) + public function getLatestVersion($author, $slug_or_id, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) { - list($response) = $this->getVersionWithHttpInfo($author, $slug, $name, $contentType); + list($response) = $this->getLatestVersionWithHttpInfo($author, $slug_or_id, $channel, $contentType); return $response; } /** - * Operation getVersionWithHttpInfo + * Operation getLatestVersionWithHttpInfo * - * @param string $author The author of the project to return the version for (required) - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation + * @param string $author The author of the project to return the latest version for (required) + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] 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\Version, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getVersionWithHttpInfo($author, $slug, $name, string $contentType = self::contentTypes['getVersion'][0]) + public function getLatestVersionWithHttpInfo($author, $slug_or_id, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) { - $request = $this->getVersionRequest($author, $slug, $name, $contentType); + $request = $this->getLatestVersionRequest($author, $slug_or_id, $channel, $contentType); try { $options = $this->createHttpClientOption(); @@ -1750,11 +1885,11 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp switch($statusCode) { case 200: - if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { + if ('string' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\Version' !== 'string') { + if ('string' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -1772,7 +1907,7 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), + ObjectSerializer::deserialize($content, 'string', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1791,7 +1926,7 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp ); } - $returnType = '\Aternos\HangarApi\Model\Version'; + $returnType = 'string'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -1824,7 +1959,7 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\Version', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1835,20 +1970,20 @@ public function getVersionWithHttpInfo($author, $slug, $name, string $contentTyp } /** - * Operation getVersionAsync + * Operation getLatestVersionAsync * - * @param string $author The author of the project to return the version for (required) - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation + * @param string $author The author of the project to return the latest version for (required) + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getVersionAsync($author, $slug, $name, string $contentType = self::contentTypes['getVersion'][0]) + public function getLatestVersionAsync($author, $slug_or_id, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) { - return $this->getVersionAsyncWithHttpInfo($author, $slug, $name, $contentType) + return $this->getLatestVersionAsyncWithHttpInfo($author, $slug_or_id, $channel, $contentType) ->then( function ($response) { return $response[0]; @@ -1857,21 +1992,21 @@ function ($response) { } /** - * Operation getVersionAsyncWithHttpInfo + * Operation getLatestVersionAsyncWithHttpInfo * - * @param string $author The author of the project to return the version for (required) - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation + * @param string $author The author of the project to return the latest version for (required) + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getVersionAsyncWithHttpInfo($author, $slug, $name, string $contentType = self::contentTypes['getVersion'][0]) + public function getLatestVersionAsyncWithHttpInfo($author, $slug_or_id, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) { - $returnType = '\Aternos\HangarApi\Model\Version'; - $request = $this->getVersionRequest($author, $slug, $name, $contentType); + $returnType = 'string'; + $request = $this->getLatestVersionRequest($author, $slug_or_id, $channel, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1910,49 +2045,58 @@ function ($exception) { } /** - * Create request for operation 'getVersion' + * Create request for operation 'getLatestVersion' * - * @param string $author The author of the project to return the version for (required) - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation + * @param string $author The author of the project to return the latest version for (required) + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getLatestVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getVersionRequest($author, $slug, $name, string $contentType = self::contentTypes['getVersion'][0]) + public function getLatestVersionRequest($author, $slug_or_id, $channel, string $contentType = self::contentTypes['getLatestVersion'][0]) { // verify the required parameter 'author' is set if ($author === null || (is_array($author) && count($author) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $author when calling getVersion' + 'Missing the required parameter $author when calling getLatestVersion' ); } - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getVersion' + 'Missing the required parameter $slug_or_id when calling getLatestVersion' ); } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'channel' is set + if ($channel === null || (is_array($channel) && count($channel) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling getVersion' + 'Missing the required parameter $channel when calling getLatestVersion' ); } - $resourcePath = '/api/v1/projects/{author}/{slug}/versions/{name}'; + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/latest'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $channel, + 'channel', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params @@ -1964,25 +2108,17 @@ public function getVersionRequest($author, $slug, $name, string $contentType = s ); } // path params - if ($slug !== null) { - $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), - $resourcePath - ); - } - // path params - if ($name !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['application/json', 'text/plain', ], $contentType, $multipart ); @@ -2035,44 +2171,40 @@ public function getVersionRequest($author, $slug, $name, string $contentType = s } /** - * Operation getVersionStats + * Operation getVersion * - * @param string $author The author of the version to return the stats for (required) - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) - * @param \DateTime $from_date The first date to include in the result (required) - * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation + * @param string $author The author of the project to return the version for (required) + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] 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 + * @return \Aternos\HangarApi\Model\Version * @deprecated */ - public function getVersionStats($author, $slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) + public function getVersion($author, $slug_or_id, $name_or_id, string $contentType = self::contentTypes['getVersion'][0]) { - list($response) = $this->getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $to_date, $contentType); + list($response) = $this->getVersionWithHttpInfo($author, $slug_or_id, $name_or_id, $contentType); return $response; } /** - * Operation getVersionStatsWithHttpInfo + * Operation getVersionWithHttpInfo * - * @param string $author The author of the version to return the stats for (required) - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) - * @param \DateTime $from_date The first date to include in the result (required) - * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation + * @param string $author The author of the project to return the version for (required) + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] 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 array, HTTP status code, HTTP response headers (array of strings) + * @return array of \Aternos\HangarApi\Model\Version, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) + public function getVersionWithHttpInfo($author, $slug_or_id, $name_or_id, string $contentType = self::contentTypes['getVersion'][0]) { - $request = $this->getVersionStatsRequest($author, $slug, $name, $from_date, $to_date, $contentType); + $request = $this->getVersionRequest($author, $slug_or_id, $name_or_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -2099,11 +2231,11 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ switch($statusCode) { case 200: - if ('array' === '\SplFileObject') { + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('array' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2121,7 +2253,7 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ } return [ - ObjectSerializer::deserialize($content, 'array', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2140,7 +2272,7 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ ); } - $returnType = 'array'; + $returnType = '\Aternos\HangarApi\Model\Version'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2173,7 +2305,7 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'array', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2184,22 +2316,20 @@ public function getVersionStatsWithHttpInfo($author, $slug, $name, $from_date, $ } /** - * Operation getVersionStatsAsync + * Operation getVersionAsync * - * @param string $author The author of the version to return the stats for (required) - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) - * @param \DateTime $from_date The first date to include in the result (required) - * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation + * @param string $author The author of the project to return the version for (required) + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getVersionStatsAsync($author, $slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) + public function getVersionAsync($author, $slug_or_id, $name_or_id, string $contentType = self::contentTypes['getVersion'][0]) { - return $this->getVersionStatsAsyncWithHttpInfo($author, $slug, $name, $from_date, $to_date, $contentType) + return $this->getVersionAsyncWithHttpInfo($author, $slug_or_id, $name_or_id, $contentType) ->then( function ($response) { return $response[0]; @@ -2208,23 +2338,21 @@ function ($response) { } /** - * Operation getVersionStatsAsyncWithHttpInfo + * Operation getVersionAsyncWithHttpInfo * - * @param string $author The author of the version to return the stats for (required) - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) - * @param \DateTime $from_date The first date to include in the result (required) - * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation + * @param string $author The author of the project to return the version for (required) + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getVersionStatsAsyncWithHttpInfo($author, $slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) + public function getVersionAsyncWithHttpInfo($author, $slug_or_id, $name_or_id, string $contentType = self::contentTypes['getVersion'][0]) { - $returnType = 'array'; - $request = $this->getVersionStatsRequest($author, $slug, $name, $from_date, $to_date, $contentType); + $returnType = '\Aternos\HangarApi\Model\Version'; + $request = $this->getVersionRequest($author, $slug_or_id, $name_or_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2263,83 +2391,49 @@ function ($exception) { } /** - * Create request for operation 'getVersionStats' + * Create request for operation 'getVersion' * - * @param string $author The author of the version to return the stats for (required) - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) - * @param \DateTime $from_date The first date to include in the result (required) - * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation + * @param string $author The author of the project to return the version for (required) + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getVersionStatsRequest($author, $slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) + public function getVersionRequest($author, $slug_or_id, $name_or_id, string $contentType = self::contentTypes['getVersion'][0]) { // verify the required parameter 'author' is set if ($author === null || (is_array($author) && count($author) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $author when calling getVersionStats' - ); - } - - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getVersionStats' - ); - } - - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling getVersionStats' + 'Missing the required parameter $author when calling getVersion' ); } - // verify the required parameter 'from_date' is set - if ($from_date === null || (is_array($from_date) && count($from_date) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from_date when calling getVersionStats' + 'Missing the required parameter $slug_or_id when calling getVersion' ); } - // verify the required parameter 'to_date' is set - if ($to_date === null || (is_array($to_date) && count($to_date) === 0)) { + // verify the required parameter 'name_or_id' is set + if ($name_or_id === null || (is_array($name_or_id) && count($name_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to_date when calling getVersionStats' + 'Missing the required parameter $name_or_id when calling getVersion' ); } - $resourcePath = '/api/v1/projects/{author}/{slug}/versions/{name}/stats'; + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/versions/{nameOrId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $from_date, - 'fromDate', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $to_date, - 'toDate', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params @@ -2351,18 +2445,18 @@ public function getVersionStatsRequest($author, $slug, $name, $from_date, $to_da ); } // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } // path params - if ($name !== null) { + if ($name_or_id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'nameOrId' . '}', + ObjectSerializer::toPathValue($name_or_id), $resourcePath ); } @@ -2422,40 +2516,44 @@ public function getVersionStatsRequest($author, $slug, $name, $from_date, $to_da } /** - * Operation getVersions + * Operation getVersionStats * - * @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 \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 + * @param string $author The author of the version to return the stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The name or id of the version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] 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 + * @return array * @deprecated */ - public function getVersions($author, $slug, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + public function getVersionStats($author, $slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) { - list($response) = $this->getVersionsWithHttpInfo($author, $slug, $pagination, $contentType); + list($response) = $this->getVersionStatsWithHttpInfo($author, $slug_or_id, $name_or_id, $from_date, $to_date, $contentType); return $response; } /** - * Operation getVersionsWithHttpInfo + * Operation getVersionStatsWithHttpInfo * - * @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 \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 + * @param string $author The author of the version to return the stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The name or id of the version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] 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, HTTP status code, HTTP response headers (array of strings) + * @return array of array, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function getVersionsWithHttpInfo($author, $slug, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + public function getVersionStatsWithHttpInfo($author, $slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) { - $request = $this->getVersionsRequest($author, $slug, $pagination, $contentType); + $request = $this->getVersionStatsRequest($author, $slug_or_id, $name_or_id, $from_date, $to_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -2482,11 +2580,11 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con switch($statusCode) { case 200: - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { + if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { + if ('array' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2504,7 +2602,7 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), + ObjectSerializer::deserialize($content, 'array', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2523,7 +2621,7 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con ); } - $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; + $returnType = 'array'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2556,7 +2654,7 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\PaginatedResultVersion', + 'array', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2567,20 +2665,22 @@ public function getVersionsWithHttpInfo($author, $slug, $pagination, string $con } /** - * Operation getVersionsAsync + * Operation getVersionStatsAsync * - * @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 \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 + * @param string $author The author of the version to return the stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The name or id of the version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getVersionsAsync($author, $slug, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + public function getVersionStatsAsync($author, $slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) { - return $this->getVersionsAsyncWithHttpInfo($author, $slug, $pagination, $contentType) + return $this->getVersionStatsAsyncWithHttpInfo($author, $slug_or_id, $name_or_id, $from_date, $to_date, $contentType) ->then( function ($response) { return $response[0]; @@ -2589,21 +2689,23 @@ function ($response) { } /** - * Operation getVersionsAsyncWithHttpInfo + * Operation getVersionStatsAsyncWithHttpInfo * - * @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 \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 + * @param string $author The author of the version to return the stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The name or id of the version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function getVersionsAsyncWithHttpInfo($author, $slug, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + public function getVersionStatsAsyncWithHttpInfo($author, $slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) { - $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; - $request = $this->getVersionsRequest($author, $slug, $pagination, $contentType); + $returnType = 'array'; + $request = $this->getVersionStatsRequest($author, $slug_or_id, $name_or_id, $from_date, $to_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2642,43 +2744,59 @@ function ($exception) { } /** - * Create request for operation 'getVersions' + * Create request for operation 'getVersionStats' * - * @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 \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 + * @param string $author The author of the version to return the stats for (required) + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The name or id of the version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getVersionStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function getVersionsRequest($author, $slug, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + public function getVersionStatsRequest($author, $slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['getVersionStats'][0]) { // verify the required parameter 'author' is set if ($author === null || (is_array($author) && count($author) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $author when calling getVersions' + 'Missing the required parameter $author when calling getVersionStats' ); } - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling getVersions' + 'Missing the required parameter $slug_or_id when calling getVersionStats' ); } - // verify the required parameter 'pagination' is set - if ($pagination === null || (is_array($pagination) && count($pagination) === 0)) { + // verify the required parameter 'name_or_id' is set + if ($name_or_id === null || (is_array($name_or_id) && count($name_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $pagination when calling getVersions' + 'Missing the required parameter $name_or_id when calling getVersionStats' + ); + } + + // verify the required parameter 'from_date' is set + if ($from_date === null || (is_array($from_date) && count($from_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from_date when calling getVersionStats' + ); + } + + // verify the required parameter 'to_date' is set + if ($to_date === null || (is_array($to_date) && count($to_date) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $to_date when calling getVersionStats' ); } - $resourcePath = '/api/v1/projects/{author}/{slug}/versions'; + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/versions/{nameOrId}/stats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2687,10 +2805,19 @@ public function getVersionsRequest($author, $slug, $pagination, string $contentT // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $pagination, - 'pagination', // param base name - 'object', // openApiType - 'form', // style + $from_date, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + 'form', // style true, // explode true // required ) ?? []); @@ -2705,17 +2832,1152 @@ public function getVersionsRequest($author, $slug, $pagination, string $contentT ); } // path params - if ($slug !== null) { + if ($slug_or_id !== null) { + $resourcePath = str_replace( + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), + $resourcePath + ); + } + // path params + if ($name_or_id !== null) { + $resourcePath = str_replace( + '{' . 'nameOrId' . '}', + ObjectSerializer::toPathValue($name_or_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation getVersions + * + * @param string $author The author of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (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 + * @throws \InvalidArgumentException + * @return \Aternos\HangarApi\Model\PaginatedResultVersion + * @deprecated + */ + public function getVersions($author, $slug_or_id, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + { + list($response) = $this->getVersionsWithHttpInfo($author, $slug_or_id, $pagination, $contentType); + return $response; + } + + /** + * Operation getVersionsWithHttpInfo + * + * @param string $author The author of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (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 + * @throws \InvalidArgumentException + * @return array of \Aternos\HangarApi\Model\PaginatedResultVersion, HTTP status code, HTTP response headers (array of strings) + * @deprecated + */ + public function getVersionsWithHttpInfo($author, $slug_or_id, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + { + $request = $this->getVersionsRequest($author, $slug_or_id, $pagination, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + 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 + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Aternos\HangarApi\Model\PaginatedResultVersion', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getVersionsAsync + * + * @param string $author The author of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (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 + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getVersionsAsync($author, $slug_or_id, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + { + return $this->getVersionsAsyncWithHttpInfo($author, $slug_or_id, $pagination, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getVersionsAsyncWithHttpInfo + * + * @param string $author The author of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (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 + * @return \GuzzleHttp\Promise\PromiseInterface + * @deprecated + */ + public function getVersionsAsyncWithHttpInfo($author, $slug_or_id, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + { + $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; + $request = $this->getVersionsRequest($author, $slug_or_id, $pagination, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getVersions' + * + * @param string $author The author of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (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 + * @return \GuzzleHttp\Psr7\Request + * @deprecated + */ + public function getVersionsRequest($author, $slug_or_id, $pagination, string $contentType = self::contentTypes['getVersions'][0]) + { + + // verify the required parameter 'author' is set + if ($author === null || (is_array($author) && count($author) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $author when calling getVersions' + ); + } + + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $slug_or_id when calling getVersions' + ); + } + + // verify the required parameter 'pagination' is set + if ($pagination === null || (is_array($pagination) && count($pagination) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pagination when calling getVersions' + ); + } + + + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/versions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pagination, + 'pagination', // param base name + 'object', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($author !== null) { + $resourcePath = str_replace( + '{' . 'author' . '}', + ObjectSerializer::toPathValue($author), + $resourcePath + ); + } + // path params + if ($slug_or_id !== null) { + $resourcePath = str_replace( + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation latestReleaseVersion + * + * Returns the latest release version of a project + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] 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 string|string|string + */ + public function latestReleaseVersion($slug_or_id, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + { + list($response) = $this->latestReleaseVersionWithHttpInfo($slug_or_id, $contentType); + return $response; + } + + /** + * Operation latestReleaseVersionWithHttpInfo + * + * Returns the latest release version of a project + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] 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 string|string|string, HTTP status code, HTTP response headers (array of strings) + */ + public function latestReleaseVersionWithHttpInfo($slug_or_id, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + { + $request = $this->latestReleaseVersionRequest($slug_or_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + 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 + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation latestReleaseVersionAsync + * + * Returns the latest release version of a project + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function latestReleaseVersionAsync($slug_or_id, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + { + return $this->latestReleaseVersionAsyncWithHttpInfo($slug_or_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation latestReleaseVersionAsyncWithHttpInfo + * + * Returns the latest release version of a project + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function latestReleaseVersionAsyncWithHttpInfo($slug_or_id, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + { + $returnType = 'string'; + $request = $this->latestReleaseVersionRequest($slug_or_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'latestReleaseVersion' + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function latestReleaseVersionRequest($slug_or_id, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + { + + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $slug_or_id when calling latestReleaseVersion' + ); + } + + + $resourcePath = '/api/v1/projects/{slugOrId}/latestrelease'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($slug_or_id !== null) { + $resourcePath = str_replace( + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation latestVersion + * + * Returns the latest version of a project for a specific channel + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] 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 string|string|string + */ + public function latestVersion($slug_or_id, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + { + list($response) = $this->latestVersionWithHttpInfo($slug_or_id, $channel, $contentType); + return $response; + } + + /** + * Operation latestVersionWithHttpInfo + * + * Returns the latest version of a project for a specific channel + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] 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 string|string|string, HTTP status code, HTTP response headers (array of strings) + */ + public function latestVersionWithHttpInfo($slug_or_id, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + { + $request = $this->latestVersionRequest($slug_or_id, $channel, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 401: + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('string' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('string' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, 'string', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + 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 + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 401: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation latestVersionAsync + * + * Returns the latest version of a project for a specific channel + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function latestVersionAsync($slug_or_id, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + { + return $this->latestVersionAsyncWithHttpInfo($slug_or_id, $channel, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation latestVersionAsyncWithHttpInfo + * + * Returns the latest version of a project for a specific channel + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function latestVersionAsyncWithHttpInfo($slug_or_id, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + { + $returnType = 'string'; + $request = $this->latestVersionRequest($slug_or_id, $channel, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'latestVersion' + * + * @param string $slug_or_id The slug or id of the project to return the latest version for (required) + * @param string $channel The channel to return the latest version for (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function latestVersionRequest($slug_or_id, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + { + + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $slug_or_id when calling latestVersion' + ); + } + + // verify the required parameter 'channel' is set + if ($channel === null || (is_array($channel) && count($channel) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $channel when calling latestVersion' + ); + } + + + $resourcePath = '/api/v1/projects/{slugOrId}/latest'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $channel, + 'channel', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + + + // path params + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['application/json', ], + ['text/plain', 'application/json', ], $contentType, $multipart ); @@ -2745,6 +4007,10 @@ public function getVersionsRequest($author, $slug, $pagination, string $contentT } } + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2768,38 +4034,46 @@ public function getVersionsRequest($author, $slug, $pagination, string $contentT } /** - * Operation latestReleaseVersion + * Operation listVersions * - * Returns the latest release version of a project + * Returns all versions of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return versions for (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) + * @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 string|string|string + * @return \Aternos\HangarApi\Model\PaginatedResultVersion|\Aternos\HangarApi\Model\PaginatedResultVersion|\Aternos\HangarApi\Model\PaginatedResultVersion */ - public function latestReleaseVersion($slug, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + public function listVersions($slug_or_id, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - list($response) = $this->latestReleaseVersionWithHttpInfo($slug, $contentType); + list($response) = $this->listVersionsWithHttpInfo($slug_or_id, $pagination, $include_hidden_channels, $channel, $platform, $contentType); return $response; } /** - * Operation latestReleaseVersionWithHttpInfo + * Operation listVersionsWithHttpInfo * - * Returns the latest release version of a project + * Returns all versions of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return versions for (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) + * @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 string|string|string, HTTP status code, HTTP response headers (array of strings) + * @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 latestReleaseVersionWithHttpInfo($slug, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + public function listVersionsWithHttpInfo($slug_or_id, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - $request = $this->latestReleaseVersionRequest($slug, $contentType); + $request = $this->listVersionsRequest($slug_or_id, $pagination, $include_hidden_channels, $channel, $platform, $contentType); try { $options = $this->createHttpClientOption(); @@ -2826,11 +4100,11 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2848,16 +4122,16 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), $response->getStatusCode(), $response->getHeaders() ]; - case 403: - if ('string' === '\SplFileObject') { + case 401: + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2875,16 +4149,16 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('string' === '\SplFileObject') { + case 403: + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -2902,7 +4176,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2921,7 +4195,7 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se ); } - $returnType = 'string'; + $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -2954,23 +4228,23 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Aternos\HangarApi\Model\PaginatedResultVersion', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Aternos\HangarApi\Model\PaginatedResultVersion', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Aternos\HangarApi\Model\PaginatedResultVersion', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2981,19 +4255,23 @@ public function latestReleaseVersionWithHttpInfo($slug, string $contentType = se } /** - * Operation latestReleaseVersionAsync + * Operation listVersionsAsync * - * Returns the latest release version of a project + * Returns all versions of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return versions for (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) + * @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 latestReleaseVersionAsync($slug, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + public function listVersionsAsync($slug_or_id, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - return $this->latestReleaseVersionAsyncWithHttpInfo($slug, $contentType) + return $this->listVersionsAsyncWithHttpInfo($slug_or_id, $pagination, $include_hidden_channels, $channel, $platform, $contentType) ->then( function ($response) { return $response[0]; @@ -3002,20 +4280,24 @@ function ($response) { } /** - * Operation latestReleaseVersionAsyncWithHttpInfo + * Operation listVersionsAsyncWithHttpInfo * - * Returns the latest release version of a project + * Returns all versions of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return versions for (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) + * @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 latestReleaseVersionAsyncWithHttpInfo($slug, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + public function listVersionsAsyncWithHttpInfo($slug_or_id, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - $returnType = 'string'; - $request = $this->latestReleaseVersionRequest($slug, $contentType); + $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; + $request = $this->listVersionsRequest($slug_or_id, $pagination, $include_hidden_channels, $channel, $platform, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3054,46 +4336,96 @@ function ($exception) { } /** - * Create request for operation 'latestReleaseVersion' + * Create request for operation 'listVersions' * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestReleaseVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return versions for (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) + * @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 latestReleaseVersionRequest($slug, string $contentType = self::contentTypes['latestReleaseVersion'][0]) + public function listVersionsRequest($slug_or_id, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $slug_or_id when calling listVersions' + ); + } + + // verify the required parameter 'pagination' is set + if ($pagination === null || (is_array($pagination) && count($pagination) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling latestReleaseVersion' + 'Missing the required parameter $pagination when calling listVersions' ); } - $resourcePath = '/api/v1/projects/{slug}/latestrelease'; + + + + $resourcePath = '/api/v1/projects/{slugOrId}/versions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $pagination, + 'pagination', // param base name + 'object', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_hidden_channels, + 'includeHiddenChannels', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $channel, + 'channel', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $platform, + 'platform', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['text/plain', 'application/json', ], + ['application/json', ], $contentType, $multipart ); @@ -3150,40 +4482,40 @@ public function latestReleaseVersionRequest($slug, string $contentType = self::c } /** - * Operation latestVersion + * Operation showVersion * - * Returns the latest version of a project for a specific channel + * Returns a specific version of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name or id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] 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 string|string|string + * @return \Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version */ - public function latestVersion($slug, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + public function showVersion($slug_or_id, $name_or_id, string $contentType = self::contentTypes['showVersion'][0]) { - list($response) = $this->latestVersionWithHttpInfo($slug, $channel, $contentType); + list($response) = $this->showVersionWithHttpInfo($slug_or_id, $name_or_id, $contentType); return $response; } /** - * Operation latestVersionWithHttpInfo + * Operation showVersionWithHttpInfo * - * Returns the latest version of a project for a specific channel + * Returns a specific version of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name or id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] 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 string|string|string, HTTP status code, HTTP response headers (array of strings) + * @return array of \Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version, HTTP status code, HTTP response headers (array of strings) */ - public function latestVersionWithHttpInfo($slug, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + public function showVersionWithHttpInfo($slug_or_id, $name_or_id, string $contentType = self::contentTypes['showVersion'][0]) { - $request = $this->latestVersionRequest($slug, $channel, $contentType); + $request = $this->showVersionRequest($slug_or_id, $name_or_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3210,11 +4542,11 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = switch($statusCode) { case 200: - if ('string' === '\SplFileObject') { + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3232,16 +4564,16 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; - case 403: - if ('string' === '\SplFileObject') { + case 401: + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3259,16 +4591,16 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('string' === '\SplFileObject') { + case 403: + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('string' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3286,7 +4618,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = } return [ - ObjectSerializer::deserialize($content, 'string', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3305,7 +4637,7 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = ); } - $returnType = 'string'; + $returnType = '\Aternos\HangarApi\Model\Version'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3338,23 +4670,23 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3365,20 +4697,20 @@ public function latestVersionWithHttpInfo($slug, $channel, string $contentType = } /** - * Operation latestVersionAsync + * Operation showVersionAsync * - * Returns the latest version of a project for a specific channel + * Returns a specific version of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name or id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function latestVersionAsync($slug, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + public function showVersionAsync($slug_or_id, $name_or_id, string $contentType = self::contentTypes['showVersion'][0]) { - return $this->latestVersionAsyncWithHttpInfo($slug, $channel, $contentType) + return $this->showVersionAsyncWithHttpInfo($slug_or_id, $name_or_id, $contentType) ->then( function ($response) { return $response[0]; @@ -3387,21 +4719,21 @@ function ($response) { } /** - * Operation latestVersionAsyncWithHttpInfo + * Operation showVersionAsyncWithHttpInfo * - * Returns the latest version of a project for a specific channel + * Returns a specific version of a project * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name or id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function latestVersionAsyncWithHttpInfo($slug, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + public function showVersionAsyncWithHttpInfo($slug_or_id, $name_or_id, string $contentType = self::contentTypes['showVersion'][0]) { - $returnType = 'string'; - $request = $this->latestVersionRequest($slug, $channel, $contentType); + $returnType = '\Aternos\HangarApi\Model\Version'; + $request = $this->showVersionRequest($slug_or_id, $name_or_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3440,63 +4772,62 @@ function ($exception) { } /** - * Create request for operation 'latestVersion' + * Create request for operation 'showVersion' * - * @param string $slug The slug of the project to return the latest version for (required) - * @param string $channel The channel to return the latest version for (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['latestVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return the version for (required) + * @param string $name_or_id The name or id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function latestVersionRequest($slug, $channel, string $contentType = self::contentTypes['latestVersion'][0]) + public function showVersionRequest($slug_or_id, $name_or_id, string $contentType = self::contentTypes['showVersion'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling latestVersion' + 'Missing the required parameter $slug_or_id when calling showVersion' ); } - // verify the required parameter 'channel' is set - if ($channel === null || (is_array($channel) && count($channel) === 0)) { + // verify the required parameter 'name_or_id' is set + if ($name_or_id === null || (is_array($name_or_id) && count($name_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $channel when calling latestVersion' + 'Missing the required parameter $name_or_id when calling showVersion' ); } - $resourcePath = '/api/v1/projects/{slug}/latest'; + $resourcePath = '/api/v1/projects/{slugOrId}/versions/{nameOrId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $channel, - 'channel', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), + $resourcePath + ); + } + // path params + if ($name_or_id !== null) { + $resourcePath = str_replace( + '{' . 'nameOrId' . '}', + ObjectSerializer::toPathValue($name_or_id), $resourcePath ); } $headers = $this->headerSelector->selectHeaders( - ['text/plain', 'application/json', ], + ['application/json', ], $contentType, $multipart ); @@ -3553,46 +4884,38 @@ public function latestVersionRequest($slug, $channel, string $contentType = self } /** - * Operation listVersions + * Operation showVersionById * - * Returns all versions of a project + * Returns a specific version by its ID * - * @param string $slug The slug of the project to return versions for (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) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation + * @param string $id The id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionById'] 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 + * @return \Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version */ - public function listVersions($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) + public function showVersionById($id, string $contentType = self::contentTypes['showVersionById'][0]) { - list($response) = $this->listVersionsWithHttpInfo($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType); + list($response) = $this->showVersionByIdWithHttpInfo($id, $contentType); return $response; } /** - * Operation listVersionsWithHttpInfo - * - * Returns all versions of a project + * Operation showVersionByIdWithHttpInfo * - * @param string $slug The slug of the project to return versions for (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) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation + * Returns a specific version by its ID + * + * @param string $id The id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionById'] 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) + * @return array of \Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version, HTTP status code, HTTP response headers (array of strings) */ - public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_channels = true, $channel = null, $platform = null, string $contentType = self::contentTypes['listVersions'][0]) + public function showVersionByIdWithHttpInfo($id, string $contentType = self::contentTypes['showVersionById'][0]) { - $request = $this->listVersionsRequest($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType); + $request = $this->showVersionByIdRequest($id, $contentType); try { $options = $this->createHttpClientOption(); @@ -3619,11 +4942,11 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha switch($statusCode) { case 200: - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3641,16 +4964,16 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; - case 403: - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { + case 401: + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3668,16 +4991,16 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' === '\SplFileObject') { + case 403: + if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\PaginatedResultVersion' !== 'string') { + if ('\Aternos\HangarApi\Model\Version' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -3695,7 +5018,7 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\PaginatedResultVersion', []), + ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3714,7 +5037,7 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha ); } - $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; + $returnType = '\Aternos\HangarApi\Model\Version'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -3747,23 +5070,23 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\PaginatedResultVersion', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\PaginatedResultVersion', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\PaginatedResultVersion', + '\Aternos\HangarApi\Model\Version', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3774,23 +5097,19 @@ public function listVersionsWithHttpInfo($slug, $pagination, $include_hidden_cha } /** - * Operation listVersionsAsync + * Operation showVersionByIdAsync * - * Returns all versions of a project + * Returns a specific version by its ID * - * @param string $slug The slug of the project to return versions for (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) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation + * @param string $id The id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionById'] 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, string $contentType = self::contentTypes['listVersions'][0]) + public function showVersionByIdAsync($id, string $contentType = self::contentTypes['showVersionById'][0]) { - return $this->listVersionsAsyncWithHttpInfo($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType) + return $this->showVersionByIdAsyncWithHttpInfo($id, $contentType) ->then( function ($response) { return $response[0]; @@ -3799,24 +5118,20 @@ function ($response) { } /** - * Operation listVersionsAsyncWithHttpInfo + * Operation showVersionByIdAsyncWithHttpInfo * - * Returns all versions of a project + * Returns a specific version by its ID * - * @param string $slug The slug of the project to return versions for (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) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation + * @param string $id The id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionById'] 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, string $contentType = self::contentTypes['listVersions'][0]) + public function showVersionByIdAsyncWithHttpInfo($id, string $contentType = self::contentTypes['showVersionById'][0]) { - $returnType = '\Aternos\HangarApi\Model\PaginatedResultVersion'; - $request = $this->listVersionsRequest($slug, $pagination, $include_hidden_channels, $channel, $platform, $contentType); + $returnType = '\Aternos\HangarApi\Model\Version'; + $request = $this->showVersionByIdRequest($id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3855,89 +5170,39 @@ function ($exception) { } /** - * Create request for operation 'listVersions' + * Create request for operation 'showVersionById' * - * @param string $slug The slug of the project to return versions for (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) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listVersions'] to see the possible values for this operation + * @param string $id The id of the version to return (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionById'] 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, string $contentType = self::contentTypes['listVersions'][0]) + public function showVersionByIdRequest($id, string $contentType = self::contentTypes['showVersionById'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling listVersions' - ); - } - - // verify the required parameter 'pagination' is set - if ($pagination === null || (is_array($pagination) && count($pagination) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $pagination when calling listVersions' + 'Missing the required parameter $id when calling showVersionById' ); } - - - - $resourcePath = '/api/v1/projects/{slug}/versions'; + $resourcePath = '/api/v1/versions/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $pagination, - 'pagination', // param base name - 'object', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $include_hidden_channels, - 'includeHiddenChannels', // param base name - 'boolean', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $channel, - 'channel', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $platform, - 'platform', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params - if ($slug !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -4001,40 +5266,44 @@ public function listVersionsRequest($slug, $pagination, $include_hidden_channels } /** - * Operation showVersion + * Operation showVersionStats * - * Returns a specific version of a project + * Returns the stats for a version * - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] 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\Version|\Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version + * @return array|array|array */ - public function showVersion($slug, $name, string $contentType = self::contentTypes['showVersion'][0]) + public function showVersionStats($slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) { - list($response) = $this->showVersionWithHttpInfo($slug, $name, $contentType); + list($response) = $this->showVersionStatsWithHttpInfo($slug_or_id, $name_or_id, $from_date, $to_date, $contentType); return $response; } /** - * Operation showVersionWithHttpInfo + * Operation showVersionStatsWithHttpInfo * - * Returns a specific version of a project + * Returns the stats for a version * - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] 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\Version|\Aternos\HangarApi\Model\Version|\Aternos\HangarApi\Model\Version, HTTP status code, HTTP response headers (array of strings) + * @return array of array|array|array, HTTP status code, HTTP response headers (array of strings) */ - public function showVersionWithHttpInfo($slug, $name, string $contentType = self::contentTypes['showVersion'][0]) + public function showVersionStatsWithHttpInfo($slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) { - $request = $this->showVersionRequest($slug, $name, $contentType); + $request = $this->showVersionStatsRequest($slug_or_id, $name_or_id, $from_date, $to_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -4061,11 +5330,11 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self switch($statusCode) { case 200: - if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { + if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\Version' !== 'string') { + if ('array' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4083,16 +5352,16 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), + ObjectSerializer::deserialize($content, 'array', []), $response->getStatusCode(), $response->getHeaders() ]; - case 403: - if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { + case 401: + if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\Version' !== 'string') { + if ('array' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4110,16 +5379,16 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), + ObjectSerializer::deserialize($content, 'array', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: - if ('\Aternos\HangarApi\Model\Version' === '\SplFileObject') { + case 403: + if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\Aternos\HangarApi\Model\Version' !== 'string') { + if ('array' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -4137,7 +5406,7 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self } return [ - ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\Version', []), + ObjectSerializer::deserialize($content, 'array', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4156,7 +5425,7 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self ); } - $returnType = '\Aternos\HangarApi\Model\Version'; + $returnType = 'array'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4189,23 +5458,23 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\Version', + 'array', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\Version', + 'array', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Aternos\HangarApi\Model\Version', + 'array', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4216,20 +5485,22 @@ public function showVersionWithHttpInfo($slug, $name, string $contentType = self } /** - * Operation showVersionAsync + * Operation showVersionStatsAsync * - * Returns a specific version of a project + * Returns the stats for a version * - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showVersionAsync($slug, $name, string $contentType = self::contentTypes['showVersion'][0]) + public function showVersionStatsAsync($slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) { - return $this->showVersionAsyncWithHttpInfo($slug, $name, $contentType) + return $this->showVersionStatsAsyncWithHttpInfo($slug_or_id, $name_or_id, $from_date, $to_date, $contentType) ->then( function ($response) { return $response[0]; @@ -4238,21 +5509,23 @@ function ($response) { } /** - * Operation showVersionAsyncWithHttpInfo + * Operation showVersionStatsAsyncWithHttpInfo * - * Returns a specific version of a project + * Returns the stats for a version * - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showVersionAsyncWithHttpInfo($slug, $name, string $contentType = self::contentTypes['showVersion'][0]) + public function showVersionStatsAsyncWithHttpInfo($slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) { - $returnType = '\Aternos\HangarApi\Model\Version'; - $request = $this->showVersionRequest($slug, $name, $contentType); + $returnType = 'array'; + $request = $this->showVersionStatsRequest($slug_or_id, $name_or_id, $from_date, $to_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4291,55 +5564,89 @@ function ($exception) { } /** - * Create request for operation 'showVersion' + * Create request for operation 'showVersionStats' * - * @param string $slug The slug of the project to return the version for (required) - * @param string $name The name of the version to return (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersion'] to see the possible values for this operation + * @param string $slug_or_id The slug or id of the project to return stats for (required) + * @param string $name_or_id The version to return the stats for (required) + * @param \DateTime $from_date The first date to include in the result (required) + * @param \DateTime $to_date The last date to include in the result (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function showVersionRequest($slug, $name, string $contentType = self::contentTypes['showVersion'][0]) + public function showVersionStatsRequest($slug_or_id, $name_or_id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $slug_or_id when calling showVersionStats' + ); + } + + // verify the required parameter 'name_or_id' is set + if ($name_or_id === null || (is_array($name_or_id) && count($name_or_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name_or_id when calling showVersionStats' + ); + } + + // verify the required parameter 'from_date' is set + if ($from_date === null || (is_array($from_date) && count($from_date) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling showVersion' + 'Missing the required parameter $from_date when calling showVersionStats' ); } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'to_date' is set + if ($to_date === null || (is_array($to_date) && count($to_date) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling showVersion' + 'Missing the required parameter $to_date when calling showVersionStats' ); } - $resourcePath = '/api/v1/projects/{slug}/versions/{name}'; + $resourcePath = '/api/v1/projects/{slugOrId}/versions/{nameOrId}/stats'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_date, + 'fromDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_date, + 'toDate', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } // path params - if ($name !== null) { + if ($name_or_id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'nameOrId' . '}', + ObjectSerializer::toPathValue($name_or_id), $resourcePath ); } @@ -4403,44 +5710,42 @@ public function showVersionRequest($slug, $name, string $contentType = self::con } /** - * Operation showVersionStats + * Operation showVersionStatsById * - * Returns the stats for a version + * Returns the stats for a version by its ID * - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) + * @param string $id The id of version to return the stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStatsById'] 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|array|array */ - public function showVersionStats($slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) + public function showVersionStatsById($id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStatsById'][0]) { - list($response) = $this->showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, $contentType); + list($response) = $this->showVersionStatsByIdWithHttpInfo($id, $from_date, $to_date, $contentType); return $response; } /** - * Operation showVersionStatsWithHttpInfo + * Operation showVersionStatsByIdWithHttpInfo * - * Returns the stats for a version + * Returns the stats for a version by its ID * - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) + * @param string $id The id of version to return the stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStatsById'] 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 array|array|array, HTTP status code, HTTP response headers (array of strings) */ - public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) + public function showVersionStatsByIdWithHttpInfo($id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStatsById'][0]) { - $request = $this->showVersionStatsRequest($slug, $name, $from_date, $to_date, $contentType); + $request = $this->showVersionStatsByIdRequest($id, $from_date, $to_date, $contentType); try { $options = $this->createHttpClientOption(); @@ -4493,7 +5798,7 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4520,7 +5825,7 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('array' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4600,7 +5905,7 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -4608,7 +5913,7 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), 'array', @@ -4622,22 +5927,21 @@ public function showVersionStatsWithHttpInfo($slug, $name, $from_date, $to_date, } /** - * Operation showVersionStatsAsync + * Operation showVersionStatsByIdAsync * - * Returns the stats for a version + * Returns the stats for a version by its ID * - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) + * @param string $id The id of version to return the stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStatsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showVersionStatsAsync($slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) + public function showVersionStatsByIdAsync($id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStatsById'][0]) { - return $this->showVersionStatsAsyncWithHttpInfo($slug, $name, $from_date, $to_date, $contentType) + return $this->showVersionStatsByIdAsyncWithHttpInfo($id, $from_date, $to_date, $contentType) ->then( function ($response) { return $response[0]; @@ -4646,23 +5950,22 @@ function ($response) { } /** - * Operation showVersionStatsAsyncWithHttpInfo + * Operation showVersionStatsByIdAsyncWithHttpInfo * - * Returns the stats for a version + * Returns the stats for a version by its ID * - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) + * @param string $id The id of version to return the stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStatsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function showVersionStatsAsyncWithHttpInfo($slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) + public function showVersionStatsByIdAsyncWithHttpInfo($id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStatsById'][0]) { $returnType = 'array'; - $request = $this->showVersionStatsRequest($slug, $name, $from_date, $to_date, $contentType); + $request = $this->showVersionStatsByIdRequest($id, $from_date, $to_date, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4701,50 +6004,42 @@ function ($exception) { } /** - * Create request for operation 'showVersionStats' + * Create request for operation 'showVersionStatsById' * - * @param string $slug The slug of the project to return stats for (required) - * @param string $name The version to return the stats for (required) + * @param string $id The id of version to return the stats for (required) * @param \DateTime $from_date The first date to include in the result (required) * @param \DateTime $to_date The last date to include in the result (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStats'] to see the possible values for this operation + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['showVersionStatsById'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function showVersionStatsRequest($slug, $name, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStats'][0]) + public function showVersionStatsByIdRequest($id, $from_date, $to_date, string $contentType = self::contentTypes['showVersionStatsById'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling showVersionStats' - ); - } - - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling showVersionStats' + 'Missing the required parameter $id when calling showVersionStatsById' ); } // verify the required parameter 'from_date' is set if ($from_date === null || (is_array($from_date) && count($from_date) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from_date when calling showVersionStats' + 'Missing the required parameter $from_date when calling showVersionStatsById' ); } // verify the required parameter 'to_date' is set if ($to_date === null || (is_array($to_date) && count($to_date) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to_date when calling showVersionStats' + 'Missing the required parameter $to_date when calling showVersionStatsById' ); } - $resourcePath = '/api/v1/projects/{slug}/versions/{name}/stats'; + $resourcePath = '/api/v1/versions/{id}/stats'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4772,18 +6067,10 @@ public function showVersionStatsRequest($slug, $name, $from_date, $to_date, stri // path params - if ($slug !== null) { - $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), - $resourcePath - ); - } - // path params - if ($name !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -4851,7 +6138,7 @@ public function showVersionStatsRequest($slug, $name, $from_date, $to_date, stri * * Creates a new version and returns parts of its metadata * - * @param string $slug The slug of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion'] to see the possible values for this operation @@ -4860,9 +6147,9 @@ public function showVersionStatsRequest($slug, $name, $from_date, $to_date, stri * @throws \InvalidArgumentException * @return \Aternos\HangarApi\Model\UploadedVersion|\Aternos\HangarApi\Model\UploadedVersion|\Aternos\HangarApi\Model\UploadedVersion */ - public function uploadVersion($slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) + public function uploadVersion($slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) { - list($response) = $this->uploadVersionWithHttpInfo($slug, $version_upload, $files, $contentType); + list($response) = $this->uploadVersionWithHttpInfo($slug_or_id, $version_upload, $files, $contentType); return $response; } @@ -4871,7 +6158,7 @@ public function uploadVersion($slug, $version_upload, $files = null, string $con * * Creates a new version and returns parts of its metadata * - * @param string $slug The slug of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion'] to see the possible values for this operation @@ -4880,9 +6167,9 @@ public function uploadVersion($slug, $version_upload, $files = null, string $con * @throws \InvalidArgumentException * @return array of \Aternos\HangarApi\Model\UploadedVersion|\Aternos\HangarApi\Model\UploadedVersion|\Aternos\HangarApi\Model\UploadedVersion, HTTP status code, HTTP response headers (array of strings) */ - public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) + public function uploadVersionWithHttpInfo($slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) { - $request = $this->uploadVersionRequest($slug, $version_upload, $files, $contentType); + $request = $this->uploadVersionRequest($slug_or_id, $version_upload, $files, $contentType); try { $options = $this->createHttpClientOption(); @@ -4935,7 +6222,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, $response->getStatusCode(), $response->getHeaders() ]; - case 403: + case 401: if ('\Aternos\HangarApi\Model\UploadedVersion' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -4962,7 +6249,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 403: if ('\Aternos\HangarApi\Model\UploadedVersion' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -5042,7 +6329,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, ); $e->setResponseObject($data); break; - case 403: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\UploadedVersion', @@ -5050,7 +6337,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, ); $e->setResponseObject($data); break; - case 401: + case 403: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Aternos\HangarApi\Model\UploadedVersion', @@ -5068,7 +6355,7 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, * * Creates a new version and returns parts of its metadata * - * @param string $slug The slug of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion'] to see the possible values for this operation @@ -5076,9 +6363,9 @@ public function uploadVersionWithHttpInfo($slug, $version_upload, $files = null, * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadVersionAsync($slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) + public function uploadVersionAsync($slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) { - return $this->uploadVersionAsyncWithHttpInfo($slug, $version_upload, $files, $contentType) + return $this->uploadVersionAsyncWithHttpInfo($slug_or_id, $version_upload, $files, $contentType) ->then( function ($response) { return $response[0]; @@ -5091,7 +6378,7 @@ function ($response) { * * Creates a new version and returns parts of its metadata * - * @param string $slug The slug of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion'] to see the possible values for this operation @@ -5099,10 +6386,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadVersionAsyncWithHttpInfo($slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) + public function uploadVersionAsyncWithHttpInfo($slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) { $returnType = '\Aternos\HangarApi\Model\UploadedVersion'; - $request = $this->uploadVersionRequest($slug, $version_upload, $files, $contentType); + $request = $this->uploadVersionRequest($slug_or_id, $version_upload, $files, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5143,7 +6430,7 @@ function ($exception) { /** * Create request for operation 'uploadVersion' * - * @param string $slug The slug of the project to return versions for (required) + * @param string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion'] to see the possible values for this operation @@ -5151,13 +6438,13 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function uploadVersionRequest($slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) + public function uploadVersionRequest($slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion'][0]) { - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling uploadVersion' + 'Missing the required parameter $slug_or_id when calling uploadVersion' ); } @@ -5170,7 +6457,7 @@ public function uploadVersionRequest($slug, $version_upload, $files = null, stri - $resourcePath = '/api/v1/projects/{slug}/upload'; + $resourcePath = '/api/v1/projects/{slugOrId}/upload'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5180,10 +6467,10 @@ public function uploadVersionRequest($slug, $version_upload, $files = null, stri // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } @@ -5266,7 +6553,7 @@ public function uploadVersionRequest($slug, $version_upload, $files = null, stri * Operation uploadVersion1 * * @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 string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion1'] to see the possible values for this operation @@ -5276,9 +6563,9 @@ public function uploadVersionRequest($slug, $version_upload, $files = null, stri * @return \Aternos\HangarApi\Model\UploadedVersion * @deprecated */ - public function uploadVersion1($author, $slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) + public function uploadVersion1($author, $slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) { - list($response) = $this->uploadVersion1WithHttpInfo($author, $slug, $version_upload, $files, $contentType); + list($response) = $this->uploadVersion1WithHttpInfo($author, $slug_or_id, $version_upload, $files, $contentType); return $response; } @@ -5286,7 +6573,7 @@ public function uploadVersion1($author, $slug, $version_upload, $files = null, s * Operation uploadVersion1WithHttpInfo * * @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 string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion1'] to see the possible values for this operation @@ -5296,9 +6583,9 @@ public function uploadVersion1($author, $slug, $version_upload, $files = null, s * @return array of \Aternos\HangarApi\Model\UploadedVersion, HTTP status code, HTTP response headers (array of strings) * @deprecated */ - public function uploadVersion1WithHttpInfo($author, $slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) + public function uploadVersion1WithHttpInfo($author, $slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) { - $request = $this->uploadVersion1Request($author, $slug, $version_upload, $files, $contentType); + $request = $this->uploadVersion1Request($author, $slug_or_id, $version_upload, $files, $contentType); try { $options = $this->createHttpClientOption(); @@ -5413,7 +6700,7 @@ public function uploadVersion1WithHttpInfo($author, $slug, $version_upload, $fil * Operation uploadVersion1Async * * @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 string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion1'] to see the possible values for this operation @@ -5422,9 +6709,9 @@ public function uploadVersion1WithHttpInfo($author, $slug, $version_upload, $fil * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function uploadVersion1Async($author, $slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) + public function uploadVersion1Async($author, $slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) { - return $this->uploadVersion1AsyncWithHttpInfo($author, $slug, $version_upload, $files, $contentType) + return $this->uploadVersion1AsyncWithHttpInfo($author, $slug_or_id, $version_upload, $files, $contentType) ->then( function ($response) { return $response[0]; @@ -5436,7 +6723,7 @@ function ($response) { * Operation uploadVersion1AsyncWithHttpInfo * * @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 string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion1'] to see the possible values for this operation @@ -5445,10 +6732,10 @@ function ($response) { * @return \GuzzleHttp\Promise\PromiseInterface * @deprecated */ - public function uploadVersion1AsyncWithHttpInfo($author, $slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) + public function uploadVersion1AsyncWithHttpInfo($author, $slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) { $returnType = '\Aternos\HangarApi\Model\UploadedVersion'; - $request = $this->uploadVersion1Request($author, $slug, $version_upload, $files, $contentType); + $request = $this->uploadVersion1Request($author, $slug_or_id, $version_upload, $files, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5490,7 +6777,7 @@ function ($exception) { * Create request for operation 'uploadVersion1' * * @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 string $slug_or_id The slug or id of the project to return versions for (required) * @param \Aternos\HangarApi\Model\VersionUpload $version_upload (required) * @param \SplFileObject[] $files The version files in order of selected platforms, if any (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['uploadVersion1'] to see the possible values for this operation @@ -5499,7 +6786,7 @@ function ($exception) { * @return \GuzzleHttp\Psr7\Request * @deprecated */ - public function uploadVersion1Request($author, $slug, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) + public function uploadVersion1Request($author, $slug_or_id, $version_upload, $files = null, string $contentType = self::contentTypes['uploadVersion1'][0]) { // verify the required parameter 'author' is set @@ -5509,10 +6796,10 @@ public function uploadVersion1Request($author, $slug, $version_upload, $files = ); } - // verify the required parameter 'slug' is set - if ($slug === null || (is_array($slug) && count($slug) === 0)) { + // verify the required parameter 'slug_or_id' is set + if ($slug_or_id === null || (is_array($slug_or_id) && count($slug_or_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $slug when calling uploadVersion1' + 'Missing the required parameter $slug_or_id when calling uploadVersion1' ); } @@ -5525,7 +6812,7 @@ public function uploadVersion1Request($author, $slug, $version_upload, $files = - $resourcePath = '/api/v1/projects/{author}/{slug}/upload'; + $resourcePath = '/api/v1/projects/{author}/{slugOrId}/upload'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5543,10 +6830,10 @@ public function uploadVersion1Request($author, $slug, $version_upload, $files = ); } // path params - if ($slug !== null) { + if ($slug_or_id !== null) { $resourcePath = str_replace( - '{' . 'slug' . '}', - ObjectSerializer::toPathValue($slug), + '{' . 'slugOrId' . '}', + ObjectSerializer::toPathValue($slug_or_id), $resourcePath ); } diff --git a/lib/Client/CompactProject.php b/lib/Client/CompactProject.php index c0fb063..8c14e76 100644 --- a/lib/Client/CompactProject.php +++ b/lib/Client/CompactProject.php @@ -44,6 +44,15 @@ public function getSlug(): string return $this->project->getNamespace()->getSlug(); } + /** + * Get the id of this project (shorthand for getData()->getId()) + * @return int + */ + public function getId(): int + { + return $this->project->getId(); + } + /** * Get the full project data * @return Project @@ -51,7 +60,7 @@ public function getSlug(): string */ public function getProject(): Project { - return $this->client->getProject($this->getSlug()); + return $this->client->getProject($this->getId()); } /** @@ -63,10 +72,10 @@ public function getProject(): Project */ public function getVersions(?string $channel = null, ?Platform $platform = null): ProjectVersionList { - $options = new VersionSearchOptions($this->getSlug()); + $options = new VersionSearchOptions($this->getId()); $options->setChannel($channel); $options->setPlatform($platform); - return $this->client->getProjectVersions($this->getSlug(), $options); + return $this->client->getProjectVersions($this->getId(), $options); } /** @@ -77,7 +86,7 @@ public function getVersions(?string $channel = null, ?Platform $platform = null) */ public function getVersion(string $name): Version { - return $this->client->getProjectVersion($this->getSlug(), $name); + return $this->client->getVersion($this->getId(), $name); } /** @@ -87,7 +96,7 @@ public function getVersion(string $name): Version */ public function getWatchers(): UserList { - return $this->client->getProjectWatchers($this->getSlug()); + return $this->client->getProjectWatchers($this->getId()); } /** @@ -101,7 +110,7 @@ public function getWatchers(): UserList public function getDailyStats(?DateTime $from = null, ?DateTime $to = null): array { return $this->client->getDailyProjectStats( - $this->getSlug(), + $this->getId(), $from ?? $this->getData()->getCreatedAt(), $to ); @@ -114,7 +123,7 @@ public function getDailyStats(?DateTime $from = null, ?DateTime $to = null): arr */ public function getStarGazers(): UserList { - return $this->client->getProjectStarGazers($this->getSlug()); + return $this->client->getProjectStarGazers($this->getId()); } /** @@ -124,7 +133,7 @@ public function getStarGazers(): UserList */ public function getMembers(): ProjectMemberList { - return $this->client->getProjectMembers($this->getSlug()); + return $this->client->getProjectMembers($this->getId()); } /** @@ -144,7 +153,7 @@ public function getOwner(): User */ public function getMainPage(): ProjectPage { - return $this->client->getProjectMainPage($this->getSlug()); + return $this->client->getProjectMainPage($this->getId()); } /** @@ -155,6 +164,6 @@ public function getMainPage(): ProjectPage */ public function getPage(string $path): ProjectPage { - return $this->client->getProjectPage($this->getSlug(), $path); + return $this->client->getProjectPage($this->getId(), $path); } -} \ No newline at end of file +} diff --git a/lib/Client/HangarAPIClient.php b/lib/Client/HangarAPIClient.php index 460a8a8..f9ff870 100644 --- a/lib/Client/HangarAPIClient.php +++ b/lib/Client/HangarAPIClient.php @@ -63,7 +63,7 @@ class HangarAPIClient protected PagesApi $pages; public function __construct( - Configuration $configuration = null, + ?Configuration $configuration = null, ?string $apiKey = null, ?ClientInterface $httpClient = null, ?string $userAgent = null, @@ -162,7 +162,7 @@ public function hasPermissions(array $permissions, ?string $project = null): boo $permissions[0] === NamedPermission::VIEW_PUBLIC_INFO; } - return $this->permissions->hasAll($permissions, $project)->getResult(); + return $this->permissions->hasAll($permissions, project: $project)->getResult(); } /** @@ -205,27 +205,40 @@ public function getProjects(ProjectSearchOptions $options = new ProjectSearchOpt /** * Get a single project - * @param string $slug + * @param string $slugOrId * @return Project * @throws ApiException */ - public function getProject(string $slug): Project + public function getProject(string $slugOrId): Project { $this->authenticate(); - $result = $this->projects->getProject($slug); + $result = $this->projects->getProject($slugOrId); + return new Project($this, $result); + } + + /** + * Get a single project by its version hash (SHA-256) + * @param string $hash + * @return Project + * @throws ApiException + */ + public function getProjectByVersionHash(string $hash): Project + { + $this->authenticate(); + + $result = $this->projects->projectByVersionHash($hash); return new Project($this, $result); } - // TODO: projectByVersionHash /** * Get a list of people watching a project - * @param string $projectSlug + * @param string $slugOrId * @param RequestPagination|null $pagination * @return ProjectWatcherList * @throws ApiException */ - public function getProjectWatchers(string $projectSlug, ?RequestPagination $pagination = null): ProjectWatcherList + public function getProjectWatchers(string $slugOrId, ?RequestPagination $pagination = null): ProjectWatcherList { $this->authenticate(); @@ -233,11 +246,11 @@ public function getProjectWatchers(string $projectSlug, ?RequestPagination $pagi ->setOffset(0) ->setLimit(25); - $result = $this->projects->getProjectWatchers($projectSlug, $pagination); + $result = $this->projects->getProjectWatchers($slugOrId, $pagination); return new ProjectWatcherList( $this, $result, - $projectSlug, + $slugOrId, $pagination, ); } @@ -247,24 +260,24 @@ public function getProjectWatchers(string $projectSlug, ?RequestPagination $pagi * Days without downloads/views will not be included * * Requires the is_subject_member permission - * @param string $slug + * @param string $slugOrId * @param DateTime $from * @param DateTime|null $to default: now * @return array * @throws ApiException */ - public function getDailyProjectStats(string $slug, DateTime $from, ?DateTime $to = null): array + public function getDailyProjectStats(string $slugOrId, DateTime $from, ?DateTime $to = null): array { $this->authenticate(); - if (!$this->hasPermission(NamedPermission::IS_SUBJECT_MEMBER, $slug)) { + if (!$this->hasPermission(NamedPermission::IS_SUBJECT_MEMBER, $slugOrId)) { throw new ApiException('You need the is_subject_member permission to view project statistics'); } $to ??= new DateTime(); return $this->projects->showProjectStats( - $slug, + $slugOrId, $from->format(DateTimeInterface::RFC3339), $to->format(DateTimeInterface::RFC3339) ); @@ -272,12 +285,12 @@ public function getDailyProjectStats(string $slug, DateTime $from, ?DateTime $to /** * Get a list of people starring a project - * @param string $projectSlug + * @param string $slugOrId * @param RequestPagination|null $pagination * @return ProjectStarGazersList * @throws ApiException */ - public function getProjectStarGazers(string $projectSlug, ?RequestPagination $pagination = null): ProjectStarGazersList + public function getProjectStarGazers(string $slugOrId, ?RequestPagination $pagination = null): ProjectStarGazersList { $this->authenticate(); @@ -285,23 +298,23 @@ public function getProjectStarGazers(string $projectSlug, ?RequestPagination $pa ->setOffset(0) ->setLimit(25); - $result = $this->projects->getProjectStarGazers($projectSlug, $pagination); + $result = $this->projects->getProjectStarGazers($slugOrId, $pagination); return new ProjectStarGazersList( $this, $result, - $projectSlug, + $slugOrId, $pagination, ); } /** * Get a list of members of a project - * @param string $projectSlug + * @param string $slugOrId * @param RequestPagination|null $pagination * @return ProjectMemberList * @throws ApiException */ - public function getProjectMembers(string $projectSlug, ?RequestPagination $pagination = null): ProjectMemberList + public function getProjectMembers(string $slugOrId, ?RequestPagination $pagination = null): ProjectMemberList { $this->authenticate(); @@ -309,13 +322,13 @@ public function getProjectMembers(string $projectSlug, ?RequestPagination $pagin ->setOffset(0) ->setLimit(25); - $result = $this->projects->getProjectMembers($projectSlug, $pagination); - return new ProjectMemberList($this, $result, $projectSlug, $pagination); + $result = $this->projects->getProjectMembers($slugOrId, $pagination); + return new ProjectMemberList($this, $result, $slugOrId, $pagination); } /** * Get versions of a project - * @param string|Project $project project slug or object + * @param string|Project $project project slug, id or object * @param VersionSearchOptions $options * @return ProjectVersionList * @throws ApiException @@ -330,11 +343,11 @@ public function getProjectVersions( if ($project instanceof Project) { $options->setProject($project); } else { - $options->setProjectSlug($project); + $options->setProjectSlugOrId($project); } $result = $this->versions->listVersions( - $options->getProjectSlug(), + $options->getProjectSlugOrId(), $options->getPagination(), $options->isIncludeHiddenChannels(), $options->getChannel(), @@ -345,50 +358,122 @@ public function getProjectVersions( } /** - * Get a single project version - * @param string|Project $project project slug or object - * @param string $name + * Get the latest release version of a project + * @param string $projectSlugOrId + * @return string + * @throws ApiException + */ + public function getLatestReleaseVersion(string $projectSlugOrId): string + { + $this->authenticate(); + + return $this->versions->latestReleaseVersion($projectSlugOrId); + } + + /** + * Get the latest version of a project in a specific channel + * @param string $projectSlugOrId + * @param string $channel + * @return string + * @throws ApiException + */ + public function getLatestVersion(string $projectSlugOrId, string $channel): string + { + $this->authenticate(); + + return $this->versions->latestVersion($projectSlugOrId, $channel); + } + + + /** + * Get a single project version using the project and version name or id + * @param string|Project $project project slug, id or object + * @param string $nameOrId version name or id * @return Version * @throws ApiException */ - public function getProjectVersion(string|Project $project, string $name): Version + public function getVersion(string|Project $project, string $nameOrId): Version { $this->authenticate(); - $projectSlug = $project instanceof Project ? $project->getSlug() : $project; - $result = $this->versions->showVersion($projectSlug, $name); + $slugOrId = $project instanceof Project ? $project->getId() : $project; + $result = $this->versions->showVersion($slugOrId, $nameOrId); return new Version( $this, $result, - $projectSlug, + $slugOrId, $project instanceof Project ? $project : null ); } + /** + * Get a single project version without specifying the project + * To use this method you need to specify the version id. If you only have the version name, use {@see getVersion} + * @param int $versionId version id + * @return Version + * @throws ApiException + */ + public function getVersionById(int $versionId): Version + { + $this->authenticate(); + + $result = $this->versions->showVersionById($versionId); + return new Version( + $this, + $result, + $versionId, + ); + } + /** * Get a list of daily version stats * Days without downloads/views will not be included * * Requires the is_subject_member permission - * @param Version $version + * @param string $projectSlugOrId + * @param string $versionNameOrId * @param DateTime $from * @param DateTime|null $to default: now * @return array * @throws ApiException */ - public function getDailyProjectVersionStats(Version $version, DateTime $from, ?DateTime $to = null): array + public function getDailyVersionStats(string $projectSlugOrId, string $versionNameOrId, DateTime $from, ?DateTime $to = null): array { $this->authenticate(); - if (!$this->hasPermission(NamedPermission::IS_SUBJECT_MEMBER, $version->getProjectSlug())) { + if (!$this->hasPermission(NamedPermission::IS_SUBJECT_MEMBER, $projectSlugOrId)) { throw new ApiException('You need the is_subject_member permission to view version statistics'); } $to ??= new DateTime(); return $this->versions->showVersionStats( - $version->getProjectSlug(), - $version->getData()->getName(), + $projectSlugOrId, + $versionNameOrId, + $from->format(DateTimeInterface::RFC3339), + $to->format(DateTimeInterface::RFC3339), + ); + } + + /** + * Get a list of daily version stats + * Days without downloads/views will not be included + * + * To use this method you need to specify the version id. If you only have the version name, use {@see getDailyVersionStats} + * + * Requires the is_subject_member permission + * @param int $versionId version id + * @return array + * @throws ApiException + */ + public function getDailyVersionStatsById(int $versionId, DateTime $from, ?DateTime $to = null): array + { + $this->authenticate(); + + $to ??= new DateTime(); + + return $this->versions->showVersionStatsById( + $versionId, $from->format(DateTimeInterface::RFC3339), $to->format(DateTimeInterface::RFC3339), ); @@ -558,22 +643,22 @@ public function getAuthors(string $query = "", ?RequestPagination $pagination = * Get the main page of a project * * Requires the view_public_info permission - * @param string $slug + * @param string $projectSlugOrId * @return ProjectPage * @throws ApiException */ - public function getProjectMainPage(string $slug): ProjectPage + public function getProjectMainPage(string $projectSlugOrId): ProjectPage { $this->authenticate(); - if (!$this->hasPermission(NamedPermission::VIEW_PUBLIC_INFO, $slug)) { + if (!$this->hasPermission(NamedPermission::VIEW_PUBLIC_INFO, $projectSlugOrId)) { throw new ApiException('You need the view_public_info permission to view project pages'); } return new ProjectPage( $this, - $slug, - $this->pages->getMainPage($slug), + $projectSlugOrId, + $this->pages->getMainPage($projectSlugOrId), ); } @@ -583,23 +668,23 @@ public function getProjectMainPage(string $slug): ProjectPage * Calling this with an empty path is equivalent to calling getProjectMainPage * * Requires the view_public_info permission - * @param string $slug + * @param string $projectSlugOrId * @param string $path * @return ProjectPage * @throws ApiException */ - public function getProjectPage(string $slug, string $path): ProjectPage + public function getProjectPage(string $projectSlugOrId, string $path): ProjectPage { $this->authenticate(); - if (!$this->hasPermission(NamedPermission::VIEW_PUBLIC_INFO, $slug)) { + if (!$this->hasPermission(NamedPermission::VIEW_PUBLIC_INFO, $projectSlugOrId)) { throw new ApiException('You need the view_public_info permission to view project pages'); } return new ProjectPage( $this, - $slug, - $this->pages->getPage($slug, $path), + $projectSlugOrId, + $this->pages->getPage($projectSlugOrId, $path), ); } @@ -607,26 +692,26 @@ public function getProjectPage(string $slug, string $path): ProjectPage * Edit the main page of a project * * Requires the edit_page permission - * @param string $slug + * @param string $projectSlugOrId * @param string $content * @return ProjectPage * @throws ApiException */ - public function editProjectMainPage(string $slug, string $content): ProjectPage + public function editProjectMainPage(string $projectSlugOrId, string $content): ProjectPage { $this->authenticate(); - if (!$this->hasPermission(NamedPermission::EDIT_PAGE, $slug)) { + if (!$this->hasPermission(NamedPermission::EDIT_PAGE, $projectSlugOrId)) { throw new ApiException('You need the edit_page permission to edit project pages'); } $form = new StringContent(); $form->setContent($content); - $this->pages->editMainPage($slug, $form); + $this->pages->editMainPage($projectSlugOrId, $form); return new ProjectPage( $this, - $slug, + $projectSlugOrId, $content, ); } @@ -636,30 +721,30 @@ public function editProjectMainPage(string $slug, string $content): ProjectPage * Starting and trailing slashes are ignored by the Hangar API * * Requires the edit_page permission - * @param string $slug + * @param string $projectSlugOrId * @param string $path * @param string $content * @return ProjectPage * @throws ApiException */ - public function editProjectPage(string $slug, string $path, string $content): ProjectPage + public function editProjectPage(string $projectSlugOrId, string $path, string $content): ProjectPage { $this->authenticate(); - if (!$this->hasPermission(NamedPermission::EDIT_PAGE, $slug)) { + if (!$this->hasPermission(NamedPermission::EDIT_PAGE, $projectSlugOrId)) { throw new ApiException('You need the edit_page permission to edit project pages'); } $form = new PageEditForm(); $form->setContent($content); $form->setPath($path); - $this->pages->editPage($slug, $form); + $this->pages->editPage($projectSlugOrId, $form); return new ProjectPage( $this, - $slug, + $projectSlugOrId, $content, $path, ); } -} \ No newline at end of file +} diff --git a/lib/Client/List/ProjectVersionList.php b/lib/Client/List/ProjectVersionList.php index 63c337e..1506bc1 100644 --- a/lib/Client/List/ProjectVersionList.php +++ b/lib/Client/List/ProjectVersionList.php @@ -27,7 +27,7 @@ public function __construct( return new Version( $this->client, $version, - $options->getProjectSlug(), + $options->getProjectSlugOrId(), $options->getProject(), ); }, $result->getResult())); @@ -38,8 +38,8 @@ public function getOffset(int $offset): static $options = clone $this->options; $options->setOffset($offset); return $this->client->getProjectVersions( - $this->options->getProject() ?? $this->options->getProjectSlug()->getSlug(), + $this->options->getProject() ?? $this->options->getProjectSlugOrId()->getSlug(), $options ); } -} \ No newline at end of file +} diff --git a/lib/Client/Options/VersionSearch/VersionSearchOptions.php b/lib/Client/Options/VersionSearch/VersionSearchOptions.php index 06a4953..fb7c5fe 100644 --- a/lib/Client/Options/VersionSearch/VersionSearchOptions.php +++ b/lib/Client/Options/VersionSearch/VersionSearchOptions.php @@ -14,7 +14,7 @@ */ class VersionSearchOptions { - protected string $projectSlug; + protected string $projectSlugOrId; protected ?Project $project = null; @@ -26,29 +26,29 @@ class VersionSearchOptions protected bool $includeHiddenChannels = true; - public function __construct(string $projectSlug) + public function __construct(string $projectSlugOrId) { $this->pagination = (new RequestPagination()) ->setOffset(0) ->setLimit(25); - $this->projectSlug = $projectSlug; + $this->projectSlugOrId = $projectSlugOrId; } /** * @return string */ - public function getProjectSlug(): string + public function getProjectSlugOrId(): string { - return $this->projectSlug; + return $this->projectSlugOrId; } /** - * @param string $projectSlug + * @param string $projectSlugOrId * @return $this */ - public function setProjectSlug(string $projectSlug): static + public function setProjectSlugOrId(string $projectSlugOrId): static { - $this->projectSlug = $projectSlug; + $this->projectSlugOrId = $projectSlugOrId; return $this; } @@ -61,13 +61,13 @@ public function getProject(): ?Project } /** - * @param Project|null $project + * @param Project $project * @return $this */ - public function setProject(?Project $project): static + public function setProject(Project $project): static { $this->project = $project; - $this->setProjectSlug($project->getSlug()); + $this->setProjectSlugOrId($project->getId()); return $this; } @@ -178,4 +178,4 @@ public function setIncludeHiddenChannels(bool $includeHiddenChannels): static $this->includeHiddenChannels = $includeHiddenChannels; return $this; } -} \ No newline at end of file +} diff --git a/lib/Client/Project.php b/lib/Client/Project.php index 1de9fc5..d34162f 100644 --- a/lib/Client/Project.php +++ b/lib/Client/Project.php @@ -43,6 +43,15 @@ public function getSlug(): string return $this->project->getNamespace()->getSlug(); } + /** + * Get the id of this project (shorthand for getData()->getId()) + * @return int + */ + public function getId(): int + { + return $this->project->getId(); + } + /** * Get all versions of this project (paginated) * @param string|null $channel @@ -52,7 +61,7 @@ public function getSlug(): string */ public function getVersions(?string $channel = null, ?Platform $platform = null): ProjectVersionList { - $options = new VersionSearchOptions($this->getSlug()); + $options = new VersionSearchOptions($this->getId()); $options->setProject($this); $options->setChannel($channel); $options->setPlatform($platform); @@ -67,7 +76,7 @@ public function getVersions(?string $channel = null, ?Platform $platform = null) */ public function getVersion(string $name): Version { - return $this->client->getProjectVersion($this, $name); + return $this->client->getVersion($this, $name); } /** @@ -77,7 +86,7 @@ public function getVersion(string $name): Version */ public function getWatchers(): UserList { - return $this->client->getProjectWatchers($this->getSlug()); + return $this->client->getProjectWatchers($this->getId()); } /** @@ -91,7 +100,7 @@ public function getWatchers(): UserList public function getDailyStats(?DateTime $from = null, ?DateTime $to = null): array { return $this->client->getDailyProjectStats( - $this->getSlug(), + $this->getId(), $from ?? $this->getData()->getCreatedAt(), $to ); @@ -104,7 +113,7 @@ public function getDailyStats(?DateTime $from = null, ?DateTime $to = null): arr */ public function getStarGazers(): UserList { - return $this->client->getProjectStarGazers($this->getSlug()); + return $this->client->getProjectStarGazers($this->getId()); } /** @@ -114,7 +123,7 @@ public function getStarGazers(): UserList */ public function getMembers(): ProjectMemberList { - return $this->client->getProjectMembers($this->getSlug()); + return $this->client->getProjectMembers($this->getId()); } /** @@ -134,7 +143,7 @@ public function getOwner(): User */ public function getMainPage(): ProjectPage { - return $this->client->getProjectMainPage($this->getSlug()); + return $this->client->getProjectMainPage($this->getId()); } /** @@ -145,6 +154,6 @@ public function getMainPage(): ProjectPage */ public function getPage(string $path): ProjectPage { - return $this->client->getProjectPage($this->getSlug(), $path); + return $this->client->getProjectPage($this->getId(), $path); } -} \ No newline at end of file +} diff --git a/lib/Client/ProjectPage.php b/lib/Client/ProjectPage.php index 06c65e5..2cfba16 100644 --- a/lib/Client/ProjectPage.php +++ b/lib/Client/ProjectPage.php @@ -10,9 +10,9 @@ class ProjectPage public function __construct( protected HangarAPIClient $client, - protected string $slug, - protected string $content, - protected string $path = "", + protected string $projectSlugOrId, + protected string $content, + protected string $path = "", ) { } @@ -45,7 +45,17 @@ public function setContent(string $content): static */ public function getProject(): Project { - return $this->project ??= $this->client->getProject($this->slug); + return $this->project ??= $this->client->getProject($this->projectSlugOrId); + } + + /** + * Get the project id or slug + * This method will return the project id if the project is set, otherwise the slug or id passed to the constructor + * @return string|int + */ + public function getProjectIdOrSlug(): string|int + { + return $this->project?->getId() ?? $this->projectSlugOrId; } /** @@ -86,7 +96,7 @@ public function setPath(string $path): static */ public function save(): static { - $this->client->editProjectPage($this->slug, $this->path, $this->content); + $this->client->editProjectPage($this->getProjectIdOrSlug(), $this->path, $this->content); return $this; } -} \ No newline at end of file +} diff --git a/lib/Client/User.php b/lib/Client/User.php index 19d48c7..6065f83 100644 --- a/lib/Client/User.php +++ b/lib/Client/User.php @@ -39,7 +39,7 @@ public function getData(): \Aternos\HangarApi\Model\User */ public function getWatchedProjects(): WatchedProjectList { - return $this->client->getProjectsWatchedByUser($this->user->getName()); + return $this->client->getProjectsWatchedByUser($this->user->getId()); } /** @@ -49,7 +49,7 @@ public function getWatchedProjects(): WatchedProjectList */ public function getStarredProjects(): StarredProjectList { - return $this->client->getProjectsStarredByUser($this->user->getName()); + return $this->client->getProjectsStarredByUser($this->user->getId()); } /** @@ -59,7 +59,7 @@ public function getStarredProjects(): StarredProjectList */ public function getPinnedProjects(): array { - return $this->client->getProjectsPinnedByUser($this->user->getName()); + return $this->client->getProjectsPinnedByUser($this->user->getId()); } /** @@ -70,7 +70,7 @@ public function getPinnedProjects(): array public function getProjects(): ProjectList { $options = new ProjectSearchOptions(); - $options->setOwner($this->user->getName()); + $options->setOwner($this->user->getId()); return $this->client->getProjects($options); } -} \ No newline at end of file +} diff --git a/lib/Client/Version.php b/lib/Client/Version.php index 26ba71e..294f62a 100644 --- a/lib/Client/Version.php +++ b/lib/Client/Version.php @@ -17,19 +17,19 @@ class Version public function __construct( protected HangarAPIClient $client, protected \Aternos\HangarApi\Model\Version $version, - protected string $projectSlug, + protected string $projectSlugOrId, protected ?Project $project = null, ) { } /** - * Get the slug of the project this version belongs to + * Get the slug or id of the project this version belongs to * @return string */ - public function getProjectSlug(): string + public function getProjectSlugOrId(): string { - return $this->projectSlug; + return $this->projectSlugOrId; } /** @@ -43,7 +43,7 @@ public function getProject(): Project return $this->project; } - $this->project = $this->client->getProject($this->projectSlug); + $this->project = $this->client->getProject($this->projectSlugOrId); return $this->project; } @@ -65,10 +65,10 @@ public function getData(): \Aternos\HangarApi\Model\Version */ public function getDailyStats(?DateTime $from = null, ?DateTime $to = null): array { - return $this->client->getDailyProjectVersionStats( - $this, + return $this->client->getDailyVersionStatsById( + $this->getData()->getId(), $from ?? $this->getData()->getCreatedAt(), $to ); } -} \ No newline at end of file +} diff --git a/lib/Model/ApiKey.php b/lib/Model/ApiKey.php index 0bec6b6..1500a0a 100644 --- a/lib/Model/ApiKey.php +++ b/lib/Model/ApiKey.php @@ -58,10 +58,10 @@ class ApiKey implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'created_at' => '\DateTime', + 'last_used' => '\DateTime', 'name' => 'string', - 'token_identifier' => 'string', 'permissions' => '\Aternos\HangarApi\Model\NamedPermission[]', - 'last_used' => '\DateTime' + 'token_identifier' => 'string' ]; /** @@ -73,10 +73,10 @@ class ApiKey implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'created_at' => 'date-time', + 'last_used' => 'date-time', 'name' => null, - 'token_identifier' => null, 'permissions' => null, - 'last_used' => 'date-time' + 'token_identifier' => null ]; /** @@ -86,10 +86,10 @@ class ApiKey implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'created_at' => false, + 'last_used' => false, 'name' => false, - 'token_identifier' => false, 'permissions' => false, - 'last_used' => false + 'token_identifier' => false ]; /** @@ -179,10 +179,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'created_at' => 'createdAt', + 'last_used' => 'lastUsed', 'name' => 'name', - 'token_identifier' => 'tokenIdentifier', 'permissions' => 'permissions', - 'last_used' => 'lastUsed' + 'token_identifier' => 'tokenIdentifier' ]; /** @@ -192,10 +192,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'created_at' => 'setCreatedAt', + 'last_used' => 'setLastUsed', 'name' => 'setName', - 'token_identifier' => 'setTokenIdentifier', 'permissions' => 'setPermissions', - 'last_used' => 'setLastUsed' + 'token_identifier' => 'setTokenIdentifier' ]; /** @@ -205,10 +205,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'created_at' => 'getCreatedAt', + 'last_used' => 'getLastUsed', 'name' => 'getName', - 'token_identifier' => 'getTokenIdentifier', 'permissions' => 'getPermissions', - 'last_used' => 'getLastUsed' + 'token_identifier' => 'getTokenIdentifier' ]; /** @@ -269,10 +269,10 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('last_used', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('token_identifier', $data ?? [], null); $this->setIfExists('permissions', $data ?? [], null); - $this->setIfExists('last_used', $data ?? [], null); + $this->setIfExists('token_identifier', $data ?? [], null); } /** @@ -345,55 +345,55 @@ public function setCreatedAt($created_at) } /** - * Gets name + * Gets last_used * - * @return string|null + * @return \DateTime|null */ - public function getName() + public function getLastUsed() { - return $this->container['name']; + return $this->container['last_used']; } /** - * Sets name + * Sets last_used * - * @param string|null $name name + * @param \DateTime|null $last_used last_used * * @return self */ - public function setName($name) + public function setLastUsed($last_used) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($last_used)) { + throw new \InvalidArgumentException('non-nullable last_used cannot be null'); } - $this->container['name'] = $name; + $this->container['last_used'] = $last_used; return $this; } /** - * Gets token_identifier + * Gets name * * @return string|null */ - public function getTokenIdentifier() + public function getName() { - return $this->container['token_identifier']; + return $this->container['name']; } /** - * Sets token_identifier + * Sets name * - * @param string|null $token_identifier token_identifier + * @param string|null $name name * * @return self */ - public function setTokenIdentifier($token_identifier) + public function setName($name) { - if (is_null($token_identifier)) { - throw new \InvalidArgumentException('non-nullable token_identifier cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['token_identifier'] = $token_identifier; + $this->container['name'] = $name; return $this; } @@ -426,28 +426,28 @@ public function setPermissions($permissions) } /** - * Gets last_used + * Gets token_identifier * - * @return \DateTime|null + * @return string|null */ - public function getLastUsed() + public function getTokenIdentifier() { - return $this->container['last_used']; + return $this->container['token_identifier']; } /** - * Sets last_used + * Sets token_identifier * - * @param \DateTime|null $last_used last_used + * @param string|null $token_identifier token_identifier * * @return self */ - public function setLastUsed($last_used) + public function setTokenIdentifier($token_identifier) { - if (is_null($last_used)) { - throw new \InvalidArgumentException('non-nullable last_used cannot be null'); + if (is_null($token_identifier)) { + throw new \InvalidArgumentException('non-nullable token_identifier cannot be null'); } - $this->container['last_used'] = $last_used; + $this->container['token_identifier'] = $token_identifier; return $this; } diff --git a/lib/Model/ApiSession.php b/lib/Model/ApiSession.php index b638ac9..a1eadc6 100644 --- a/lib/Model/ApiSession.php +++ b/lib/Model/ApiSession.php @@ -57,8 +57,8 @@ class ApiSession implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'token' => 'string', - 'expires_in' => 'int' + 'expires_in' => 'int', + 'token' => 'string' ]; /** @@ -69,8 +69,8 @@ class ApiSession implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'token' => null, - 'expires_in' => 'int64' + 'expires_in' => 'int64', + 'token' => null ]; /** @@ -79,8 +79,8 @@ class ApiSession implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'token' => false, - 'expires_in' => false + 'expires_in' => false, + 'token' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'token' => 'token', - 'expires_in' => 'expiresIn' + 'expires_in' => 'expiresIn', + 'token' => 'token' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'token' => 'setToken', - 'expires_in' => 'setExpiresIn' + 'expires_in' => 'setExpiresIn', + 'token' => 'setToken' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'token' => 'getToken', - 'expires_in' => 'getExpiresIn' + 'expires_in' => 'getExpiresIn', + 'token' => 'getToken' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('token', $data ?? [], null); $this->setIfExists('expires_in', $data ?? [], null); + $this->setIfExists('token', $data ?? [], null); } /** @@ -297,55 +297,55 @@ public function valid() /** - * Gets token + * Gets expires_in * - * @return string|null + * @return int|null */ - public function getToken() + public function getExpiresIn() { - return $this->container['token']; + return $this->container['expires_in']; } /** - * Sets token + * Sets expires_in * - * @param string|null $token JWT used for authentication + * @param int|null $expires_in Milliseconds this JWT expires in * * @return self */ - public function setToken($token) + public function setExpiresIn($expires_in) { - if (is_null($token)) { - throw new \InvalidArgumentException('non-nullable token cannot be null'); + if (is_null($expires_in)) { + throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); } - $this->container['token'] = $token; + $this->container['expires_in'] = $expires_in; return $this; } /** - * Gets expires_in + * Gets token * - * @return int|null + * @return string|null */ - public function getExpiresIn() + public function getToken() { - return $this->container['expires_in']; + return $this->container['token']; } /** - * Sets expires_in + * Sets token * - * @param int|null $expires_in Milliseconds this JWT expires in + * @param string|null $token JWT used for authentication * * @return self */ - public function setExpiresIn($expires_in) + public function setToken($token) { - if (is_null($expires_in)) { - throw new \InvalidArgumentException('non-nullable expires_in cannot be null'); + if (is_null($token)) { + throw new \InvalidArgumentException('non-nullable token cannot be null'); } - $this->container['expires_in'] = $expires_in; + $this->container['token'] = $token; return $this; } diff --git a/lib/Model/Category.php b/lib/Model/Category.php index 70ea5c0..fdb3884 100644 --- a/lib/Model/Category.php +++ b/lib/Model/Category.php @@ -33,7 +33,6 @@ * Category Class Doc Comment * * @category Class - * @description The category of the project * @package Aternos\HangarApi * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/lib/Model/Color.php b/lib/Model/Color.php index 7a2c47b..22a192b 100644 --- a/lib/Model/Color.php +++ b/lib/Model/Color.php @@ -42,37 +42,37 @@ class Color /** * Possible values of this enum */ - public const B400_FF = '#B400FF'; + public const D946EF = '#d946ef'; - public const C87_DFF = '#C87DFF'; + public const A855F7 = '#a855f7'; - public const E100_E1 = '#E100E1'; + public const _8B5CF6 = '#8b5cf6'; - public const _0000_FF = '#0000FF'; + public const _6366F1 = '#6366f1'; - public const B9_F2_FF = '#B9F2FF'; + public const _3B82F6 = '#3b82f6'; - public const E7_FEFF = '#E7FEFF'; + public const _0EA5E9 = '#0ea5e9'; - public const _0096_FF = '#0096FF'; + public const _06B6D4 = '#06b6d4'; - public const _00_E1_E1 = '#00E1E1'; + public const _14B8A6 = '#14b8a6'; - public const _00_DC00 = '#00DC00'; + public const _34D399 = '#34d399'; - public const _009600 = '#009600'; + public const _22C55E = '#22c55e'; - public const _7_FFF00 = '#7FFF00'; + public const _84CC16 = '#84cc16'; - public const FFC800 = '#FFC800'; + public const EAB308 = '#eab308'; - public const CFB53_B = '#CFB53B'; + public const F59E0B = '#f59e0b'; - public const FF8200 = '#FF8200'; + public const F97316 = '#f97316'; - public const DC0000 = '#DC0000'; + public const EF4444 = '#ef4444'; - public const C0_C0_C0 = '#C0C0C0'; + public const _78716C = '#78716c'; public const A9_A9_A9 = '#A9A9A9'; @@ -85,22 +85,22 @@ class Color public static function getAllowableEnumValues() { return [ - self::B400_FF, - self::C87_DFF, - self::E100_E1, - self::_0000_FF, - self::B9_F2_FF, - self::E7_FEFF, - self::_0096_FF, - self::_00_E1_E1, - self::_00_DC00, - self::_009600, - self::_7_FFF00, - self::FFC800, - self::CFB53_B, - self::FF8200, - self::DC0000, - self::C0_C0_C0, + self::D946EF, + self::A855F7, + self::_8B5CF6, + self::_6366F1, + self::_3B82F6, + self::_0EA5E9, + self::_06B6D4, + self::_14B8A6, + self::_34D399, + self::_22C55E, + self::_84CC16, + self::EAB308, + self::F59E0B, + self::F97316, + self::EF4444, + self::_78716C, self::A9_A9_A9, self::TRANSPARENT ]; diff --git a/lib/Model/CompactRole.php b/lib/Model/CompactRole.php index 36a2e32..f493c3d 100644 --- a/lib/Model/CompactRole.php +++ b/lib/Model/CompactRole.php @@ -57,10 +57,10 @@ class CompactRole implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'title' => 'string', + 'category' => 'string', 'color' => '\Aternos\HangarApi\Model\Color', 'rank' => 'int', - 'category' => 'string' + 'title' => 'string' ]; /** @@ -71,10 +71,10 @@ class CompactRole implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'title' => null, + 'category' => null, 'color' => null, 'rank' => 'int32', - 'category' => null + 'title' => null ]; /** @@ -83,10 +83,10 @@ class CompactRole implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'title' => false, + 'category' => false, 'color' => false, 'rank' => false, - 'category' => false + 'title' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'title' => 'title', + 'category' => 'category', 'color' => 'color', 'rank' => 'rank', - 'category' => 'category' + 'title' => 'title' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'title' => 'setTitle', + 'category' => 'setCategory', 'color' => 'setColor', 'rank' => 'setRank', - 'category' => 'setCategory' + 'title' => 'setTitle' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'title' => 'getTitle', + 'category' => 'getCategory', 'color' => 'getColor', 'rank' => 'getRank', - 'category' => 'getCategory' + 'title' => 'getTitle' ]; /** @@ -262,10 +262,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('color', $data ?? [], null); $this->setIfExists('rank', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); } /** @@ -311,28 +311,28 @@ public function valid() /** - * Gets title + * Gets category * * @return string|null */ - public function getTitle() + public function getCategory() { - return $this->container['title']; + return $this->container['category']; } /** - * Sets title + * Sets category * - * @param string|null $title title + * @param string|null $category category * * @return self */ - public function setTitle($title) + public function setCategory($category) { - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['title'] = $title; + $this->container['category'] = $category; return $this; } @@ -392,28 +392,28 @@ public function setRank($rank) } /** - * Gets category + * Gets title * * @return string|null */ - public function getCategory() + public function getTitle() { - return $this->container['category']; + return $this->container['title']; } /** - * Sets category + * Sets title * - * @param string|null $category category + * @param string|null $title title * * @return self */ - public function setCategory($category) + public function setTitle($title) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); } - $this->container['category'] = $category; + $this->container['title'] = $title; return $this; } diff --git a/lib/Model/DayProjectStats.php b/lib/Model/DayProjectStats.php index 5905ecf..c85bc24 100644 --- a/lib/Model/DayProjectStats.php +++ b/lib/Model/DayProjectStats.php @@ -57,8 +57,8 @@ class DayProjectStats implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'views' => 'int', - 'downloads' => 'int' + 'downloads' => 'int', + 'views' => 'int' ]; /** @@ -69,8 +69,8 @@ class DayProjectStats implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'views' => 'int64', - 'downloads' => 'int64' + 'downloads' => 'int64', + 'views' => 'int64' ]; /** @@ -79,8 +79,8 @@ class DayProjectStats implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'views' => false, - 'downloads' => false + 'downloads' => false, + 'views' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'views' => 'views', - 'downloads' => 'downloads' + 'downloads' => 'downloads', + 'views' => 'views' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'views' => 'setViews', - 'downloads' => 'setDownloads' + 'downloads' => 'setDownloads', + 'views' => 'setViews' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'views' => 'getViews', - 'downloads' => 'getDownloads' + 'downloads' => 'getDownloads', + 'views' => 'getViews' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('views', $data ?? [], null); $this->setIfExists('downloads', $data ?? [], null); + $this->setIfExists('views', $data ?? [], null); } /** @@ -297,55 +297,55 @@ public function valid() /** - * Gets views + * Gets downloads * * @return int|null */ - public function getViews() + public function getDownloads() { - return $this->container['views']; + return $this->container['downloads']; } /** - * Sets views + * Sets downloads * - * @param int|null $views views + * @param int|null $downloads downloads * * @return self */ - public function setViews($views) + public function setDownloads($downloads) { - if (is_null($views)) { - throw new \InvalidArgumentException('non-nullable views cannot be null'); + if (is_null($downloads)) { + throw new \InvalidArgumentException('non-nullable downloads cannot be null'); } - $this->container['views'] = $views; + $this->container['downloads'] = $downloads; return $this; } /** - * Gets downloads + * Gets views * * @return int|null */ - public function getDownloads() + public function getViews() { - return $this->container['downloads']; + return $this->container['views']; } /** - * Sets downloads + * Sets views * - * @param int|null $downloads downloads + * @param int|null $views views * * @return self */ - public function setDownloads($downloads) + public function setViews($views) { - if (is_null($downloads)) { - throw new \InvalidArgumentException('non-nullable downloads cannot be null'); + if (is_null($views)) { + throw new \InvalidArgumentException('non-nullable views cannot be null'); } - $this->container['downloads'] = $downloads; + $this->container['views'] = $views; return $this; } diff --git a/lib/Model/FileInfo.php b/lib/Model/FileInfo.php index 9dbeaed..eed741a 100644 --- a/lib/Model/FileInfo.php +++ b/lib/Model/FileInfo.php @@ -58,8 +58,8 @@ class FileInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'name' => 'string', - 'size_bytes' => 'int', - 'sha256_hash' => 'string' + 'sha256_hash' => 'string', + 'size_bytes' => 'int' ]; /** @@ -71,8 +71,8 @@ class FileInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'name' => null, - 'size_bytes' => 'int64', - 'sha256_hash' => null + 'sha256_hash' => null, + 'size_bytes' => 'int64' ]; /** @@ -82,8 +82,8 @@ class FileInfo implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'name' => false, - 'size_bytes' => false, - 'sha256_hash' => false + 'sha256_hash' => false, + 'size_bytes' => false ]; /** @@ -173,8 +173,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'size_bytes' => 'sizeBytes', - 'sha256_hash' => 'sha256Hash' + 'sha256_hash' => 'sha256Hash', + 'size_bytes' => 'sizeBytes' ]; /** @@ -184,8 +184,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'size_bytes' => 'setSizeBytes', - 'sha256_hash' => 'setSha256Hash' + 'sha256_hash' => 'setSha256Hash', + 'size_bytes' => 'setSizeBytes' ]; /** @@ -195,8 +195,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'size_bytes' => 'getSizeBytes', - 'sha256_hash' => 'getSha256Hash' + 'sha256_hash' => 'getSha256Hash', + 'size_bytes' => 'getSizeBytes' ]; /** @@ -257,8 +257,8 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('size_bytes', $data ?? [], null); $this->setIfExists('sha256_hash', $data ?? [], null); + $this->setIfExists('size_bytes', $data ?? [], null); } /** @@ -331,55 +331,55 @@ public function setName($name) } /** - * Gets size_bytes + * Gets sha256_hash * - * @return int|null + * @return string|null */ - public function getSizeBytes() + public function getSha256Hash() { - return $this->container['size_bytes']; + return $this->container['sha256_hash']; } /** - * Sets size_bytes + * Sets sha256_hash * - * @param int|null $size_bytes size_bytes + * @param string|null $sha256_hash sha256_hash * * @return self */ - public function setSizeBytes($size_bytes) + public function setSha256Hash($sha256_hash) { - if (is_null($size_bytes)) { - throw new \InvalidArgumentException('non-nullable size_bytes cannot be null'); + if (is_null($sha256_hash)) { + throw new \InvalidArgumentException('non-nullable sha256_hash cannot be null'); } - $this->container['size_bytes'] = $size_bytes; + $this->container['sha256_hash'] = $sha256_hash; return $this; } /** - * Gets sha256_hash + * Gets size_bytes * - * @return string|null + * @return int|null */ - public function getSha256Hash() + public function getSizeBytes() { - return $this->container['sha256_hash']; + return $this->container['size_bytes']; } /** - * Sets sha256_hash + * Sets size_bytes * - * @param string|null $sha256_hash sha256_hash + * @param int|null $size_bytes size_bytes * * @return self */ - public function setSha256Hash($sha256_hash) + public function setSizeBytes($size_bytes) { - if (is_null($sha256_hash)) { - throw new \InvalidArgumentException('non-nullable sha256_hash cannot be null'); + if (is_null($size_bytes)) { + throw new \InvalidArgumentException('non-nullable size_bytes cannot be null'); } - $this->container['sha256_hash'] = $sha256_hash; + $this->container['size_bytes'] = $size_bytes; return $this; } diff --git a/lib/Model/LinkSection.php b/lib/Model/LinkSection.php index aa1e719..a9398c3 100644 --- a/lib/Model/LinkSection.php +++ b/lib/Model/LinkSection.php @@ -58,9 +58,9 @@ class LinkSection implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'id' => 'int', - 'type' => 'string', + 'links' => '\Aternos\HangarApi\Model\Link[]', 'title' => 'string', - 'links' => '\Aternos\HangarApi\Model\Link[]' + 'type' => 'string' ]; /** @@ -72,9 +72,9 @@ class LinkSection implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'id' => 'int64', - 'type' => null, + 'links' => null, 'title' => null, - 'links' => null + 'type' => null ]; /** @@ -84,9 +84,9 @@ class LinkSection implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'id' => false, - 'type' => false, + 'links' => false, 'title' => false, - 'links' => false + 'type' => false ]; /** @@ -176,9 +176,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'id' => 'id', - 'type' => 'type', + 'links' => 'links', 'title' => 'title', - 'links' => 'links' + 'type' => 'type' ]; /** @@ -188,9 +188,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'id' => 'setId', - 'type' => 'setType', + 'links' => 'setLinks', 'title' => 'setTitle', - 'links' => 'setLinks' + 'type' => 'setType' ]; /** @@ -200,9 +200,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'id' => 'getId', - 'type' => 'getType', + 'links' => 'getLinks', 'title' => 'getTitle', - 'links' => 'getLinks' + 'type' => 'getType' ]; /** @@ -263,9 +263,9 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('title', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -295,12 +295,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } return $invalidProperties; } @@ -344,28 +344,28 @@ public function setId($id) } /** - * Gets type + * Gets links * - * @return string + * @return \Aternos\HangarApi\Model\Link[] */ - public function getType() + public function getLinks() { - return $this->container['type']; + return $this->container['links']; } /** - * Sets type + * Sets links * - * @param string $type Type of the link. Either SIDEBAR or TOP + * @param \Aternos\HangarApi\Model\Link[] $links links * * @return self */ - public function setType($type) + public function setLinks($links) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['type'] = $type; + $this->container['links'] = $links; return $this; } @@ -398,28 +398,28 @@ public function setTitle($title) } /** - * Gets links + * Gets type * - * @return \Aternos\HangarApi\Model\Link[] + * @return string */ - public function getLinks() + public function getType() { - return $this->container['links']; + return $this->container['type']; } /** - * Sets links + * Sets type * - * @param \Aternos\HangarApi\Model\Link[] $links links + * @param string $type Type of the link. Either SIDEBAR or TOP * * @return self */ - public function setLinks($links) + public function setType($type) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['links'] = $links; + $this->container['type'] = $type; return $this; } diff --git a/lib/Model/MultipartFileOrUrl.php b/lib/Model/MultipartFileOrUrl.php index a1c83a6..26f5b44 100644 --- a/lib/Model/MultipartFileOrUrl.php +++ b/lib/Model/MultipartFileOrUrl.php @@ -58,8 +58,8 @@ class MultipartFileOrUrl implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'platforms' => '\Aternos\HangarApi\Model\Platform[]', - 'external_url' => 'string' + 'external_url' => 'string', + 'platforms' => '\Aternos\HangarApi\Model\Platform[]' ]; /** @@ -70,8 +70,8 @@ class MultipartFileOrUrl implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'platforms' => null, - 'external_url' => null + 'external_url' => null, + 'platforms' => null ]; /** @@ -80,8 +80,8 @@ class MultipartFileOrUrl implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'platforms' => false, - 'external_url' => false + 'external_url' => false, + 'platforms' => false ]; /** @@ -170,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'platforms' => 'platforms', - 'external_url' => 'externalUrl' + 'external_url' => 'externalUrl', + 'platforms' => 'platforms' ]; /** @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'platforms' => 'setPlatforms', - 'external_url' => 'setExternalUrl' + 'external_url' => 'setExternalUrl', + 'platforms' => 'setPlatforms' ]; /** @@ -190,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'platforms' => 'getPlatforms', - 'external_url' => 'getExternalUrl' + 'external_url' => 'getExternalUrl', + 'platforms' => 'getPlatforms' ]; /** @@ -251,8 +251,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('platforms', $data ?? [], null); $this->setIfExists('external_url', $data ?? [], null); + $this->setIfExists('platforms', $data ?? [], null); } /** @@ -298,55 +298,55 @@ public function valid() /** - * Gets platforms + * Gets external_url * - * @return \Aternos\HangarApi\Model\Platform[]|null + * @return string|null */ - public function getPlatforms() + public function getExternalUrl() { - return $this->container['platforms']; + return $this->container['external_url']; } /** - * Sets platforms + * Sets external_url * - * @param \Aternos\HangarApi\Model\Platform[]|null $platforms List of platforms this jar runs on + * @param string|null $external_url External url to download the jar from if not provided via an attached jar, else null * * @return self */ - public function setPlatforms($platforms) + public function setExternalUrl($external_url) { - if (is_null($platforms)) { - throw new \InvalidArgumentException('non-nullable platforms cannot be null'); + if (is_null($external_url)) { + throw new \InvalidArgumentException('non-nullable external_url cannot be null'); } - $this->container['platforms'] = $platforms; + $this->container['external_url'] = $external_url; return $this; } /** - * Gets external_url + * Gets platforms * - * @return string|null + * @return \Aternos\HangarApi\Model\Platform[]|null */ - public function getExternalUrl() + public function getPlatforms() { - return $this->container['external_url']; + return $this->container['platforms']; } /** - * Sets external_url + * Sets platforms * - * @param string|null $external_url External url to download the jar from if not provided via an attached jar, else null + * @param \Aternos\HangarApi\Model\Platform[]|null $platforms List of platforms this jar runs on * * @return self */ - public function setExternalUrl($external_url) + public function setPlatforms($platforms) { - if (is_null($external_url)) { - throw new \InvalidArgumentException('non-nullable external_url cannot be null'); + if (is_null($platforms)) { + throw new \InvalidArgumentException('non-nullable platforms cannot be null'); } - $this->container['external_url'] = $external_url; + $this->container['platforms'] = $platforms; return $this; } diff --git a/lib/Model/PageEditForm.php b/lib/Model/PageEditForm.php index 05588c3..4725f16 100644 --- a/lib/Model/PageEditForm.php +++ b/lib/Model/PageEditForm.php @@ -58,8 +58,8 @@ class PageEditForm implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'path' => 'string', - 'content' => 'string' + 'content' => 'string', + 'path' => 'string' ]; /** @@ -70,8 +70,8 @@ class PageEditForm implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'path' => null, - 'content' => null + 'content' => null, + 'path' => null ]; /** @@ -80,8 +80,8 @@ class PageEditForm implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'path' => false, - 'content' => false + 'content' => false, + 'path' => false ]; /** @@ -170,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'path' => 'path', - 'content' => 'content' + 'content' => 'content', + 'path' => 'path' ]; /** @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'path' => 'setPath', - 'content' => 'setContent' + 'content' => 'setContent', + 'path' => 'setPath' ]; /** @@ -190,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'path' => 'getPath', - 'content' => 'getContent' + 'content' => 'getContent', + 'path' => 'getPath' ]; /** @@ -251,8 +251,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('path', $data ?? [], null); $this->setIfExists('content', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); } /** @@ -282,6 +282,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['content'] === null) { + $invalidProperties[] = "'content' can't be null"; + } + if ($this->container['path'] === null) { + $invalidProperties[] = "'path' can't be null"; + } return $invalidProperties; } @@ -298,55 +304,55 @@ public function valid() /** - * Gets path + * Gets content * - * @return string|null + * @return string */ - public function getPath() + public function getContent() { - return $this->container['path']; + return $this->container['content']; } /** - * Sets path + * Sets content * - * @param string|null $path path + * @param string $content content * * @return self */ - public function setPath($path) + public function setContent($content) { - if (is_null($path)) { - throw new \InvalidArgumentException('non-nullable path cannot be null'); + if (is_null($content)) { + throw new \InvalidArgumentException('non-nullable content cannot be null'); } - $this->container['path'] = $path; + $this->container['content'] = $content; return $this; } /** - * Gets content + * Gets path * - * @return string|null + * @return string */ - public function getContent() + public function getPath() { - return $this->container['content']; + return $this->container['path']; } /** - * Sets content + * Sets path * - * @param string|null $content content + * @param string $path path * * @return self */ - public function setContent($content) + public function setPath($path) { - if (is_null($content)) { - throw new \InvalidArgumentException('non-nullable content cannot be null'); + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); } - $this->container['content'] = $content; + $this->container['path'] = $path; return $this; } diff --git a/lib/Model/Pagination.php b/lib/Model/Pagination.php index 4b89399..2e8f4c7 100644 --- a/lib/Model/Pagination.php +++ b/lib/Model/Pagination.php @@ -57,9 +57,9 @@ class Pagination implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'count' => 'int', 'limit' => 'int', - 'offset' => 'int', - 'count' => 'int' + 'offset' => 'int' ]; /** @@ -70,9 +70,9 @@ class Pagination implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'count' => 'int64', 'limit' => 'int64', - 'offset' => 'int64', - 'count' => 'int64' + 'offset' => 'int64' ]; /** @@ -81,9 +81,9 @@ class Pagination implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'count' => false, 'limit' => false, - 'offset' => false, - 'count' => false + 'offset' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'count' => 'count', 'limit' => 'limit', - 'offset' => 'offset', - 'count' => 'count' + 'offset' => 'offset' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'count' => 'setCount', 'limit' => 'setLimit', - 'offset' => 'setOffset', - 'count' => 'setCount' + 'offset' => 'setOffset' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'count' => 'getCount', 'limit' => 'getLimit', - 'offset' => 'getOffset', - 'count' => 'getCount' + 'offset' => 'getOffset' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('count', $data ?? [], null); $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('offset', $data ?? [], null); - $this->setIfExists('count', $data ?? [], null); } /** @@ -315,6 +315,33 @@ public function valid() } + /** + * Gets count + * + * @return int|null + */ + public function getCount() + { + return $this->container['count']; + } + + /** + * Sets count + * + * @param int|null $count count + * + * @return self + */ + public function setCount($count) + { + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); + } + $this->container['count'] = $count; + + return $this; + } + /** * Gets limit * @@ -381,33 +408,6 @@ public function setOffset($offset) return $this; } - - /** - * Gets count - * - * @return int|null - */ - public function getCount() - { - return $this->container['count']; - } - - /** - * Sets count - * - * @param int|null $count count - * - * @return self - */ - public function setCount($count) - { - if (is_null($count)) { - throw new \InvalidArgumentException('non-nullable count cannot be null'); - } - $this->container['count'] = $count; - - return $this; - } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/PermissionCheck.php b/lib/Model/PermissionCheck.php index a742cbd..cbc5ffc 100644 --- a/lib/Model/PermissionCheck.php +++ b/lib/Model/PermissionCheck.php @@ -57,8 +57,8 @@ class PermissionCheck implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'type' => '\Aternos\HangarApi\Model\PermissionType', - 'result' => 'bool' + 'result' => 'bool', + 'type' => '\Aternos\HangarApi\Model\PermissionType' ]; /** @@ -69,8 +69,8 @@ class PermissionCheck implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'result' => null + 'result' => null, + 'type' => null ]; /** @@ -79,8 +79,8 @@ class PermissionCheck implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'result' => false + 'result' => false, + 'type' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'result' => 'result' + 'result' => 'result', + 'type' => 'type' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'result' => 'setResult' + 'result' => 'setResult', + 'type' => 'setType' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'result' => 'getResult' + 'result' => 'getResult', + 'type' => 'getType' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); $this->setIfExists('result', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -297,55 +297,55 @@ public function valid() /** - * Gets type + * Gets result * - * @return \Aternos\HangarApi\Model\PermissionType|null + * @return bool|null */ - public function getType() + public function getResult() { - return $this->container['type']; + return $this->container['result']; } /** - * Sets type + * Sets result * - * @param \Aternos\HangarApi\Model\PermissionType|null $type type + * @param bool|null $result result * * @return self */ - public function setType($type) + public function setResult($result) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); } - $this->container['type'] = $type; + $this->container['result'] = $result; return $this; } /** - * Gets result + * Gets type * - * @return bool|null + * @return \Aternos\HangarApi\Model\PermissionType|null */ - public function getResult() + public function getType() { - return $this->container['result']; + return $this->container['type']; } /** - * Sets result + * Sets type * - * @param bool|null $result result + * @param \Aternos\HangarApi\Model\PermissionType|null $type type * * @return self */ - public function setResult($result) + public function setType($type) { - if (is_null($result)) { - throw new \InvalidArgumentException('non-nullable result cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['result'] = $result; + $this->container['type'] = $type; return $this; } diff --git a/lib/Model/PlatformVersionDownload.php b/lib/Model/PlatformVersionDownload.php index bef6ab8..c4dd1e0 100644 --- a/lib/Model/PlatformVersionDownload.php +++ b/lib/Model/PlatformVersionDownload.php @@ -57,9 +57,9 @@ class PlatformVersionDownload implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'file_info' => '\Aternos\HangarApi\Model\FileInfo', + 'download_url' => 'string', 'external_url' => 'string', - 'download_url' => 'string' + 'file_info' => '\Aternos\HangarApi\Model\FileInfo' ]; /** @@ -70,9 +70,9 @@ class PlatformVersionDownload implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ - 'file_info' => null, + 'download_url' => null, 'external_url' => null, - 'download_url' => null + 'file_info' => null ]; /** @@ -81,9 +81,9 @@ class PlatformVersionDownload implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ - 'file_info' => false, + 'download_url' => false, 'external_url' => false, - 'download_url' => false + 'file_info' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'file_info' => 'fileInfo', + 'download_url' => 'downloadUrl', 'external_url' => 'externalUrl', - 'download_url' => 'downloadUrl' + 'file_info' => 'fileInfo' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'file_info' => 'setFileInfo', + 'download_url' => 'setDownloadUrl', 'external_url' => 'setExternalUrl', - 'download_url' => 'setDownloadUrl' + 'file_info' => 'setFileInfo' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'file_info' => 'getFileInfo', + 'download_url' => 'getDownloadUrl', 'external_url' => 'getExternalUrl', - 'download_url' => 'getDownloadUrl' + 'file_info' => 'getFileInfo' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('file_info', $data ?? [], null); - $this->setIfExists('external_url', $data ?? [], null); $this->setIfExists('download_url', $data ?? [], null); + $this->setIfExists('external_url', $data ?? [], null); + $this->setIfExists('file_info', $data ?? [], null); } /** @@ -304,28 +304,28 @@ public function valid() /** - * Gets file_info + * Gets download_url * - * @return \Aternos\HangarApi\Model\FileInfo|null + * @return string|null */ - public function getFileInfo() + public function getDownloadUrl() { - return $this->container['file_info']; + return $this->container['download_url']; } /** - * Sets file_info + * Sets download_url * - * @param \Aternos\HangarApi\Model\FileInfo|null $file_info file_info + * @param string|null $download_url Hangar download url if not an external download * * @return self */ - public function setFileInfo($file_info) + public function setDownloadUrl($download_url) { - if (is_null($file_info)) { - throw new \InvalidArgumentException('non-nullable file_info cannot be null'); + if (is_null($download_url)) { + throw new \InvalidArgumentException('non-nullable download_url cannot be null'); } - $this->container['file_info'] = $file_info; + $this->container['download_url'] = $download_url; return $this; } @@ -358,28 +358,28 @@ public function setExternalUrl($external_url) } /** - * Gets download_url + * Gets file_info * - * @return string|null + * @return \Aternos\HangarApi\Model\FileInfo|null */ - public function getDownloadUrl() + public function getFileInfo() { - return $this->container['download_url']; + return $this->container['file_info']; } /** - * Sets download_url + * Sets file_info * - * @param string|null $download_url Hangar download url if not an external download + * @param \Aternos\HangarApi\Model\FileInfo|null $file_info file_info * * @return self */ - public function setDownloadUrl($download_url) + public function setFileInfo($file_info) { - if (is_null($download_url)) { - throw new \InvalidArgumentException('non-nullable download_url cannot be null'); + if (is_null($file_info)) { + throw new \InvalidArgumentException('non-nullable file_info cannot be null'); } - $this->container['download_url'] = $download_url; + $this->container['file_info'] = $file_info; return $this; } diff --git a/lib/Model/PluginDependency.php b/lib/Model/PluginDependency.php index 2ada944..18e2857 100644 --- a/lib/Model/PluginDependency.php +++ b/lib/Model/PluginDependency.php @@ -35,7 +35,6 @@ * PluginDependency Class Doc Comment * * @category Class - * @description Map of each platform's plugin dependencies * @package Aternos\HangarApi * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +57,10 @@ class PluginDependency implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string', - 'required' => 'bool', 'external_url' => 'string', - 'platform' => '\Aternos\HangarApi\Model\Platform' + 'name' => 'string', + 'platform' => '\Aternos\HangarApi\Model\Platform', + 'required' => 'bool' ]; /** @@ -72,10 +71,10 @@ class PluginDependency implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'name' => null, - 'required' => null, 'external_url' => null, - 'platform' => null + 'name' => null, + 'platform' => null, + 'required' => null ]; /** @@ -84,10 +83,10 @@ class PluginDependency implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, - 'required' => false, 'external_url' => false, - 'platform' => false + 'name' => false, + 'platform' => false, + 'required' => false ]; /** @@ -176,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', - 'required' => 'required', 'external_url' => 'externalUrl', - 'platform' => 'platform' + 'name' => 'name', + 'platform' => 'platform', + 'required' => 'required' ]; /** @@ -188,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', - 'required' => 'setRequired', 'external_url' => 'setExternalUrl', - 'platform' => 'setPlatform' + 'name' => 'setName', + 'platform' => 'setPlatform', + 'required' => 'setRequired' ]; /** @@ -200,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', - 'required' => 'getRequired', 'external_url' => 'getExternalUrl', - 'platform' => 'getPlatform' + 'name' => 'getName', + 'platform' => 'getPlatform', + 'required' => 'getRequired' ]; /** @@ -263,10 +262,10 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('required', $data ?? [], null); $this->setIfExists('external_url', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('platform', $data ?? [], null); + $this->setIfExists('required', $data ?? [], null); } /** @@ -312,109 +311,109 @@ public function valid() /** - * Gets name + * Gets external_url * * @return string|null */ - public function getName() + public function getExternalUrl() { - return $this->container['name']; + return $this->container['external_url']; } /** - * Sets name + * Sets external_url * - * @param string|null $name Name of the plugin dependency. For non-external dependencies, this should be the Hangar project name + * @param string|null $external_url External url to download the dependency from if not a Hangar project, else null * * @return self */ - public function setName($name) + public function setExternalUrl($external_url) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($external_url)) { + throw new \InvalidArgumentException('non-nullable external_url cannot be null'); } - $this->container['name'] = $name; + $this->container['external_url'] = $external_url; return $this; } /** - * Gets required + * Gets name * - * @return bool|null + * @return string|null */ - public function getRequired() + public function getName() { - return $this->container['required']; + return $this->container['name']; } /** - * Sets required + * Sets name * - * @param bool|null $required Whether the dependency is required for the plugin to function + * @param string|null $name Name of the plugin dependency. For non-external dependencies, this should be the Hangar project name * * @return self */ - public function setRequired($required) + public function setName($name) { - if (is_null($required)) { - throw new \InvalidArgumentException('non-nullable required cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['required'] = $required; + $this->container['name'] = $name; return $this; } /** - * Gets external_url + * Gets platform * - * @return string|null + * @return \Aternos\HangarApi\Model\Platform|null */ - public function getExternalUrl() + public function getPlatform() { - return $this->container['external_url']; + return $this->container['platform']; } /** - * Sets external_url + * Sets platform * - * @param string|null $external_url External url to download the dependency from if not a Hangar project, else null + * @param \Aternos\HangarApi\Model\Platform|null $platform Platform the dependency runs on * * @return self */ - public function setExternalUrl($external_url) + public function setPlatform($platform) { - if (is_null($external_url)) { - throw new \InvalidArgumentException('non-nullable external_url cannot be null'); + if (is_null($platform)) { + throw new \InvalidArgumentException('non-nullable platform cannot be null'); } - $this->container['external_url'] = $external_url; + $this->container['platform'] = $platform; return $this; } /** - * Gets platform + * Gets required * - * @return \Aternos\HangarApi\Model\Platform|null + * @return bool|null */ - public function getPlatform() + public function getRequired() { - return $this->container['platform']; + return $this->container['required']; } /** - * Sets platform + * Sets required * - * @param \Aternos\HangarApi\Model\Platform|null $platform platform + * @param bool|null $required Whether the dependency is required for the plugin to function * * @return self */ - public function setPlatform($platform) + public function setRequired($required) { - if (is_null($platform)) { - throw new \InvalidArgumentException('non-nullable platform cannot be null'); + if (is_null($required)) { + throw new \InvalidArgumentException('non-nullable required cannot be null'); } - $this->container['platform'] = $platform; + $this->container['required'] = $required; return $this; } diff --git a/lib/Model/Project.php b/lib/Model/Project.php index a0bb2c2..c93bb20 100644 --- a/lib/Model/Project.php +++ b/lib/Model/Project.php @@ -57,17 +57,18 @@ class Project implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'avatar_url' => 'string', + 'category' => '\Aternos\HangarApi\Model\Category', 'created_at' => '\DateTime', + 'description' => 'string', + 'id' => 'int', + 'last_updated' => '\DateTime', 'name' => 'string', 'namespace' => '\Aternos\HangarApi\Model\ProjectNamespace', + 'settings' => '\Aternos\HangarApi\Model\ProjectSettings', 'stats' => '\Aternos\HangarApi\Model\ProjectStats', - 'category' => '\Aternos\HangarApi\Model\Category', - 'last_updated' => '\DateTime', - 'visibility' => '\Aternos\HangarApi\Model\Visibility', - 'avatar_url' => 'string', - 'description' => 'string', 'user_actions' => '\Aternos\HangarApi\Model\UserActions', - 'settings' => '\Aternos\HangarApi\Model\ProjectSettings' + 'visibility' => '\Aternos\HangarApi\Model\Visibility' ]; /** @@ -78,17 +79,18 @@ class Project implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'avatar_url' => null, + 'category' => null, 'created_at' => 'date-time', + 'description' => null, + 'id' => 'int64', + 'last_updated' => 'date-time', 'name' => null, 'namespace' => null, + 'settings' => null, 'stats' => null, - 'category' => null, - 'last_updated' => 'date-time', - 'visibility' => null, - 'avatar_url' => null, - 'description' => null, 'user_actions' => null, - 'settings' => null + 'visibility' => null ]; /** @@ -97,17 +99,18 @@ class Project implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'avatar_url' => false, + 'category' => false, 'created_at' => false, + 'description' => false, + 'id' => false, + 'last_updated' => false, 'name' => false, 'namespace' => false, + 'settings' => false, 'stats' => false, - 'category' => false, - 'last_updated' => false, - 'visibility' => false, - 'avatar_url' => false, - 'description' => false, 'user_actions' => false, - 'settings' => false + 'visibility' => false ]; /** @@ -196,17 +199,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'avatar_url' => 'avatarUrl', + 'category' => 'category', 'created_at' => 'createdAt', + 'description' => 'description', + 'id' => 'id', + 'last_updated' => 'lastUpdated', 'name' => 'name', 'namespace' => 'namespace', + 'settings' => 'settings', 'stats' => 'stats', - 'category' => 'category', - 'last_updated' => 'lastUpdated', - 'visibility' => 'visibility', - 'avatar_url' => 'avatarUrl', - 'description' => 'description', 'user_actions' => 'userActions', - 'settings' => 'settings' + 'visibility' => 'visibility' ]; /** @@ -215,17 +219,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'avatar_url' => 'setAvatarUrl', + 'category' => 'setCategory', 'created_at' => 'setCreatedAt', + 'description' => 'setDescription', + 'id' => 'setId', + 'last_updated' => 'setLastUpdated', 'name' => 'setName', 'namespace' => 'setNamespace', + 'settings' => 'setSettings', 'stats' => 'setStats', - 'category' => 'setCategory', - 'last_updated' => 'setLastUpdated', - 'visibility' => 'setVisibility', - 'avatar_url' => 'setAvatarUrl', - 'description' => 'setDescription', 'user_actions' => 'setUserActions', - 'settings' => 'setSettings' + 'visibility' => 'setVisibility' ]; /** @@ -234,17 +239,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'avatar_url' => 'getAvatarUrl', + 'category' => 'getCategory', 'created_at' => 'getCreatedAt', + 'description' => 'getDescription', + 'id' => 'getId', + 'last_updated' => 'getLastUpdated', 'name' => 'getName', 'namespace' => 'getNamespace', + 'settings' => 'getSettings', 'stats' => 'getStats', - 'category' => 'getCategory', - 'last_updated' => 'getLastUpdated', - 'visibility' => 'getVisibility', - 'avatar_url' => 'getAvatarUrl', - 'description' => 'getDescription', 'user_actions' => 'getUserActions', - 'settings' => 'getSettings' + 'visibility' => 'getVisibility' ]; /** @@ -304,17 +310,18 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('avatar_url', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('namespace', $data ?? [], null); + $this->setIfExists('settings', $data ?? [], null); $this->setIfExists('stats', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('last_updated', $data ?? [], null); - $this->setIfExists('visibility', $data ?? [], null); - $this->setIfExists('avatar_url', $data ?? [], null); - $this->setIfExists('description', $data ?? [], null); $this->setIfExists('user_actions', $data ?? [], null); - $this->setIfExists('settings', $data ?? [], null); + $this->setIfExists('visibility', $data ?? [], null); } /** @@ -360,136 +367,136 @@ public function valid() /** - * Gets created_at + * Gets avatar_url * - * @return \DateTime|null + * @return string|null */ - public function getCreatedAt() + public function getAvatarUrl() { - return $this->container['created_at']; + return $this->container['avatar_url']; } /** - * Sets created_at + * Sets avatar_url * - * @param \DateTime|null $created_at created_at + * @param string|null $avatar_url The url to the project's icon * * @return self */ - public function setCreatedAt($created_at) + public function setAvatarUrl($avatar_url) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($avatar_url)) { + throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['avatar_url'] = $avatar_url; return $this; } /** - * Gets name + * Gets category * - * @return string|null + * @return \Aternos\HangarApi\Model\Category|null */ - public function getName() + public function getCategory() { - return $this->container['name']; + return $this->container['category']; } /** - * Sets name + * Sets category * - * @param string|null $name The unique name of the project + * @param \Aternos\HangarApi\Model\Category|null $category The category of the project * * @return self */ - public function setName($name) + public function setCategory($category) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['name'] = $name; + $this->container['category'] = $category; return $this; } /** - * Gets namespace + * Gets created_at * - * @return \Aternos\HangarApi\Model\ProjectNamespace|null + * @return \DateTime|null */ - public function getNamespace() + public function getCreatedAt() { - return $this->container['namespace']; + return $this->container['created_at']; } /** - * Sets namespace + * Sets created_at * - * @param \Aternos\HangarApi\Model\ProjectNamespace|null $namespace namespace + * @param \DateTime|null $created_at created_at * * @return self */ - public function setNamespace($namespace) + public function setCreatedAt($created_at) { - if (is_null($namespace)) { - throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['namespace'] = $namespace; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets stats + * Gets description * - * @return \Aternos\HangarApi\Model\ProjectStats|null + * @return string|null */ - public function getStats() + public function getDescription() { - return $this->container['stats']; + return $this->container['description']; } /** - * Sets stats + * Sets description * - * @param \Aternos\HangarApi\Model\ProjectStats|null $stats stats + * @param string|null $description The short description of the project * * @return self */ - public function setStats($stats) + public function setDescription($description) { - if (is_null($stats)) { - throw new \InvalidArgumentException('non-nullable stats cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['stats'] = $stats; + $this->container['description'] = $description; return $this; } /** - * Gets category + * Gets id * - * @return \Aternos\HangarApi\Model\Category|null + * @return int|null */ - public function getCategory() + public function getId() { - return $this->container['category']; + return $this->container['id']; } /** - * Sets category + * Sets id * - * @param \Aternos\HangarApi\Model\Category|null $category category + * @param int|null $id The internal id of the project * * @return self */ - public function setCategory($category) + public function setId($id) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['category'] = $category; + $this->container['id'] = $id; return $this; } @@ -522,82 +529,109 @@ public function setLastUpdated($last_updated) } /** - * Gets visibility + * Gets name * - * @return \Aternos\HangarApi\Model\Visibility|null + * @return string|null */ - public function getVisibility() + public function getName() { - return $this->container['visibility']; + return $this->container['name']; } /** - * Sets visibility + * Sets name * - * @param \Aternos\HangarApi\Model\Visibility|null $visibility visibility + * @param string|null $name The unique name of the project * * @return self */ - public function setVisibility($visibility) + public function setName($name) { - if (is_null($visibility)) { - throw new \InvalidArgumentException('non-nullable visibility cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['visibility'] = $visibility; + $this->container['name'] = $name; return $this; } /** - * Gets avatar_url + * Gets namespace * - * @return string|null + * @return \Aternos\HangarApi\Model\ProjectNamespace|null */ - public function getAvatarUrl() + public function getNamespace() { - return $this->container['avatar_url']; + return $this->container['namespace']; } /** - * Sets avatar_url + * Sets namespace * - * @param string|null $avatar_url The url to the project's icon + * @param \Aternos\HangarApi\Model\ProjectNamespace|null $namespace The namespace of the project * * @return self */ - public function setAvatarUrl($avatar_url) + public function setNamespace($namespace) { - if (is_null($avatar_url)) { - throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); } - $this->container['avatar_url'] = $avatar_url; + $this->container['namespace'] = $namespace; return $this; } /** - * Gets description + * Gets settings * - * @return string|null + * @return \Aternos\HangarApi\Model\ProjectSettings|null */ - public function getDescription() + public function getSettings() { - return $this->container['description']; + return $this->container['settings']; } /** - * Sets description + * Sets settings * - * @param string|null $description The short description of the project + * @param \Aternos\HangarApi\Model\ProjectSettings|null $settings The settings of the project * * @return self */ - public function setDescription($description) + public function setSettings($settings) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($settings)) { + throw new \InvalidArgumentException('non-nullable settings cannot be null'); } - $this->container['description'] = $description; + $this->container['settings'] = $settings; + + return $this; + } + + /** + * Gets stats + * + * @return \Aternos\HangarApi\Model\ProjectStats|null + */ + public function getStats() + { + return $this->container['stats']; + } + + /** + * Sets stats + * + * @param \Aternos\HangarApi\Model\ProjectStats|null $stats Stats of the project + * + * @return self + */ + public function setStats($stats) + { + if (is_null($stats)) { + throw new \InvalidArgumentException('non-nullable stats cannot be null'); + } + $this->container['stats'] = $stats; return $this; } @@ -615,7 +649,7 @@ public function getUserActions() /** * Sets user_actions * - * @param \Aternos\HangarApi\Model\UserActions|null $user_actions user_actions + * @param \Aternos\HangarApi\Model\UserActions|null $user_actions Information about your interactions with the project * * @return self */ @@ -630,28 +664,28 @@ public function setUserActions($user_actions) } /** - * Gets settings + * Gets visibility * - * @return \Aternos\HangarApi\Model\ProjectSettings|null + * @return \Aternos\HangarApi\Model\Visibility|null */ - public function getSettings() + public function getVisibility() { - return $this->container['settings']; + return $this->container['visibility']; } /** - * Sets settings + * Sets visibility * - * @param \Aternos\HangarApi\Model\ProjectSettings|null $settings settings + * @param \Aternos\HangarApi\Model\Visibility|null $visibility The visibility of the project * * @return self */ - public function setSettings($settings) + public function setVisibility($visibility) { - if (is_null($settings)) { - throw new \InvalidArgumentException('non-nullable settings cannot be null'); + if (is_null($visibility)) { + throw new \InvalidArgumentException('non-nullable visibility cannot be null'); } - $this->container['settings'] = $settings; + $this->container['visibility'] = $visibility; return $this; } diff --git a/lib/Model/ProjectChannel.php b/lib/Model/ProjectChannel.php index 958a6e6..4a9d49e 100644 --- a/lib/Model/ProjectChannel.php +++ b/lib/Model/ProjectChannel.php @@ -57,11 +57,11 @@ class ProjectChannel implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'color' => '\Aternos\HangarApi\Model\Color', 'created_at' => '\DateTime', - 'name' => 'string', 'description' => 'string', - 'color' => '\Aternos\HangarApi\Model\Color', - 'flags' => '\Aternos\HangarApi\Model\ChannelFlag[]' + 'flags' => '\Aternos\HangarApi\Model\ChannelFlag[]', + 'name' => 'string' ]; /** @@ -72,11 +72,11 @@ class ProjectChannel implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'color' => null, 'created_at' => 'date-time', - 'name' => null, 'description' => null, - 'color' => null, - 'flags' => null + 'flags' => null, + 'name' => null ]; /** @@ -85,11 +85,11 @@ class ProjectChannel implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'color' => false, 'created_at' => false, - 'name' => false, 'description' => false, - 'color' => false, - 'flags' => false + 'flags' => false, + 'name' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'color' => 'color', 'created_at' => 'createdAt', - 'name' => 'name', 'description' => 'description', - 'color' => 'color', - 'flags' => 'flags' + 'flags' => 'flags', + 'name' => 'name' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'color' => 'setColor', 'created_at' => 'setCreatedAt', - 'name' => 'setName', 'description' => 'setDescription', - 'color' => 'setColor', - 'flags' => 'setFlags' + 'flags' => 'setFlags', + 'name' => 'setName' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'color' => 'getColor', 'created_at' => 'getCreatedAt', - 'name' => 'getName', 'description' => 'getDescription', - 'color' => 'getColor', - 'flags' => 'getFlags' + 'flags' => 'getFlags', + 'name' => 'getName' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('color', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('color', $data ?? [], null); $this->setIfExists('flags', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); } /** @@ -318,55 +318,55 @@ public function valid() /** - * Gets created_at + * Gets color * - * @return \DateTime|null + * @return \Aternos\HangarApi\Model\Color|null */ - public function getCreatedAt() + public function getColor() { - return $this->container['created_at']; + return $this->container['color']; } /** - * Sets created_at + * Sets color * - * @param \DateTime|null $created_at created_at + * @param \Aternos\HangarApi\Model\Color|null $color color * * @return self */ - public function setCreatedAt($created_at) + public function setColor($color) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($color)) { + throw new \InvalidArgumentException('non-nullable color cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['color'] = $color; return $this; } /** - * Gets name + * Gets created_at * - * @return string|null + * @return \DateTime|null */ - public function getName() + public function getCreatedAt() { - return $this->container['name']; + return $this->container['created_at']; } /** - * Sets name + * Sets created_at * - * @param string|null $name name + * @param \DateTime|null $created_at created_at * * @return self */ - public function setName($name) + public function setCreatedAt($created_at) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['name'] = $name; + $this->container['created_at'] = $created_at; return $this; } @@ -399,57 +399,57 @@ public function setDescription($description) } /** - * Gets color + * Gets flags * - * @return \Aternos\HangarApi\Model\Color|null + * @return \Aternos\HangarApi\Model\ChannelFlag[]|null */ - public function getColor() + public function getFlags() { - return $this->container['color']; + return $this->container['flags']; } /** - * Sets color + * Sets flags * - * @param \Aternos\HangarApi\Model\Color|null $color color + * @param \Aternos\HangarApi\Model\ChannelFlag[]|null $flags flags * * @return self */ - public function setColor($color) + public function setFlags($flags) { - if (is_null($color)) { - throw new \InvalidArgumentException('non-nullable color cannot be null'); + if (is_null($flags)) { + throw new \InvalidArgumentException('non-nullable flags cannot be null'); } - $this->container['color'] = $color; + + + $this->container['flags'] = $flags; return $this; } /** - * Gets flags + * Gets name * - * @return \Aternos\HangarApi\Model\ChannelFlag[]|null + * @return string|null */ - public function getFlags() + public function getName() { - return $this->container['flags']; + return $this->container['name']; } /** - * Sets flags + * Sets name * - * @param \Aternos\HangarApi\Model\ChannelFlag[]|null $flags flags + * @param string|null $name name * * @return self */ - public function setFlags($flags) + public function setName($name) { - if (is_null($flags)) { - throw new \InvalidArgumentException('non-nullable flags cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - - - $this->container['flags'] = $flags; + $this->container['name'] = $name; return $this; } diff --git a/lib/Model/ProjectCompact.php b/lib/Model/ProjectCompact.php index cbd666f..f81c1fb 100644 --- a/lib/Model/ProjectCompact.php +++ b/lib/Model/ProjectCompact.php @@ -57,15 +57,16 @@ class ProjectCompact implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'avatar_url' => 'string', + 'category' => '\Aternos\HangarApi\Model\Category', 'created_at' => '\DateTime', + 'description' => 'string', + 'id' => 'int', + 'last_updated' => '\DateTime', 'name' => 'string', 'namespace' => '\Aternos\HangarApi\Model\ProjectNamespace', 'stats' => '\Aternos\HangarApi\Model\ProjectStats', - 'category' => '\Aternos\HangarApi\Model\Category', - 'last_updated' => '\DateTime', - 'visibility' => '\Aternos\HangarApi\Model\Visibility', - 'avatar_url' => 'string', - 'description' => 'string' + 'visibility' => '\Aternos\HangarApi\Model\Visibility' ]; /** @@ -76,15 +77,16 @@ class ProjectCompact implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'avatar_url' => null, + 'category' => null, 'created_at' => 'date-time', + 'description' => null, + 'id' => 'int64', + 'last_updated' => 'date-time', 'name' => null, 'namespace' => null, 'stats' => null, - 'category' => null, - 'last_updated' => 'date-time', - 'visibility' => null, - 'avatar_url' => null, - 'description' => null + 'visibility' => null ]; /** @@ -93,15 +95,16 @@ class ProjectCompact implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'avatar_url' => false, + 'category' => false, 'created_at' => false, + 'description' => false, + 'id' => false, + 'last_updated' => false, 'name' => false, 'namespace' => false, 'stats' => false, - 'category' => false, - 'last_updated' => false, - 'visibility' => false, - 'avatar_url' => false, - 'description' => false + 'visibility' => false ]; /** @@ -190,15 +193,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'avatar_url' => 'avatarUrl', + 'category' => 'category', 'created_at' => 'createdAt', + 'description' => 'description', + 'id' => 'id', + 'last_updated' => 'lastUpdated', 'name' => 'name', 'namespace' => 'namespace', 'stats' => 'stats', - 'category' => 'category', - 'last_updated' => 'lastUpdated', - 'visibility' => 'visibility', - 'avatar_url' => 'avatarUrl', - 'description' => 'description' + 'visibility' => 'visibility' ]; /** @@ -207,15 +211,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'avatar_url' => 'setAvatarUrl', + 'category' => 'setCategory', 'created_at' => 'setCreatedAt', + 'description' => 'setDescription', + 'id' => 'setId', + 'last_updated' => 'setLastUpdated', 'name' => 'setName', 'namespace' => 'setNamespace', 'stats' => 'setStats', - 'category' => 'setCategory', - 'last_updated' => 'setLastUpdated', - 'visibility' => 'setVisibility', - 'avatar_url' => 'setAvatarUrl', - 'description' => 'setDescription' + 'visibility' => 'setVisibility' ]; /** @@ -224,15 +229,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'avatar_url' => 'getAvatarUrl', + 'category' => 'getCategory', 'created_at' => 'getCreatedAt', + 'description' => 'getDescription', + 'id' => 'getId', + 'last_updated' => 'getLastUpdated', 'name' => 'getName', 'namespace' => 'getNamespace', 'stats' => 'getStats', - 'category' => 'getCategory', - 'last_updated' => 'getLastUpdated', - 'visibility' => 'getVisibility', - 'avatar_url' => 'getAvatarUrl', - 'description' => 'getDescription' + 'visibility' => 'getVisibility' ]; /** @@ -292,15 +298,16 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('avatar_url', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('last_updated', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); $this->setIfExists('namespace', $data ?? [], null); $this->setIfExists('stats', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('last_updated', $data ?? [], null); $this->setIfExists('visibility', $data ?? [], null); - $this->setIfExists('avatar_url', $data ?? [], null); - $this->setIfExists('description', $data ?? [], null); } /** @@ -346,136 +353,136 @@ public function valid() /** - * Gets created_at + * Gets avatar_url * - * @return \DateTime|null + * @return string|null */ - public function getCreatedAt() + public function getAvatarUrl() { - return $this->container['created_at']; + return $this->container['avatar_url']; } /** - * Sets created_at + * Sets avatar_url * - * @param \DateTime|null $created_at created_at + * @param string|null $avatar_url The url to the project's icon * * @return self */ - public function setCreatedAt($created_at) + public function setAvatarUrl($avatar_url) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($avatar_url)) { + throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['avatar_url'] = $avatar_url; return $this; } /** - * Gets name + * Gets category * - * @return string|null + * @return \Aternos\HangarApi\Model\Category|null */ - public function getName() + public function getCategory() { - return $this->container['name']; + return $this->container['category']; } /** - * Sets name + * Sets category * - * @param string|null $name The unique name of the project + * @param \Aternos\HangarApi\Model\Category|null $category The category of the project * * @return self */ - public function setName($name) + public function setCategory($category) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['name'] = $name; + $this->container['category'] = $category; return $this; } /** - * Gets namespace + * Gets created_at * - * @return \Aternos\HangarApi\Model\ProjectNamespace|null + * @return \DateTime|null */ - public function getNamespace() + public function getCreatedAt() { - return $this->container['namespace']; + return $this->container['created_at']; } /** - * Sets namespace + * Sets created_at * - * @param \Aternos\HangarApi\Model\ProjectNamespace|null $namespace namespace + * @param \DateTime|null $created_at created_at * * @return self */ - public function setNamespace($namespace) + public function setCreatedAt($created_at) { - if (is_null($namespace)) { - throw new \InvalidArgumentException('non-nullable namespace cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['namespace'] = $namespace; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets stats + * Gets description * - * @return \Aternos\HangarApi\Model\ProjectStats|null + * @return string|null */ - public function getStats() + public function getDescription() { - return $this->container['stats']; + return $this->container['description']; } /** - * Sets stats + * Sets description * - * @param \Aternos\HangarApi\Model\ProjectStats|null $stats stats + * @param string|null $description The short description of the project * * @return self */ - public function setStats($stats) + public function setDescription($description) { - if (is_null($stats)) { - throw new \InvalidArgumentException('non-nullable stats cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['stats'] = $stats; + $this->container['description'] = $description; return $this; } /** - * Gets category + * Gets id * - * @return \Aternos\HangarApi\Model\Category|null + * @return int|null */ - public function getCategory() + public function getId() { - return $this->container['category']; + return $this->container['id']; } /** - * Sets category + * Sets id * - * @param \Aternos\HangarApi\Model\Category|null $category category + * @param int|null $id The internal id of the project * * @return self */ - public function setCategory($category) + public function setId($id) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['category'] = $category; + $this->container['id'] = $id; return $this; } @@ -508,82 +515,109 @@ public function setLastUpdated($last_updated) } /** - * Gets visibility + * Gets name * - * @return \Aternos\HangarApi\Model\Visibility|null + * @return string|null */ - public function getVisibility() + public function getName() { - return $this->container['visibility']; + return $this->container['name']; } /** - * Sets visibility + * Sets name * - * @param \Aternos\HangarApi\Model\Visibility|null $visibility visibility + * @param string|null $name The unique name of the project * * @return self */ - public function setVisibility($visibility) + public function setName($name) { - if (is_null($visibility)) { - throw new \InvalidArgumentException('non-nullable visibility cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['visibility'] = $visibility; + $this->container['name'] = $name; return $this; } /** - * Gets avatar_url + * Gets namespace * - * @return string|null + * @return \Aternos\HangarApi\Model\ProjectNamespace|null */ - public function getAvatarUrl() + public function getNamespace() { - return $this->container['avatar_url']; + return $this->container['namespace']; } /** - * Sets avatar_url + * Sets namespace * - * @param string|null $avatar_url The url to the project's icon + * @param \Aternos\HangarApi\Model\ProjectNamespace|null $namespace The namespace of the project * * @return self */ - public function setAvatarUrl($avatar_url) + public function setNamespace($namespace) { - if (is_null($avatar_url)) { - throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); + if (is_null($namespace)) { + throw new \InvalidArgumentException('non-nullable namespace cannot be null'); } - $this->container['avatar_url'] = $avatar_url; + $this->container['namespace'] = $namespace; return $this; } /** - * Gets description + * Gets stats * - * @return string|null + * @return \Aternos\HangarApi\Model\ProjectStats|null */ - public function getDescription() + public function getStats() { - return $this->container['description']; + return $this->container['stats']; } /** - * Sets description + * Sets stats * - * @param string|null $description The short description of the project + * @param \Aternos\HangarApi\Model\ProjectStats|null $stats Stats of the project * * @return self */ - public function setDescription($description) + public function setStats($stats) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($stats)) { + throw new \InvalidArgumentException('non-nullable stats cannot be null'); } - $this->container['description'] = $description; + $this->container['stats'] = $stats; + + return $this; + } + + /** + * Gets visibility + * + * @return \Aternos\HangarApi\Model\Visibility|null + */ + public function getVisibility() + { + return $this->container['visibility']; + } + + /** + * Sets visibility + * + * @param \Aternos\HangarApi\Model\Visibility|null $visibility The visibility of the project + * + * @return self + */ + public function setVisibility($visibility) + { + if (is_null($visibility)) { + throw new \InvalidArgumentException('non-nullable visibility cannot be null'); + } + $this->container['visibility'] = $visibility; return $this; } diff --git a/lib/Model/ProjectLicense.php b/lib/Model/ProjectLicense.php index 6a8ce67..68c8ff3 100644 --- a/lib/Model/ProjectLicense.php +++ b/lib/Model/ProjectLicense.php @@ -58,8 +58,8 @@ class ProjectLicense implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'name' => 'string', - 'url' => 'string', - 'type' => 'string' + 'type' => 'string', + 'url' => 'string' ]; /** @@ -71,8 +71,8 @@ class ProjectLicense implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'name' => null, - 'url' => null, - 'type' => null + 'type' => null, + 'url' => null ]; /** @@ -82,8 +82,8 @@ class ProjectLicense implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'name' => false, - 'url' => false, - 'type' => false + 'type' => false, + 'url' => false ]; /** @@ -173,8 +173,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'name' => 'name', - 'url' => 'url', - 'type' => 'type' + 'type' => 'type', + 'url' => 'url' ]; /** @@ -184,8 +184,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'name' => 'setName', - 'url' => 'setUrl', - 'type' => 'setType' + 'type' => 'setType', + 'url' => 'setUrl' ]; /** @@ -195,8 +195,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'name' => 'getName', - 'url' => 'getUrl', - 'type' => 'getType' + 'type' => 'getType', + 'url' => 'getUrl' ]; /** @@ -257,8 +257,8 @@ public function getModelName() public function __construct(array $data = null) { $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('url', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); } /** @@ -331,55 +331,55 @@ public function setName($name) } /** - * Gets url + * Gets type * * @return string|null */ - public function getUrl() + public function getType() { - return $this->container['url']; + return $this->container['type']; } /** - * Sets url + * Sets type * - * @param string|null $url url + * @param string|null $type type * * @return self */ - public function setUrl($url) + public function setType($type) { - if (is_null($url)) { - throw new \InvalidArgumentException('non-nullable url cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['url'] = $url; + $this->container['type'] = $type; return $this; } /** - * Gets type + * Gets url * * @return string|null */ - public function getType() + public function getUrl() { - return $this->container['type']; + return $this->container['url']; } /** - * Sets type + * Sets url * - * @param string|null $type type + * @param string|null $url url * * @return self */ - public function setType($type) + public function setUrl($url) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($url)) { + throw new \InvalidArgumentException('non-nullable url cannot be null'); } - $this->container['type'] = $type; + $this->container['url'] = $url; return $this; } diff --git a/lib/Model/ProjectMember.php b/lib/Model/ProjectMember.php index 209440f..95cf9a1 100644 --- a/lib/Model/ProjectMember.php +++ b/lib/Model/ProjectMember.php @@ -57,8 +57,8 @@ class ProjectMember implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'user' => 'string', - 'roles' => '\Aternos\HangarApi\Model\CompactRole[]' + 'roles' => '\Aternos\HangarApi\Model\CompactRole[]', + 'user' => 'string' ]; /** @@ -69,8 +69,8 @@ class ProjectMember implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'user' => null, - 'roles' => null + 'roles' => null, + 'user' => null ]; /** @@ -79,8 +79,8 @@ class ProjectMember implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'user' => false, - 'roles' => false + 'roles' => false, + 'user' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'user' => 'user', - 'roles' => 'roles' + 'roles' => 'roles', + 'user' => 'user' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'user' => 'setUser', - 'roles' => 'setRoles' + 'roles' => 'setRoles', + 'user' => 'setUser' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'user' => 'getUser', - 'roles' => 'getRoles' + 'roles' => 'getRoles', + 'user' => 'getUser' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('user', $data ?? [], null); $this->setIfExists('roles', $data ?? [], null); + $this->setIfExists('user', $data ?? [], null); } /** @@ -297,55 +297,55 @@ public function valid() /** - * Gets user + * Gets roles * - * @return string|null + * @return \Aternos\HangarApi\Model\CompactRole[]|null */ - public function getUser() + public function getRoles() { - return $this->container['user']; + return $this->container['roles']; } /** - * Sets user + * Sets roles * - * @param string|null $user user + * @param \Aternos\HangarApi\Model\CompactRole[]|null $roles roles * * @return self */ - public function setUser($user) + public function setRoles($roles) { - if (is_null($user)) { - throw new \InvalidArgumentException('non-nullable user cannot be null'); + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); } - $this->container['user'] = $user; + $this->container['roles'] = $roles; return $this; } /** - * Gets roles + * Gets user * - * @return \Aternos\HangarApi\Model\CompactRole[]|null + * @return string|null */ - public function getRoles() + public function getUser() { - return $this->container['roles']; + return $this->container['user']; } /** - * Sets roles + * Sets user * - * @param \Aternos\HangarApi\Model\CompactRole[]|null $roles roles + * @param string|null $user user * * @return self */ - public function setRoles($roles) + public function setUser($user) { - if (is_null($roles)) { - throw new \InvalidArgumentException('non-nullable roles cannot be null'); + if (is_null($user)) { + throw new \InvalidArgumentException('non-nullable user cannot be null'); } - $this->container['roles'] = $roles; + $this->container['user'] = $user; return $this; } diff --git a/lib/Model/ProjectNamespace.php b/lib/Model/ProjectNamespace.php index 0f709c6..21476de 100644 --- a/lib/Model/ProjectNamespace.php +++ b/lib/Model/ProjectNamespace.php @@ -35,7 +35,6 @@ * ProjectNamespace Class Doc Comment * * @category Class - * @description The namespace of the project * @package Aternos\HangarApi * @author OpenAPI Generator team * @link https://openapi-generator.tech diff --git a/lib/Model/ProjectSettings.php b/lib/Model/ProjectSettings.php index c50ea50..269bc51 100644 --- a/lib/Model/ProjectSettings.php +++ b/lib/Model/ProjectSettings.php @@ -35,7 +35,6 @@ * ProjectSettings Class Doc Comment * * @category Class - * @description The settings of the project * @package Aternos\HangarApi * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,12 +57,12 @@ class ProjectSettings implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'links' => '\Aternos\HangarApi\Model\LinkSection[]', - 'tags' => '\Aternos\HangarApi\Model\Tag[]', - 'license' => '\Aternos\HangarApi\Model\ProjectLicense', + 'donation' => '\Aternos\HangarApi\Model\ProjectDonationSettings', 'keywords' => 'string[]', + 'license' => '\Aternos\HangarApi\Model\ProjectLicense', + 'links' => '\Aternos\HangarApi\Model\LinkSection[]', 'sponsors' => 'string', - 'donation' => '\Aternos\HangarApi\Model\ProjectDonationSettings' + 'tags' => '\Aternos\HangarApi\Model\Tag[]' ]; /** @@ -74,12 +73,12 @@ class ProjectSettings implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'links' => null, - 'tags' => null, - 'license' => null, + 'donation' => null, 'keywords' => null, + 'license' => null, + 'links' => null, 'sponsors' => null, - 'donation' => null + 'tags' => null ]; /** @@ -88,12 +87,12 @@ class ProjectSettings implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'links' => false, - 'tags' => false, - 'license' => false, + 'donation' => false, 'keywords' => false, + 'license' => false, + 'links' => false, 'sponsors' => false, - 'donation' => false + 'tags' => false ]; /** @@ -182,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'links' => 'links', - 'tags' => 'tags', - 'license' => 'license', + 'donation' => 'donation', 'keywords' => 'keywords', + 'license' => 'license', + 'links' => 'links', 'sponsors' => 'sponsors', - 'donation' => 'donation' + 'tags' => 'tags' ]; /** @@ -196,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'links' => 'setLinks', - 'tags' => 'setTags', - 'license' => 'setLicense', + 'donation' => 'setDonation', 'keywords' => 'setKeywords', + 'license' => 'setLicense', + 'links' => 'setLinks', 'sponsors' => 'setSponsors', - 'donation' => 'setDonation' + 'tags' => 'setTags' ]; /** @@ -210,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'links' => 'getLinks', - 'tags' => 'getTags', - 'license' => 'getLicense', + 'donation' => 'getDonation', 'keywords' => 'getKeywords', + 'license' => 'getLicense', + 'links' => 'getLinks', 'sponsors' => 'getSponsors', - 'donation' => 'getDonation' + 'tags' => 'getTags' ]; /** @@ -275,12 +274,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('tags', $data ?? [], null); - $this->setIfExists('license', $data ?? [], null); + $this->setIfExists('donation', $data ?? [], null); $this->setIfExists('keywords', $data ?? [], null); + $this->setIfExists('license', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('sponsors', $data ?? [], null); - $this->setIfExists('donation', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); } /** @@ -310,15 +309,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['keywords'] === null) { + $invalidProperties[] = "'keywords' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } if ($this->container['tags'] === null) { $invalidProperties[] = "'tags' can't be null"; } - if ($this->container['keywords'] === null) { - $invalidProperties[] = "'keywords' can't be null"; - } return $invalidProperties; } @@ -335,55 +334,57 @@ public function valid() /** - * Gets links + * Gets donation * - * @return \Aternos\HangarApi\Model\LinkSection[] + * @return \Aternos\HangarApi\Model\ProjectDonationSettings|null + * @deprecated */ - public function getLinks() + public function getDonation() { - return $this->container['links']; + return $this->container['donation']; } /** - * Sets links + * Sets donation * - * @param \Aternos\HangarApi\Model\LinkSection[] $links links + * @param \Aternos\HangarApi\Model\ProjectDonationSettings|null $donation donation * * @return self + * @deprecated */ - public function setLinks($links) + public function setDonation($donation) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($donation)) { + throw new \InvalidArgumentException('non-nullable donation cannot be null'); } - $this->container['links'] = $links; + $this->container['donation'] = $donation; return $this; } /** - * Gets tags + * Gets keywords * - * @return \Aternos\HangarApi\Model\Tag[] + * @return string[] */ - public function getTags() + public function getKeywords() { - return $this->container['tags']; + return $this->container['keywords']; } /** - * Sets tags + * Sets keywords * - * @param \Aternos\HangarApi\Model\Tag[] $tags tags + * @param string[] $keywords keywords * * @return self */ - public function setTags($tags) + public function setKeywords($keywords) { - if (is_null($tags)) { - throw new \InvalidArgumentException('non-nullable tags cannot be null'); + if (is_null($keywords)) { + throw new \InvalidArgumentException('non-nullable keywords cannot be null'); } - $this->container['tags'] = $tags; + $this->container['keywords'] = $keywords; return $this; } @@ -416,28 +417,28 @@ public function setLicense($license) } /** - * Gets keywords + * Gets links * - * @return string[] + * @return \Aternos\HangarApi\Model\LinkSection[] */ - public function getKeywords() + public function getLinks() { - return $this->container['keywords']; + return $this->container['links']; } /** - * Sets keywords + * Sets links * - * @param string[] $keywords keywords + * @param \Aternos\HangarApi\Model\LinkSection[] $links links * * @return self */ - public function setKeywords($keywords) + public function setLinks($links) { - if (is_null($keywords)) { - throw new \InvalidArgumentException('non-nullable keywords cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['keywords'] = $keywords; + $this->container['links'] = $links; return $this; } @@ -470,28 +471,28 @@ public function setSponsors($sponsors) } /** - * Gets donation + * Gets tags * - * @return \Aternos\HangarApi\Model\ProjectDonationSettings|null + * @return \Aternos\HangarApi\Model\Tag[] */ - public function getDonation() + public function getTags() { - return $this->container['donation']; + return $this->container['tags']; } /** - * Sets donation + * Sets tags * - * @param \Aternos\HangarApi\Model\ProjectDonationSettings|null $donation donation + * @param \Aternos\HangarApi\Model\Tag[] $tags tags * * @return self */ - public function setDonation($donation) + public function setTags($tags) { - if (is_null($donation)) { - throw new \InvalidArgumentException('non-nullable donation cannot be null'); + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); } - $this->container['donation'] = $donation; + $this->container['tags'] = $tags; return $this; } diff --git a/lib/Model/ProjectStats.php b/lib/Model/ProjectStats.php index fe3b02e..a411e04 100644 --- a/lib/Model/ProjectStats.php +++ b/lib/Model/ProjectStats.php @@ -35,7 +35,6 @@ * ProjectStats Class Doc Comment * * @category Class - * @description Stats of the project * @package Aternos\HangarApi * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,11 +57,11 @@ class ProjectStats implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'views' => 'int', 'downloads' => 'int', - 'recent_views' => 'int', 'recent_downloads' => 'int', + 'recent_views' => 'int', 'stars' => 'int', + 'views' => 'int', 'watchers' => 'int' ]; @@ -74,11 +73,11 @@ class ProjectStats implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'views' => 'int64', 'downloads' => 'int64', - 'recent_views' => 'int64', 'recent_downloads' => 'int64', + 'recent_views' => 'int64', 'stars' => 'int64', + 'views' => 'int64', 'watchers' => 'int64' ]; @@ -88,11 +87,11 @@ class ProjectStats implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'views' => false, 'downloads' => false, - 'recent_views' => false, 'recent_downloads' => false, + 'recent_views' => false, 'stars' => false, + 'views' => false, 'watchers' => false ]; @@ -182,11 +181,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'views' => 'views', 'downloads' => 'downloads', - 'recent_views' => 'recentViews', 'recent_downloads' => 'recentDownloads', + 'recent_views' => 'recentViews', 'stars' => 'stars', + 'views' => 'views', 'watchers' => 'watchers' ]; @@ -196,11 +195,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'views' => 'setViews', 'downloads' => 'setDownloads', - 'recent_views' => 'setRecentViews', 'recent_downloads' => 'setRecentDownloads', + 'recent_views' => 'setRecentViews', 'stars' => 'setStars', + 'views' => 'setViews', 'watchers' => 'setWatchers' ]; @@ -210,11 +209,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'views' => 'getViews', 'downloads' => 'getDownloads', - 'recent_views' => 'getRecentViews', 'recent_downloads' => 'getRecentDownloads', + 'recent_views' => 'getRecentViews', 'stars' => 'getStars', + 'views' => 'getViews', 'watchers' => 'getWatchers' ]; @@ -275,11 +274,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('views', $data ?? [], null); $this->setIfExists('downloads', $data ?? [], null); - $this->setIfExists('recent_views', $data ?? [], null); $this->setIfExists('recent_downloads', $data ?? [], null); + $this->setIfExists('recent_views', $data ?? [], null); $this->setIfExists('stars', $data ?? [], null); + $this->setIfExists('views', $data ?? [], null); $this->setIfExists('watchers', $data ?? [], null); } @@ -326,55 +325,55 @@ public function valid() /** - * Gets views + * Gets downloads * * @return int|null */ - public function getViews() + public function getDownloads() { - return $this->container['views']; + return $this->container['downloads']; } /** - * Sets views + * Sets downloads * - * @param int|null $views views + * @param int|null $downloads downloads * * @return self */ - public function setViews($views) + public function setDownloads($downloads) { - if (is_null($views)) { - throw new \InvalidArgumentException('non-nullable views cannot be null'); + if (is_null($downloads)) { + throw new \InvalidArgumentException('non-nullable downloads cannot be null'); } - $this->container['views'] = $views; + $this->container['downloads'] = $downloads; return $this; } /** - * Gets downloads + * Gets recent_downloads * * @return int|null */ - public function getDownloads() + public function getRecentDownloads() { - return $this->container['downloads']; + return $this->container['recent_downloads']; } /** - * Sets downloads + * Sets recent_downloads * - * @param int|null $downloads downloads + * @param int|null $recent_downloads recent_downloads * * @return self */ - public function setDownloads($downloads) + public function setRecentDownloads($recent_downloads) { - if (is_null($downloads)) { - throw new \InvalidArgumentException('non-nullable downloads cannot be null'); + if (is_null($recent_downloads)) { + throw new \InvalidArgumentException('non-nullable recent_downloads cannot be null'); } - $this->container['downloads'] = $downloads; + $this->container['recent_downloads'] = $recent_downloads; return $this; } @@ -407,55 +406,55 @@ public function setRecentViews($recent_views) } /** - * Gets recent_downloads + * Gets stars * * @return int|null */ - public function getRecentDownloads() + public function getStars() { - return $this->container['recent_downloads']; + return $this->container['stars']; } /** - * Sets recent_downloads + * Sets stars * - * @param int|null $recent_downloads recent_downloads + * @param int|null $stars stars * * @return self */ - public function setRecentDownloads($recent_downloads) + public function setStars($stars) { - if (is_null($recent_downloads)) { - throw new \InvalidArgumentException('non-nullable recent_downloads cannot be null'); + if (is_null($stars)) { + throw new \InvalidArgumentException('non-nullable stars cannot be null'); } - $this->container['recent_downloads'] = $recent_downloads; + $this->container['stars'] = $stars; return $this; } /** - * Gets stars + * Gets views * * @return int|null */ - public function getStars() + public function getViews() { - return $this->container['stars']; + return $this->container['views']; } /** - * Sets stars + * Sets views * - * @param int|null $stars stars + * @param int|null $views views * * @return self */ - public function setStars($stars) + public function setViews($views) { - if (is_null($stars)) { - throw new \InvalidArgumentException('non-nullable stars cannot be null'); + if (is_null($views)) { + throw new \InvalidArgumentException('non-nullable views cannot be null'); } - $this->container['stars'] = $stars; + $this->container['views'] = $views; return $this; } diff --git a/lib/Model/User.php b/lib/Model/User.php index 8fca3a8..211fd03 100644 --- a/lib/Model/User.php +++ b/lib/Model/User.php @@ -57,16 +57,17 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'avatar_url' => 'string', 'created_at' => '\DateTime', - 'name' => 'string', - 'tagline' => 'string', - 'roles' => 'int[]', - 'project_count' => 'int', + 'id' => 'int', + 'is_organization' => 'bool', 'locked' => 'bool', + 'name' => 'string', 'name_history' => '\Aternos\HangarApi\Model\UserNameChange[]', - 'avatar_url' => 'string', + 'project_count' => 'int', + 'roles' => 'int[]', 'socials' => 'object', - 'is_organization' => 'bool' + 'tagline' => 'string' ]; /** @@ -77,16 +78,17 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'avatar_url' => null, 'created_at' => 'date-time', - 'name' => null, - 'tagline' => null, - 'roles' => 'int64', - 'project_count' => 'int64', + 'id' => 'int64', + 'is_organization' => null, 'locked' => null, + 'name' => null, 'name_history' => null, - 'avatar_url' => null, + 'project_count' => 'int64', + 'roles' => 'int64', 'socials' => null, - 'is_organization' => null + 'tagline' => null ]; /** @@ -95,16 +97,17 @@ class User implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'avatar_url' => false, 'created_at' => false, - 'name' => false, - 'tagline' => false, - 'roles' => false, - 'project_count' => false, + 'id' => false, + 'is_organization' => false, 'locked' => false, + 'name' => false, 'name_history' => false, - 'avatar_url' => false, + 'project_count' => false, + 'roles' => false, 'socials' => false, - 'is_organization' => false + 'tagline' => false ]; /** @@ -193,16 +196,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'avatar_url' => 'avatarUrl', 'created_at' => 'createdAt', - 'name' => 'name', - 'tagline' => 'tagline', - 'roles' => 'roles', - 'project_count' => 'projectCount', + 'id' => 'id', + 'is_organization' => 'isOrganization', 'locked' => 'locked', + 'name' => 'name', 'name_history' => 'nameHistory', - 'avatar_url' => 'avatarUrl', + 'project_count' => 'projectCount', + 'roles' => 'roles', 'socials' => 'socials', - 'is_organization' => 'isOrganization' + 'tagline' => 'tagline' ]; /** @@ -211,16 +215,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'avatar_url' => 'setAvatarUrl', 'created_at' => 'setCreatedAt', - 'name' => 'setName', - 'tagline' => 'setTagline', - 'roles' => 'setRoles', - 'project_count' => 'setProjectCount', + 'id' => 'setId', + 'is_organization' => 'setIsOrganization', 'locked' => 'setLocked', + 'name' => 'setName', 'name_history' => 'setNameHistory', - 'avatar_url' => 'setAvatarUrl', + 'project_count' => 'setProjectCount', + 'roles' => 'setRoles', 'socials' => 'setSocials', - 'is_organization' => 'setIsOrganization' + 'tagline' => 'setTagline' ]; /** @@ -229,16 +234,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'avatar_url' => 'getAvatarUrl', 'created_at' => 'getCreatedAt', - 'name' => 'getName', - 'tagline' => 'getTagline', - 'roles' => 'getRoles', - 'project_count' => 'getProjectCount', + 'id' => 'getId', + 'is_organization' => 'getIsOrganization', 'locked' => 'getLocked', + 'name' => 'getName', 'name_history' => 'getNameHistory', - 'avatar_url' => 'getAvatarUrl', + 'project_count' => 'getProjectCount', + 'roles' => 'getRoles', 'socials' => 'getSocials', - 'is_organization' => 'getIsOrganization' + 'tagline' => 'getTagline' ]; /** @@ -298,16 +304,17 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('avatar_url', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('tagline', $data ?? [], null); - $this->setIfExists('roles', $data ?? [], null); - $this->setIfExists('project_count', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('is_organization', $data ?? [], null); $this->setIfExists('locked', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('name_history', $data ?? [], null); - $this->setIfExists('avatar_url', $data ?? [], null); + $this->setIfExists('project_count', $data ?? [], null); + $this->setIfExists('roles', $data ?? [], null); $this->setIfExists('socials', $data ?? [], null); - $this->setIfExists('is_organization', $data ?? [], null); + $this->setIfExists('tagline', $data ?? [], null); } /** @@ -353,163 +360,163 @@ public function valid() /** - * Gets created_at + * Gets avatar_url * - * @return \DateTime|null + * @return string|null */ - public function getCreatedAt() + public function getAvatarUrl() { - return $this->container['created_at']; + return $this->container['avatar_url']; } /** - * Sets created_at + * Sets avatar_url * - * @param \DateTime|null $created_at created_at + * @param string|null $avatar_url avatar_url * * @return self */ - public function setCreatedAt($created_at) + public function setAvatarUrl($avatar_url) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($avatar_url)) { + throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['avatar_url'] = $avatar_url; return $this; } /** - * Gets name + * Gets created_at * - * @return string|null + * @return \DateTime|null */ - public function getName() + public function getCreatedAt() { - return $this->container['name']; + return $this->container['created_at']; } /** - * Sets name + * Sets created_at * - * @param string|null $name name + * @param \DateTime|null $created_at created_at * * @return self */ - public function setName($name) + public function setCreatedAt($created_at) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['name'] = $name; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets tagline + * Gets id * - * @return string|null + * @return int|null */ - public function getTagline() + public function getId() { - return $this->container['tagline']; + return $this->container['id']; } /** - * Sets tagline + * Sets id * - * @param string|null $tagline tagline + * @param int|null $id id * * @return self */ - public function setTagline($tagline) + public function setId($id) { - if (is_null($tagline)) { - throw new \InvalidArgumentException('non-nullable tagline cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['tagline'] = $tagline; + $this->container['id'] = $id; return $this; } /** - * Gets roles + * Gets is_organization * - * @return int[]|null + * @return bool|null */ - public function getRoles() + public function getIsOrganization() { - return $this->container['roles']; + return $this->container['is_organization']; } /** - * Sets roles + * Sets is_organization * - * @param int[]|null $roles roles + * @param bool|null $is_organization is_organization * * @return self */ - public function setRoles($roles) + public function setIsOrganization($is_organization) { - if (is_null($roles)) { - throw new \InvalidArgumentException('non-nullable roles cannot be null'); + if (is_null($is_organization)) { + throw new \InvalidArgumentException('non-nullable is_organization cannot be null'); } - $this->container['roles'] = $roles; + $this->container['is_organization'] = $is_organization; return $this; } /** - * Gets project_count + * Gets locked * - * @return int|null + * @return bool|null */ - public function getProjectCount() + public function getLocked() { - return $this->container['project_count']; + return $this->container['locked']; } /** - * Sets project_count + * Sets locked * - * @param int|null $project_count project_count + * @param bool|null $locked locked * * @return self */ - public function setProjectCount($project_count) + public function setLocked($locked) { - if (is_null($project_count)) { - throw new \InvalidArgumentException('non-nullable project_count cannot be null'); + if (is_null($locked)) { + throw new \InvalidArgumentException('non-nullable locked cannot be null'); } - $this->container['project_count'] = $project_count; + $this->container['locked'] = $locked; return $this; } /** - * Gets locked + * Gets name * - * @return bool|null + * @return string|null */ - public function getLocked() + public function getName() { - return $this->container['locked']; + return $this->container['name']; } /** - * Sets locked + * Sets name * - * @param bool|null $locked locked + * @param string|null $name name * * @return self */ - public function setLocked($locked) + public function setName($name) { - if (is_null($locked)) { - throw new \InvalidArgumentException('non-nullable locked cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['locked'] = $locked; + $this->container['name'] = $name; return $this; } @@ -542,28 +549,55 @@ public function setNameHistory($name_history) } /** - * Gets avatar_url + * Gets project_count * - * @return string|null + * @return int|null */ - public function getAvatarUrl() + public function getProjectCount() { - return $this->container['avatar_url']; + return $this->container['project_count']; } /** - * Sets avatar_url + * Sets project_count * - * @param string|null $avatar_url avatar_url + * @param int|null $project_count project_count * * @return self */ - public function setAvatarUrl($avatar_url) + public function setProjectCount($project_count) { - if (is_null($avatar_url)) { - throw new \InvalidArgumentException('non-nullable avatar_url cannot be null'); + if (is_null($project_count)) { + throw new \InvalidArgumentException('non-nullable project_count cannot be null'); } - $this->container['avatar_url'] = $avatar_url; + $this->container['project_count'] = $project_count; + + return $this; + } + + /** + * Gets roles + * + * @return int[]|null + */ + public function getRoles() + { + return $this->container['roles']; + } + + /** + * Sets roles + * + * @param int[]|null $roles roles + * + * @return self + */ + public function setRoles($roles) + { + if (is_null($roles)) { + throw new \InvalidArgumentException('non-nullable roles cannot be null'); + } + $this->container['roles'] = $roles; return $this; } @@ -596,28 +630,28 @@ public function setSocials($socials) } /** - * Gets is_organization + * Gets tagline * - * @return bool|null + * @return string|null */ - public function getIsOrganization() + public function getTagline() { - return $this->container['is_organization']; + return $this->container['tagline']; } /** - * Sets is_organization + * Sets tagline * - * @param bool|null $is_organization is_organization + * @param string|null $tagline tagline * * @return self */ - public function setIsOrganization($is_organization) + public function setTagline($tagline) { - if (is_null($is_organization)) { - throw new \InvalidArgumentException('non-nullable is_organization cannot be null'); + if (is_null($tagline)) { + throw new \InvalidArgumentException('non-nullable tagline cannot be null'); } - $this->container['is_organization'] = $is_organization; + $this->container['tagline'] = $tagline; return $this; } diff --git a/lib/Model/UserActions.php b/lib/Model/UserActions.php index 8d8f1f7..3136003 100644 --- a/lib/Model/UserActions.php +++ b/lib/Model/UserActions.php @@ -35,7 +35,6 @@ * UserActions Class Doc Comment * * @category Class - * @description Information about your interactions with the project * @package Aternos\HangarApi * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,9 +57,9 @@ class UserActions implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'flagged' => 'bool', 'starred' => 'bool', - 'watching' => 'bool', - 'flagged' => 'bool' + 'watching' => 'bool' ]; /** @@ -71,9 +70,9 @@ class UserActions implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'flagged' => null, 'starred' => null, - 'watching' => null, - 'flagged' => null + 'watching' => null ]; /** @@ -82,9 +81,9 @@ class UserActions implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'flagged' => false, 'starred' => false, - 'watching' => false, - 'flagged' => false + 'watching' => false ]; /** @@ -173,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'flagged' => 'flagged', 'starred' => 'starred', - 'watching' => 'watching', - 'flagged' => 'flagged' + 'watching' => 'watching' ]; /** @@ -184,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'flagged' => 'setFlagged', 'starred' => 'setStarred', - 'watching' => 'setWatching', - 'flagged' => 'setFlagged' + 'watching' => 'setWatching' ]; /** @@ -195,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'flagged' => 'getFlagged', 'starred' => 'getStarred', - 'watching' => 'getWatching', - 'flagged' => 'getFlagged' + 'watching' => 'getWatching' ]; /** @@ -257,9 +256,9 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('flagged', $data ?? [], null); $this->setIfExists('starred', $data ?? [], null); $this->setIfExists('watching', $data ?? [], null); - $this->setIfExists('flagged', $data ?? [], null); } /** @@ -305,82 +304,82 @@ public function valid() /** - * Gets starred + * Gets flagged * * @return bool|null */ - public function getStarred() + public function getFlagged() { - return $this->container['starred']; + return $this->container['flagged']; } /** - * Sets starred + * Sets flagged * - * @param bool|null $starred starred + * @param bool|null $flagged flagged * * @return self */ - public function setStarred($starred) + public function setFlagged($flagged) { - if (is_null($starred)) { - throw new \InvalidArgumentException('non-nullable starred cannot be null'); + if (is_null($flagged)) { + throw new \InvalidArgumentException('non-nullable flagged cannot be null'); } - $this->container['starred'] = $starred; + $this->container['flagged'] = $flagged; return $this; } /** - * Gets watching + * Gets starred * * @return bool|null */ - public function getWatching() + public function getStarred() { - return $this->container['watching']; + return $this->container['starred']; } /** - * Sets watching + * Sets starred * - * @param bool|null $watching watching + * @param bool|null $starred starred * * @return self */ - public function setWatching($watching) + public function setStarred($starred) { - if (is_null($watching)) { - throw new \InvalidArgumentException('non-nullable watching cannot be null'); + if (is_null($starred)) { + throw new \InvalidArgumentException('non-nullable starred cannot be null'); } - $this->container['watching'] = $watching; + $this->container['starred'] = $starred; return $this; } /** - * Gets flagged + * Gets watching * * @return bool|null */ - public function getFlagged() + public function getWatching() { - return $this->container['flagged']; + return $this->container['watching']; } /** - * Sets flagged + * Sets watching * - * @param bool|null $flagged flagged + * @param bool|null $watching watching * * @return self */ - public function setFlagged($flagged) + public function setWatching($watching) { - if (is_null($flagged)) { - throw new \InvalidArgumentException('non-nullable flagged cannot be null'); + if (is_null($watching)) { + throw new \InvalidArgumentException('non-nullable watching cannot be null'); } - $this->container['flagged'] = $flagged; + $this->container['watching'] = $watching; return $this; } diff --git a/lib/Model/UserNameChange.php b/lib/Model/UserNameChange.php index 773aabc..3d19b8b 100644 --- a/lib/Model/UserNameChange.php +++ b/lib/Model/UserNameChange.php @@ -57,9 +57,9 @@ class UserNameChange implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'old_name' => 'string', + 'date' => '\DateTime', 'new_name' => 'string', - 'date' => '\DateTime' + 'old_name' => 'string' ]; /** @@ -70,9 +70,9 @@ class UserNameChange implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'old_name' => null, + 'date' => 'date-time', 'new_name' => null, - 'date' => 'date-time' + 'old_name' => null ]; /** @@ -81,9 +81,9 @@ class UserNameChange implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'old_name' => false, + 'date' => false, 'new_name' => false, - 'date' => false + 'old_name' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'old_name' => 'oldName', + 'date' => 'date', 'new_name' => 'newName', - 'date' => 'date' + 'old_name' => 'oldName' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'old_name' => 'setOldName', + 'date' => 'setDate', 'new_name' => 'setNewName', - 'date' => 'setDate' + 'old_name' => 'setOldName' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'old_name' => 'getOldName', + 'date' => 'getDate', 'new_name' => 'getNewName', - 'date' => 'getDate' + 'old_name' => 'getOldName' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('old_name', $data ?? [], null); - $this->setIfExists('new_name', $data ?? [], null); $this->setIfExists('date', $data ?? [], null); + $this->setIfExists('new_name', $data ?? [], null); + $this->setIfExists('old_name', $data ?? [], null); } /** @@ -304,28 +304,28 @@ public function valid() /** - * Gets old_name + * Gets date * - * @return string|null + * @return \DateTime|null */ - public function getOldName() + public function getDate() { - return $this->container['old_name']; + return $this->container['date']; } /** - * Sets old_name + * Sets date * - * @param string|null $old_name old_name + * @param \DateTime|null $date date * * @return self */ - public function setOldName($old_name) + public function setDate($date) { - if (is_null($old_name)) { - throw new \InvalidArgumentException('non-nullable old_name cannot be null'); + if (is_null($date)) { + throw new \InvalidArgumentException('non-nullable date cannot be null'); } - $this->container['old_name'] = $old_name; + $this->container['date'] = $date; return $this; } @@ -358,28 +358,28 @@ public function setNewName($new_name) } /** - * Gets date + * Gets old_name * - * @return \DateTime|null + * @return string|null */ - public function getDate() + public function getOldName() { - return $this->container['date']; + return $this->container['old_name']; } /** - * Sets date + * Sets old_name * - * @param \DateTime|null $date date + * @param string|null $old_name old_name * * @return self */ - public function setDate($date) + public function setOldName($old_name) { - if (is_null($date)) { - throw new \InvalidArgumentException('non-nullable date cannot be null'); + if (is_null($old_name)) { + throw new \InvalidArgumentException('non-nullable old_name cannot be null'); } - $this->container['date'] = $date; + $this->container['old_name'] = $old_name; return $this; } diff --git a/lib/Model/UserPermissions.php b/lib/Model/UserPermissions.php index 7d58c33..843c1b0 100644 --- a/lib/Model/UserPermissions.php +++ b/lib/Model/UserPermissions.php @@ -57,9 +57,9 @@ class UserPermissions implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'type' => '\Aternos\HangarApi\Model\PermissionType', 'permission_bin_string' => 'string', - 'permissions' => '\Aternos\HangarApi\Model\NamedPermission[]' + 'permissions' => '\Aternos\HangarApi\Model\NamedPermission[]', + 'type' => '\Aternos\HangarApi\Model\PermissionType' ]; /** @@ -70,9 +70,9 @@ class UserPermissions implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, 'permission_bin_string' => null, - 'permissions' => null + 'permissions' => null, + 'type' => null ]; /** @@ -81,9 +81,9 @@ class UserPermissions implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, 'permission_bin_string' => false, - 'permissions' => false + 'permissions' => false, + 'type' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', 'permission_bin_string' => 'permissionBinString', - 'permissions' => 'permissions' + 'permissions' => 'permissions', + 'type' => 'type' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', 'permission_bin_string' => 'setPermissionBinString', - 'permissions' => 'setPermissions' + 'permissions' => 'setPermissions', + 'type' => 'setType' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', 'permission_bin_string' => 'getPermissionBinString', - 'permissions' => 'getPermissions' + 'permissions' => 'getPermissions', + 'type' => 'getType' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('type', $data ?? [], null); $this->setIfExists('permission_bin_string', $data ?? [], null); $this->setIfExists('permissions', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); } /** @@ -303,33 +303,6 @@ public function valid() } - /** - * Gets type - * - * @return \Aternos\HangarApi\Model\PermissionType|null - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param \Aternos\HangarApi\Model\PermissionType|null $type type - * - * @return self - */ - public function setType($type) - { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $this->container['type'] = $type; - - return $this; - } - /** * Gets permission_bin_string * @@ -383,6 +356,33 @@ public function setPermissions($permissions) return $this; } + + /** + * Gets type + * + * @return \Aternos\HangarApi\Model\PermissionType|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param \Aternos\HangarApi\Model\PermissionType|null $type type + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/Version.php b/lib/Model/Version.php index 898581a..74c0341 100644 --- a/lib/Model/Version.php +++ b/lib/Model/Version.php @@ -57,19 +57,20 @@ class Version implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', - 'name' => 'string', - 'visibility' => '\Aternos\HangarApi\Model\Visibility', - 'description' => 'string', - 'stats' => '\Aternos\HangarApi\Model\VersionStats', 'author' => 'string', - 'review_state' => '\Aternos\HangarApi\Model\ReviewState', 'channel' => '\Aternos\HangarApi\Model\ProjectChannel', - 'pinned_status' => '\Aternos\HangarApi\Model\PinnedStatus', + 'created_at' => '\DateTime', + 'description' => 'string', 'downloads' => 'array', - 'plugin_dependencies' => 'array', + 'id' => 'int', + 'name' => 'string', + 'pinned_status' => '\Aternos\HangarApi\Model\PinnedStatus', 'platform_dependencies' => 'array', - 'platform_dependencies_formatted' => 'array' + 'platform_dependencies_formatted' => 'array', + 'plugin_dependencies' => 'array', + 'review_state' => '\Aternos\HangarApi\Model\ReviewState', + 'stats' => '\Aternos\HangarApi\Model\VersionStats', + 'visibility' => '\Aternos\HangarApi\Model\Visibility' ]; /** @@ -80,19 +81,20 @@ class Version implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', - 'name' => null, - 'visibility' => null, - 'description' => null, - 'stats' => null, 'author' => null, - 'review_state' => null, 'channel' => null, - 'pinned_status' => null, + 'created_at' => 'date-time', + 'description' => null, 'downloads' => null, - 'plugin_dependencies' => null, + 'id' => 'int64', + 'name' => null, + 'pinned_status' => null, 'platform_dependencies' => null, - 'platform_dependencies_formatted' => null + 'platform_dependencies_formatted' => null, + 'plugin_dependencies' => null, + 'review_state' => null, + 'stats' => null, + 'visibility' => null ]; /** @@ -101,19 +103,20 @@ class Version implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, - 'name' => false, - 'visibility' => false, - 'description' => false, - 'stats' => false, 'author' => false, - 'review_state' => false, 'channel' => false, - 'pinned_status' => false, + 'created_at' => false, + 'description' => false, 'downloads' => false, - 'plugin_dependencies' => false, + 'id' => false, + 'name' => false, + 'pinned_status' => false, 'platform_dependencies' => false, - 'platform_dependencies_formatted' => false + 'platform_dependencies_formatted' => false, + 'plugin_dependencies' => false, + 'review_state' => false, + 'stats' => false, + 'visibility' => false ]; /** @@ -202,19 +205,20 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', - 'name' => 'name', - 'visibility' => 'visibility', - 'description' => 'description', - 'stats' => 'stats', 'author' => 'author', - 'review_state' => 'reviewState', 'channel' => 'channel', - 'pinned_status' => 'pinnedStatus', + 'created_at' => 'createdAt', + 'description' => 'description', 'downloads' => 'downloads', - 'plugin_dependencies' => 'pluginDependencies', + 'id' => 'id', + 'name' => 'name', + 'pinned_status' => 'pinnedStatus', 'platform_dependencies' => 'platformDependencies', - 'platform_dependencies_formatted' => 'platformDependenciesFormatted' + 'platform_dependencies_formatted' => 'platformDependenciesFormatted', + 'plugin_dependencies' => 'pluginDependencies', + 'review_state' => 'reviewState', + 'stats' => 'stats', + 'visibility' => 'visibility' ]; /** @@ -223,19 +227,20 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', - 'name' => 'setName', - 'visibility' => 'setVisibility', - 'description' => 'setDescription', - 'stats' => 'setStats', 'author' => 'setAuthor', - 'review_state' => 'setReviewState', 'channel' => 'setChannel', - 'pinned_status' => 'setPinnedStatus', + 'created_at' => 'setCreatedAt', + 'description' => 'setDescription', 'downloads' => 'setDownloads', - 'plugin_dependencies' => 'setPluginDependencies', + 'id' => 'setId', + 'name' => 'setName', + 'pinned_status' => 'setPinnedStatus', 'platform_dependencies' => 'setPlatformDependencies', - 'platform_dependencies_formatted' => 'setPlatformDependenciesFormatted' + 'platform_dependencies_formatted' => 'setPlatformDependenciesFormatted', + 'plugin_dependencies' => 'setPluginDependencies', + 'review_state' => 'setReviewState', + 'stats' => 'setStats', + 'visibility' => 'setVisibility' ]; /** @@ -244,19 +249,20 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', - 'name' => 'getName', - 'visibility' => 'getVisibility', - 'description' => 'getDescription', - 'stats' => 'getStats', 'author' => 'getAuthor', - 'review_state' => 'getReviewState', 'channel' => 'getChannel', - 'pinned_status' => 'getPinnedStatus', + 'created_at' => 'getCreatedAt', + 'description' => 'getDescription', 'downloads' => 'getDownloads', - 'plugin_dependencies' => 'getPluginDependencies', + 'id' => 'getId', + 'name' => 'getName', + 'pinned_status' => 'getPinnedStatus', 'platform_dependencies' => 'getPlatformDependencies', - 'platform_dependencies_formatted' => 'getPlatformDependenciesFormatted' + 'platform_dependencies_formatted' => 'getPlatformDependenciesFormatted', + 'plugin_dependencies' => 'getPluginDependencies', + 'review_state' => 'getReviewState', + 'stats' => 'getStats', + 'visibility' => 'getVisibility' ]; /** @@ -316,19 +322,20 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('visibility', $data ?? [], null); - $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('stats', $data ?? [], null); $this->setIfExists('author', $data ?? [], null); - $this->setIfExists('review_state', $data ?? [], null); $this->setIfExists('channel', $data ?? [], null); - $this->setIfExists('pinned_status', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('downloads', $data ?? [], null); - $this->setIfExists('plugin_dependencies', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('pinned_status', $data ?? [], null); $this->setIfExists('platform_dependencies', $data ?? [], null); $this->setIfExists('platform_dependencies_formatted', $data ?? [], null); + $this->setIfExists('plugin_dependencies', $data ?? [], null); + $this->setIfExists('review_state', $data ?? [], null); + $this->setIfExists('stats', $data ?? [], null); + $this->setIfExists('visibility', $data ?? [], null); } /** @@ -374,82 +381,82 @@ public function valid() /** - * Gets created_at + * Gets author * - * @return \DateTime|null + * @return string|null */ - public function getCreatedAt() + public function getAuthor() { - return $this->container['created_at']; + return $this->container['author']; } /** - * Sets created_at + * Sets author * - * @param \DateTime|null $created_at created_at + * @param string|null $author author * * @return self */ - public function setCreatedAt($created_at) + public function setAuthor($author) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($author)) { + throw new \InvalidArgumentException('non-nullable author cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['author'] = $author; return $this; } /** - * Gets name + * Gets channel * - * @return string|null + * @return \Aternos\HangarApi\Model\ProjectChannel|null */ - public function getName() + public function getChannel() { - return $this->container['name']; + return $this->container['channel']; } /** - * Sets name + * Sets channel * - * @param string|null $name name + * @param \Aternos\HangarApi\Model\ProjectChannel|null $channel channel * * @return self */ - public function setName($name) + public function setChannel($channel) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); } - $this->container['name'] = $name; + $this->container['channel'] = $channel; return $this; } /** - * Gets visibility + * Gets created_at * - * @return \Aternos\HangarApi\Model\Visibility|null + * @return \DateTime|null */ - public function getVisibility() + public function getCreatedAt() { - return $this->container['visibility']; + return $this->container['created_at']; } /** - * Sets visibility + * Sets created_at * - * @param \Aternos\HangarApi\Model\Visibility|null $visibility visibility + * @param \DateTime|null $created_at created_at * * @return self */ - public function setVisibility($visibility) + public function setCreatedAt($created_at) { - if (is_null($visibility)) { - throw new \InvalidArgumentException('non-nullable visibility cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['visibility'] = $visibility; + $this->container['created_at'] = $created_at; return $this; } @@ -482,163 +489,163 @@ public function setDescription($description) } /** - * Gets stats + * Gets downloads * - * @return \Aternos\HangarApi\Model\VersionStats|null + * @return array|null */ - public function getStats() + public function getDownloads() { - return $this->container['stats']; + return $this->container['downloads']; } /** - * Sets stats + * Sets downloads * - * @param \Aternos\HangarApi\Model\VersionStats|null $stats stats + * @param array|null $downloads downloads * * @return self */ - public function setStats($stats) + public function setDownloads($downloads) { - if (is_null($stats)) { - throw new \InvalidArgumentException('non-nullable stats cannot be null'); + if (is_null($downloads)) { + throw new \InvalidArgumentException('non-nullable downloads cannot be null'); } - $this->container['stats'] = $stats; + $this->container['downloads'] = $downloads; return $this; } /** - * Gets author + * Gets id * - * @return string|null + * @return int|null */ - public function getAuthor() + public function getId() { - return $this->container['author']; + return $this->container['id']; } /** - * Sets author + * Sets id * - * @param string|null $author author + * @param int|null $id id * * @return self */ - public function setAuthor($author) + public function setId($id) { - if (is_null($author)) { - throw new \InvalidArgumentException('non-nullable author cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['author'] = $author; + $this->container['id'] = $id; return $this; } /** - * Gets review_state + * Gets name * - * @return \Aternos\HangarApi\Model\ReviewState|null + * @return string|null */ - public function getReviewState() + public function getName() { - return $this->container['review_state']; + return $this->container['name']; } /** - * Sets review_state + * Sets name * - * @param \Aternos\HangarApi\Model\ReviewState|null $review_state review_state + * @param string|null $name name * * @return self */ - public function setReviewState($review_state) + public function setName($name) { - if (is_null($review_state)) { - throw new \InvalidArgumentException('non-nullable review_state cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['review_state'] = $review_state; + $this->container['name'] = $name; return $this; } /** - * Gets channel + * Gets pinned_status * - * @return \Aternos\HangarApi\Model\ProjectChannel|null + * @return \Aternos\HangarApi\Model\PinnedStatus|null */ - public function getChannel() + public function getPinnedStatus() { - return $this->container['channel']; + return $this->container['pinned_status']; } /** - * Sets channel + * Sets pinned_status * - * @param \Aternos\HangarApi\Model\ProjectChannel|null $channel channel + * @param \Aternos\HangarApi\Model\PinnedStatus|null $pinned_status pinned_status * * @return self */ - public function setChannel($channel) + public function setPinnedStatus($pinned_status) { - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); + if (is_null($pinned_status)) { + throw new \InvalidArgumentException('non-nullable pinned_status cannot be null'); } - $this->container['channel'] = $channel; + $this->container['pinned_status'] = $pinned_status; return $this; } /** - * Gets pinned_status + * Gets platform_dependencies * - * @return \Aternos\HangarApi\Model\PinnedStatus|null + * @return array|null */ - public function getPinnedStatus() + public function getPlatformDependencies() { - return $this->container['pinned_status']; + return $this->container['platform_dependencies']; } /** - * Sets pinned_status + * Sets platform_dependencies * - * @param \Aternos\HangarApi\Model\PinnedStatus|null $pinned_status pinned_status + * @param array|null $platform_dependencies platform_dependencies * * @return self */ - public function setPinnedStatus($pinned_status) + public function setPlatformDependencies($platform_dependencies) { - if (is_null($pinned_status)) { - throw new \InvalidArgumentException('non-nullable pinned_status cannot be null'); + if (is_null($platform_dependencies)) { + throw new \InvalidArgumentException('non-nullable platform_dependencies cannot be null'); } - $this->container['pinned_status'] = $pinned_status; + $this->container['platform_dependencies'] = $platform_dependencies; return $this; } /** - * Gets downloads + * Gets platform_dependencies_formatted * - * @return array|null + * @return array|null */ - public function getDownloads() + public function getPlatformDependenciesFormatted() { - return $this->container['downloads']; + return $this->container['platform_dependencies_formatted']; } /** - * Sets downloads + * Sets platform_dependencies_formatted * - * @param array|null $downloads downloads + * @param array|null $platform_dependencies_formatted platform_dependencies_formatted * * @return self */ - public function setDownloads($downloads) + public function setPlatformDependenciesFormatted($platform_dependencies_formatted) { - if (is_null($downloads)) { - throw new \InvalidArgumentException('non-nullable downloads cannot be null'); + if (is_null($platform_dependencies_formatted)) { + throw new \InvalidArgumentException('non-nullable platform_dependencies_formatted cannot be null'); } - $this->container['downloads'] = $downloads; + $this->container['platform_dependencies_formatted'] = $platform_dependencies_formatted; return $this; } @@ -671,55 +678,82 @@ public function setPluginDependencies($plugin_dependencies) } /** - * Gets platform_dependencies + * Gets review_state * - * @return array|null + * @return \Aternos\HangarApi\Model\ReviewState|null */ - public function getPlatformDependencies() + public function getReviewState() { - return $this->container['platform_dependencies']; + return $this->container['review_state']; } /** - * Sets platform_dependencies + * Sets review_state * - * @param array|null $platform_dependencies platform_dependencies + * @param \Aternos\HangarApi\Model\ReviewState|null $review_state review_state * * @return self */ - public function setPlatformDependencies($platform_dependencies) + public function setReviewState($review_state) { - if (is_null($platform_dependencies)) { - throw new \InvalidArgumentException('non-nullable platform_dependencies cannot be null'); + if (is_null($review_state)) { + throw new \InvalidArgumentException('non-nullable review_state cannot be null'); } - $this->container['platform_dependencies'] = $platform_dependencies; + $this->container['review_state'] = $review_state; return $this; } /** - * Gets platform_dependencies_formatted + * Gets stats * - * @return array|null + * @return \Aternos\HangarApi\Model\VersionStats|null */ - public function getPlatformDependenciesFormatted() + public function getStats() { - return $this->container['platform_dependencies_formatted']; + return $this->container['stats']; } /** - * Sets platform_dependencies_formatted + * Sets stats * - * @param array|null $platform_dependencies_formatted platform_dependencies_formatted + * @param \Aternos\HangarApi\Model\VersionStats|null $stats stats * * @return self */ - public function setPlatformDependenciesFormatted($platform_dependencies_formatted) + public function setStats($stats) { - if (is_null($platform_dependencies_formatted)) { - throw new \InvalidArgumentException('non-nullable platform_dependencies_formatted cannot be null'); + if (is_null($stats)) { + throw new \InvalidArgumentException('non-nullable stats cannot be null'); } - $this->container['platform_dependencies_formatted'] = $platform_dependencies_formatted; + $this->container['stats'] = $stats; + + return $this; + } + + /** + * Gets visibility + * + * @return \Aternos\HangarApi\Model\Visibility|null + */ + public function getVisibility() + { + return $this->container['visibility']; + } + + /** + * Sets visibility + * + * @param \Aternos\HangarApi\Model\Visibility|null $visibility visibility + * + * @return self + */ + public function setVisibility($visibility) + { + if (is_null($visibility)) { + throw new \InvalidArgumentException('non-nullable visibility cannot be null'); + } + $this->container['visibility'] = $visibility; return $this; } diff --git a/lib/Model/VersionStats.php b/lib/Model/VersionStats.php index 03a116f..467ca00 100644 --- a/lib/Model/VersionStats.php +++ b/lib/Model/VersionStats.php @@ -57,8 +57,8 @@ class VersionStats implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'total_downloads' => 'int', - 'platform_downloads' => 'array' + 'platform_downloads' => 'array', + 'total_downloads' => 'int' ]; /** @@ -69,8 +69,8 @@ class VersionStats implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'total_downloads' => 'int64', - 'platform_downloads' => 'int64' + 'platform_downloads' => 'int64', + 'total_downloads' => 'int64' ]; /** @@ -79,8 +79,8 @@ class VersionStats implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'total_downloads' => false, - 'platform_downloads' => false + 'platform_downloads' => false, + 'total_downloads' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total_downloads' => 'totalDownloads', - 'platform_downloads' => 'platformDownloads' + 'platform_downloads' => 'platformDownloads', + 'total_downloads' => 'totalDownloads' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total_downloads' => 'setTotalDownloads', - 'platform_downloads' => 'setPlatformDownloads' + 'platform_downloads' => 'setPlatformDownloads', + 'total_downloads' => 'setTotalDownloads' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total_downloads' => 'getTotalDownloads', - 'platform_downloads' => 'getPlatformDownloads' + 'platform_downloads' => 'getPlatformDownloads', + 'total_downloads' => 'getTotalDownloads' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('total_downloads', $data ?? [], null); $this->setIfExists('platform_downloads', $data ?? [], null); + $this->setIfExists('total_downloads', $data ?? [], null); } /** @@ -297,55 +297,55 @@ public function valid() /** - * Gets total_downloads + * Gets platform_downloads * - * @return int|null + * @return array|null */ - public function getTotalDownloads() + public function getPlatformDownloads() { - return $this->container['total_downloads']; + return $this->container['platform_downloads']; } /** - * Sets total_downloads + * Sets platform_downloads * - * @param int|null $total_downloads total_downloads + * @param array|null $platform_downloads platform_downloads * * @return self */ - public function setTotalDownloads($total_downloads) + public function setPlatformDownloads($platform_downloads) { - if (is_null($total_downloads)) { - throw new \InvalidArgumentException('non-nullable total_downloads cannot be null'); + if (is_null($platform_downloads)) { + throw new \InvalidArgumentException('non-nullable platform_downloads cannot be null'); } - $this->container['total_downloads'] = $total_downloads; + $this->container['platform_downloads'] = $platform_downloads; return $this; } /** - * Gets platform_downloads + * Gets total_downloads * - * @return array|null + * @return int|null */ - public function getPlatformDownloads() + public function getTotalDownloads() { - return $this->container['platform_downloads']; + return $this->container['total_downloads']; } /** - * Sets platform_downloads + * Sets total_downloads * - * @param array|null $platform_downloads platform_downloads + * @param int|null $total_downloads total_downloads * * @return self */ - public function setPlatformDownloads($platform_downloads) + public function setTotalDownloads($total_downloads) { - if (is_null($platform_downloads)) { - throw new \InvalidArgumentException('non-nullable platform_downloads cannot be null'); + if (is_null($total_downloads)) { + throw new \InvalidArgumentException('non-nullable total_downloads cannot be null'); } - $this->container['platform_downloads'] = $platform_downloads; + $this->container['total_downloads'] = $total_downloads; return $this; } diff --git a/lib/Model/VersionUpload.php b/lib/Model/VersionUpload.php index 102b635..ba590b5 100644 --- a/lib/Model/VersionUpload.php +++ b/lib/Model/VersionUpload.php @@ -58,12 +58,12 @@ class VersionUpload implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'version' => 'string', - 'plugin_dependencies' => 'array', - 'platform_dependencies' => 'array', + 'channel' => 'string', 'description' => 'string', 'files' => '\Aternos\HangarApi\Model\MultipartFileOrUrl[]', - 'channel' => 'string' + 'platform_dependencies' => 'array', + 'plugin_dependencies' => 'array', + 'version' => 'string' ]; /** @@ -74,12 +74,12 @@ class VersionUpload implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'version' => null, - 'plugin_dependencies' => null, - 'platform_dependencies' => null, + 'channel' => null, 'description' => null, 'files' => null, - 'channel' => null + 'platform_dependencies' => null, + 'plugin_dependencies' => null, + 'version' => null ]; /** @@ -88,12 +88,12 @@ class VersionUpload implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'version' => false, - 'plugin_dependencies' => false, - 'platform_dependencies' => false, + 'channel' => false, 'description' => false, 'files' => false, - 'channel' => false + 'platform_dependencies' => false, + 'plugin_dependencies' => false, + 'version' => false ]; /** @@ -182,12 +182,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'version' => 'version', - 'plugin_dependencies' => 'pluginDependencies', - 'platform_dependencies' => 'platformDependencies', + 'channel' => 'channel', 'description' => 'description', 'files' => 'files', - 'channel' => 'channel' + 'platform_dependencies' => 'platformDependencies', + 'plugin_dependencies' => 'pluginDependencies', + 'version' => 'version' ]; /** @@ -196,12 +196,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'version' => 'setVersion', - 'plugin_dependencies' => 'setPluginDependencies', - 'platform_dependencies' => 'setPlatformDependencies', + 'channel' => 'setChannel', 'description' => 'setDescription', 'files' => 'setFiles', - 'channel' => 'setChannel' + 'platform_dependencies' => 'setPlatformDependencies', + 'plugin_dependencies' => 'setPluginDependencies', + 'version' => 'setVersion' ]; /** @@ -210,12 +210,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'version' => 'getVersion', - 'plugin_dependencies' => 'getPluginDependencies', - 'platform_dependencies' => 'getPlatformDependencies', + 'channel' => 'getChannel', 'description' => 'getDescription', 'files' => 'getFiles', - 'channel' => 'getChannel' + 'platform_dependencies' => 'getPlatformDependencies', + 'plugin_dependencies' => 'getPluginDependencies', + 'version' => 'getVersion' ]; /** @@ -275,12 +275,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->setIfExists('version', $data ?? [], null); - $this->setIfExists('plugin_dependencies', $data ?? [], null); - $this->setIfExists('platform_dependencies', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); $this->setIfExists('files', $data ?? [], null); - $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('platform_dependencies', $data ?? [], null); + $this->setIfExists('plugin_dependencies', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); } /** @@ -310,8 +310,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' can't be null"; + if ($this->container['channel'] === null) { + $invalidProperties[] = "'channel' can't be null"; } if (!is_null($this->container['files']) && (count($this->container['files']) > 3)) { $invalidProperties[] = "invalid value for 'files', number of items must be less than or equal to 3."; @@ -321,8 +321,8 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'files', number of items must be greater than or equal to 1."; } - if ($this->container['channel'] === null) { - $invalidProperties[] = "'channel' can't be null"; + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; } return $invalidProperties; } @@ -340,170 +340,170 @@ public function valid() /** - * Gets version + * Gets channel * * @return string */ - public function getVersion() + public function getChannel() { - return $this->container['version']; + return $this->container['channel']; } /** - * Sets version + * Sets channel * - * @param string $version Version string of the version to be published + * @param string $channel Channel of the version to be published under * * @return self */ - public function setVersion($version) + public function setChannel($channel) { - if (is_null($version)) { - throw new \InvalidArgumentException('non-nullable version cannot be null'); + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); } - $this->container['version'] = $version; + $this->container['channel'] = $channel; return $this; } /** - * Gets plugin_dependencies + * Gets description * - * @return array|null + * @return string|null */ - public function getPluginDependencies() + public function getDescription() { - return $this->container['plugin_dependencies']; + return $this->container['description']; } /** - * Sets plugin_dependencies + * Sets description * - * @param array|null $plugin_dependencies Map of each platform's plugin dependencies + * @param string|null $description description * * @return self */ - public function setPluginDependencies($plugin_dependencies) + public function setDescription($description) { - if (is_null($plugin_dependencies)) { - throw new \InvalidArgumentException('non-nullable plugin_dependencies cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['plugin_dependencies'] = $plugin_dependencies; + $this->container['description'] = $description; return $this; } /** - * Gets platform_dependencies + * Gets files * - * @return array|null + * @return \Aternos\HangarApi\Model\MultipartFileOrUrl[]|null */ - public function getPlatformDependencies() + public function getFiles() { - return $this->container['platform_dependencies']; + return $this->container['files']; } /** - * Sets platform_dependencies + * Sets files * - * @param array|null $platform_dependencies Map of platforms and their versions this version runs on + * @param \Aternos\HangarApi\Model\MultipartFileOrUrl[]|null $files files * * @return self */ - public function setPlatformDependencies($platform_dependencies) + public function setFiles($files) { - if (is_null($platform_dependencies)) { - throw new \InvalidArgumentException('non-nullable platform_dependencies cannot be null'); + if (is_null($files)) { + throw new \InvalidArgumentException('non-nullable files cannot be null'); } - $this->container['platform_dependencies'] = $platform_dependencies; + + if ((count($files) > 3)) { + throw new \InvalidArgumentException('invalid value for $files when calling VersionUpload., number of items must be less than or equal to 3.'); + } + if ((count($files) < 1)) { + throw new \InvalidArgumentException('invalid length for $files when calling VersionUpload., number of items must be greater than or equal to 1.'); + } + $this->container['files'] = $files; return $this; } /** - * Gets description + * Gets platform_dependencies * - * @return string|null + * @return array|null */ - public function getDescription() + public function getPlatformDependencies() { - return $this->container['description']; + return $this->container['platform_dependencies']; } /** - * Sets description + * Sets platform_dependencies * - * @param string|null $description description + * @param array|null $platform_dependencies Map of platforms and their versions this version runs on * * @return self */ - public function setDescription($description) + public function setPlatformDependencies($platform_dependencies) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($platform_dependencies)) { + throw new \InvalidArgumentException('non-nullable platform_dependencies cannot be null'); } - $this->container['description'] = $description; + $this->container['platform_dependencies'] = $platform_dependencies; return $this; } /** - * Gets files + * Gets plugin_dependencies * - * @return \Aternos\HangarApi\Model\MultipartFileOrUrl[]|null + * @return array|null */ - public function getFiles() + public function getPluginDependencies() { - return $this->container['files']; + return $this->container['plugin_dependencies']; } /** - * Sets files + * Sets plugin_dependencies * - * @param \Aternos\HangarApi\Model\MultipartFileOrUrl[]|null $files files + * @param array|null $plugin_dependencies Map of each platform's plugin dependencies * * @return self */ - public function setFiles($files) + public function setPluginDependencies($plugin_dependencies) { - if (is_null($files)) { - throw new \InvalidArgumentException('non-nullable files cannot be null'); - } - - if ((count($files) > 3)) { - throw new \InvalidArgumentException('invalid value for $files when calling VersionUpload., number of items must be less than or equal to 3.'); - } - if ((count($files) < 1)) { - throw new \InvalidArgumentException('invalid length for $files when calling VersionUpload., number of items must be greater than or equal to 1.'); + if (is_null($plugin_dependencies)) { + throw new \InvalidArgumentException('non-nullable plugin_dependencies cannot be null'); } - $this->container['files'] = $files; + $this->container['plugin_dependencies'] = $plugin_dependencies; return $this; } /** - * Gets channel + * Gets version * * @return string */ - public function getChannel() + public function getVersion() { - return $this->container['channel']; + return $this->container['version']; } /** - * Sets channel + * Sets version * - * @param string $channel Channel of the version to be published under + * @param string $version Version string of the version to be published * * @return self */ - public function setChannel($channel) + public function setVersion($version) { - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); } - $this->container['channel'] = $channel; + $this->container['version'] = $version; return $this; }