Skip to content

Commit a625709

Browse files
Merge pull request #449 from HubSpot/feature/codegenCMSHubDB
Codegen: CMS HubDB
2 parents 6620784 + bdd4c1d commit a625709

40 files changed

Lines changed: 849 additions & 779 deletions

codegen/Cms/Hubdb/Api/RowsApi.php

Lines changed: 185 additions & 189 deletions
Large diffs are not rendered by default.

codegen/Cms/Hubdb/Api/RowsBatchApi.php

Lines changed: 84 additions & 90 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
/**
@@ -101,13 +101,13 @@ class RowsBatchApi
101101
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
102102
*/
103103
public function __construct(
104-
ClientInterface $client = null,
105-
Configuration $config = null,
106-
HeaderSelector $selector = null,
107-
$hostIndex = 0
104+
?ClientInterface $client = null,
105+
?Configuration $config = null,
106+
?HeaderSelector $selector = null,
107+
int $hostIndex = 0
108108
) {
109109
$this->client = $client ?: new Client();
110-
$this->config = $config ?: new Configuration();
110+
$this->config = $config ?: Configuration::getDefaultConfiguration();
111111
$this->headerSelector = $selector ?: new HeaderSelector();
112112
$this->hostIndex = $hostIndex;
113113
}
@@ -198,18 +198,6 @@ public function cloneDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_
198198

199199
$statusCode = $response->getStatusCode();
200200

201-
if ($statusCode < 200 || $statusCode > 299) {
202-
throw new ApiException(
203-
sprintf(
204-
'[%d] Error connecting to the API (%s)',
205-
$statusCode,
206-
(string) $request->getUri()
207-
),
208-
$statusCode,
209-
$response->getHeaders(),
210-
(string) $response->getBody()
211-
);
212-
}
213201

214202
switch($statusCode) {
215203
case 200:
@@ -268,6 +256,19 @@ public function cloneDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_
268256
];
269257
}
270258

259+
if ($statusCode < 200 || $statusCode > 299) {
260+
throw new ApiException(
261+
sprintf(
262+
'[%d] Error connecting to the API (%s)',
263+
$statusCode,
264+
(string) $request->getUri()
265+
),
266+
$statusCode,
267+
$response->getHeaders(),
268+
(string) $response->getBody()
269+
);
270+
}
271+
271272
$returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3';
272273
if ($returnType === '\SplFileObject') {
273274
$content = $response->getBody(); //stream goes to serializer
@@ -563,18 +564,6 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input
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
switch($statusCode) {
580569
case 201:
@@ -660,6 +649,19 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input
660649
];
661650
}
662651

652+
if ($statusCode < 200 || $statusCode > 299) {
653+
throw new ApiException(
654+
sprintf(
655+
'[%d] Error connecting to the API (%s)',
656+
$statusCode,
657+
(string) $request->getUri()
658+
),
659+
$statusCode,
660+
$response->getHeaders(),
661+
(string) $response->getBody()
662+
);
663+
}
664+
663665
$returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3';
664666
if ($returnType === '\SplFileObject') {
665667
$content = $response->getBody(); //stream goes to serializer
@@ -962,18 +964,6 @@ public function purgeDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_
962964

963965
$statusCode = $response->getStatusCode();
964966

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

978968
return [null, $statusCode, $response->getHeaders()];
979969

@@ -1223,18 +1213,6 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s
12231213

12241214
$statusCode = $response->getStatusCode();
12251215

1226-
if ($statusCode < 200 || $statusCode > 299) {
1227-
throw new ApiException(
1228-
sprintf(
1229-
'[%d] Error connecting to the API (%s)',
1230-
$statusCode,
1231-
(string) $request->getUri()
1232-
),
1233-
$statusCode,
1234-
$response->getHeaders(),
1235-
(string) $response->getBody()
1236-
);
1237-
}
12381216

12391217
switch($statusCode) {
12401218
case 200:
@@ -1320,6 +1298,19 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s
13201298
];
13211299
}
13221300

