Skip to content

Commit cd21465

Browse files
Codegen: CRM Imports
1 parent 76fafd9 commit cd21465

23 files changed

Lines changed: 282 additions & 198 deletions

codegen/Crm/Imports/Api/CoreApi.php

Lines changed: 84 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* The version of the OpenAPI document: v3
1818
* Generated by: https://openapi-generator.tech
19-
* OpenAPI Generator version: 7.3.0
19+
* Generator version: 7.12.0
2020
*/
2121

2222
/**
@@ -92,13 +92,13 @@ class CoreApi
9292
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
9393
*/
9494
public function __construct(
95-
ClientInterface $client = null,
96-
Configuration $config = null,
97-
HeaderSelector $selector = null,
98-
$hostIndex = 0
95+
?ClientInterface $client = null,
96+
?Configuration $config = null,
97+
?HeaderSelector $selector = null,
98+
int $hostIndex = 0
9999
) {
100100
$this->client = $client ?: new Client();
101-
$this->config = $config ?: new Configuration();
101+
$this->config = $config ?: Configuration::getDefaultConfiguration();
102102
$this->headerSelector = $selector ?: new HeaderSelector();
103103
$this->hostIndex = $hostIndex;
104104
}
@@ -187,18 +187,6 @@ public function cancelWithHttpInfo($import_id, string $contentType = self::conte
187187

188188
$statusCode = $response->getStatusCode();
189189

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-
}
202190

203191
switch($statusCode) {
204192
case 200:
@@ -257,6 +245,19 @@ public function cancelWithHttpInfo($import_id, string $contentType = self::conte
257245
];
258246
}
259247

