Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM Objects: Update generator version to 7.3.0. #344

Merged
merged 1 commit into from
Feb 28, 2024
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
476 changes: 334 additions & 142 deletions codegen/Crm/Objects/Emails/Api/BasicApi.php

Large diffs are not rendered by default.

419 changes: 298 additions & 121 deletions codegen/Crm/Objects/Emails/Api/BatchApi.php

Large diffs are not rendered by default.

67 changes: 39 additions & 28 deletions codegen/Crm/Objects/Emails/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 @@ -121,14 +128,15 @@ public function getConfig()
* GDPR DELETE
*
* @param \HubSpot\Client\Crm\Objects\Emails\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\Emails\ApiException on non-2xx response
* @throws \HubSpot\Client\Crm\Objects\Emails\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return void
*/
public function purge($public_gdpr_delete_input)
public function purge($public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
$this->purgeWithHttpInfo($public_gdpr_delete_input);
$this->purgeWithHttpInfo($public_gdpr_delete_input, $contentType);
}

/**
Expand All @@ -137,14 +145,15 @@ public function purge($public_gdpr_delete_input)
* GDPR DELETE
*
* @param \HubSpot\Client\Crm\Objects\Emails\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\Emails\ApiException on non-2xx response
* @throws \HubSpot\Client\Crm\Objects\Emails\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($public_gdpr_delete_input)
public function purgeWithHttpInfo($public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
$request = $this->purgeRequest($public_gdpr_delete_input);
$request = $this->purgeRequest($public_gdpr_delete_input, $contentType);

try {
$options = $this->createHttpClientOption();
Expand Down Expand Up @@ -204,13 +213,14 @@ public function purgeWithHttpInfo($public_gdpr_delete_input)
* GDPR DELETE
*
* @param \HubSpot\Client\Crm\Objects\Emails\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($public_gdpr_delete_input)
public function purgeAsync($public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
return $this->purgeAsyncWithHttpInfo($public_gdpr_delete_input)
return $this->purgeAsyncWithHttpInfo($public_gdpr_delete_input, $contentType)
->then(
function ($response) {
return $response[0];
Expand All @@ -224,14 +234,15 @@ function ($response) {
* GDPR DELETE
*
* @param \HubSpot\Client\Crm\Objects\Emails\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($public_gdpr_delete_input)
public function purgeAsyncWithHttpInfo($public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{
$returnType = '';
$request = $this->purgeRequest($public_gdpr_delete_input);
$request = $this->purgeRequest($public_gdpr_delete_input, $contentType);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -260,19 +271,22 @@ function ($exception) {
* Create request for operation 'purge'
*
* @param \HubSpot\Client\Crm\Objects\Emails\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($public_gdpr_delete_input)
public function purgeRequest($public_gdpr_delete_input, string $contentType = self::contentTypes['purge'][0])
{

// 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/emails/gdpr-delete';
$formParams = [];
$queryParams = [];
Expand All @@ -284,21 +298,17 @@ public function purgeRequest($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 @@ -317,9 +327,9 @@ public function purgeRequest($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 @@ -342,10 +352,11 @@ public function purgeRequest($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
Loading