Skip to content

Commit f78f233

Browse files
authoredDec 6, 2024··
Merge pull request #3 from aternosorg/update-tags
Update 4.0.0
2 parents 8fc4f70 + 914ebcc commit f78f233

Some content is hidden

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

68 files changed

+896
-713
lines changed
 

‎config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
invokerPackage: Aternos\HangarApi
2-
artifactVersion: 3.2.0
2+
artifactVersion: 4.0.0
33
generatorName: php
44
outputDir: .
55
sourceFolder: src

‎lib/Api/APIKeysApi.php

+40-50
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: 1.0
1818
* Generated by: https://openapi-generator.tech
19-
* Generator version: 7.8.0
19+
* Generator version: 7.10.0
2020
*/
2121

2222
/**
@@ -95,7 +95,7 @@ public function __construct(
9595
$hostIndex = 0
9696
) {
9797
$this->client = $client ?: new Client();
98-
$this->config = $config ?: new Configuration();
98+
$this->config = $config ?: Configuration::getDefaultConfiguration();
9999
$this->headerSelector = $selector ?: new HeaderSelector();
100100
$this->hostIndex = $hostIndex;
101101
}
@@ -184,18 +184,6 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
184184

185185
$statusCode = $response->getStatusCode();
186186

187-
if ($statusCode < 200 || $statusCode > 299) {
188-
throw new ApiException(
189-
sprintf(
190-
'[%d] Error connecting to the API (%s)',
191-
$statusCode,
192-
(string) $request->getUri()
193-
),
194-
$statusCode,
195-
$response->getHeaders(),
196-
(string) $response->getBody()
197-
);
198-
}
199187

200188
switch($statusCode) {
201189
case 403:
@@ -225,7 +213,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
225213
$response->getStatusCode(),
226214
$response->getHeaders()
227215
];
228-
case 201:
216+
case 401:
229217
if ('string' === '\SplFileObject') {
230218
$content = $response->getBody(); //stream goes to serializer
231219
} else {
@@ -252,7 +240,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
252240
$response->getStatusCode(),
253241
$response->getHeaders()
254242
];
255-
case 401:
243+
case 201:
256244
if ('string' === '\SplFileObject') {
257245
$content = $response->getBody(); //stream goes to serializer
258246
} else {
@@ -281,6 +269,19 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
281269
];
282270
}
283271

272+
if ($statusCode < 200 || $statusCode > 299) {
273+
throw new ApiException(
274+
sprintf(
275+
'[%d] Error connecting to the API (%s)',
276+
$statusCode,
277+
(string) $request->getUri()
278+
),
279+
$statusCode,
280+
$response->getHeaders(),
281+
(string) $response->getBody()
282+
);
283+
}
284+
284285
$returnType = 'string';
285286
if ($returnType === '\SplFileObject') {
286287
$content = $response->getBody(); //stream goes to serializer
@@ -319,15 +320,15 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
319320
);
320321
$e->setResponseObject($data);
321322
break;
322-
case 201:
323+
case 401:
323324
$data = ObjectSerializer::deserialize(
324325
$e->getResponseBody(),
325326
'string',
326327
$e->getResponseHeaders()
327328
);
328329
$e->setResponseObject($data);
329330
break;
330-
case 401:
331+
case 201:
331332
$data = ObjectSerializer::deserialize(
332333
$e->getResponseBody(),
333334
'string',
@@ -563,18 +564,6 @@ public function deleteKeyWithHttpInfo($name, string $contentType = self::content
563564

564565
$statusCode = $response->getStatusCode();
565566

566-
if ($statusCode < 200 || $statusCode > 299) {
567-
throw new ApiException(
568-
sprintf(
569-
'[%d] Error connecting to the API (%s)',
570-
$statusCode,
571-
(string) $request->getUri()
572-
),
573-
$statusCode,
574-
$response->getHeaders(),
575-
(string) $response->getBody()
576-
);
577-
}
578567

579568
return [null, $statusCode, $response->getHeaders()];
580569

@@ -751,7 +740,7 @@ public function deleteKeyRequest($name, string $contentType = self::contentTypes
751740
*
752741
* @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format
753742
* @throws \InvalidArgumentException
754-
* @return \Aternos\HangarApi\Model\ApiKey|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[]
743+
* @return \Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[]
755744
*/
756745
public function getKeys(string $contentType = self::contentTypes['getKeys'][0])
757746
{
@@ -768,7 +757,7 @@ public function getKeys(string $contentType = self::contentTypes['getKeys'][0])
768757
*
769758
* @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format
770759
* @throws \InvalidArgumentException
771-
* @return array of \Aternos\HangarApi\Model\ApiKey|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[], HTTP status code, HTTP response headers (array of strings)
760+
* @return array of \Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[]|\Aternos\HangarApi\Model\ApiKey[], HTTP status code, HTTP response headers (array of strings)
772761
*/
773762
public function getKeysWithHttpInfo(string $contentType = self::contentTypes['getKeys'][0])
774763
{
@@ -796,26 +785,14 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
796785

797786
$statusCode = $response->getStatusCode();
798787

799-
if ($statusCode < 200 || $statusCode > 299) {
800-
throw new ApiException(
801-
sprintf(
802-
'[%d] Error connecting to the API (%s)',
803-
$statusCode,
804-
(string) $request->getUri()
805-
),
806-
$statusCode,
807-
$response->getHeaders(),
808-
(string) $response->getBody()
809-
);
810-
}
811788

812789
switch($statusCode) {
813790
case 200:
814-
if ('\Aternos\HangarApi\Model\ApiKey' === '\SplFileObject') {
791+
if ('\Aternos\HangarApi\Model\ApiKey[]' === '\SplFileObject') {
815792
$content = $response->getBody(); //stream goes to serializer
816793
} else {
817794
$content = (string) $response->getBody();
818-
if ('\Aternos\HangarApi\Model\ApiKey' !== 'string') {
795+
if ('\Aternos\HangarApi\Model\ApiKey[]' !== 'string') {
819796
try {
820797
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
821798
} catch (\JsonException $exception) {
@@ -833,7 +810,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
833810
}
834811

835812
return [
836-
ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\ApiKey', []),
813+
ObjectSerializer::deserialize($content, '\Aternos\HangarApi\Model\ApiKey[]', []),
837814
$response->getStatusCode(),
838815
$response->getHeaders()
839816
];
@@ -893,7 +870,20 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
893870
];
894871
}
895872

896-
$returnType = '\Aternos\HangarApi\Model\ApiKey';
873+
if ($statusCode < 200 || $statusCode > 299) {
874+
throw new ApiException(
875+
sprintf(
876+
'[%d] Error connecting to the API (%s)',
877+
$statusCode,
878+
(string) $request->getUri()
879+
),
880+
$statusCode,
881+
$response->getHeaders(),
882+
(string) $response->getBody()
883+
);
884+
}
885+
886+
$returnType = '\Aternos\HangarApi\Model\ApiKey[]';
897887
if ($returnType === '\SplFileObject') {
898888
$content = $response->getBody(); //stream goes to serializer
899889
} else {
@@ -926,7 +916,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
926916
case 200:
927917
$data = ObjectSerializer::deserialize(
928918
$e->getResponseBody(),
929-
'\Aternos\HangarApi\Model\ApiKey',
919+
'\Aternos\HangarApi\Model\ApiKey[]',
930920
$e->getResponseHeaders()
931921
);
932922
$e->setResponseObject($data);
@@ -984,7 +974,7 @@ function ($response) {
984974
*/
985975
public function getKeysAsyncWithHttpInfo(string $contentType = self::contentTypes['getKeys'][0])
986976
{
987-
$returnType = '\Aternos\HangarApi\Model\ApiKey';
977+
$returnType = '\Aternos\HangarApi\Model\ApiKey[]';
988978
$request = $this->getKeysRequest($contentType);
989979

990980
return $this->client

0 commit comments

Comments
 (0)
Please sign in to comment.