Skip to content

Commit 57bc81c

Browse files
Codegen: CRM Timeline
1 parent bbd8f54 commit 57bc81c

25 files changed

Lines changed: 315 additions & 263 deletions

codegen/Crm/Timeline/Api/EventsApi.php

Lines changed: 63 additions & 71 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
/**
@@ -95,13 +95,13 @@ class EventsApi
9595
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
9696
*/
9797
public function __construct(
98-
ClientInterface $client = null,
99-
Configuration $config = null,
100-
HeaderSelector $selector = null,
101-
$hostIndex = 0
98+
?ClientInterface $client = null,
99+
?Configuration $config = null,
100+
?HeaderSelector $selector = null,
101+
int $hostIndex = 0
102102
) {
103103
$this->client = $client ?: new Client();
104-
$this->config = $config ?: new Configuration();
104+
$this->config = $config ?: Configuration::getDefaultConfiguration();
105105
$this->headerSelector = $selector ?: new HeaderSelector();
106106
$this->hostIndex = $hostIndex;
107107
}
@@ -190,18 +190,6 @@ public function createWithHttpInfo($timeline_event, string $contentType = self::
190190

191191
$statusCode = $response->getStatusCode();
192192

193-
if ($statusCode < 200 || $statusCode > 299) {
194-
throw new ApiException(
195-
sprintf(
196-
'[%d] Error connecting to the API (%s)',
197-
$statusCode,
198-
(string) $request->getUri()
199-
),
200-
$statusCode,
201-
$response->getHeaders(),
202-
(string) $response->getBody()
203-
);
204-
}
205193

206194
switch($statusCode) {
207195
case 201:
@@ -260,6 +248,19 @@ public function createWithHttpInfo($timeline_event, string $contentType = self::
260248
];
261249
}
262250

251+
if ($statusCode < 200 || $statusCode > 299) {
252+
throw new ApiException(
253+
sprintf(
254+
'[%d] Error connecting to the API (%s)',
255+
$statusCode,
256+
(string) $request->getUri()
257+
),
258+
$statusCode,
259+
$response->getHeaders(),
260+
(string) $response->getBody()
261+
);
262+
}
263+
263264
$returnType = '\HubSpot\Client\Crm\Timeline\Model\TimelineEventResponse';
264265
if ($returnType === '\SplFileObject') {
265266
$content = $response->getBody(); //stream goes to serializer
@@ -534,18 +535,6 @@ public function createBatchWithHttpInfo($batch_input_timeline_event, string $con
534535

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

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

550539
return [null, $statusCode, $response->getHeaders()];
551540

@@ -793,18 +782,6 @@ public function getByIdWithHttpInfo($event_template_id, $event_id, string $conte
793782

794783
$statusCode = $response->getStatusCode();
795784

796-
if ($statusCode < 200 || $statusCode > 299) {
797-
throw new ApiException(
798-
sprintf(
799-
'[%d] Error connecting to the API (%s)',
800-
$statusCode,
801-
(string) $request->getUri()
802-
),
803-
$statusCode,
804-
$response->getHeaders(),
805-
(string) $response->getBody()
806-
);
807-
}
808785

809786
switch($statusCode) {
810787
case 200:
@@ -863,6 +840,19 @@ public function getByIdWithHttpInfo($event_template_id, $event_id, string $conte
863840
];
864841
}
865842

843+
if ($statusCode < 200 || $statusCode > 299) {
844+
throw new ApiException(
845+
sprintf(
846+
'[%d] Error connecting to the API (%s)',
847+
$statusCode,
848+
(string) $request->getUri()
849+
),
850+
$statusCode,
851+
$response->getHeaders(),
852+
(string) $response->getBody()
853+
);
854+
}
855+
866856
$returnType = '\HubSpot\Client\Crm\Timeline\Model\TimelineEventResponse';
867857
if ($returnType === '\SplFileObject') {
868858
$content = $response->getBody(); //stream goes to serializer
@@ -1159,18 +1149,6 @@ public function getDetailByIdWithHttpInfo($event_template_id, $event_id, string
11591149

11601150
$statusCode = $response->getStatusCode();
11611151

1162-
if ($statusCode < 200 || $statusCode > 299) {
1163-
throw new ApiException(
1164-
sprintf(
1165-
'[%d] Error connecting to the API (%s)',
1166-
$statusCode,
1167-
(string) $request->getUri()
1168-
),
1169-
$statusCode,
1170-
$response->getHeaders(),
1171-
(string) $response->getBody()
1172-
);
1173-
}
11741152

11751153
switch($statusCode) {
11761154
case 200:
@@ -1229,6 +1207,19 @@ public function getDetailByIdWithHttpInfo($event_template_id, $event_id, string
12291207
];
12301208
}
12311209

1210+
if ($statusCode < 200 || $statusCode > 299) {
1211+
throw new ApiException(
1212+
sprintf(
1213+
'[%d] Error connecting to the API (%s)',
1214+
$statusCode,
1215+
(string) $request->getUri()
1216+
),
1217+
$statusCode,
1218+
$response->getHeaders(),
1219+
(string) $response->getBody()
1220+
);
1221+
}
1222+
12321223
$returnType = '\HubSpot\Client\Crm\Timeline\Model\EventDetail';
12331224
if ($returnType === '\SplFileObject') {
12341225
$content = $response->getBody(); //stream goes to serializer
@@ -1474,7 +1465,7 @@ public function getDetailByIdRequest($event_template_id, $event_id, string $cont
14741465
*
14751466
* @param string $event_template_id The event template ID. (required)
14761467
* @param string $event_id The event ID. (required)
1477-
* @param bool $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
1468+
* @param bool|null $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
14781469
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRenderById'] to see the possible values for this operation
14791470
*
14801471
* @throws \HubSpot\Client\Crm\Timeline\ApiException on non-2xx response or if the response body is not in the expected format
@@ -1494,7 +1485,7 @@ public function getRenderById($event_template_id, $event_id, $detail = null, str
14941485
*
14951486
* @param string $event_template_id The event template ID. (required)
14961487
* @param string $event_id The event ID. (required)
1497-
* @param bool $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
1488+
* @param bool|null $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
14981489
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRenderById'] to see the possible values for this operation
14991490
*
15001491
* @throws \HubSpot\Client\Crm\Timeline\ApiException on non-2xx response or if the response body is not in the expected format
@@ -1527,18 +1518,6 @@ public function getRenderByIdWithHttpInfo($event_template_id, $event_id, $detail
15271518

15281519
$statusCode = $response->getStatusCode();
15291520

1530-
if ($statusCode < 200 || $statusCode > 299) {
1531-
throw new ApiException(
1532-
sprintf(
1533-
'[%d] Error connecting to the API (%s)',
1534-
$statusCode,
1535-
(string) $request->getUri()
1536-
),
1537-
$statusCode,
1538-
$response->getHeaders(),
1539-
(string) $response->getBody()
1540-
);
1541-
}
15421521

15431522
switch($statusCode) {
15441523
case 200:
@@ -1597,6 +1576,19 @@ public function getRenderByIdWithHttpInfo($event_template_id, $event_id, $detail
15971576
];
15981577
}
15991578

1579+
if ($statusCode < 200 || $statusCode > 299) {
1580+
throw new ApiException(
1581+
sprintf(
1582+
'[%d] Error connecting to the API (%s)',
1583+
$statusCode,
1584+
(string) $request->getUri()
1585+
),
1586+
$statusCode,
1587+
$response->getHeaders(),
1588+
(string) $response->getBody()
1589+
);
1590+
}
1591+
16001592
$returnType = 'string';
16011593
if ($returnType === '\SplFileObject') {
16021594
$content = $response->getBody(); //stream goes to serializer
@@ -1655,7 +1647,7 @@ public function getRenderByIdWithHttpInfo($event_template_id, $event_id, $detail
16551647
*
16561648
* @param string $event_template_id The event template ID. (required)
16571649
* @param string $event_id The event ID. (required)
1658-
* @param bool $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
1650+
* @param bool|null $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
16591651
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRenderById'] to see the possible values for this operation
16601652
*
16611653
* @throws \InvalidArgumentException
@@ -1678,7 +1670,7 @@ function ($response) {
16781670
*
16791671
* @param string $event_template_id The event template ID. (required)
16801672
* @param string $event_id The event ID. (required)
1681-
* @param bool $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
1673+
* @param bool|null $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
16821674
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRenderById'] to see the possible values for this operation
16831675
*
16841676
* @throws \InvalidArgumentException
@@ -1730,7 +1722,7 @@ function ($exception) {
17301722
*
17311723
* @param string $event_template_id The event template ID. (required)
17321724
* @param string $event_id The event ID. (required)
1733-
* @param bool $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
1725+
* @param bool|null $detail Set to &#39;true&#39;, we want to render the &#x60;detailTemplate&#x60; instead of the &#x60;headerTemplate&#x60;. (optional)
17341726
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['getRenderById'] to see the possible values for this operation
17351727
*
17361728
* @throws \InvalidArgumentException

0 commit comments

Comments
 (0)