|
17 | 17 | * The version of the OpenAPI document: 2.0.0 |
18 | 18 | * Contact: messente@messente.com |
19 | 19 | * Generated by: https://openapi-generator.tech |
20 | | - * Generator version: 7.6.0 |
| 20 | + * Generator version: 7.11.0 |
21 | 21 | */ |
22 | 22 |
|
23 | 23 | /** |
@@ -93,13 +93,13 @@ class BlacklistApi |
93 | 93 | * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec |
94 | 94 | */ |
95 | 95 | public function __construct( |
96 | | - ClientInterface $client = null, |
97 | | - Configuration $config = null, |
98 | | - HeaderSelector $selector = null, |
99 | | - $hostIndex = 0 |
| 96 | + ?ClientInterface $client = null, |
| 97 | + ?Configuration $config = null, |
| 98 | + ?HeaderSelector $selector = null, |
| 99 | + int $hostIndex = 0 |
100 | 100 | ) { |
101 | 101 | $this->client = $client ?: new Client(); |
102 | | - $this->config = $config ?: new Configuration(); |
| 102 | + $this->config = $config ?: Configuration::getDefaultConfiguration(); |
103 | 103 | $this->headerSelector = $selector ?: new HeaderSelector(); |
104 | 104 | $this->hostIndex = $hostIndex; |
105 | 105 | } |
@@ -187,18 +187,6 @@ public function addToBlacklistWithHttpInfo($numberToBlacklist, string $contentTy |
187 | 187 |
|
188 | 188 | $statusCode = $response->getStatusCode(); |
189 | 189 |
|
190 | | - if ($statusCode < 200 || $statusCode > 299) { |
191 | | - throw new ApiException( |
192 | | - sprintf( |
193 | | - '[%d] Error connecting to the API (%s)', |
194 | | - $statusCode, |
195 | | - (string) $request->getUri() |
196 | | - ), |
197 | | - $statusCode, |
198 | | - $response->getHeaders(), |
199 | | - (string) $response->getBody() |
200 | | - ); |
201 | | - } |
202 | 190 |
|
203 | 191 | return [null, $statusCode, $response->getHeaders()]; |
204 | 192 |
|
@@ -451,18 +439,6 @@ public function deleteFromBlacklistWithHttpInfo($phone, string $contentType = se |
451 | 439 |
|
452 | 440 | $statusCode = $response->getStatusCode(); |
453 | 441 |
|
454 | | - if ($statusCode < 200 || $statusCode > 299) { |
455 | | - throw new ApiException( |
456 | | - sprintf( |
457 | | - '[%d] Error connecting to the API (%s)', |
458 | | - $statusCode, |
459 | | - (string) $request->getUri() |
460 | | - ), |
461 | | - $statusCode, |
462 | | - $response->getHeaders(), |
463 | | - (string) $response->getBody() |
464 | | - ); |
465 | | - } |
466 | 442 |
|
467 | 443 | return [null, $statusCode, $response->getHeaders()]; |
468 | 444 |
|
@@ -715,18 +691,6 @@ public function fetchBlacklistWithHttpInfo(string $contentType = self::contentTy |
715 | 691 |
|
716 | 692 | $statusCode = $response->getStatusCode(); |
717 | 693 |
|
718 | | - if ($statusCode < 200 || $statusCode > 299) { |
719 | | - throw new ApiException( |
720 | | - sprintf( |
721 | | - '[%d] Error connecting to the API (%s)', |
722 | | - $statusCode, |
723 | | - (string) $request->getUri() |
724 | | - ), |
725 | | - $statusCode, |
726 | | - $response->getHeaders(), |
727 | | - (string) $response->getBody() |
728 | | - ); |
729 | | - } |
730 | 694 |
|
731 | 695 | switch($statusCode) { |
732 | 696 | case 200: |
@@ -812,6 +776,19 @@ public function fetchBlacklistWithHttpInfo(string $contentType = self::contentTy |
812 | 776 | ]; |
813 | 777 | } |
814 | 778 |
|
| 779 | + if ($statusCode < 200 || $statusCode > 299) { |
| 780 | + throw new ApiException( |
| 781 | + sprintf( |
| 782 | + '[%d] Error connecting to the API (%s)', |
| 783 | + $statusCode, |
| 784 | + (string) $request->getUri() |
| 785 | + ), |
| 786 | + $statusCode, |
| 787 | + $response->getHeaders(), |
| 788 | + (string) $response->getBody() |
| 789 | + ); |
| 790 | + } |
| 791 | + |
815 | 792 | $returnType = '\Messente\Api\Model\FetchBlacklistSuccess'; |
816 | 793 | if ($returnType === '\SplFileObject') { |
817 | 794 | $content = $response->getBody(); //stream goes to serializer |
@@ -1077,18 +1054,6 @@ public function isBlacklistedWithHttpInfo($phone, string $contentType = self::co |
1077 | 1054 |
|
1078 | 1055 | $statusCode = $response->getStatusCode(); |
1079 | 1056 |
|
1080 | | - if ($statusCode < 200 || $statusCode > 299) { |
1081 | | - throw new ApiException( |
1082 | | - sprintf( |
1083 | | - '[%d] Error connecting to the API (%s)', |
1084 | | - $statusCode, |
1085 | | - (string) $request->getUri() |
1086 | | - ), |
1087 | | - $statusCode, |
1088 | | - $response->getHeaders(), |
1089 | | - (string) $response->getBody() |
1090 | | - ); |
1091 | | - } |
1092 | 1057 |
|
1093 | 1058 | return [null, $statusCode, $response->getHeaders()]; |
1094 | 1059 |
|
|
0 commit comments