1301+
if ($statusCode < 200 || $statusCode > 299) {
1302+
throw new ApiException(
1303+
sprintf(
1304+
'[%d] Error connecting to the API (%s)',
1305+
$statusCode,
1306+
(string) $request->getUri()
1307+
),
1308+
$statusCode,
1309+
$response->getHeaders(),
1310+
(string) $response->getBody()
1311+
);
1312+
}
1313+
13231314
$returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3';
13241315
if ($returnType === '\SplFileObject') {
13251316
$content = $response->getBody(); //stream goes to serializer
@@ -1623,18 +1614,6 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string
16231614

16241615
$statusCode = $response->getStatusCode();
16251616

1626-
if ($statusCode < 200 || $statusCode > 299) {
1627-
throw new ApiException(
1628-
sprintf(
1629-
'[%d] Error connecting to the API (%s)',
1630-
$statusCode,
1631-
(string) $request->getUri()
1632-
),
1633-
$statusCode,
1634-
$response->getHeaders(),
1635-
(string) $response->getBody()
1636-
);
1637-
}
16381617

16391618
switch($statusCode) {
16401619
case 200:
@@ -1720,6 +1699,19 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string
17201699
];
17211700
}
17221701

1702+
if ($statusCode < 200 || $statusCode > 299) {
1703+
throw new ApiException(
1704+
sprintf(
1705+
'[%d] Error connecting to the API (%s)',
1706+
$statusCode,
1707+
(string) $request->getUri()
1708+
),
1709+
$statusCode,
1710+
$response->getHeaders(),
1711+
(string) $response->getBody()
1712+
);
1713+
}
1714+
17231715
$returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3';
17241716
if ($returnType === '\SplFileObject') {
17251717
$content = $response->getBody(); //stream goes to serializer
@@ -2023,18 +2015,6 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu
20232015

20242016
$statusCode = $response->getStatusCode();
20252017

2026-
if ($statusCode < 200 || $statusCode > 299) {
2027-
throw new ApiException(
2028-
sprintf(
2029-
'[%d] Error connecting to the API (%s)',
2030-
$statusCode,
2031-
(string) $request->getUri()
2032-
),
2033-
$statusCode,
2034-
$response->getHeaders(),
2035-
(string) $response->getBody()
2036-
);
2037-
}
20382018

20392019
switch($statusCode) {
20402020
case 200:
@@ -2120,6 +2100,19 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu
21202100
];
21212101
}
21222102

2103+
if ($statusCode < 200 || $statusCode > 299) {
2104+
throw new ApiException(
2105+
sprintf(
2106+
'[%d] Error connecting to the API (%s)',
2107+
$statusCode,
2108+
(string) $request->getUri()
2109+
),
2110+
$statusCode,
2111+
$response->getHeaders(),
2112+
(string) $response->getBody()
2113+
);
2114+
}
2115+
21232116
$returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3';
21242117
if ($returnType === '\SplFileObject') {
21252118
$content = $response->getBody(); //stream goes to serializer
@@ -2423,18 +2416,6 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input
24232416

24242417
$statusCode = $response->getStatusCode();
24252418

2426-
if ($statusCode < 200 || $statusCode > 299) {
2427-
throw new ApiException(
2428-
sprintf(
2429-
'[%d] Error connecting to the API (%s)',
2430-
$statusCode,
2431-
(string) $request->getUri()
2432-
),
2433-
$statusCode,
2434-
$response->getHeaders(),
2435-
(string) $response->getBody()
2436-
);
2437-
}
24382419

24392420
switch($statusCode) {
24402421
case 200:
@@ -2520,6 +2501,19 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input
25202501
];
25212502
}
25222503

2504+
if ($statusCode < 200 || $statusCode > 299) {
2505+
throw new ApiException(
2506+
sprintf(
2507+
'[%d] Error connecting to the API (%s)',
2508+
$statusCode,
2509+
(string) $request->getUri()
2510+
),
2511+
$statusCode,
2512+
$response->getHeaders(),
2513+
(string) $response->getBody()
2514+
);
2515+
}
2516+
25232517
$returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3';
25242518
if ($returnType === '\SplFileObject') {
25252519
$content = $response->getBody(); //stream goes to serializer

0 commit comments

Comments
 (0)