16
16
*
17
17
* The version of the OpenAPI document: 1.0
18
18
* Generated by: https://openapi-generator.tech
19
- * Generator version: 7.8 .0
19
+ * Generator version: 7.10 .0
20
20
*/
21
21
22
22
/**
@@ -95,7 +95,7 @@ public function __construct(
95
95
$ hostIndex = 0
96
96
) {
97
97
$ this ->client = $ client ?: new Client ();
98
- $ this ->config = $ config ?: new Configuration ();
98
+ $ this ->config = $ config ?: Configuration:: getDefaultConfiguration ();
99
99
$ this ->headerSelector = $ selector ?: new HeaderSelector ();
100
100
$ this ->hostIndex = $ hostIndex ;
101
101
}
@@ -184,18 +184,6 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
184
184
185
185
$ statusCode = $ response ->getStatusCode ();
186
186
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
- }
199
187
200
188
switch ($ statusCode ) {
201
189
case 403 :
@@ -225,7 +213,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
225
213
$ response ->getStatusCode (),
226
214
$ response ->getHeaders ()
227
215
];
228
- case 201 :
216
+ case 401 :
229
217
if ('string ' === '\SplFileObject ' ) {
230
218
$ content = $ response ->getBody (); //stream goes to serializer
231
219
} else {
@@ -252,7 +240,7 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
252
240
$ response ->getStatusCode (),
253
241
$ response ->getHeaders ()
254
242
];
255
- case 401 :
243
+ case 201 :
256
244
if ('string ' === '\SplFileObject ' ) {
257
245
$ content = $ response ->getBody (); //stream goes to serializer
258
246
} else {
@@ -281,6 +269,19 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
281
269
];
282
270
}
283
271
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
+
284
285
$ returnType = 'string ' ;
285
286
if ($ returnType === '\SplFileObject ' ) {
286
287
$ content = $ response ->getBody (); //stream goes to serializer
@@ -319,15 +320,15 @@ public function createKeyWithHttpInfo($create_api_key_form, string $contentType
319
320
);
320
321
$ e ->setResponseObject ($ data );
321
322
break ;
322
- case 201 :
323
+ case 401 :
323
324
$ data = ObjectSerializer::deserialize (
324
325
$ e ->getResponseBody (),
325
326
'string ' ,
326
327
$ e ->getResponseHeaders ()
327
328
);
328
329
$ e ->setResponseObject ($ data );
329
330
break ;
330
- case 401 :
331
+ case 201 :
331
332
$ data = ObjectSerializer::deserialize (
332
333
$ e ->getResponseBody (),
333
334
'string ' ,
@@ -563,18 +564,6 @@ public function deleteKeyWithHttpInfo($name, string $contentType = self::content
563
564
564
565
$ statusCode = $ response ->getStatusCode ();
565
566
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
- }
578
567
579
568
return [null , $ statusCode , $ response ->getHeaders ()];
580
569
@@ -751,7 +740,7 @@ public function deleteKeyRequest($name, string $contentType = self::contentTypes
751
740
*
752
741
* @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format
753
742
* @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[]
755
744
*/
756
745
public function getKeys (string $ contentType = self ::contentTypes['getKeys ' ][0 ])
757
746
{
@@ -768,7 +757,7 @@ public function getKeys(string $contentType = self::contentTypes['getKeys'][0])
768
757
*
769
758
* @throws \Aternos\HangarApi\ApiException on non-2xx response or if the response body is not in the expected format
770
759
* @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)
772
761
*/
773
762
public function getKeysWithHttpInfo (string $ contentType = self ::contentTypes['getKeys ' ][0 ])
774
763
{
@@ -796,26 +785,14 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
796
785
797
786
$ statusCode = $ response ->getStatusCode ();
798
787
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
- }
811
788
812
789
switch ($ statusCode ) {
813
790
case 200 :
814
- if ('\Aternos\HangarApi\Model\ApiKey ' === '\SplFileObject ' ) {
791
+ if ('\Aternos\HangarApi\Model\ApiKey[] ' === '\SplFileObject ' ) {
815
792
$ content = $ response ->getBody (); //stream goes to serializer
816
793
} else {
817
794
$ content = (string ) $ response ->getBody ();
818
- if ('\Aternos\HangarApi\Model\ApiKey ' !== 'string ' ) {
795
+ if ('\Aternos\HangarApi\Model\ApiKey[] ' !== 'string ' ) {
819
796
try {
820
797
$ content = json_decode ($ content , false , 512 , JSON_THROW_ON_ERROR );
821
798
} catch (\JsonException $ exception ) {
@@ -833,7 +810,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
833
810
}
834
811
835
812
return [
836
- ObjectSerializer::deserialize ($ content , '\Aternos\HangarApi\Model\ApiKey ' , []),
813
+ ObjectSerializer::deserialize ($ content , '\Aternos\HangarApi\Model\ApiKey[] ' , []),
837
814
$ response ->getStatusCode (),
838
815
$ response ->getHeaders ()
839
816
];
@@ -893,7 +870,20 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
893
870
];
894
871
}
895
872
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[] ' ;
897
887
if ($ returnType === '\SplFileObject ' ) {
898
888
$ content = $ response ->getBody (); //stream goes to serializer
899
889
} else {
@@ -926,7 +916,7 @@ public function getKeysWithHttpInfo(string $contentType = self::contentTypes['ge
926
916
case 200 :
927
917
$ data = ObjectSerializer::deserialize (
928
918
$ e ->getResponseBody (),
929
- '\Aternos\HangarApi\Model\ApiKey ' ,
919
+ '\Aternos\HangarApi\Model\ApiKey[] ' ,
930
920
$ e ->getResponseHeaders ()
931
921
);
932
922
$ e ->setResponseObject ($ data );
@@ -984,7 +974,7 @@ function ($response) {
984
974
*/
985
975
public function getKeysAsyncWithHttpInfo (string $ contentType = self ::contentTypes['getKeys ' ][0 ])
986
976
{
987
- $ returnType = '\Aternos\HangarApi\Model\ApiKey ' ;
977
+ $ returnType = '\Aternos\HangarApi\Model\ApiKey[] ' ;
988
978
$ request = $ this ->getKeysRequest ($ contentType );
989
979
990
980
return $ this ->client
0 commit comments