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
40 changes: 34 additions & 6 deletions codegen/Crm/Properties/Api/BatchApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public function archiveRequest($object_type, $batch_input_property_name, string
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error
*/
public function create($object_type, $batch_input_property_create, string $contentType = self::contentTypes['create'][0])
{
Expand All @@ -410,7 +410,7 @@ public function create($object_type, $batch_input_property_create, string $conte
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function createWithHttpInfo($object_type, $batch_input_property_create, string $contentType = self::contentTypes['create'][0])
{
Expand Down Expand Up @@ -440,12 +440,18 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s


switch($statusCode) {
case 200:
case 201:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
$request,
$response,
);
case 207:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
$request,
$response,
);
default:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Properties\Model\Error',
Expand Down Expand Up @@ -476,14 +482,22 @@ public function createWithHttpInfo($object_type, $batch_input_property_create, s
);
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
case 201:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\BatchResponseProperty',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
case 207:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
default:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
Expand Down Expand Up @@ -697,7 +711,7 @@ public function createRequest($object_type, $batch_input_property_create, string
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error
* @return \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error
*/
public function read($object_type, $batch_read_input_property_name, $locale = null, string $contentType = self::contentTypes['read'][0])
{
Expand All @@ -717,7 +731,7 @@ public function read($object_type, $batch_read_input_property_name, $locale = nu
*
* @throws \HubSpot\Client\Crm\Properties\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
* @return array of \HubSpot\Client\Crm\Properties\Model\BatchResponseProperty|\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors|\HubSpot\Client\Crm\Properties\Model\Error, HTTP status code, HTTP response headers (array of strings)
*/
public function readWithHttpInfo($object_type, $batch_read_input_property_name, $locale = null, string $contentType = self::contentTypes['read'][0])
{
Expand Down Expand Up @@ -753,6 +767,12 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name,
$request,
$response,
);
case 207:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
$request,
$response,
);
default:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Properties\Model\Error',
Expand Down Expand Up @@ -791,6 +811,14 @@ public function readWithHttpInfo($object_type, $batch_read_input_property_name,
);
$e->setResponseObject($data);
throw $e;
case 207:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\HubSpot\Client\Crm\Properties\Model\BatchResponsePropertyWithErrors',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
throw $e;
default:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
Expand Down
18 changes: 9 additions & 9 deletions codegen/Crm/Properties/Api/GroupsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function archiveWithHttpInfo($object_type, $group_name, string $contentTy
$e->setResponseObject($data);
throw $e;
}


throw $e;
}
Expand Down Expand Up @@ -461,7 +461,7 @@ public function createWithHttpInfo($object_type, $property_group_create, string
);
}



if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
Expand Down Expand Up @@ -500,7 +500,7 @@ public function createWithHttpInfo($object_type, $property_group_create, string
$e->setResponseObject($data);
throw $e;
}


throw $e;
}
Expand Down Expand Up @@ -766,7 +766,7 @@ public function getAllWithHttpInfo($object_type, $locale = null, string $content
);
}



if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
Expand Down Expand Up @@ -805,7 +805,7 @@ public function getAllWithHttpInfo($object_type, $locale = null, string $content
$e->setResponseObject($data);
throw $e;
}


throw $e;
}
Expand Down Expand Up @@ -1069,7 +1069,7 @@ public function getByNameWithHttpInfo($object_type, $group_name, $locale = null,
);
}



if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
Expand Down Expand Up @@ -1108,7 +1108,7 @@ public function getByNameWithHttpInfo($object_type, $group_name, $locale = null,
$e->setResponseObject($data);
throw $e;
}


throw $e;
}
Expand Down Expand Up @@ -1390,7 +1390,7 @@ public function updateWithHttpInfo($object_type, $group_name, $property_group_up
);
}



if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
Expand Down Expand Up @@ -1429,7 +1429,7 @@ public function updateWithHttpInfo($object_type, $group_name, $property_group_up
$e->setResponseObject($data);
throw $e;
}


