Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/12.0.0...HEAD)
## [Unreleased](https://github.com/HubSpot/hubspot-api-php/compare/12.1.0...HEAD)

## [12.1.0](https://github.com/HubSpot/hubspot-api-php/releases/tag/12.1.0) - 2024-04-08

## Updated

- Added `crm()->commerce()->invoices()` api client.
- Added `crm()->exports()` api client.
- Added `crm()->objects()->dealSplits()` api client.
- Added `marketing()->emails()` api client.

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

Expand Down Expand Up @@ -846,7 +855,7 @@ ListAssociationsApi
25. getSubscriptions => getAll (webhooks()->subscriptionsApi())
26. updateSubscription => update (webhooks()->subscriptionsApi())

[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/12.0.0...HEAD
[Unreleased]: https://github.com/HubSpot/hubspot-api-php/compare/12.1.0...HEAD
[1.0.0-beta]: https://github.com/HubSpot/hubspot-api-php/releases/tag/v1.0.0-beta
[1.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.1.0
[1.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/1.2.0
Expand Down Expand Up @@ -904,3 +913,4 @@ ListAssociationsApi
[11.2.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/11.2.0
[11.3.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/11.3.0
[12.0.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/12.0.0
[12.1.0]: https://github.com/HubSpot/hubspot-api-php/releases/tag/12.1.0
244 changes: 118 additions & 126 deletions codegen/Crm/Commerce/Invoices/Api/BasicApi.php

Large diffs are not rendered by default.

134 changes: 63 additions & 71 deletions codegen/Crm/Commerce/Invoices/Api/BatchApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: v3
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.3.0
* Generator version: 7.12.0
*/

/**
Expand Down Expand Up @@ -95,13 +95,13 @@ class BatchApi
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
ClientInterface $client = null,
Configuration $config = null,
HeaderSelector $selector = null,
$hostIndex = 0
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: new Configuration();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
Expand Down Expand Up @@ -189,18 +189,6 @@ public function archiveWithHttpInfo($batch_input_simple_public_object_id, string

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

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

Expand Down Expand Up @@ -430,18 +418,6 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 201:
Expand Down Expand Up @@ -527,6 +503,19 @@ public function createWithHttpInfo($batch_input_simple_public_object_batch_input
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -760,7 +749,7 @@ public function createRequest($batch_input_simple_public_object_batch_input_for_
* Read a batch of invoices by internal ID, or unique property values
*
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id batch_read_input_simple_public_object_id (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format
Expand All @@ -779,7 +768,7 @@ public function read($batch_read_input_simple_public_object_id, $archived = fals
* Read a batch of invoices by internal ID, or unique property values
*
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Crm\Commerce\Invoices\ApiException on non-2xx response or if the response body is not in the expected format
Expand Down Expand Up @@ -812,18 +801,6 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -909,6 +886,19 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -974,7 +964,7 @@ public function readWithHttpInfo($batch_read_input_simple_public_object_id, $arc
* Read a batch of invoices by internal ID, or unique property values
*
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand All @@ -996,7 +986,7 @@ function ($response) {
* Read a batch of invoices by internal ID, or unique property values
*
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -1047,7 +1037,7 @@ function ($exception) {
* Create request for operation 'read'
*
* @param \HubSpot\Client\Crm\Commerce\Invoices\Model\BatchReadInputSimplePublicObjectId $batch_read_input_simple_public_object_id (required)
* @param bool $archived Whether to return only results that have been archived. (optional, default to false)
* @param bool|null $archived Whether to return only results that have been archived. (optional, default to false)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['read'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -1205,18 +1195,6 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -1302,6 +1280,19 @@ public function updateWithHttpInfo($batch_input_simple_public_object_batch_input
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicObject';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -1585,18 +1576,6 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -1682,6 +1661,19 @@ public function upsertWithHttpInfo($batch_input_simple_public_object_batch_input
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\BatchResponseSimplePublicUpsertObject';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down
37 changes: 19 additions & 18 deletions codegen/Crm/Commerce/Invoices/Api/SearchApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: v3
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.3.0
* Generator version: 7.12.0
*/

/**
Expand Down Expand Up @@ -83,13 +83,13 @@ class SearchApi
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
*/
public function __construct(
ClientInterface $client = null,
Configuration $config = null,
HeaderSelector $selector = null,
$hostIndex = 0
?ClientInterface $client = null,
?Configuration $config = null,
?HeaderSelector $selector = null,
int $hostIndex = 0
) {
$this->client = $client ?: new Client();
$this->config = $config ?: new Configuration();
$this->config = $config ?: Configuration::getDefaultConfiguration();
$this->headerSelector = $selector ?: new HeaderSelector();
$this->hostIndex = $hostIndex;
}
Expand Down Expand Up @@ -178,18 +178,6 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont

$statusCode = $response->getStatusCode();

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -248,6 +236,19 @@ public function doSearchWithHttpInfo($public_object_search_request, string $cont
];
}

if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
(string) $request->getUri()
),
$statusCode,
$response->getHeaders(),
(string) $response->getBody()
);
}

$returnType = '\HubSpot\Client\Crm\Commerce\Invoices\Model\CollectionResponseWithTotalSimplePublicObjectForwardPaging';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down
8 changes: 4 additions & 4 deletions codegen/Crm/Commerce/Invoices/ApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The version of the OpenAPI document: v3
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 7.3.0
* Generator version: 7.12.0
*/

/**
Expand Down Expand Up @@ -49,7 +49,7 @@ class ApiException extends Exception
/**
* The HTTP header of the server response.
*
* @var string[]|null
* @var string[][]|null
*/
protected $responseHeaders;

Expand All @@ -65,7 +65,7 @@ class ApiException extends Exception
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string[]|null $responseHeaders HTTP response header
* @param string[][]|null $responseHeaders HTTP response header
* @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string
*/
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
Expand All @@ -78,7 +78,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re
/**
* Gets the HTTP response header
*
* @return string[]|null HTTP response header
* @return string[][]|null HTTP response header
*/
public function getResponseHeaders()
{
Expand Down
Loading