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
82 changes: 36 additions & 46 deletions codegen/Webhooks/Api/SettingsApi.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 @@ -89,13 +89,13 @@ class SettingsApi
* @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 @@ -183,18 +183,6 @@ public function clearWithHttpInfo($app_id, string $contentType = self::contentTy

$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 @@ -373,7 +361,7 @@ public function clearRequest($app_id, string $contentType = self::contentTypes['
/**
* Operation configure
*
* Delete webhook settings
* Update webhook settings
*
* @param int $app_id The ID of the app. (required)
* @param \HubSpot\Client\Webhooks\Model\SettingsChangeRequest $settings_change_request settings_change_request (required)
Expand All @@ -392,7 +380,7 @@ public function configure($app_id, $settings_change_request, string $contentType
/**
* Operation configureWithHttpInfo
*
* Delete webhook settings
* Update webhook settings
*
* @param int $app_id The ID of the app. (required)
* @param \HubSpot\Client\Webhooks\Model\SettingsChangeRequest $settings_change_request (required)
Expand Down Expand Up @@ -428,18 +416,6 @@ public function configureWithHttpInfo($app_id, $settings_change_request, 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()
);
}

switch($statusCode) {
case 200:
Expand Down Expand Up @@ -498,6 +474,19 @@ public function configureWithHttpInfo($app_id, $settings_change_request, string
];
}

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\Webhooks\Model\SettingsResponse';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down Expand Up @@ -552,7 +541,7 @@ public function configureWithHttpInfo($app_id, $settings_change_request, string
/**
* Operation configureAsync
*
* Delete webhook settings
* Update webhook settings
*
* @param int $app_id The ID of the app. (required)
* @param \HubSpot\Client\Webhooks\Model\SettingsChangeRequest $settings_change_request (required)
Expand All @@ -574,7 +563,7 @@ function ($response) {
/**
* Operation configureAsyncWithHttpInfo
*
* Delete webhook settings
* Update webhook settings
*
* @param int $app_id The ID of the app. (required)
* @param \HubSpot\Client\Webhooks\Model\SettingsChangeRequest $settings_change_request (required)
Expand Down Expand Up @@ -792,18 +781,6 @@ public function getAllWithHttpInfo($app_id, string $contentType = self::contentT

$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 @@ -862,6 +839,19 @@ public function getAllWithHttpInfo($app_id, string $contentType = self::contentT
];
}

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\Webhooks\Model\SettingsResponse';
if ($returnType === '\SplFileObject') {
$content = $response->getBody(); //stream goes to serializer
Expand Down
Loading