Skip to content

Commit

Permalink
CRM Objects: Update codegenerator to 7.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksvirkou-hubspot committed Feb 28, 2024
1 parent b4012cf commit 9bd653e
Show file tree
Hide file tree
Showing 168 changed files with 17,608 additions and 2,212 deletions.
481 changes: 339 additions & 142 deletions codegen/Crm/Objects/Api/BasicApi.php

Large diffs are not rendered by default.

423 changes: 302 additions & 121 deletions codegen/Crm/Objects/Api/BatchApi.php

Large diffs are not rendered by default.

68 changes: 40 additions & 28 deletions codegen/Crm/Objects/Api/GDPRApi.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: 6.0.1
* OpenAPI Generator version: 7.3.0
*/

/**
Expand Down Expand Up @@ -69,6 +69,13 @@ class GDPRApi
*/
protected $hostIndex;

/** @var string[] $contentTypes **/
public const contentTypes = [
'purge' => [
'application/json',
],
];

/**
* @param ClientInterface $client
* @param Configuration $config
Expand Down Expand Up @@ -122,14 +129,15 @@ public function getConfig()
*
* @param string $object_type object_type (required)
* @param \HubSpot\Client\Crm\Objects\Model\PublicGdprDeleteInput $public_gdpr_delete_input public_gdpr_delete_input (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['purge'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Crm\Objects\ApiException on non-2xx response
* @throws \HubSpot\Client\Crm\Objects\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return void
*/
public function purge($object_type, $public_gdpr_delete_input)
public function purge($object_type, $public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
$this->purgeWithHttpInfo($object_type, $public_gdpr_delete_input);
$this->purgeWithHttpInfo($object_type, $public_gdpr_delete_input, $contentType);
}

/**
Expand All @@ -139,14 +147,15 @@ public function purge($object_type, $public_gdpr_delete_input)
*
* @param string $object_type (required)
* @param \HubSpot\Client\Crm\Objects\Model\PublicGdprDeleteInput $public_gdpr_delete_input (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['purge'] to see the possible values for this operation
*
* @throws \HubSpot\Client\Crm\Objects\ApiException on non-2xx response
* @throws \HubSpot\Client\Crm\Objects\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return array of null, HTTP status code, HTTP response headers (array of strings)
*/
public function purgeWithHttpInfo($object_type, $public_gdpr_delete_input)
public function purgeWithHttpInfo($object_type, $public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
$request = $this->purgeRequest($object_type, $public_gdpr_delete_input);
$request = $this->purgeRequest($object_type, $public_gdpr_delete_input, $contentType);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -207,13 +216,14 @@ public function purgeWithHttpInfo($object_type, $public_gdpr_delete_input)
*
* @param string $object_type (required)
* @param \HubSpot\Client\Crm\Objects\Model\PublicGdprDeleteInput $public_gdpr_delete_input (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['purge'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function purgeAsync($object_type, $public_gdpr_delete_input)
public function purgeAsync($object_type, $public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
return $this->purgeAsyncWithHttpInfo($object_type, $public_gdpr_delete_input)
return $this->purgeAsyncWithHttpInfo($object_type, $public_gdpr_delete_input, $contentType)
->then(
function ($response) {
return $response[0];
Expand All @@ -228,14 +238,15 @@ function ($response) {
*
* @param string $object_type (required)
* @param \HubSpot\Client\Crm\Objects\Model\PublicGdprDeleteInput $public_gdpr_delete_input (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['purge'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function purgeAsyncWithHttpInfo($object_type, $public_gdpr_delete_input)
public function purgeAsyncWithHttpInfo($object_type, $public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
$returnType = '';
$request = $this->purgeRequest($object_type, $public_gdpr_delete_input);
$request = $this->purgeRequest($object_type, $public_gdpr_delete_input, $contentType);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -265,25 +276,29 @@ function ($exception) {
*
* @param string $object_type (required)
* @param \HubSpot\Client\Crm\Objects\Model\PublicGdprDeleteInput $public_gdpr_delete_input (required)
* @param string $contentType The value for the Content-Type header. Check self::contentTypes['purge'] to see the possible values for this operation
*
* @throws \InvalidArgumentException
* @return \GuzzleHttp\Psr7\Request
*/
public function purgeRequest($object_type, $public_gdpr_delete_input)
public function purgeRequest($object_type, $public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{

// verify the required parameter 'object_type' is set
if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $object_type when calling purge'
);
}

// verify the required parameter 'public_gdpr_delete_input' is set
if ($public_gdpr_delete_input === null || (is_array($public_gdpr_delete_input) && count($public_gdpr_delete_input) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $public_gdpr_delete_input when calling purge'
);
}


$resourcePath = '/crm/v3/objects/{objectType}/gdpr-delete';
$formParams = [];
$queryParams = [];
Expand All @@ -303,21 +318,17 @@ public function purgeRequest($object_type, $public_gdpr_delete_input)
}


if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['*/*']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['*/*'],
['application/json']
);
}
$headers = $this->headerSelector->selectHeaders(
['*/*', ],
$contentType,
$multipart
);

// for model (json/xml)
if (isset($public_gdpr_delete_input)) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($public_gdpr_delete_input));
if (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the body
$httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($public_gdpr_delete_input));
} else {
$httpBody = $public_gdpr_delete_input;
}
Expand All @@ -336,9 +347,9 @@ public function purgeRequest($object_type, $public_gdpr_delete_input)
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);

} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);

} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
# if Content-Type contains "application/json", json_encode the form parameters
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
} else {
// for HTTP post (form)
$httpBody = ObjectSerializer::buildQuery($formParams);
Expand All @@ -361,10 +372,11 @@ public function purgeRequest($object_type, $public_gdpr_delete_input)
$headers
);

$operationHost = $this->config->getHost();
$query = ObjectSerializer::buildQuery($queryParams);
return new Request(
'POST',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
Expand Down
Loading

0 comments on commit 9bd653e

Please sign in to comment.