|
16 | 16 | * |
17 | 17 | * The version of the OpenAPI document: v3 |
18 | 18 | * Generated by: https://openapi-generator.tech |
19 | | - * OpenAPI Generator version: 7.3.0 |
| 19 | + * Generator version: 7.12.0 |
20 | 20 | */ |
21 | 21 |
|
22 | 22 | /** |
@@ -89,13 +89,13 @@ class BatchApi |
89 | 89 | * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec |
90 | 90 | */ |
91 | 91 | public function __construct( |
92 | | - ClientInterface $client = null, |
93 | | - Configuration $config = null, |
94 | | - HeaderSelector $selector = null, |
95 | | - $hostIndex = 0 |
| 92 | + ?ClientInterface $client = null, |
| 93 | + ?Configuration $config = null, |
| 94 | + ?HeaderSelector $selector = null, |
| 95 | + int $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 | } |
@@ -187,18 +187,6 @@ public function archiveWithHttpInfo($from_object_type, $to_object_type, $batch_i |
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 |
|
@@ -468,18 +456,6 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in |
468 | 456 |
|
469 | 457 | $statusCode = $response->getStatusCode(); |
470 | 458 |
|
471 | | - if ($statusCode < 200 || $statusCode > 299) { |
472 | | - throw new ApiException( |
473 | | - sprintf( |
474 | | - '[%d] Error connecting to the API (%s)', |
475 | | - $statusCode, |
476 | | - (string) $request->getUri() |
477 | | - ), |
478 | | - $statusCode, |
479 | | - $response->getHeaders(), |
480 | | - (string) $response->getBody() |
481 | | - ); |
482 | | - } |
483 | 459 |
|
484 | 460 | switch($statusCode) { |
485 | 461 | case 201: |
@@ -565,6 +541,19 @@ public function createWithHttpInfo($from_object_type, $to_object_type, $batch_in |
565 | 541 | ]; |
566 | 542 | } |
567 | 543 |
|
| 544 | + if ($statusCode < 200 || $statusCode > 299) { |
| 545 | + throw new ApiException( |
| 546 | + sprintf( |
| 547 | + '[%d] Error connecting to the API (%s)', |
| 548 | + $statusCode, |
| 549 | + (string) $request->getUri() |
| 550 | + ), |
| 551 | + $statusCode, |
| 552 | + $response->getHeaders(), |
| 553 | + (string) $response->getBody() |
| 554 | + ); |
| 555 | + } |
| 556 | + |
568 | 557 | $returnType = '\HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociation'; |
569 | 558 | if ($returnType === '\SplFileObject') { |
570 | 559 | $content = $response->getBody(); //stream goes to serializer |
@@ -888,18 +877,6 @@ public function readWithHttpInfo($from_object_type, $to_object_type, $batch_inpu |
888 | 877 |
|
889 | 878 | $statusCode = $response->getStatusCode(); |
890 | 879 |
|
891 | | - if ($statusCode < 200 || $statusCode > 299) { |
892 | | - throw new ApiException( |
893 | | - sprintf( |
894 | | - '[%d] Error connecting to the API (%s)', |
895 | | - $statusCode, |
896 | | - (string) $request->getUri() |
897 | | - ), |
898 | | - $statusCode, |
899 | | - $response->getHeaders(), |
900 | | - (string) $response->getBody() |
901 | | - ); |
902 | | - } |
903 | 880 |
|
904 | 881 | switch($statusCode) { |
905 | 882 | case 200: |
@@ -985,6 +962,19 @@ public function readWithHttpInfo($from_object_type, $to_object_type, $batch_inpu |
985 | 962 | ]; |
986 | 963 | } |
987 | 964 |
|
| 965 | + if ($statusCode < 200 || $statusCode > 299) { |
| 966 | + throw new ApiException( |
| 967 | + sprintf( |
| 968 | + '[%d] Error connecting to the API (%s)', |
| 969 | + $statusCode, |
| 970 | + (string) $request->getUri() |
| 971 | + ), |
| 972 | + $statusCode, |
| 973 | + $response->getHeaders(), |
| 974 | + (string) $response->getBody() |
| 975 | + ); |
| 976 | + } |
| 977 | + |
988 | 978 | $returnType = '\HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociationMulti'; |
989 | 979 | if ($returnType === '\SplFileObject') { |
990 | 980 | $content = $response->getBody(); //stream goes to serializer |
|
0 commit comments