Skip to content

Commit 9bce1a2

Browse files
Merge pull request #444 from HubSpot/feature/updateGenVersionNewClients
Update generator version: New clients
2 parents 10039a0 + e73dabf commit 9bce1a2

File tree

120 files changed

+1358
-1093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1358
-1093
lines changed

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/12.0.0...HEAD)
8+
## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/12.1.0...HEAD)
9+
10+
## [12.1.0](https://github.com/HubSpot/hubspot-api-php/releases/tag/12.1.0) - 2024-04-08
11+
12+
## Updated
13+
14+
- Added `crm()->commerce()->invoices()` api client.
15+
- Added `crm()->exports()` api client.
16+
- Added `crm()->objects()->dealSplits()` api client.
17+
- Added `marketing()->emails()` api client.
918

1019
## [12.0.0](https://github.com/HubSpot/hubspot-api-php/releases/tag/12.0.0) - 2024-10-28
1120

@@ -846,7 +855,7 @@ ListAssociationsApi
846855
25. getSubscriptions => getAll (webhooks()->subscriptionsApi())
847856
26. updateSubscription => update (webhooks()->subscriptionsApi())
848857

849-
[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/12.0.0...HEAD
858+
[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/12.1.0...HEAD
850859
[1.0.0-beta]: https://github.com/HubSpot/hubspot-api-php/releases/tag/v1.0.0-beta
851860
[1.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.1.0
852861
[1.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.2.0
@@ -904,3 +913,4 @@ ListAssociationsApi
904913
[11.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/11.2.0
905914
[11.3.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/11.3.0
906915
[12.0.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/12.0.0
916+
[12.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/12.1.0

codegen/Crm/Commerce/Invoices/Api/BasicApi.php

Lines changed: 118 additions & 126 deletions
Large diffs are not rendered by default.

codegen/Crm/Commerce/Invoices/Api/BatchApi.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 BatchApi
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
}
@@ -189,18 +189,6 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string
189189

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

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

205193
return [null, $statusCode, $response->getHeaders()];
206194

@@ -430,18 +418,6 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input
430418

431419
$statusCode = $response->getStatusCode();
432420

433-
if ($statusCode < 200 || $statusCode > 299) {
434-
throw new ApiException(
435-
sprintf(
436-
'[%d] Error connecting to the API (%s)',
437-
$statusCode,
438-
(string) $request->getUri()
439-
),
440-
$statusCode,
441-
$response->getHeaders(),
442-
(string) $response->getBody()
443-
);
444-
}
445421

446422
switch($statusCode) {
447423
case 201:
@@ -527,6 +503,19 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input
527503
];
528504
}
529505

506+
if ($statusCode < 200 || $statusCode > 299) {
507+
throw new ApiException(
508+
sprintf(
509+
'[%d] Error connecting to the API (%s)',
510+
$statusCode,
511+
(string) $request->getUri()
512+
),
513+
$statusCode,
514+
$response->getHeaders(),
515+
(string) $response->getBody()
516+
);
517+
}
518+
530519
$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject';
531520
if ($returnType === '\SplFileObject') {
532521
$content = $response->getBody(); //stream goes to serializer
@@ -760,7 +749,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_
760749
* Read a batch of invoices by internal ID, or unique property values
761750
*
762751
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id batch_read_input_simple_public_object_id (required)
763-
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
752+
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
764753
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
765754
*
766755
* @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format
@@ -779,7 +768,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals
779768
* Read a batch of invoices by internal ID, or unique property values
780769
*
781770
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
782-
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
771+
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
783772
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
784773
*
785774
* @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format
@@ -812,18 +801,6 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc
812801

813802
$statusCode = $response->getStatusCode();
814803

815-
if ($statusCode < 200 || $statusCode > 299) {
816-
throw new ApiException(
817-
sprintf(
818-
'[%d] Error connecting to the API (%s)',
819-
$statusCode,
820-
(string) $request->getUri()
821-
),
822-
$statusCode,
823-
$response->getHeaders(),
824-
(string) $response->getBody()
825-
);
826-
}
827804

828805
switch($statusCode) {
829806
case 200:
@@ -909,6 +886,19 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc
909886
];
910887
}
911888

889+
if ($statusCode < 200 || $statusCode > 299) {
890+
throw new ApiException(
891+
sprintf(
892+
'[%d] Error connecting to the API (%s)',
893+
$statusCode,
894+
(string) $request->getUri()
895+
),
896+
$statusCode,
897+
$response->getHeaders(),
898+
(string) $response->getBody()
899+
);
900+
}
901+
912902
$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject';
913903
if ($returnType === '\SplFileObject') {
914904
$content = $response->getBody(); //stream goes to serializer
@@ -974,7 +964,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc
974964
* Read a batch of invoices by internal ID, or unique property values
975965
*
976966
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
977-
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
967+
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
978968
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
979969
*
980970
* @throws \InvalidArgumentException
@@ -996,7 +986,7 @@ function ($response) {
996986
* Read a batch of invoices by internal ID, or unique property values
997987
*
998988
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
999-
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
989+
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
1000990
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
1001991
*
1002992
* @throws \InvalidArgumentException
@@ -1047,7 +1037,7 @@ function ($exception) {
10471037
* Create request for operation 'read'
10481038
*
10491039
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
1050-
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
1040+
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
10511041
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
10521042
*
10531043
* @throws \InvalidArgumentException
@@ -1205,18 +1195,6 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input
12051195

12061196
$statusCode = $response->getStatusCode();
12071197

1208-
if ($statusCode < 200 || $statusCode > 299) {
1209-
throw new ApiException(
1210-
sprintf(
1211-
'[%d] Error connecting to the API (%s)',
1212-
$statusCode,
1213-
(string) $request->getUri()
1214-
),
1215-
$statusCode,
1216-
$response->getHeaders(),
1217-
(string) $response->getBody()
1218-
);
1219-
}
12201198

12211199
switch($statusCode) {
12221200
case 200:
@@ -1302,6 +1280,19 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input
13021280
];
13031281
}
13041282

1283+
if ($statusCode < 200 || $statusCode > 299) {
1284+
throw new ApiException(
1285+
sprintf(
1286+
'[%d] Error connecting to the API (%s)',
1287+
$statusCode,
1288+
(string) $request->getUri()
1289+
),
1290+
$statusCode,
1291+
$response->getHeaders(),
1292+
(string) $response->getBody()
1293+
);
1294+
}
1295+
13051296
$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject';
13061297
if ($returnType === '\SplFileObject') {
13071298
$content = $response->getBody(); //stream goes to serializer
@@ -1585,18 +1576,6 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input
15851576

15861577
$statusCode = $response->getStatusCode();
15871578

1588-
if ($statusCode < 200 || $statusCode > 299) {
1589-
throw new ApiException(
1590-
sprintf(
1591-
'[%d] Error connecting to the API (%s)',
1592-
$statusCode,
1593-
(string) $request->getUri()
1594-
),
1595-
$statusCode,
1596-
$response->getHeaders(),
1597-
(string) $response->getBody()
1598-
);
1599-
}
16001579

16011580
switch($statusCode) {
16021581
case 200:
@@ -1682,6 +1661,19 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input
16821661
];
16831662
}
16841663

1664+
if ($statusCode < 200 || $statusCode > 299) {
1665+
throw new ApiException(
1666+
sprintf(
1667+
'[%d] Error connecting to the API (%s)',
1668+
$statusCode,
1669+
(string) $request->getUri()
1670+
),
1671+
$statusCode,
1672+
$response->getHeaders(),
1673+
(string) $response->getBody()
1674+
);
1675+
}
1676+
16851677
$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicUpsertObject';
16861678
if ($returnType === '\SplFileObject') {
16871679
$content = $response->getBody(); //stream goes to serializer

codegen/Crm/Commerce/Invoices/Api/SearchApi.php

Lines changed: 19 additions & 18 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
/**
@@ -83,13 +83,13 @@ class SearchApi
8383
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
8484
*/
8585
public function __construct(
86-
ClientInterface $client = null,
87-
Configuration $config = null,
88-
HeaderSelector $selector = null,
89-
$hostIndex = 0
86+
?ClientInterface $client = null,
87+
?Configuration $config = null,
88+
?HeaderSelector $selector = null,
89+
int $hostIndex = 0
9090
) {
9191
$this->client = $client ?: new Client();
92-
$this->config = $config ?: new Configuration();
92+
$this->config = $config ?: Configuration::getDefaultConfiguration();
9393
$this->headerSelector = $selector ?: new HeaderSelector();
9494
$this->hostIndex = $hostIndex;
9595
}
@@ -178,18 +178,6 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont
178178

179179
$statusCode = $response->getStatusCode();
180180

181-
if ($statusCode < 200 || $statusCode > 299) {
182-
throw new ApiException(
183-
sprintf(
184-
'[%d] Error connecting to the API (%s)',
185-
$statusCode,
186-
(string) $request->getUri()
187-
),
188-
$statusCode,
189-
$response->getHeaders(),
190-
(string) $response->getBody()
191-
);
192-
}
193181

194182
switch($statusCode) {
195183
case 200:
@@ -248,6 +236,19 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont
248236
];
249237
}
250238

239+
if ($statusCode < 200 || $statusCode > 299) {
240+
throw new ApiException(
241+
sprintf(
242+
'[%d] Error connecting to the API (%s)',
243+
$statusCode,
244+
(string) $request->getUri()
245+
),
246+
$statusCode,
247+
$response->getHeaders(),
248+
(string) $response->getBody()
249+
);
250+
}
251+
251252
$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging';
252253
if ($returnType === '\SplFileObject') {
253254
$content = $response->getBody(); //stream goes to serializer

codegen/Crm/Commerce/Invoices/ApiException.php

Lines changed: 4 additions & 4 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
/**
@@ -49,7 +49,7 @@ class ApiException extends Exception
4949
/**
5050
* The HTTP header of the server response.
5151
*
52-
* @var string[]|null
52+
* @var string[][]|null
5353
*/
5454
protected $responseHeaders;
5555

@@ -65,7 +65,7 @@ class ApiException extends Exception
6565
*
6666
* @param string $message Error message
6767
* @param int $code HTTP status code
68-
* @param string[]|null $responseHeaders HTTP response header
68+
* @param string[][]|null $responseHeaders HTTP response header
6969
* @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string
7070
*/
7171
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
@@ -78,7 +78,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re
7878
/**
7979
* Gets the HTTP response header
8080
*
81-
* @return string[]|null HTTP response header
81+
* @return string[][]|null HTTP response header
8282
*/
8383
public function getResponseHeaders()
8484
{

0 commit comments

Comments
 (0)