248+
if ($statusCode < 200 || $statusCode > 299) {
249+
throw new ApiException(
250+
sprintf(
251+
'[%d] Error connecting to the API (%s)',
252+
$statusCode,
253+
(string) $request->getUri()
254+
),
255+
$statusCode,
256+
$response->getHeaders(),
257+
(string) $response->getBody()
258+
);
259+
}
260+
260261
$returnType = '\HubSpot\Client\Crm\Imports\Model\ActionResponse';
261262
if ($returnType === '\SplFileObject') {
262263
$content = $response->getBody(); //stream goes to serializer
@@ -482,8 +483,8 @@ public function cancelRequest($import_id, string $contentType = self::contentTyp
482483
*
483484
* Start a new import
484485
*
485-
* @param \SplFileObject $files files (optional)
486-
* @param string $import_request import_request (optional)
486+
* @param \SplFileObject|null $files files (optional)
487+
* @param string|null $import_request import_request (optional)
487488
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
488489
*
489490
* @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format
@@ -501,8 +502,8 @@ public function create($files = null, $import_request = null, string $contentTyp
501502
*
502503
* Start a new import
503504
*
504-
* @param \SplFileObject $files (optional)
505-
* @param string $import_request (optional)
505+
* @param \SplFileObject|null $files (optional)
506+
* @param string|null $import_request (optional)
506507
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
507508
*
508509
* @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format
@@ -535,18 +536,6 @@ public function createWithHttpInfo($files = null, $import_request = null, string
535536

536537
$statusCode = $response->getStatusCode();
537538

538-
if ($statusCode < 200 || $statusCode > 299) {
539-
throw new ApiException(
540-
sprintf(
541-
'[%d] Error connecting to the API (%s)',
542-
$statusCode,
543-
(string) $request->getUri()
544-
),
545-
$statusCode,
546-
$response->getHeaders(),
547-
(string) $response->getBody()
548-
);
549-
}
550539

551540
switch($statusCode) {
552541
case 200:
@@ -605,6 +594,19 @@ public function createWithHttpInfo($files = null, $import_request = null, string
605594
];
606595
}
607596

597+
if ($statusCode < 200 || $statusCode > 299) {
598+
throw new ApiException(
599+
sprintf(
600+
'[%d] Error connecting to the API (%s)',
601+
$statusCode,
602+
(string) $request->getUri()
603+
),
604+
$statusCode,
605+
$response->getHeaders(),
606+
(string) $response->getBody()
607+
);
608+
}
609+
608610
$returnType = '\HubSpot\Client\Crm\Imports\Model\PublicImportResponse';
609611
if ($returnType === '\SplFileObject') {
610612
$content = $response->getBody(); //stream goes to serializer
@@ -661,8 +663,8 @@ public function createWithHttpInfo($files = null, $import_request = null, string
661663
*
662664
* Start a new import
663665
*
664-
* @param \SplFileObject $files (optional)
665-
* @param string $import_request (optional)
666+
* @param \SplFileObject|null $files (optional)
667+
* @param string|null $import_request (optional)
666668
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
667669
*
668670
* @throws \InvalidArgumentException
@@ -683,8 +685,8 @@ function ($response) {
683685
*
684686
* Start a new import
685687
*
686-
* @param \SplFileObject $files (optional)
687-
* @param string $import_request (optional)
688+
* @param \SplFileObject|null $files (optional)
689+
* @param string|null $import_request (optional)
688690
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
689691
*
690692
* @throws \InvalidArgumentException
@@ -734,8 +736,8 @@ function ($exception) {
734736
/**
735737
* Create request for operation 'create'
736738
*
737-
* @param \SplFileObject $files (optional)
738-
* @param string $import_request (optional)
739+
* @param \SplFileObject|null $files (optional)
740+
* @param string|null $import_request (optional)
739741
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation
740742
*
741743
* @throws \InvalidArgumentException
@@ -774,6 +776,7 @@ public function createRequest($files = null, $import_request = null, string $con
774776
$formParams['importRequest'] = ObjectSerializer::toFormValue($import_request);
775777
}
776778

779+
$multipart = true;
777780
$headers = $this->headerSelector->selectHeaders(
778781
['application/json', '*/*', ],
779782
$contentType,
@@ -887,18 +890,6 @@ public function getByIdWithHttpInfo($import_id, string $contentType = self::cont
887890

888891
$statusCode = $response->getStatusCode();
889892

890-
if ($statusCode < 200 || $statusCode > 299) {
891-
throw new ApiException(
892-
sprintf(
893-
'[%d] Error connecting to the API (%s)',
894-
$statusCode,
895-
(string) $request->getUri()
896-
),
897-
$statusCode,
898-
$response->getHeaders(),
899-
(string) $response->getBody()
900-
);
901-
}
902893

903894
switch($statusCode) {
904895
case 200:
@@ -957,6 +948,19 @@ public function getByIdWithHttpInfo($import_id, string $contentType = self::cont
957948
];
958949
}
959950

951+
if ($statusCode < 200 || $statusCode > 299) {
952+
throw new ApiException(
953+
sprintf(
954+
'[%d] Error connecting to the API (%s)',
955+
$statusCode,
956+
(string) $request->getUri()
957+
),
958+
$statusCode,
959+
$response->getHeaders(),
960+
(string) $response->getBody()
961+
);
962+
}
963+
960964
$returnType = '\HubSpot\Client\Crm\Imports\Model\PublicImportResponse';
961965
if ($returnType === '\SplFileObject') {
962966
$content = $response->getBody(); //stream goes to serializer
@@ -1182,9 +1186,9 @@ public function getByIdRequest($import_id, string $contentType = self::contentTy
11821186
*
11831187
* Get active imports
11841188
*
1185-
* @param string $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1186-
* @param string $before before (optional)
1187-
* @param int $limit The maximum number of results to display per page. (optional)
1189+
* @param string|null $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1190+
* @param string|null $before before (optional)
1191+
* @param int|null $limit The maximum number of results to display per page. (optional)
11881192
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation
11891193
*
11901194
* @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format
@@ -1202,9 +1206,9 @@ public function getPage($after = null, $before = null, $limit = null, string $co
12021206
*
12031207
* Get active imports
12041208
*
1205-
* @param string $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1206-
* @param string $before (optional)
1207-
* @param int $limit The maximum number of results to display per page. (optional)
1209+
* @param string|null $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1210+
* @param string|null $before (optional)
1211+
* @param int|null $limit The maximum number of results to display per page. (optional)
12081212
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation
12091213
*
12101214
* @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format
@@ -1237,18 +1241,6 @@ public function getPageWithHttpInfo($after = null, $before = null, $limit = null
12371241

12381242
$statusCode = $response->getStatusCode();
12391243

1240-
if ($statusCode < 200 || $statusCode > 299) {
1241-
throw new ApiException(
1242-
sprintf(
1243-
'[%d] Error connecting to the API (%s)',
1244-
$statusCode,
1245-
(string) $request->getUri()
1246-
),
1247-
$statusCode,
1248-
$response->getHeaders(),
1249-
(string) $response->getBody()
1250-
);
1251-
}
12521244

12531245
switch($statusCode) {
12541246
case 200:
@@ -1307,6 +1299,19 @@ public function getPageWithHttpInfo($after = null, $before = null, $limit = null
13071299
];
13081300
}
13091301

1302+
if ($statusCode < 200 || $statusCode > 299) {
1303+
throw new ApiException(
1304+
sprintf(
1305+
'[%d] Error connecting to the API (%s)',
1306+
$statusCode,
1307+
(string) $request->getUri()
1308+
),
1309+
$statusCode,
1310+
$response->getHeaders(),
1311+
(string) $response->getBody()
1312+
);
1313+
}
1314+
13101315
$returnType = '\HubSpot\Client\Crm\Imports\Model\CollectionResponsePublicImportResponse';
13111316
if ($returnType === '\SplFileObject') {
13121317
$content = $response->getBody(); //stream goes to serializer
@@ -1363,9 +1368,9 @@ public function getPageWithHttpInfo($after = null, $before = null, $limit = null
13631368
*
13641369
* Get active imports
13651370
*
1366-
* @param string $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1367-
* @param string $before (optional)
1368-
* @param int $limit The maximum number of results to display per page. (optional)
1371+
* @param string|null $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1372+
* @param string|null $before (optional)
1373+
* @param int|null $limit The maximum number of results to display per page. (optional)
13691374
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation
13701375
*
13711376
* @throws \InvalidArgumentException
@@ -1386,9 +1391,9 @@ function ($response) {
13861391
*
13871392
* Get active imports
13881393
*
1389-
* @param string $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1390-
* @param string $before (optional)
1391-
* @param int $limit The maximum number of results to display per page. (optional)
1394+
* @param string|null $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1395+
* @param string|null $before (optional)
1396+
* @param int|null $limit The maximum number of results to display per page. (optional)
13921397
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation
13931398
*
13941399
* @throws \InvalidArgumentException
@@ -1438,9 +1443,9 @@ function ($exception) {
14381443
/**
14391444
* Create request for operation 'getPage'
14401445
*
1441-
* @param string $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1442-
* @param string $before (optional)
1443-
* @param int $limit The maximum number of results to display per page. (optional)
1446+
* @param string|null $after The paging cursor token of the last successfully read resource will be returned as the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results. (optional)
1447+
* @param string|null $before (optional)
1448+
* @param int|null $limit The maximum number of results to display per page. (optional)
14441449
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation
14451450
*
14461451
* @throws \InvalidArgumentException

0 commit comments

Comments
 (0)