throw $e;
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/Crm/Properties/Model/BatchReadInputPropertyName.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function getArchived()
/**
* Sets archived
*
* @param bool $archived archived
* @param bool $archived Specifies whether the property is archived.
*
* @return self
*/
Expand All @@ -378,7 +378,7 @@ public function getDataSensitivity()
/**
* Sets data_sensitivity
*
* @param string $data_sensitivity data_sensitivity
* @param string $data_sensitivity Indicates the sensitivity level of the data, such as 'non_sensitive', 'sensitive', or 'highly_sensitive'.
*
* @return self
*/
Expand Down
78 changes: 5 additions & 73 deletions codegen/Crm/Properties/Model/BatchResponseProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali
*/
protected static $openAPITypes = [
'completed_at' => '\DateTime',
'errors' => '\HubSpot\Client\Crm\Properties\Model\StandardError[]',
'links' => 'array<string,string>',
'num_errors' => 'int',
'requested_at' => '\DateTime',
'results' => '\HubSpot\Client\Crm\Properties\Model\Property[]',
'started_at' => '\DateTime',
Expand All @@ -76,9 +74,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali
*/
protected static $openAPIFormats = [
'completed_at' => 'date-time',
'errors' => null,
'links' => null,
'num_errors' => 'int32',
'requested_at' => 'date-time',
'results' => null,
'started_at' => 'date-time',
Expand All @@ -92,9 +88,7 @@ class BatchResponseProperty implements ModelInterface, ArrayAccess, \JsonSeriali
*/
protected static array $openAPINullables = [
'completed_at' => false,
'errors' => false,
'links' => false,
'num_errors' => false,
'requested_at' => false,
'results' => false,
'started_at' => false,
Expand Down Expand Up @@ -188,9 +182,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $attributeMap = [
'completed_at' => 'completedAt',
'errors' => 'errors',
'links' => 'links',
'num_errors' => 'numErrors',
'requested_at' => 'requestedAt',
'results' => 'results',
'started_at' => 'startedAt',
Expand All @@ -204,9 +196,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $setters = [
'completed_at' => 'setCompletedAt',
'errors' => 'setErrors',
'links' => 'setLinks',
'num_errors' => 'setNumErrors',
'requested_at' => 'setRequestedAt',
'results' => 'setResults',
'started_at' => 'setStartedAt',
Expand All @@ -220,9 +210,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $getters = [
'completed_at' => 'getCompletedAt',
'errors' => 'getErrors',
'links' => 'getLinks',
'num_errors' => 'getNumErrors',
'requested_at' => 'getRequestedAt',
'results' => 'getResults',
'started_at' => 'getStartedAt',
Expand Down Expand Up @@ -306,9 +294,7 @@ public function getStatusAllowableValues()
public function __construct(?array $data = null)
{
$this->setIfExists('completed_at', $data ?? [], null);
$this->setIfExists('errors', $data ?? [], null);
$this->setIfExists('links', $data ?? [], null);
$this->setIfExists('num_errors', $data ?? [], null);
$this->setIfExists('requested_at', $data ?? [], null);
$this->setIfExists('results', $data ?? [], null);
$this->setIfExists('started_at', $data ?? [], null);
Expand Down Expand Up @@ -391,7 +377,7 @@ public function getCompletedAt()
/**
* Sets completed_at
*
* @param \DateTime $completed_at completed_at
* @param \DateTime $completed_at The timestamp indicating when the batch operation was completed.
*
* @return self
*/
Expand All @@ -405,33 +391,6 @@ public function setCompletedAt($completed_at)
return $this;
}

/**
* Gets errors
*
* @return \HubSpot\Client\Crm\Properties\Model\StandardError[]|null
*/
public function getErrors()
{
return $this->container['errors'];
}

/**
* Sets errors
*
* @param \HubSpot\Client\Crm\Properties\Model\StandardError[]|null $errors errors
*
* @return self
*/
public function setErrors($errors)
{
if (is_null($errors)) {
throw new \InvalidArgumentException('non-nullable errors cannot be null');
}
$this->container['errors'] = $errors;

return $this;
}

/**
* Gets links
*
Expand All @@ -445,7 +404,7 @@ public function getLinks()
/**
* Sets links
*
* @param array<string,string>|null $links links
* @param array<string,string>|null $links A collection of URLs linking to documentation or resources related to the batch operation.
*
* @return self
*/
Expand All @@ -459,33 +418,6 @@ public function setLinks($links)
return $this;
}

/**
* Gets num_errors
*
* @return int|null
*/
public function getNumErrors()
{
return $this->container['num_errors'];
}

/**
* Sets num_errors
*
* @param int|null $num_errors num_errors
*
* @return self
*/
public function setNumErrors($num_errors)
{
if (is_null($num_errors)) {
throw new \InvalidArgumentException('non-nullable num_errors cannot be null');
}
$this->container['num_errors'] = $num_errors;

return $this;
}

/**
* Gets requested_at
*
Expand All @@ -499,7 +431,7 @@ public function getRequestedAt()
/**
* Sets requested_at
*
* @param \DateTime|null $requested_at requested_at
* @param \DateTime|null $requested_at The timestamp indicating when the batch operation was requested.
*
* @return self
*/
Expand Down Expand Up @@ -553,7 +485,7 @@ public function getStartedAt()
/**
* Sets started_at
*
* @param \DateTime $started_at started_at
* @param \DateTime $started_at The timestamp indicating when the batch operation began processing.
*
* @return self
*/
Expand All @@ -580,7 +512,7 @@ public function getStatus()
/**
* Sets status
*
* @param string $status status
* @param string $status The current status of the batch operation, with possible values being CANCELED, COMPLETE, PENDING, or PROCESSING.
*
* @return self
*/
Expand Down
Loading
Loading